Skip to content

Commit a5257f3

Browse files
author
neurodynamic
committed
fixes a number of minor layout and style issues
1 parent 9cc47ea commit a5257f3

File tree

7 files changed

+130
-114
lines changed

7 files changed

+130
-114
lines changed

elm/Main.js

Lines changed: 86 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -12812,7 +12812,7 @@ var $author$project$Utils$UI$Buttons$buttonTemplate = function (_v0) {
1281212812
$author$project$Utils$Colors$lightened(0.5)),
1281312813
$mdgriffith$elm_ui$Element$width(
1281412814
A2($mdgriffith$elm_ui$Element$minimum, 250, $mdgriffith$elm_ui$Element$shrink)),
12815-
A2($mdgriffith$elm_ui$Element$paddingXY, 37, 22),
12815+
A2($mdgriffith$elm_ui$Element$paddingXY, 30, 22),
1281612816
$mdgriffith$elm_ui$Element$Border$rounded(8),
1281712817
$mdgriffith$elm_ui$Element$htmlAttribute(
1281812818
A2($elm$html$Html$Attributes$style, 'cursor', 'pointer')),
@@ -14058,22 +14058,16 @@ var $elm$core$Basics$modBy = _Basics_modBy;
1405814058
var $author$project$Utils$String$isEven = function (integer) {
1405914059
return !A2($elm$core$Basics$modBy, 2, integer);
1406014060
};
14061-
var $author$project$Utils$String$toFormattedElements = function (description) {
14062-
return A2(
14063-
$elm$core$List$indexedMap,
14064-
F2(
14065-
function (i, string) {
14066-
return $author$project$Utils$String$isEven(i) ? $mdgriffith$elm_ui$Element$text(string) : A2(
14067-
$author$project$Utils$UI$Text$codeWithAttrs,
14068-
_List_fromArray(
14069-
[
14070-
A2($mdgriffith$elm_ui$Element$paddingXY, 6, 1),
14071-
$mdgriffith$elm_ui$Element$Border$rounded(3)
14072-
]),
14073-
string);
14074-
}),
14075-
A2($elm$core$String$split, '`', description));
14076-
};
14061+
var $author$project$Utils$String$formatBackticks = F2(
14062+
function (formatFunction, description) {
14063+
return A2(
14064+
$elm$core$List$indexedMap,
14065+
F2(
14066+
function (i, string) {
14067+
return $author$project$Utils$String$isEven(i) ? $mdgriffith$elm_ui$Element$text(string) : formatFunction(string);
14068+
}),
14069+
A2($elm$core$String$split, '`', description));
14070+
});
1407714071
var $author$project$Stages$Debugging$View$HelpTabs$BugHints$changeOptions = F3(
1407814072
function (brokenFile, index, _v0) {
1407914073
var change = _v0.a;
@@ -14143,7 +14137,15 @@ var $author$project$Stages$Debugging$View$HelpTabs$BugHints$changeOptions = F3(
1414314137
$mdgriffith$elm_ui$Element$centerY,
1414414138
$mdgriffith$elm_ui$Element$spacing(5)
1414514139
]),
14146-
$author$project$Utils$String$toFormattedElements(change.changeDescription)) : A2(
14140+
A2(
14141+
$author$project$Utils$String$formatBackticks,
14142+
$author$project$Utils$UI$Text$codeWithAttrs(
14143+
_List_fromArray(
14144+
[
14145+
A2($mdgriffith$elm_ui$Element$paddingXY, 6, 1),
14146+
$mdgriffith$elm_ui$Element$Border$rounded(3)
14147+
])),
14148+
change.changeDescription)) : A2(
1414714149
$author$project$Utils$UI$Buttons$button,
1414814150
_List_Nil,
1414914151
{
@@ -14599,21 +14601,30 @@ var $author$project$Stages$Debugging$View$HelpTabs$DebuggingTips$debuggingTips =
1459914601
[
1460014602
A2(
1460114603
$mdgriffith$elm_ui$Element$paragraph,
14602-
_List_Nil,
1460314604
_List_fromArray(
1460414605
[
14605-
$mdgriffith$elm_ui$Element$text('Read through your code one line at a time, and for each line, check if you know the value of every variable on that line, the return value of every function, the outcome of every comparison, et cetera.')
14606+
$mdgriffith$elm_ui$Element$Font$size(18)
14607+
]),
14608+
_List_fromArray(
14609+
[
14610+
$mdgriffith$elm_ui$Element$text('Read through your code one line at a time. For each line, check if you know the value of every variable on that line, the return value of every function, the outcome of every comparison, et cetera.')
1460614611
])),
1460714612
A2(
1460814613
$mdgriffith$elm_ui$Element$paragraph,
14609-
_List_Nil,
14614+
_List_fromArray(
14615+
[
14616+
$mdgriffith$elm_ui$Element$Font$size(18)
14617+
]),
1461014618
_List_fromArray(
1461114619
[
1461214620
$mdgriffith$elm_ui$Element$text('Don\'t think about anything that happens on the next line until you\'ve figured out everything that happens on the one you\'re looking at.')
1461314621
])),
1461414622
A2(
1461514623
$mdgriffith$elm_ui$Element$paragraph,
14616-
_List_Nil,
14624+
_List_fromArray(
14625+
[
14626+
$mdgriffith$elm_ui$Element$Font$size(18)
14627+
]),
1461714628
_List_fromArray(
1461814629
[
1461914630
$mdgriffith$elm_ui$Element$text('If you\'re even the slightest bit unsure about something, print it to make sure.')
@@ -14808,7 +14819,7 @@ var $author$project$Stages$Debugging$View$HelpTabs$DebuggingTips$render = functi
1480814819
[
1480914820
$mdgriffith$elm_ui$Element$height($mdgriffith$elm_ui$Element$fill),
1481014821
$mdgriffith$elm_ui$Element$width($mdgriffith$elm_ui$Element$fill),
14811-
A2($mdgriffith$elm_ui$Element$paddingXY, 60, 20)
14822+
A2($mdgriffith$elm_ui$Element$paddingXY, 60, 0)
1481214823
]),
1481314824
A2(
1481414825
$mdgriffith$elm_ui$Element$column,
@@ -15076,7 +15087,8 @@ var $author$project$Stages$Debugging$View$HelpPage$render = function (_v0) {
1507615087
_List_fromArray(
1507715088
[
1507815089
$mdgriffith$elm_ui$Element$width($mdgriffith$elm_ui$Element$fill),
15079-
$mdgriffith$elm_ui$Element$height($mdgriffith$elm_ui$Element$fill)
15090+
$mdgriffith$elm_ui$Element$height($mdgriffith$elm_ui$Element$fill),
15091+
$mdgriffith$elm_ui$Element$spacing(20)
1508015092
]),
1508115093
_List_fromArray(
1508215094
[
@@ -15442,8 +15454,6 @@ var $author$project$Stages$Debugging$View$render = function (_v0) {
1544215454
return $author$project$Stages$Debugging$View$IDontSeeAnyErrorsPage$render(brokenFile);
1544315455
}
1544415456
};
15445-
var $author$project$Stages$Finished$Msg$ResetFileAndExit = {$: 'ResetFileAndExit'};
15446-
var $author$project$Stages$Finished$Msg$ResetFileAndPlayAgain = {$: 'ResetFileAndPlayAgain'};
1544715457
var $elm$core$String$lines = _String_lines;
1544815458
var $author$project$Stages$Finished$View$getNearbyLines = F2(
1544915459
function (lineNumber, wholeFile) {
@@ -15582,11 +15592,22 @@ var $author$project$Stages$Finished$View$renderChange = F3(
1558215592
$mdgriffith$elm_ui$Element$Font$center,
1558315593
$mdgriffith$elm_ui$Element$Font$color($author$project$Utils$Colors$white),
1558415594
$mdgriffith$elm_ui$Element$Background$color($author$project$Utils$Colors$purple),
15585-
A2($mdgriffith$elm_ui$Element$paddingXY, 8, 8),
15595+
$mdgriffith$elm_ui$Element$Border$rounded(5),
15596+
A2($mdgriffith$elm_ui$Element$paddingXY, 20, 8),
1558615597
$mdgriffith$elm_ui$Element$width($mdgriffith$elm_ui$Element$fill)
1558715598
]),
1558815599
_Utils_ap(
15589-
$author$project$Utils$String$toFormattedElements(changeDescription),
15600+
A2(
15601+
$author$project$Utils$String$formatBackticks,
15602+
$author$project$Utils$UI$Text$codeWithAttrs(
15603+
_List_fromArray(
15604+
[
15605+
A2($mdgriffith$elm_ui$Element$paddingXY, 6, 1),
15606+
$mdgriffith$elm_ui$Element$Border$rounded(3),
15607+
$mdgriffith$elm_ui$Element$Background$color(
15608+
$author$project$Utils$Colors$lightened(0.75))
15609+
])),
15610+
changeDescription),
1559015611
_List_fromArray(
1559115612
[
1559215613
$mdgriffith$elm_ui$Element$text(
@@ -15614,8 +15635,6 @@ var $author$project$Stages$Finished$View$fileChanges = function (brokenFile) {
1561415635
_List_fromArray(
1561515636
[
1561615637
$mdgriffith$elm_ui$Element$spacing(50),
15617-
$mdgriffith$elm_ui$Element$height(
15618-
$mdgriffith$elm_ui$Element$px(500)),
1561915638
A2($mdgriffith$elm_ui$Element$paddingXY, 40, 40),
1562015639
$mdgriffith$elm_ui$Element$centerX
1562115640
]),
@@ -15624,6 +15643,38 @@ var $author$project$Stages$Finished$View$fileChanges = function (brokenFile) {
1562415643
$author$project$Stages$Finished$View$renderChange(brokenFile),
1562515644
A2($elm$core$List$map, $elm$core$Tuple$first, brokenFile.changes)));
1562615645
};
15646+
var $author$project$Stages$Finished$Msg$ResetFileAndExit = {$: 'ResetFileAndExit'};
15647+
var $author$project$Stages$Finished$Msg$ResetFileAndPlayAgain = {$: 'ResetFileAndPlayAgain'};
15648+
var $author$project$Stages$Finished$View$finishButtons = function (attrs) {
15649+
return A2(
15650+
$mdgriffith$elm_ui$Element$row,
15651+
_Utils_ap(
15652+
_List_fromArray(
15653+
[
15654+
$mdgriffith$elm_ui$Element$width($mdgriffith$elm_ui$Element$fill),
15655+
$mdgriffith$elm_ui$Element$spacing(20)
15656+
]),
15657+
attrs),
15658+
_List_fromArray(
15659+
[
15660+
A2(
15661+
$author$project$Utils$UI$Buttons$button,
15662+
_List_fromArray(
15663+
[
15664+
$mdgriffith$elm_ui$Element$width($mdgriffith$elm_ui$Element$fill),
15665+
$mdgriffith$elm_ui$Element$Background$color($author$project$Utils$Colors$green)
15666+
]),
15667+
{msg: $author$project$Stages$Finished$Msg$ResetFileAndPlayAgain, name: 'Reset the file and play again!'}),
15668+
A2(
15669+
$author$project$Utils$UI$Buttons$button,
15670+
_List_fromArray(
15671+
[
15672+
$mdgriffith$elm_ui$Element$width($mdgriffith$elm_ui$Element$fill),
15673+
$mdgriffith$elm_ui$Element$Background$color($author$project$Utils$Colors$red)
15674+
]),
15675+
{msg: $author$project$Stages$Finished$Msg$ResetFileAndExit, name: 'Reset the file and exit'})
15676+
]));
15677+
};
1562715678
var $author$project$Stages$Finished$View$render = function (_v0) {
1562815679
var finishType = _v0.finishType;
1562915680
var brokenFile = _v0.brokenFile;
@@ -15637,39 +15688,18 @@ var $author$project$Stages$Finished$View$render = function (_v0) {
1563715688
]),
1563815689
_List_fromArray(
1563915690
[
15640-
A2(
15641-
$mdgriffith$elm_ui$Element$row,
15642-
_List_fromArray(
15643-
[
15644-
$mdgriffith$elm_ui$Element$width($mdgriffith$elm_ui$Element$fill),
15645-
$mdgriffith$elm_ui$Element$spacing(20)
15646-
]),
15691+
$author$project$Stages$Finished$View$finishButtons(
1564715692
_List_fromArray(
1564815693
[
15649-
A2(
15650-
$author$project$Utils$UI$Buttons$button,
15651-
_List_fromArray(
15652-
[
15653-
$mdgriffith$elm_ui$Element$width($mdgriffith$elm_ui$Element$fill),
15654-
$mdgriffith$elm_ui$Element$Background$color($author$project$Utils$Colors$green)
15655-
]),
15656-
{msg: $author$project$Stages$Finished$Msg$ResetFileAndPlayAgain, name: 'Reset the file and play again!'}),
15657-
A2(
15658-
$author$project$Utils$UI$Buttons$button,
15659-
_List_fromArray(
15660-
[
15661-
$mdgriffith$elm_ui$Element$width($mdgriffith$elm_ui$Element$fill),
15662-
$mdgriffith$elm_ui$Element$Background$color($author$project$Utils$Colors$red)
15663-
]),
15664-
{msg: $author$project$Stages$Finished$Msg$ResetFileAndExit, name: 'Reset the file and exit'})
15694+
$mdgriffith$elm_ui$Element$paddingEach(
15695+
{bottom: 5, left: 0, right: 0, top: 0})
1566515696
])),
1566615697
A2(
1566715698
$mdgriffith$elm_ui$Element$column,
1566815699
_List_fromArray(
1566915700
[
1567015701
$mdgriffith$elm_ui$Element$width($mdgriffith$elm_ui$Element$fill),
15671-
$mdgriffith$elm_ui$Element$height($mdgriffith$elm_ui$Element$fill),
15672-
$mdgriffith$elm_ui$Element$scrollbarY
15702+
$mdgriffith$elm_ui$Element$height($mdgriffith$elm_ui$Element$fill)
1567315703
]),
1567415704
_List_fromArray(
1567515705
[
@@ -15711,33 +15741,11 @@ var $author$project$Stages$Finished$View$render = function (_v0) {
1571115741
}()),
1571215742
$author$project$Stages$Finished$View$fileChanges(brokenFile)
1571315743
])),
15714-
($elm$core$List$length(brokenFile.changes) > 1) ? A2(
15715-
$mdgriffith$elm_ui$Element$row,
15744+
($elm$core$List$length(brokenFile.changes) > 1) ? $author$project$Stages$Finished$View$finishButtons(
1571615745
_List_fromArray(
1571715746
[
15718-
$mdgriffith$elm_ui$Element$width($mdgriffith$elm_ui$Element$fill),
15719-
$mdgriffith$elm_ui$Element$spacing(20),
1572015747
$mdgriffith$elm_ui$Element$paddingEach(
1572115748
{bottom: 5, left: 0, right: 0, top: 0})
15722-
]),
15723-
_List_fromArray(
15724-
[
15725-
A2(
15726-
$author$project$Utils$UI$Buttons$button,
15727-
_List_fromArray(
15728-
[
15729-
$mdgriffith$elm_ui$Element$width($mdgriffith$elm_ui$Element$fill),
15730-
$mdgriffith$elm_ui$Element$Background$color($author$project$Utils$Colors$green)
15731-
]),
15732-
{msg: $author$project$Stages$Finished$Msg$ResetFileAndPlayAgain, name: 'Reset the file and play again!'}),
15733-
A2(
15734-
$author$project$Utils$UI$Buttons$button,
15735-
_List_fromArray(
15736-
[
15737-
$mdgriffith$elm_ui$Element$width($mdgriffith$elm_ui$Element$fill),
15738-
$mdgriffith$elm_ui$Element$Background$color($author$project$Utils$Colors$red)
15739-
]),
15740-
{msg: $author$project$Stages$Finished$Msg$ResetFileAndExit, name: 'Reset the file and exit'})
1574115749
])) : $mdgriffith$elm_ui$Element$none
1574215750
]));
1574315751
};

elm/Stages/Debugging/View/HelpPage.elm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ render :
3232
render { bugCount, currentDebuggingTip, encouragements, currentHelpTab, brokenFile } =
3333
column [ spacing 30, width fill, height fill ]
3434
[ Buttons.back { name = "back to instructions", msg = ChangePage StepsPage }
35-
, column [ width fill, height fill ]
35+
, column [ width fill, height fill, spacing 20 ]
3636
[ row [ width fill ]
3737
[ renderTab
3838
{ tab = DebuggingTips

elm/Stages/Debugging/View/HelpTabs/BugHints.elm

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
module Stages.Debugging.View.HelpTabs.BugHints exposing (render)
22

33
import Element exposing (..)
4+
import Element.Border as Border
45
import Element.Font as Font
56
import Stages.Debugging.Msg exposing (Msg(..))
67
import Utils.List
78
import Utils.String
89
import Utils.Types.BrokenFile exposing (BrokenFile, HintVisibility)
910
import Utils.Types.ChangeData exposing (ChangeData)
1011
import Utils.UI.Buttons as Buttons
12+
import Utils.UI.Text as Text
1113

1214

1315
render : { bugCount : Int, brokenFile : BrokenFile } -> Element Msg
@@ -55,7 +57,13 @@ changeOptions brokenFile index ( change, hintVisibility ) =
5557
}
5658
, el [ height (px 85) ] <|
5759
if hintVisibility.showingBugType then
58-
paragraph [ centerY, spacing 5 ] (Utils.String.toFormattedElements change.changeDescription)
60+
paragraph [ centerY, spacing 5 ]
61+
(Utils.String.formatBackticks
62+
(Text.codeWithAttrs
63+
[ paddingXY 6 1, Border.rounded 3 ]
64+
)
65+
change.changeDescription
66+
)
5967

6068
else
6169
Buttons.button []

elm/Stages/Debugging/View/HelpTabs/DebuggingTips.elm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ render { currentDebuggingTip, brokenFile } =
2323
[ el
2424
[ height fill
2525
, width fill
26-
, paddingXY 60 20
26+
, paddingXY 60 0
2727
]
2828
(column [ centerY, centerX, spacing 10 ]
2929
(Utils.List.getByWrappedIndex currentDebuggingTip (debuggingTips fileType)
@@ -99,9 +99,9 @@ debuggingTips fileType =
9999
, tip
100100
{ header = "Tip #4: Read through your code one line at a time"
101101
, content =
102-
[ paragraph [] [ text "Read through your code one line at a time, and for each line, check if you know the value of every variable on that line, the return value of every function, the outcome of every comparison, et cetera." ]
103-
, paragraph [] [ text "Don't think about anything that happens on the next line until you've figured out everything that happens on the one you're looking at." ]
104-
, paragraph [] [ text "If you're even the slightest bit unsure about something, print it to make sure." ]
102+
[ paragraph [ Font.size 18 ] [ text "Read through your code one line at a time. For each line, check if you know the value of every variable on that line, the return value of every function, the outcome of every comparison, et cetera." ]
103+
, paragraph [ Font.size 18 ] [ text "Don't think about anything that happens on the next line until you've figured out everything that happens on the one you're looking at." ]
104+
, paragraph [ Font.size 18 ] [ text "If you're even the slightest bit unsure about something, print it to make sure." ]
105105
]
106106
}
107107
, tip

0 commit comments

Comments
 (0)