diff --git a/demos/dice/index.html b/demos/dice/index.html new file mode 100644 index 0000000..ce6c069 --- /dev/null +++ b/demos/dice/index.html @@ -0,0 +1,98 @@ + +
+ + +! + +! Twin dice roller + + script DiceRoller + + div Screen + div Dice + div Dot + variable NDice + variable M + variable N + variable D + variable Index + variable Row + variable Dots + variable Patterns + variable Left + variable Top + + put 2 into NDice + set style `.ec-dice` to `{width:100px;height:100px;margin:20px;` + cat `background:yellow;border:1px solid black;display:inline-block;` + cat `position:relative}` + set style `.ec-dot` to `{width:20px;height:20;position:absolute;` + cat `background:black;border-radius:10px}` + + set Patterns to + 40 40 0 0 0 0 0 0 0 0 0 0 + 10 40 70 40 0 0 0 0 0 0 0 0 + 10 40 40 40 70 40 0 0 0 0 0 0 + 10 10 70 10 10 70 70 70 0 0 0 0 + 10 10 70 10 10 70 70 70 40 40 0 0 + 10 10 10 70 40 10 40 70 70 10 70 70 + + create Screen + set the style of Screen to `padding:1em` + set the elements of Dice to NDice + +Redraw: + put 0 into M + while M is less than 10 + begin + put 0 into N + while N is less than NDice + begin + index Dice to N + remove element Dice + create Dice in Screen + set the class of Dice to `ec-dice` + gosub to RandomiseDots + add 1 to N + end + wait 10 ticks + add 1 to M + end + on click Dice go to Redraw + stop + +RandomiseDots: + put random 6 into Dots + multiply Dots by 12 giving Row + put 0 into D + while D is less than 12 + begin + add D to Row giving Index + index Patterns to Index + put Patterns into Top + add 1 to D + if Top is not 0 + begin + add 1 to Index + index Patterns to Index + put Patterns into Left + create Dot in Dice + set the class of Dot to `ec-dot` + set style `top` of Dot to Top + set style `left` of Dot to Left + on click Dot go to Redraw + end + add 1 to D + end + return ++ + + + + diff --git a/storyteller/index.html b/demos/storyteller/index.html similarity index 92% rename from storyteller/index.html rename to demos/storyteller/index.html index 1d875b2..27c22b8 100644 --- a/storyteller/index.html +++ b/demos/storyteller/index.html @@ -8,7 +8,7 @@
dev-
storyteller+
stories
script Boot diff --git a/storyteller/storyteller/GetStoryteller/content.txt b/demos/storyteller/stories/GetStoryteller/content.txt similarity index 100% rename from storyteller/storyteller/GetStoryteller/content.txt rename to demos/storyteller/stories/GetStoryteller/content.txt diff --git a/storyteller/storyteller/GetStoryteller/source.txt b/demos/storyteller/stories/GetStoryteller/source.txt similarity index 100% rename from storyteller/storyteller/GetStoryteller/source.txt rename to demos/storyteller/stories/GetStoryteller/source.txt diff --git a/storyteller/storyteller/GetStoryteller/title.txt b/demos/storyteller/stories/GetStoryteller/title.txt similarity index 100% rename from storyteller/storyteller/GetStoryteller/title.txt rename to demos/storyteller/stories/GetStoryteller/title.txt diff --git a/storyteller/storyteller/Images/content.txt b/demos/storyteller/stories/Images/content.txt similarity index 100% rename from storyteller/storyteller/Images/content.txt rename to demos/storyteller/stories/Images/content.txt diff --git a/storyteller/storyteller/Images/source.txt b/demos/storyteller/stories/Images/source.txt similarity index 100% rename from storyteller/storyteller/Images/source.txt rename to demos/storyteller/stories/Images/source.txt diff --git a/storyteller/storyteller/Images/title.txt b/demos/storyteller/stories/Images/title.txt similarity index 100% rename from storyteller/storyteller/Images/title.txt rename to demos/storyteller/stories/Images/title.txt diff --git a/storyteller/storyteller/Markdown/content.txt b/demos/storyteller/stories/Markdown/content.txt similarity index 100% rename from storyteller/storyteller/Markdown/content.txt rename to demos/storyteller/stories/Markdown/content.txt diff --git a/storyteller/storyteller/Markdown/source.txt b/demos/storyteller/stories/Markdown/source.txt similarity index 100% rename from storyteller/storyteller/Markdown/source.txt rename to demos/storyteller/stories/Markdown/source.txt diff --git a/storyteller/storyteller/Markdown/title.txt b/demos/storyteller/stories/Markdown/title.txt similarity index 100% rename from storyteller/storyteller/Markdown/title.txt rename to demos/storyteller/stories/Markdown/title.txt diff --git a/storyteller/storyteller/Structure/content.txt b/demos/storyteller/stories/Structure/content.txt similarity index 100% rename from storyteller/storyteller/Structure/content.txt rename to demos/storyteller/stories/Structure/content.txt diff --git a/storyteller/storyteller/Structure/source.txt b/demos/storyteller/stories/Structure/source.txt similarity index 100% rename from storyteller/storyteller/Structure/source.txt rename to demos/storyteller/stories/Structure/source.txt diff --git a/storyteller/storyteller/Structure/title.txt b/demos/storyteller/stories/Structure/title.txt similarity index 100% rename from storyteller/storyteller/Structure/title.txt rename to demos/storyteller/stories/Structure/title.txt diff --git a/storyteller/storyteller/home/content.txt b/demos/storyteller/stories/home/content.txt similarity index 100% rename from storyteller/storyteller/home/content.txt rename to demos/storyteller/stories/home/content.txt diff --git a/storyteller/storyteller/home/images/demo0.jpg b/demos/storyteller/stories/home/images/demo0.jpg similarity index 100% rename from storyteller/storyteller/home/images/demo0.jpg rename to demos/storyteller/stories/home/images/demo0.jpg diff --git a/storyteller/storyteller/home/images/demo3.jpg b/demos/storyteller/stories/home/images/demo3.jpg similarity index 100% rename from storyteller/storyteller/home/images/demo3.jpg rename to demos/storyteller/stories/home/images/demo3.jpg diff --git a/storyteller/storyteller/home/images/demo5.jpg b/demos/storyteller/stories/home/images/demo5.jpg similarity index 100% rename from storyteller/storyteller/home/images/demo5.jpg rename to demos/storyteller/stories/home/images/demo5.jpg diff --git a/storyteller/storyteller/home/images/demo8.jpg b/demos/storyteller/stories/home/images/demo8.jpg similarity index 100% rename from storyteller/storyteller/home/images/demo8.jpg rename to demos/storyteller/stories/home/images/demo8.jpg diff --git a/storyteller/storyteller/home/source.txt b/demos/storyteller/stories/home/source.txt similarity index 100% rename from storyteller/storyteller/home/source.txt rename to demos/storyteller/stories/home/source.txt diff --git a/storyteller/storyteller/home/title.txt b/demos/storyteller/stories/home/title.txt similarity index 100% rename from storyteller/storyteller/home/title.txt rename to demos/storyteller/stories/home/title.txt diff --git a/storyteller/storyteller/info/content.txt b/demos/storyteller/stories/info/content.txt similarity index 100% rename from storyteller/storyteller/info/content.txt rename to demos/storyteller/stories/info/content.txt diff --git a/storyteller/storyteller/info/source.txt b/demos/storyteller/stories/info/source.txt similarity index 100% rename from storyteller/storyteller/info/source.txt rename to demos/storyteller/stories/info/source.txt diff --git a/storyteller/storyteller/info/title.txt b/demos/storyteller/stories/info/title.txt similarity index 100% rename from storyteller/storyteller/info/title.txt rename to demos/storyteller/stories/info/title.txt diff --git a/storyteller/storyteller/theme.txt b/demos/storyteller/stories/theme.txt similarity index 100% rename from storyteller/storyteller/theme.txt rename to demos/storyteller/stories/theme.txt diff --git a/storyteller/storyteller/title.txt b/demos/storyteller/stories/title.txt similarity index 100% rename from storyteller/storyteller/title.txt rename to demos/storyteller/stories/title.txt