about summary refs log tree commit diff stats
path: root/app
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-10-31 18:33:30 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-10-31 18:33:30 -0400
commit5052207e0f5fd03e49fc51f1a5dbeb92dd79de59 (patch)
tree673752de8a3bdce028ec7e6f86bcf7df61660601 /app
parent40d61ac1c9c59a613ea1ef0ede35b1033f2e5830 (diff)
downloadwittle-5052207e0f5fd03e49fc51f1a5dbeb92dd79de59.tar.gz
wittle-5052207e0f5fd03e49fc51f1a5dbeb92dd79de59.tar.bz2
wittle-5052207e0f5fd03e49fc51f1a5dbeb92dd79de59.zip
Added countdown to tomorrow's puzzles
Diffstat (limited to 'app')
-rw-r--r--app/assets/stylesheets/wittle/general.css.scss6
-rw-r--r--app/views/wittle/puzzles/about.html.haml30
2 files changed, 36 insertions, 0 deletions
diff --git a/app/assets/stylesheets/wittle/general.css.scss b/app/assets/stylesheets/wittle/general.css.scss index 984e9f7..12e5486 100644 --- a/app/assets/stylesheets/wittle/general.css.scss +++ b/app/assets/stylesheets/wittle/general.css.scss
@@ -255,3 +255,9 @@ input[type="range"]::-ms-thumb {
255 text-decoration: underline; 255 text-decoration: underline;
256 } 256 }
257} 257}
258
259#new-puzzles {
260 text-align: center;
261 font-size: 1.25em;
262 margin-bottom: 1em;
263}
diff --git a/app/views/wittle/puzzles/about.html.haml b/app/views/wittle/puzzles/about.html.haml index dcc3132..8bdb11e 100644 --- a/app/views/wittle/puzzles/about.html.haml +++ b/app/views/wittle/puzzles/about.html.haml
@@ -19,5 +19,35 @@
19 %p.puzzle-status Solved! 19 %p.puzzle-status Solved!
20 - elsif @expert_started 20 - elsif @expert_started
21 %p.puzzle-status Started 21 %p.puzzle-status Started
22#new-puzzles
23 - if @normal_puzzle.created_at.localtime.to_date != DateTime.now.localtime.to_date
24 New puzzles are being generated...
25 - else
26 Time until new puzzles: <span id="hours">00</span>:<span id="minutes">00</span>:<span id="seconds">00</span>
27 :javascript
28 function pad(val) {
29 var valString = val + ""
30 if (valString.length < 2)
31 {
32 return "0" + valString
33 } else {
34 return valString
35 }
36 }
37 function setTime() {
38 --totalSeconds
39 if (totalSeconds == 0)
40 {
41 $("#new-puzzles").text("Refresh the page for today's puzzles!")
42 clearInterval(timerInterval)
43 } else {
44 $("#seconds").text(pad(totalSeconds%60))
45 $("#minutes").text(pad(parseInt(totalSeconds/60)%60))
46 $("#hours").text(pad(parseInt(parseInt(totalSeconds/60)/60)))
47 }
48 }
49 var totalSeconds = #{(1.day.from_now.beginning_of_day - DateTime.now).to_i + 1}
50 setTime()
51 var timerInterval = setInterval(setTime, 1000);
22%p.summary Wittle was created by <a href="https://www.fourisland.com/">Hatkirby</a>, with major help from <a href="https://github.com/sigma144/">Sigma144</a> (who wrote the puzzle generation code) and <a href="https://github.com/jbzdarkid">jbzdarkid</a> (who wrote the puzzle solving web interface). If you encounter any bugs, or have feedback regarding puzzle difficulty level, feel free to contact me! I am <code>hatkirby</code> on Discord, and you can also find me in the <a href="https://discord.gg/0nJwyUyYIfTEgSz0">Witness Speedrunning server</a>. 52%p.summary Wittle was created by <a href="https://www.fourisland.com/">Hatkirby</a>, with major help from <a href="https://github.com/sigma144/">Sigma144</a> (who wrote the puzzle generation code) and <a href="https://github.com/jbzdarkid">jbzdarkid</a> (who wrote the puzzle solving web interface). If you encounter any bugs, or have feedback regarding puzzle difficulty level, feel free to contact me! I am <code>hatkirby</code> on Discord, and you can also find me in the <a href="https://discord.gg/0nJwyUyYIfTEgSz0">Witness Speedrunning server</a>.
23%p.summary There is an <a href="#{ archive_path }">archive of past puzzles</a> for those interested. 53%p.summary There is an <a href="#{ archive_path }">archive of past puzzles</a> for those interested.