From 0929719a845897cc8567cf972e07a69a71f0fa6f Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 30 Nov 2023 13:29:08 -0500 Subject: Migrate to a full rails app --- app/views/puzzles/about.html.haml | 53 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 app/views/puzzles/about.html.haml (limited to 'app/views/puzzles/about.html.haml') diff --git a/app/views/puzzles/about.html.haml b/app/views/puzzles/about.html.haml new file mode 100644 index 0000000..f1f7aa0 --- /dev/null +++ b/app/views/puzzles/about.html.haml @@ -0,0 +1,53 @@ +%p.summary Wittle gives you daily randomly-generated puzzles in the style of those from the 2016 indie game, The Witness. There are three difficulties of puzzles to choose from: +%h2#current-date= @normal_puzzle.created_at.localtime.strftime("%B %-d, %Y") +%nav#choose-difficulty + #normal-link + = link_to "Normal", @normal_puzzle + - if @normal_solved + %p.puzzle-status Solved! + - elsif @normal_started + %p.puzzle-status Started + #hard-link + = link_to "Hard", @hard_puzzle + - if @hard_solved + %p.puzzle-status Solved! + - elsif @hard_started + %p.puzzle-status Started + #expert-link + = link_to "Expert", @expert_puzzle + - if @expert_solved + %p.puzzle-status Solved! + - elsif @expert_started + %p.puzzle-status Started +#new-puzzles + - if @normal_puzzle.created_at.localtime.to_date != DateTime.now.localtime.to_date + New puzzles are being generated... + - else + Time until new puzzles: 00:00:00 + :javascript + function pad(val) { + var valString = val + "" + if (valString.length < 2) + { + return "0" + valString + } else { + return valString + } + } + function setTime() { + --totalSeconds + if (totalSeconds == 0) + { + $("#new-puzzles").text("Refresh the page for today's puzzles!") + clearInterval(timerInterval) + } else { + $("#seconds").text(pad(totalSeconds%60)) + $("#minutes").text(pad(parseInt(totalSeconds/60)%60)) + $("#hours").text(pad(parseInt(parseInt(totalSeconds/60)/60))) + } + } + var totalSeconds = #{(Time.now.tomorrow.beginning_of_day - Time.now).to_i + 1} + setTime() + var timerInterval = setInterval(setTime, 1000); +%p.summary Wittle was created by Hatkirby, with major help from Sigma144 (who wrote the puzzle generation code) and jbzdarkid (who wrote the puzzle solving web interface). The source code is available here. If you encounter any bugs, or have feedback regarding puzzle difficulty level, feel free to contact me! I am hatkirby on Discord, and you can also find me in the Witness Speedrunning server. +%p.summary There is an archive of past puzzles for those interested. -- cgit 1.4.1