2022-03-07 23:51:59 +09:00
|
|
|
{##
|
|
|
|
# SPDX-FileCopyrightText: 2022 n9k [https://git.076.ne.jp/ninya9k]
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
##}
|
2022-02-26 19:34:14 +09:00
|
|
|
{% from 'macros/user.html' import appearance with context %}
|
2022-02-16 18:55:30 +09:00
|
|
|
<!doctype html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
2022-03-03 19:38:55 +09:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
2022-07-15 01:31:11 +09:00
|
|
|
<meta http-equiv="content-security-policy" content="default-src 'none'; style-src 'nonce-{{ csp }}'; img-src 'self';">
|
2022-07-15 01:33:31 +09:00
|
|
|
<!--<meta http-equiv="refresh" content="{{ refresh }}">-->
|
|
|
|
<meta http-equiv="refresh" content="{{ refresh }}; url={{ url_for('nojs_chat_messages_redirect', token=user.token) }}">
|
2022-03-07 16:11:49 +09:00
|
|
|
<style nonce="{{ csp }}">
|
2022-02-16 18:55:30 +09:00
|
|
|
html {
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
body {
|
|
|
|
margin: 0;
|
2022-02-18 21:24:19 +09:00
|
|
|
padding: 0.5rem 0.5rem 0 0.5rem;
|
|
|
|
min-height: 100%;
|
|
|
|
box-sizing: border-box;
|
2022-02-16 18:55:30 +09:00
|
|
|
color: #ddd;
|
|
|
|
font-family: sans-serif;
|
|
|
|
font-size: 11pt;
|
2022-02-18 21:24:19 +09:00
|
|
|
transform: rotate(180deg);
|
|
|
|
}
|
|
|
|
|
|
|
|
.button {
|
|
|
|
display: block;
|
|
|
|
text-align: center;
|
|
|
|
background-color: #3674bf;
|
|
|
|
border: 4px outset #3584e4;
|
|
|
|
box-shadow: 0 0 5px #3584e4;
|
|
|
|
padding: 1.25ch 0;
|
|
|
|
box-sizing: border-box;
|
|
|
|
color: inherit;
|
|
|
|
font-size: 12pt;
|
|
|
|
font-weight: bold;
|
|
|
|
text-decoration: none;
|
|
|
|
transform: rotate(-180deg);
|
|
|
|
}
|
2022-02-27 14:01:49 +09:00
|
|
|
#timeout {
|
2022-02-18 21:24:19 +09:00
|
|
|
z-index: 1;
|
|
|
|
position: absolute;
|
|
|
|
top: 0.5rem;
|
|
|
|
width: calc(100% - 1rem);
|
|
|
|
visibility: hidden;
|
|
|
|
animation: appear 0s {{ timeout }}s forwards;
|
|
|
|
}
|
2022-02-27 14:01:49 +09:00
|
|
|
#timeout header {
|
2022-02-18 21:24:19 +09:00
|
|
|
font-size: 20pt;
|
2022-02-16 18:55:30 +09:00
|
|
|
}
|
2022-02-27 14:01:49 +09:00
|
|
|
#timeout-dismiss {
|
2022-02-20 12:41:54 +09:00
|
|
|
position: absolute;
|
|
|
|
bottom: 2px;
|
|
|
|
width: calc(100% - 1rem);
|
2022-02-18 21:24:19 +09:00
|
|
|
}
|
2022-02-27 14:01:49 +09:00
|
|
|
#timeout-dismiss > .button {
|
2022-02-18 21:24:19 +09:00
|
|
|
visibility: hidden;
|
|
|
|
height: 0;
|
|
|
|
padding: 0;
|
|
|
|
border: none;
|
|
|
|
animation:
|
|
|
|
appear 0s {{ timeout }}s forwards,
|
|
|
|
unskinny 0s {{ timeout }}s forwards;
|
|
|
|
}
|
2022-02-27 14:01:49 +09:00
|
|
|
#timeout-alt {
|
2022-02-18 21:24:19 +09:00
|
|
|
padding: 4px 0 2px 0;
|
|
|
|
}
|
2022-02-27 14:01:49 +09:00
|
|
|
#notimeout:target + #timeout,
|
|
|
|
#notimeout:target ~ #timeout-dismiss,
|
|
|
|
#notimeout:not(:target) ~ #timeout-alt {
|
2022-02-18 21:24:19 +09:00
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
@keyframes appear {
|
|
|
|
to {
|
|
|
|
visibility: visible;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@keyframes unskinny {
|
|
|
|
to {
|
|
|
|
height: auto;
|
|
|
|
padding: 1.25ch 0;
|
|
|
|
border: 4px outset #3584e4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-16 18:55:30 +09:00
|
|
|
#chat-messages {
|
|
|
|
list-style: none;
|
|
|
|
margin: 0;
|
2022-02-18 21:24:19 +09:00
|
|
|
padding: 0;
|
2022-02-16 18:55:30 +09:00
|
|
|
min-height: 100%;
|
|
|
|
}
|
|
|
|
.chat-message {
|
|
|
|
padding: 0.5ch 0.75ch;
|
|
|
|
width: 100%;
|
|
|
|
box-sizing: border-box;
|
|
|
|
border-radius: 4px;
|
|
|
|
transform: rotate(-180deg);
|
2022-03-09 12:38:05 +09:00
|
|
|
overflow: hidden;
|
2022-02-16 18:55:30 +09:00
|
|
|
}
|
|
|
|
.chat-message:hover {
|
|
|
|
background-color: #434347;
|
|
|
|
}
|
2022-02-22 14:27:42 +09:00
|
|
|
.chat-message__time {
|
|
|
|
color: #b2b2b3;
|
|
|
|
font-size: 10pt;
|
2022-03-04 22:23:28 +09:00
|
|
|
cursor: default;
|
|
|
|
}
|
|
|
|
.chat-message__insignia {
|
2022-04-19 11:46:03 +09:00
|
|
|
color: var(--chat-bg);
|
|
|
|
border: 1px outset #0000007f;
|
|
|
|
text-shadow: 0 0 1px var(--chat-bg-color);
|
|
|
|
background-color: orangered;
|
|
|
|
padding: 0 2px;
|
|
|
|
border-radius: 3px;
|
2022-02-22 14:27:42 +09:00
|
|
|
cursor: help;
|
|
|
|
}
|
2022-02-16 18:55:30 +09:00
|
|
|
.chat-message__name {
|
|
|
|
overflow-wrap: anywhere;
|
|
|
|
font-weight: bold;
|
|
|
|
/* color: attr("data-color"); */
|
2022-02-18 14:16:54 +09:00
|
|
|
cursor: default;
|
2022-02-16 18:55:30 +09:00
|
|
|
}
|
2022-02-22 18:30:23 +09:00
|
|
|
.chat-message__name__tag {
|
|
|
|
font-family: monospace;
|
|
|
|
font-size: 9pt;
|
|
|
|
vertical-align: top;
|
|
|
|
}
|
2022-02-16 18:55:30 +09:00
|
|
|
.chat-message__markup {
|
2022-03-09 13:16:24 +09:00
|
|
|
white-space: pre-wrap;
|
2022-02-16 18:55:30 +09:00
|
|
|
overflow-wrap: anywhere;
|
|
|
|
line-height: 1.3125;
|
|
|
|
}
|
2022-07-15 01:31:11 +09:00
|
|
|
.emote {
|
2022-07-17 08:47:25 +09:00
|
|
|
background-image: url("{{ escape_css_string(url_for('static', filename=emotesheet, coords=emotehash)) | safe }}");
|
2022-07-15 01:31:11 +09:00
|
|
|
display: inline-block;
|
|
|
|
font-size: 0;
|
|
|
|
vertical-align: middle;
|
|
|
|
cursor: default;
|
|
|
|
}
|
2022-02-18 14:16:54 +09:00
|
|
|
.tripcode {
|
|
|
|
padding: 0 5px;
|
|
|
|
border-radius: 7px;
|
|
|
|
font-family: monospace;
|
|
|
|
font-size: 9pt;
|
|
|
|
cursor: default;
|
|
|
|
}
|
2022-03-07 16:11:49 +09:00
|
|
|
|
|
|
|
{% for token in messages | map(attribute='token') | list | unique %}
|
2022-03-09 12:39:43 +09:00
|
|
|
{% with this_user = users_by_token[token] %}
|
|
|
|
[data-token-hash="{{ this_user.token_hash }}"] > .chat-message__name {
|
|
|
|
color: {{ this_user.color }};
|
2022-03-07 16:11:49 +09:00
|
|
|
}
|
2022-03-09 12:39:43 +09:00
|
|
|
{% if this_user.tripcode %}
|
|
|
|
[data-token-hash="{{ this_user.token_hash }}"] > .tripcode {
|
|
|
|
background-color: {{ this_user.tripcode.background_color }};
|
|
|
|
color: {{ this_user.tripcode.foreground_color }};
|
2022-03-07 16:11:49 +09:00
|
|
|
}
|
|
|
|
{% endif %}
|
|
|
|
{% endwith %}
|
|
|
|
{% endfor %}
|
2022-07-15 01:31:11 +09:00
|
|
|
|
|
|
|
{% for name, _regex, (x, y), (width, height) in emotes %}
|
|
|
|
[data-emote="{{ escape_css_string(name) | safe }}"] {
|
|
|
|
background-position: {{ -x }}px {{ -y }}px;
|
|
|
|
width: {{ width }}px;
|
|
|
|
height: {{ height }}px;
|
|
|
|
}
|
|
|
|
{% endfor %}
|
2022-02-16 18:55:30 +09:00
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
2022-02-18 21:24:19 +09:00
|
|
|
<div id="end"></div>
|
|
|
|
<div id="notimeout"></div>
|
2022-02-27 14:01:49 +09:00
|
|
|
<aside id="timeout">
|
2022-03-04 15:15:56 +09:00
|
|
|
<a class="button" href="{{ url_for('nojs_chat_messages_redirect', token=user.token) }}">
|
2022-02-18 21:24:19 +09:00
|
|
|
<header>Timed out</header>
|
|
|
|
<small>Click to refresh</small>
|
|
|
|
</a>
|
|
|
|
</aside>
|
|
|
|
<ol id="chat-messages">
|
2022-02-16 18:55:30 +09:00
|
|
|
{% for message in messages | reverse %}
|
2022-03-09 12:39:43 +09:00
|
|
|
{% with this_user = users_by_token[message.token] %}
|
|
|
|
<li class="chat-message" data-seq="{{ message.seq }}" data-token-hash="{{ this_user.token_hash }}">
|
2022-02-23 08:03:14 +09:00
|
|
|
<time class="chat-message__time" datetime="{{ message.date }}T{{ message.time_seconds }}Z" title="{{ message.date }} {{ message.time_seconds }}">{{ message.time_minutes }}</time>
|
|
|
|
{{- ' ' | safe -}}
|
2022-03-09 12:39:43 +09:00
|
|
|
{{ appearance(this_user, insignia_class='chat-message__insignia', name_class='chat-message__name', tag_class='chat-message__name__tag') }}
|
2022-03-04 15:18:47 +09:00
|
|
|
{{- ': ' -}}
|
2022-02-23 08:03:14 +09:00
|
|
|
<span class="chat-message__markup">{{ message.markup }}</span>
|
2022-03-09 12:39:43 +09:00
|
|
|
</li>
|
|
|
|
{% endwith %}
|
2022-02-16 18:55:30 +09:00
|
|
|
{% endfor %}
|
2022-02-18 21:24:19 +09:00
|
|
|
</ol>
|
2022-02-27 14:01:49 +09:00
|
|
|
<aside id="timeout-dismiss">
|
2022-02-18 21:24:19 +09:00
|
|
|
<a class="button" href="#notimeout">Hide timeout notice</a>
|
|
|
|
</aside>
|
2022-02-27 14:01:49 +09:00
|
|
|
<aside id="timeout-alt">
|
2022-03-04 15:15:56 +09:00
|
|
|
<a class="button" href="{{ url_for('nojs_chat_messages_redirect', token=user.token) }}">Click to refresh</a>
|
2022-02-18 21:24:19 +09:00
|
|
|
</aside>
|
2022-02-16 18:55:30 +09:00
|
|
|
</body>
|
|
|
|
</html>
|