about summary refs log tree commit diff stats
path: root/app/views/puzzles/show.html.haml
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/puzzles/show.html.haml')
-rw-r--r--app/views/puzzles/show.html.haml41
1 files changed, 41 insertions, 0 deletions
diff --git a/app/views/puzzles/show.html.haml b/app/views/puzzles/show.html.haml new file mode 100644 index 0000000..47db8f2 --- /dev/null +++ b/app/views/puzzles/show.html.haml
@@ -0,0 +1,41 @@
1.breadcrumb= link_to "← Back to home page", root_path
2%h1 Wittle ##{@puzzle.id}
3.puzzle-description #{@puzzle.category.capitalize} - #{@puzzle.created_at.localtime.strftime("%B %-d, %Y")}
4#puzzle-container{ style: "display: flex; justify-content: center; align-items: center" }
5 %svg#puzzle{ style: "pointer-events: auto"}
6#submission-form
7- if @playable
8 - unless @already_started
9 #activation-button
10 %button{ type: "button" } Reveal Puzzle
11 #timer
12 %label#minutes 00
13 %label#colon :
14 %label#seconds 00
15- if @playable or @puzzle.latest?
16 %details#trace-settings
17 %summary Settings
18 .things
19 %label{ for: "sens" } Mouse Speed 2D
20 %input#sens{ type: "range", min: "0.1", max: "1.3", step: "0.1" }
21 %label{ for: "volume" } Volume
22 %input#volume{ type: "range", min: "0", max: "0.24", step: "0.02" }
23- unless @playable
24 #scores
25 #by-time
26 %h2 Fastest Solves
27 %table
28 - @puzzle.scores.where("seconds_taken IS NOT NULL").order(seconds_taken: :asc, created_at: :asc).limit(100).each_with_index do |score, i|
29 %tr
30 %td #{(i + 1)}.
31 %td= score.name
32 %td.score-field= humanize_interval(score.seconds_taken)
33 #by-when
34 %h2 Completion Order
35 %table
36 - @puzzle.scores.order(created_at: :asc).limit(100).each_with_index do |score, i|
37 %tr
38 %td #{(i + 1)}.
39 %td= score.name
40 %td.score-field= score.created_at.getlocal().strftime("%-I:%M:%S%P")
41= render partial: "handle_puzzle"