Compare commits
No commits in common. "dd856d93d50c733f125855d8b2193229d4e9727f" and "2794359218c5584f3deafbe6612fa003f9079313" have entirely different histories.
dd856d93d5
...
2794359218
5 changed files with 48 additions and 66 deletions
|
@ -1,4 +1,3 @@
|
|||
copyright_start: 2021
|
||||
guilds:
|
||||
# Tegaki Tuesday
|
||||
- id: 814700630958276649
|
||||
|
|
|
@ -6,7 +6,6 @@ use std::fs;
|
|||
#[derive(Serialize, Deserialize)]
|
||||
pub struct Settings {
|
||||
pub guilds: Vec<Guild>,
|
||||
pub copyright_start: u32,
|
||||
}
|
||||
|
||||
impl Settings {
|
||||
|
|
|
@ -43,19 +43,11 @@ input[type=number] {
|
|||
#content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
display: grid;
|
||||
grid-template-areas:
|
||||
"nav nav"
|
||||
"challenge submissions";
|
||||
grid-template-columns: 30em auto;
|
||||
grid-template-rows: min-content auto;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
|
||||
nav {
|
||||
grid-area: nav;
|
||||
|
||||
--bg: #{$fg};
|
||||
--fg: #{$bg};
|
||||
background: var(--bg);
|
||||
|
@ -106,20 +98,16 @@ input[type=number] {
|
|||
}
|
||||
}
|
||||
|
||||
& > div {
|
||||
overflow: scroll;
|
||||
& > div:first-of-type {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1em;
|
||||
|
||||
footer {
|
||||
margin-top: auto;
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
& > :first-child {
|
||||
min-width: 40em;
|
||||
padding: 1em;
|
||||
}
|
||||
& > * {
|
||||
overflow: scroll;
|
||||
}
|
||||
}
|
||||
|
||||
#challenge {
|
||||
padding: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -128,17 +116,17 @@ input[type=number] {
|
|||
}
|
||||
|
||||
#submissions {
|
||||
grid-area: submissions;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100% - 2em);
|
||||
background: rgba(0, 0, 0, 0.125);
|
||||
padding: 1em;
|
||||
|
||||
$gap: 0.5em;
|
||||
padding: $gap;
|
||||
& > div {
|
||||
width: 100%;
|
||||
column-count: 3;
|
||||
margin: 0;
|
||||
|
||||
$gap: 0.5em;
|
||||
gap: $gap;
|
||||
|
||||
& > figure {
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
© {% set year = now() | date(format="%Y") | int %}{{ settings.copyright_start }}{% if year != settings.copyright_start %}–{{ year }}{% endif %}
|
|
@ -64,7 +64,7 @@
|
|||
</nav>
|
||||
</a>
|
||||
</nav>
|
||||
<div id="challenge">
|
||||
<div>
|
||||
<div>
|
||||
<h1>Welcome to Tegaki Tuesday #{{ challenge }}!</h1>
|
||||
{% 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>
|
||||
{%- endif -%}
|
||||
</div>
|
||||
<footer>
|
||||
Copyright {% include "copyright-years" %} Tegaki Tuesday. All rights reserved. 字ちゃん mascot art by <a href="https://twitter.com/bellumela" target="_blank">@bellumela</a>.
|
||||
</footer>
|
||||
</div>
|
||||
<div id="submissions">
|
||||
<script>
|
||||
const submissionModal = image => {
|
||||
const dialog = document.createElement("dialog");
|
||||
dialog.style.padding = "0";
|
||||
const img = document.createElement("img");
|
||||
img.src = "/{{ challenge }}/" + image;
|
||||
const defaultZoom = "75vh";
|
||||
img.style.height = defaultZoom;
|
||||
img.style.cursor = "zoom-in";
|
||||
img.style.display = "block";
|
||||
img.style.margin = "0";
|
||||
img.onclick = event => img.style.height = img.style.height ? "" : defaultZoom;
|
||||
dialog.appendChild(img);
|
||||
dialog.addEventListener("close", event => document.body.removeChild(dialog));
|
||||
document.body.appendChild(dialog);
|
||||
dialog.showModal();
|
||||
};
|
||||
</script>
|
||||
<div>
|
||||
{% for submission in submissions %}
|
||||
{% set author = users[submission.author_id] %}
|
||||
<figure>
|
||||
<img src="/{{ challenge }}/{{ submission.image }}" alt="{{ author.username }}'s submission" onclick="submissionModal('{{ submission.image }}')">
|
||||
<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>
|
||||
</figure>
|
||||
{% endfor %}
|
||||
</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 id="submissions">
|
||||
<script>
|
||||
const submissionModal = image => {
|
||||
const dialog = document.createElement("dialog");
|
||||
dialog.style.padding = "0";
|
||||
const img = document.createElement("img");
|
||||
img.src = "/{{ challenge }}/" + image;
|
||||
const defaultZoom = "75vh";
|
||||
img.style.height = defaultZoom;
|
||||
img.style.cursor = "zoom-in";
|
||||
img.style.display = "block";
|
||||
img.style.margin = "0";
|
||||
img.onclick = event => img.style.height = img.style.height ? "" : defaultZoom;
|
||||
dialog.appendChild(img);
|
||||
dialog.addEventListener("close", event => document.body.removeChild(dialog));
|
||||
document.body.appendChild(dialog);
|
||||
dialog.showModal();
|
||||
};
|
||||
</script>
|
||||
<div>
|
||||
{% for submission in submissions %}
|
||||
{% set author = users[submission.author_id] %}
|
||||
<figure>
|
||||
<img src="/{{ challenge }}/{{ submission.image }}" alt="{{ author.username }}'s submission" onclick="submissionModal('{{ submission.image }}')">
|
||||
<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>
|
||||
</figure>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div>
|
||||
some random shit goes here
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
Loading…
Add table
Reference in a new issue