diff --git a/sitemap.json b/sitemap.json index 09c46d4..d4fa178 100644 --- a/sitemap.json +++ b/sitemap.json @@ -276,6 +276,11 @@ "route": "hourglass", "template": "template_hourglass.html" }, + { + "title": "constant rolls", + "route": "constantrolls", + "template": "template_constant_rolls.html" + }, { "title": "jaxbox", "route": "jaxbox", diff --git a/templates/index.css b/templates/index.css index dfb7f32..ee2f5a1 100644 --- a/templates/index.css +++ b/templates/index.css @@ -318,6 +318,16 @@ code { align-content: center } +#hourglass-header { + width: 100%; +} + +#fullscreen-btn { + margin-left: auto; + width: fit-content; + cursor: pointer; +} + #hourglass-form { width: fit-content; margin: 10px auto; @@ -335,7 +345,7 @@ code { .timedisplay { min-width: 200px; - font-size: 100px; + font-size: 200px; margin-bottom: -20px; } @@ -344,6 +354,42 @@ code { padding-bottom: 10px; } +#constantrolls-dice { + display: grid; +} + +@media (min-width: 350px) { + #constantrolls-dice { grid-template-columns: repeat(2, 1fr); } +} + +@media (min-width: 500px) { + #constantrolls-dice { grid-template-columns: repeat(3, 1fr); } +} + +@media (min-width: 650px) { + #constantrolls-dice { grid-template-columns: repeat(4, 1fr); } +} + +@media (min-width: 800px) { + #constantrolls-dice { grid-template-columns: repeat(5, 1fr); } +} + +.constantrolls-tile { + display: flex; + flex-direction: column; + width: 150px; + flex: 1; +} +.constantrolls-result { + font-size: 100px; + align-self: center; +} +.constantrolls-label { + font-size: 20px; + align-self: center; +} + +/* generics */ .v-spacer { height: 100%; } @@ -368,3 +414,7 @@ code { background: var(--light-bg); color: var(--bg); } + +.notes { + font-size: 15px; +} diff --git a/templates/template_constant_rolls.html b/templates/template_constant_rolls.html new file mode 100644 index 0000000..80725ef --- /dev/null +++ b/templates/template_constant_rolls.html @@ -0,0 +1,107 @@ +{% with title="purajit | tools" %} +{% include './header.html' %} +{% endwith %} +
+
+

Constant roller

+
+
+
+
d2
+
+
+
+
d4
+
+
+
+
d6
+
+
+
+
d8
+
+
+
+
d10
+
+
+
+
d12
+
+
+
+
d14
+
+
+
+
d16
+
+
+
+
d20
+
+
+
+
d100
+
+
+
Hit spacebar to stop rolling
+
+{% include './footer.html' %} + + diff --git a/templates/template_hourglass.html b/templates/template_hourglass.html index 7851a3b..9380d2f 100644 --- a/templates/template_hourglass.html +++ b/templates/template_hourglass.html @@ -4,6 +4,7 @@
+
@@ -92,17 +93,22 @@ } window.onload = function() { - document.body.onkeyup = function(e) { + window.onkeydown = function(e) { if (e.key == " " || e.code == "Space" || e.keyCode == 32) { e.preventDefault(); primaryAction(); } } + document.getElementById("hg-control").textContent = "Start"; document.getElementById("hourglass-timerequested").value = 180; document.getElementById("hourglass-timeleft").textContent = 180; document.getElementById("hourglass-timeelapsed").textContent = 0; + document.getElementById("fullscreen-btn").onclick = function(e) { + e.preventDefault(); + enterAppMode(); + } document.getElementById("hourglass-display").onclick = function(e) { e.preventDefault(); primaryAction();