Compare commits

..

No commits in common. "dd856d93d50c733f125855d8b2193229d4e9727f" and "2794359218c5584f3deafbe6612fa003f9079313" have entirely different histories.

5 changed files with 48 additions and 66 deletions

View file

@ -1,4 +1,3 @@
copyright_start: 2021
guilds: guilds:
# Tegaki Tuesday # Tegaki Tuesday
- id: 814700630958276649 - id: 814700630958276649

View file

@ -6,7 +6,6 @@ use std::fs;
#[derive(Serialize, Deserialize)] #[derive(Serialize, Deserialize)]
pub struct Settings { pub struct Settings {
pub guilds: Vec<Guild>, pub guilds: Vec<Guild>,
pub copyright_start: u32,
} }
impl Settings { impl Settings {

View file

@ -43,19 +43,11 @@ input[type=number] {
#content { #content {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex;
display: grid; flex-direction: column;
grid-template-areas:
"nav nav"
"challenge submissions";
grid-template-columns: 30em auto;
grid-template-rows: min-content auto;
overflow: hidden; overflow: hidden;
nav { nav {
grid-area: nav;
--bg: #{$fg}; --bg: #{$fg};
--fg: #{$bg}; --fg: #{$bg};
background: var(--bg); background: var(--bg);
@ -106,20 +98,16 @@ input[type=number] {
} }
} }
& > div { & > div:first-of-type {
overflow: scroll;
display: flex; display: flex;
flex-direction: column; height: 100%;
gap: 1em; & > :first-child {
min-width: 40em;
footer { padding: 1em;
margin-top: auto; }
text-align: center; & > * {
overflow: scroll;
} }
}
#challenge {
padding: 1em;
} }
} }
@ -128,17 +116,17 @@ input[type=number] {
} }
#submissions { #submissions {
grid-area: submissions; display: flex;
flex-direction: column;
height: calc(100% - 2em);
background: rgba(0, 0, 0, 0.125); background: rgba(0, 0, 0, 0.125);
padding: 1em; $gap: 0.5em;
padding: $gap;
& > div { & > div {
width: 100%; width: 100%;
column-count: 3; column-count: 3;
margin: 0; margin: 0;
$gap: 0.5em;
gap: $gap; gap: $gap;
& > figure { & > figure {

View file

@ -1 +0,0 @@
© {% set year = now() | date(format="%Y") | int %}{{ settings.copyright_start }}{% if year != settings.copyright_start %}{{ year }}{% endif %}

View file

@ -64,7 +64,7 @@
</nav> </nav>
</a> </a>
</nav> </nav>
<div id="challenge"> <div>
<div> <div>
<h1>Welcome to Tegaki Tuesday #{{ challenge }}!</h1> <h1>Welcome to Tegaki Tuesday #{{ challenge }}!</h1>
{% if content.japanese %} {% if content.japanese %}
@ -118,41 +118,38 @@
<p><em>This challenge was suggested by <strong>{{ content.suggester }}</strong> using the <code>-h suggest</code> command.</code></em></p> <p><em>This challenge was suggested by <strong>{{ content.suggester }}</strong> using the <code>-h suggest</code> command.</code></em></p>
{%- endif -%} {%- endif -%}
</div> </div>
<footer> <div id="submissions">
Copyright {% include "copyright-years" %} Tegaki Tuesday. All rights reserved. 字ちゃん mascot art by <a href="https://twitter.com/bellumela" target="_blank">@bellumela</a>. <script>
</footer> const submissionModal = image => {
</div> const dialog = document.createElement("dialog");
<div id="submissions"> dialog.style.padding = "0";
<script> const img = document.createElement("img");
const submissionModal = image => { img.src = "/{{ challenge }}/" + image;
const dialog = document.createElement("dialog"); const defaultZoom = "75vh";
dialog.style.padding = "0"; img.style.height = defaultZoom;
const img = document.createElement("img"); img.style.cursor = "zoom-in";
img.src = "/{{ challenge }}/" + image; img.style.display = "block";
const defaultZoom = "75vh"; img.style.margin = "0";
img.style.height = defaultZoom; img.onclick = event => img.style.height = img.style.height ? "" : defaultZoom;
img.style.cursor = "zoom-in"; dialog.appendChild(img);
img.style.display = "block"; dialog.addEventListener("close", event => document.body.removeChild(dialog));
img.style.margin = "0"; document.body.appendChild(dialog);
img.onclick = event => img.style.height = img.style.height ? "" : defaultZoom; dialog.showModal();
dialog.appendChild(img); };
dialog.addEventListener("close", event => document.body.removeChild(dialog)); </script>
document.body.appendChild(dialog); <div>
dialog.showModal(); {% for submission in submissions %}
}; {% set author = users[submission.author_id] %}
</script> <figure>
<div> <img src="/{{ challenge }}/{{ submission.image }}" alt="{{ author.username }}'s submission" onclick="submissionModal('{{ submission.image }}')">
{% for submission in submissions %} <figcaption>{% if not author.deleted %}<a href="https://discord.com/users/{{ author.id }}" target="_blank">{% endif %}{{ author.username }}{% if author.deleted %} (deleted account){% else %}</a>{% endif %}</figcaption>
{% set author = users[submission.author_id] %} </figure>
<figure> {% endfor %}
<img src="/{{ challenge }}/{{ submission.image }}" alt="{{ author.username }}'s submission" onclick="submissionModal('{{ submission.image }}')"> </div>
<figcaption>{% if not author.deleted %}<a href="https://discord.com/users/{{ author.id }}" target="_blank">{% endif %}{{ author.username }}{% if author.deleted %} (deleted account){% else %}</a>{% endif %}</figcaption> <div>
</figure> some random shit goes here
{% endfor %} </div>
</div> </div>
<footer>
Submissions are copyright {% include "copyright-years" %} their respective submitters, and are licensed under the <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank">Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</a> license.
</footer>
</div> </div>
</div> </div>
</body> </body>