Skip to content

Commit

Permalink
Merge branch 'main' into tf-add-puzzle-ant
Browse files Browse the repository at this point in the history
  • Loading branch information
lsammut authored Oct 11, 2024
2 parents b62971b + bf1207b commit 5060f76
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 17 deletions.
18 changes: 14 additions & 4 deletions openday_scavenger/puzzles/fourbyfour/static/styles.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

.word-item {
background-color: lightgrey;
background-color: #f0f0f0;
border-radius: 10px;
height: 100px;
/* Fixed height for grid items */
Expand All @@ -12,7 +12,7 @@
}

.category-item {
background-color: lightgrey;
background-color: #203d79;
border-radius: 10px;
height: 100px;
/* Fixed height for grid items */
Expand All @@ -25,7 +25,7 @@
/* Center children vertically */
text-align: center;
cursor: pointer;

color: white;
}

.category-item strong,
Expand All @@ -36,7 +36,7 @@
}

.selected {
background-color: darkgrey;
background-color: #0078c1;
color: white;
}

Expand All @@ -53,6 +53,16 @@
max-width: 768px;
}


.btn-custom {
background-color: #35bfc9;
color: white;
}
.btn-custom:hover {
background-color: #2aa3b0;
color: white;
}

@media (max-width: 600px) {
.container {
max-width: 100%;
Expand Down
27 changes: 14 additions & 13 deletions openday_scavenger/puzzles/fourbyfour/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ <h1 class="text-center my-4">Create four groups of four!</h1>

{% if game_over %}
<div class="alert alert-danger text-center" role="alert">
Oh no! Too many mistakes!
Would you like to <a href="#" class="alert-link" hx-delete="/puzzles/{{ puzzle }}/" hx-target="body"
hx-swap="outerHTML">start again</a>?
</div>
Expand Down Expand Up @@ -68,6 +69,8 @@ <h1 class="text-center my-4">Create four groups of four!</h1>

</div>

{% if not register_success %}

<div class="text-center my-4">
<p>Mistakes remaining:</p>
{% for _ in range(status.mistakes_available) %}
Expand All @@ -88,29 +91,27 @@ <h1 class="text-center my-4">Create four groups of four!</h1>

</div>

{% endif %}
{% endif %}

{% if message and register_success %}
<div class="alert alert-success text-center" role="alert">
<div class="alert alert-success text-center mt-3" role="alert">
{{ message }}
</div>
{% elif message %}
<div class="alert alert-warning text-center" role="alert">
{{ message }}
{% endif %}

{% if register_success %}
<form id="auto-submit-form" class="text-center" method="POST" action="/submission">
<input hidden type="text" id="name" name="name" value="{{ puzzle }}">
<input hidden type="text" id="visitor" name="visitor" value="{{ visitor }}">
<input hidden type="text" id="answer" name="answer" value="{{ status.export_solution() }}">
<div id="submit-me" style="visibility: hidden; height: 1px;">Submitting...</div>
<button class="btn btn-custom">
Register your answer!
</button>
</form>
<script>
setTimeout(function () {
document.getElementById('auto-submit-form').submit();
}, 1000); // 1 second delay
</script>

{% elif message %}

<div class="alert alert-warning text-center" role="alert">
{{ message }}
</div>
{% endif %}

</body>
Expand Down

0 comments on commit 5060f76

Please sign in to comment.