about summary refs log tree commit diff stats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/assets/images/wittle/wittle_expert.pngbin0 -> 155050 bytes
-rw-r--r--app/assets/images/wittle/wittle_hard.pngbin0 -> 92194 bytes
-rw-r--r--app/assets/images/wittle/wittle_normal.pngbin0 -> 81341 bytes
-rw-r--r--app/assets/stylesheets/wittle/general.css.scss86
-rw-r--r--app/controllers/wittle/puzzles_controller.rb8
-rw-r--r--app/views/wittle/puzzles/about.html.haml27
-rw-r--r--app/views/wittle/puzzles/index.html.haml1
-rw-r--r--app/views/wittle/puzzles/show.html.haml1
8 files changed, 117 insertions, 6 deletions
diff --git a/app/assets/images/wittle/wittle_expert.png b/app/assets/images/wittle/wittle_expert.png new file mode 100644 index 0000000..b806b57 --- /dev/null +++ b/app/assets/images/wittle/wittle_expert.png
Binary files differ
diff --git a/app/assets/images/wittle/wittle_hard.png b/app/assets/images/wittle/wittle_hard.png new file mode 100644 index 0000000..e993e9b --- /dev/null +++ b/app/assets/images/wittle/wittle_hard.png
Binary files differ
diff --git a/app/assets/images/wittle/wittle_normal.png b/app/assets/images/wittle/wittle_normal.png new file mode 100644 index 0000000..adc0943 --- /dev/null +++ b/app/assets/images/wittle/wittle_normal.png
Binary files differ
diff --git a/app/assets/stylesheets/wittle/general.css.scss b/app/assets/stylesheets/wittle/general.css.scss index a0eb980..f7bb56f 100644 --- a/app/assets/stylesheets/wittle/general.css.scss +++ b/app/assets/stylesheets/wittle/general.css.scss
@@ -10,8 +10,8 @@
10 10
11 a { 11 a {
12 display: block; 12 display: block;
13 width: 1110px; 13 width: 600px;
14 height: 454px; 14 height: 245px;
15 text-indent: -5000px; 15 text-indent: -5000px;
16 text-decoration: none; 16 text-decoration: none;
17 margin: 0; 17 margin: 0;
@@ -169,3 +169,85 @@ input[type="range"]::-ms-thumb {
169 padding: 0; 169 padding: 0;
170 } 170 }
171} 171}
172
173#current-date {
174 margin-top: 1em;
175 text-align: center;
176}
177
178#choose-difficulty {
179 margin: 1em auto 2em;
180 width: max-content;
181 display: flex;
182}
183
184#normal-link {
185 width: 215px;
186 margin-right: 1em;
187
188 a {
189 background-image: image-url("wittle/wittle_normal.png");
190 background-size: cover;
191 display: block;
192 width: 215px;
193 height: 215px;
194 text-indent: -5000px;
195 text-decoration: none;
196 margin: 0;
197 }
198}
199
200#hard-link {
201 width: 215px;
202 margin-right: 1em;
203
204 a {
205 background-image: image-url("wittle/wittle_hard.png");
206 background-size: cover;
207 display: block;
208 width: 215px;
209 height: 215px;
210 text-indent: -5000px;
211 text-decoration: none;
212 margin: 0;
213 }
214}
215
216#expert-link {
217 width: 215px;
218
219 a {
220 background-image: image-url("wittle/wittle_expert.png");
221 background-size: cover;
222 display: block;
223 width: 215px;
224 height: 215px;
225 text-indent: -5000px;
226 text-decoration: none;
227 margin: 0;
228 }
229}
230
231.summary {
232 width: 50%;
233 min-width: 600px;
234 margin: 0 auto 1em;
235}
236
237.puzzle-status {
238 text-align: center;
239 margin-bottom: 0;
240}
241
242.breadcrumb {
243 text-align: center;
244
245 a, a:visited {
246 color: #555d66;
247 text-decoration: none;
248 }
249
250 a:hover {
251 text-decoration: underline;
252 }
253}
diff --git a/app/controllers/wittle/puzzles_controller.rb b/app/controllers/wittle/puzzles_controller.rb index 3c3c8a6..b481460 100644 --- a/app/controllers/wittle/puzzles_controller.rb +++ b/app/controllers/wittle/puzzles_controller.rb
@@ -2,8 +2,16 @@ module Wittle
2 class PuzzlesController < ApplicationController 2 class PuzzlesController < ApplicationController
3 def about 3 def about
4 @normal_puzzle = Puzzle.normal.order(created_at: :desc).first 4 @normal_puzzle = Puzzle.normal.order(created_at: :desc).first
5 @normal_started = ((session[:started_puzzles] || []).include? @normal_puzzle.id)
6 @normal_solved = ((session[:played_puzzles] || []).include? @normal_puzzle.id)
7
5 @hard_puzzle = Puzzle.hard.order(created_at: :desc).first 8 @hard_puzzle = Puzzle.hard.order(created_at: :desc).first
9 @hard_started = ((session[:started_puzzles] || []).include? @hard_puzzle.id)
10 @hard_solved = ((session[:played_puzzles] || []).include? @hard_puzzle.id)
11
6 @expert_puzzle = Puzzle.expert.order(created_at: :desc).first 12 @expert_puzzle = Puzzle.expert.order(created_at: :desc).first
13 @expert_started = ((session[:started_puzzles] || []).include? @expert_puzzle.id)
14 @expert_solved = ((session[:played_puzzles] || []).include? @expert_puzzle.id)
7 end 15 end
8 16
9 def index 17 def index
diff --git a/app/views/wittle/puzzles/about.html.haml b/app/views/wittle/puzzles/about.html.haml index 6a47972..a96fcf9 100644 --- a/app/views/wittle/puzzles/about.html.haml +++ b/app/views/wittle/puzzles/about.html.haml
@@ -1,4 +1,23 @@
1%p by Hatkirby, with help from Sigma144 and jbzdarkid 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%p= link_to "Normal", @normal_puzzle 2%h2#current-date= @normal_puzzle.created_at.strftime("%B %-d, %Y")
3%p= link_to "Hard", @hard_puzzle 3%nav#choose-difficulty
4%p= link_to "Expert", @expert_puzzle 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%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.
diff --git a/app/views/wittle/puzzles/index.html.haml b/app/views/wittle/puzzles/index.html.haml index 097eb87..fe497e4 100644 --- a/app/views/wittle/puzzles/index.html.haml +++ b/app/views/wittle/puzzles/index.html.haml
@@ -1,3 +1,4 @@
1.breadcrumb= link_to "← Back to home page", root_path
1%h1 Archive 2%h1 Archive
2%table#archive 3%table#archive
3 %tr 4 %tr
diff --git a/app/views/wittle/puzzles/show.html.haml b/app/views/wittle/puzzles/show.html.haml index 8628298..7307152 100644 --- a/app/views/wittle/puzzles/show.html.haml +++ b/app/views/wittle/puzzles/show.html.haml
@@ -1,3 +1,4 @@
1.breadcrumb= link_to "← Back to home page", root_path
1%h1 Wittle ##{@puzzle.id} 2%h1 Wittle ##{@puzzle.id}
2.puzzle-description #{@puzzle.category.capitalize} - #{@puzzle.created_at.strftime("%B %-d, %Y")} 3.puzzle-description #{@puzzle.category.capitalize} - #{@puzzle.created_at.strftime("%B %-d, %Y")}
3#puzzle-container{ style: "display: flex; justify-content: center; align-items: center" } 4#puzzle-container{ style: "display: flex; justify-content: center; align-items: center" }