about summary refs log tree commit diff stats
path: root/app/views/puzzles/about.html.haml
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-11-30 13:29:08 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2023-11-30 13:29:08 -0500
commit0929719a845897cc8567cf972e07a69a71f0fa6f (patch)
tree2b6f69c1d906abb6e0abf8a0f1d51725bc78087d /app/views/puzzles/about.html.haml
parent01c1947537e4e23ded0c16812a7cd9d49ad88356 (diff)
downloadwittle-0929719a845897cc8567cf972e07a69a71f0fa6f.tar.gz
wittle-0929719a845897cc8567cf972e07a69a71f0fa6f.tar.bz2
wittle-0929719a845897cc8567cf972e07a69a71f0fa6f.zip
Migrate to a full rails app
Diffstat (limited to 'app/views/puzzles/about.html.haml')
-rw-r--r--app/views/puzzles/about.html.haml53
1 files changed, 53 insertions, 0 deletions
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 @@
1%p.summary <strong>Wittle</strong> gives you daily randomly-generated puzzles in the style of those from the 2016 indie game, <a href="http://the-witness.net">The Witness</a>. There are three difficulties of puzzles to choose from:
2%h2#current-date= @normal_puzzle.created_at.localtime.strftime("%B %-d, %Y")
3%nav#choose-difficulty
4 #normal-link
5 = link_to "Normal", @normal_puzzle
6 - if @normal_solved
7 %p.puzzle-status Solved!
8 - elsif @normal_started
9 %p.puzzle-status Started
10 #hard-link
11 = link_to "Hard", @hard_puzzle
12 - if @hard_solved
13 %p.puzzle-status Solved!
14 - elsif @hard_started
15 %p.puzzle-status Started
16 #expert-link
17 = link_to "Expert", @expert_puzzle
18 - if @expert_solved
19 %p.puzzle-status Solved!
20 - elsif @expert_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 = #{(Time.now.tomorrow.beginning_of_day - Time.now).to_i + 1}
50 setTime()
51 var timerInterval = setInterval(setTime, 1000);
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/witness-randomizer">Sigma144</a> (who wrote the puzzle generation code) and <a href="https://github.com/jbzdarkid/jbzdarkid.github.io">jbzdarkid</a> (who wrote the puzzle solving web interface). The source code is available <a href="https://code.fourisland.com/wittle">here</a>. 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>.
53%p.summary There is an <a href="#{ archive_path }">archive of past puzzles</a> for those interested.