anonstream/templates/chat-iframe.html

90 行
3.6 KiB
HTML

<html>
<head>
<meta charset="utf-8">
<meta http-equiv="conent-security-policy" content="default-src 'none'">
{% if not debug %}<meta http-equiv="refresh" content="5">{% endif %}
<style>
div.comment {color: white;margin-bottom:0.375em;overflow:hidden;}
.rotate {transform: rotate(-180deg);}
.reverse {direction: rtl;}
.inline-block {display: inline-block;}
div.name {font-weight: bold;}
div.tripcode {
margin-left: 0.625em;
padding: 0 5px;
border-radius: 6px;
font-size: 90%;
font-family: monospace;
vertical-align: middle;
}
div.message {display: block;/*margin-left: 0.625em;*/overflow-wrap: break-word;}
div.camera {transform: scaleX(-1);text-shadow: 0px 0px 6px #ff8280;cursor: help;margin-right:0.25em;}
div.time {font-size: 80%;color: gray;vertical-align:middle;margin-right:0.5em;}
body {margin: 0.5em;margin-bottom: 0;min-height: calc(100vh - 1em);transform: scaleX(-1);}
input[type="submit"] {padding: 0;margin-bottom: 0.5em;}
div#refresh {
color: white;
background-color: gray;
position: sticky;
/*top: 100vh;*/ /* placement is correct with top when there is no scrollbar */
bottom: 0; /* placement is correct with bottom when there is a scrollbar */
padding: 1em;
text-align: center;
font-weight: bold;
border-radius: 4px;
box-shadow: 0px 2px 4px black;
}
div#refresh {
animation: unhide 0s forwards 30s;
height: 0;
padding: 0;
visibility: hidden;
}
@keyframes unhide {
to {
height: revert;
padding: 1em;
visibility: visible;
}
}
</style>
</head>
<body>
{% if broadcaster %}
<form action="/mod" method="post">
<div class="reverse">
<input class="rotate" type="submit" name="ban" value="Ban">
<input class="rotate" type="submit" name="hide" value="Hide">
<input class="rotate" type="submit" name="ban_purge" value="Ban and hide all">
</div>
{% endif %}
{% for message in messages %}
<div class="comment rotate">
{% if not message['hidden'] %}
{% if broadcaster %}
<input type="checkbox" name="message_id[]" value="{{ message['id'] }}">
{% endif %}
<div class="inline-block time" title="{{ message['date'] }}">{{ message['time'] }}</div>
{% if message['viewer']['broadcaster'] %}
<div class="inline-block camera" title="Broadcaster">🎥</div>
{% endif %}
<div class="inline-block name" style="color:#{{ message['viewer']['colour'].hex() }};">{{ message['viewer']['nickname'] }}</div>
{% if message['viewer']['tripcode']['string'] %}
<div class="inline-block tripcode" style="background-color:#{{ message['viewer']['tripcode']['background_colour'].hex() }};color:#{{ message['viewer']['tripcode']['foreground_colour'].hex() }};">{{ message['viewer']['tripcode']['string'] }}</div>
{% endif %}
<div class="inline-block message">{{ message['text'] }}</div>
{% endif %}
</div>
{% endfor %}
{% if broadcaster %}
</form>
{% endif %}
<a href="" style="text-decoration: none;"><div id="refresh" class="rotate">Manual refresh required</div></a>
</body>
</html>