Commits: 2
Put scattered and evenly distributed examples next to each other
Implement new block: Row
index c28bbed..edb1bc0 100644
--- a/content/day-2.txt
+++ b/content/day-2.txt
@@ -105,37 +105,44 @@ Next slightly rotate the ruler around the center (keep point {Code|0} of the rul
=
=In other words, you can put a thing in the center and then move it in any direction, let's say 1 meter. If you do the same to several things in several directions (but same length), you will make them lay on a circle. The direction must be different each time. Otherwise the things would just stack one on top of another! We wouldn't call it a circle, right?
=
-Now, notice that the dots displayed by the program we are creating are not laying just anywhere on the circle. They are evenly distributed:
+Now, notice that the dots displayed by the program we are creating are not laying just anywhere on the circle. They are evenly distributed. It means that not only the distance between each dot and the center is the same. Also each dots lay the same distance away from it's two nearest neighbors. Just compare the following two pictures:
=
-| Circle
- dots = 5
- circle = 0 1
- angles = 0 1
- center = none
- radius = 0 1
- scatter = False
+| Row
+ | Circle
+ dots = 5
+ circle = 0 1
+ angles = 0 1
+ center = none
+ radius = 0 1
+ scatter = True
=
-It means that not only the distance between each dot and the center is the same. Also each dots lay the same distance away from it's two nearest neighbors.
+ | Circle
+ dots = 5
+ circle = 0 1
+ angles = 0 1
+ center = none
+ radius = 0 1
+ scatter = False
=
-Just compare it with the following picture:
+Both are showing 5 dots laying on a circle. Look:
=
-| Circle
- dots = 5
- circle = 0 1
- angles = 0 1
- center = none
- radius = 0 1
- scatter = True
+| Row
+ | Circle
+ dots = 5
+ circle = 3
+ angles = 0 1
+ center = none
+ radius = 0 1
+ scatter = True
=
-These are also 5 dots laying on a circle. Look:
+ | Circle
+ dots = 5
+ circle = 3
+ angles = 0 1
+ center = none
+ radius = 0 1
+ scatter = False
=
-| Circle
- dots = 5
- circle = 3
- angles = 0 1
- center = none
- radius = 0 1
- scatter = True
=
=| Note
= IDEA: An interactive program (game of sorts) that shows a ruler and dots. User can drag the ruler around and rotate it. Also dots can be dragged around. Once the dots are placed on a circle, the program rewards the user with a nice animation and message. It would be super awesome to make it touch capable {Icon|name=award}
@@ -145,7 +152,7 @@ These are also 5 dots laying on a circle. Look:
= In the mean time we have two non-interactive examples with evenly and randomly distributed dots.
=
=
-So they lay on a circle, but there is a striking difference. They are all scattered! This means that there is something missing in our solution. We need to take care of one more aspect when we place our dots.
+So the dots on the left lay on a circle, but there is a striking difference. They are all scattered! This means that there is something missing in our solution. We need to take care of one more aspect when we place our dots.
=
=Since the center and radius is the same for each dot, the only thing we can play with is the angle that we rotate the ruler each time.
=index 444dac4..f8def73 100644
--- a/src/Main.elm
+++ b/src/Main.elm
@@ -450,57 +450,41 @@ document =
= )
= Mark.Custom.title
= (Mark.manyOf
- [ Mark.Custom.header
- , Mark.Custom.paragraph
- , Mark.Custom.monospace
- , Mark.Custom.code
- , Mark.Custom.note
- , Mark.Custom.emphasize
- , Mark.Custom.list
- , Mark.Custom.image
-
- -- Embeded programs
- , counter
- , dot
- , dotInElement
- , dotWithViewBox
- , twoDots
- , circle
- , line
- , gradient
- , transformations
- , nestedTransformations
- , cartesianCoordinates
- , polarCoordinates
- , rosette
- , spiral
- , tree
- , viewBox
-
- -- Window block can contain any embeded program
- , Mark.Custom.window
- (Mark.oneOf
- [ counter
- , dot
- , dotInElement
- , dotWithViewBox
- , twoDots
- , circle
- , line
- , gradient
- , transformations
- , nestedTransformations
- , cartesianCoordinates
- , polarCoordinates
- , rosette
- , spiral
- , tree
- , viewBox
- ]
- )
- ]
+ ([ Mark.Custom.header
+ , Mark.Custom.paragraph
+ , Mark.Custom.monospace
+ , Mark.Custom.code
+ , Mark.Custom.note
+ , Mark.Custom.emphasize
+ , Mark.Custom.list
+ , Mark.Custom.image
+ ]
+ ++ examples
+ ++ [ Mark.Custom.window (Mark.oneOf examples)
+ , Mark.Custom.row (Mark.manyOf examples)
+ ]
+ )
= )
=
+ examples =
+ [ counter
+ , dot
+ , dotInElement
+ , dotWithViewBox
+ , twoDots
+ , circle
+ , line
+ , gradient
+ , transformations
+ , nestedTransformations
+ , cartesianCoordinates
+ , polarCoordinates
+ , rosette
+ , spiral
+ , tree
+ , viewBox
+ ]
+
= -- Embeded programs' blocks
= counter : Mark.Block (Model -> Element Msg)
= counter =index bfe94a4..193f700 100644
--- a/src/Mark/Custom.elm
+++ b/src/Mark/Custom.elm
@@ -10,6 +10,7 @@ module Mark.Custom exposing
= , monospace
= , note
= , paragraph
+ , row
= , text
= , title
= , window
@@ -141,6 +142,29 @@ window block =
= block
=
=
+row :
+ Mark.Block (List (a -> Element msg))
+ -> Mark.Block (a -> Element msg)
+row block =
+ let
+ render children model =
+ children
+ |> List.map (\child -> child model)
+ |> List.map
+ (Element.el
+ [ Element.width Element.fill
+ , Border.width 1
+ , Border.rounded 5
+ , Border.color (Element.rgb 0.6 0.6 0.6)
+ ]
+ )
+ |> Element.row [ Element.spacing 20 ]
+ in
+ Mark.block "Row"
+ render
+ block
+
+
=note : Mark.Block (model -> Element msg)
=note =
= letAdd ACME challenge code for Let's Encrypt verification
Temporarily enable this branch (custom-domain) in CI, so we can test if it works before merging.
index 4472935..28e2f71 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -15,3 +15,4 @@ pages:
=
= only:
= - master
+ - custom-domainnew file mode 100644
index 0000000..44f3504
--- /dev/null
+++ b/.well-known/acme-challenge/HVUehfup9PAAASIMOcJoCGvD9q9bzX_W_tBUSSI6RXI
@@ -0,0 +1 @@
+HVUehfup9PAAASIMOcJoCGvD9q9bzX_W_tBUSSI6RXI.HvUI1nPJPHTnM--CR4G53bMPL5yhCFd2qGlsMDuIw14