diff --git a/files/assets/css/chat.css b/files/assets/css/chat.css index 46307859c..d95658755 100644 --- a/files/assets/css/chat.css +++ b/files/assets/css/chat.css @@ -184,94 +184,3 @@ h1, h2, h3, h4, h5, h6 { margin-bottom: 0.3rem; } } - - -@media (min-width: 768px) { - lite-youtube { /* fix overflow */ - max-width: 25vw !important; - } -} - -.top-container { - display: flex; - justify-content: space-around; -} - -@media (max-width: 768px) { - .top-container { - flex-flow: column wrap; - } - #chat-window { - max-height: 34vh !important; - } -} - -.chat-window-item { - flex-grow: 2; -} - -#orgy-file-container { - width: 65vw; - max-height: 80vh !important; - max-width: 100vw !important; -} - -#orgy-file-container > * { - max-height: 80vh !important; - margin: 0 !important; - height: 98% !important; - width: 98% !important; -} - -@media (max-width: 768px) { - #orgy-file-container { - width: 100% !important; - } - #orgy-title { - display: none; - } - #orgy-col { - padding: 0px; - } - #orgy-file-container > * { - height: 100% !important; - width: 100% !important; - } - .chat-window-item { - max-width: 100% - } -} - - -#cursormarsey, #cursormarsey-heart { - display: none; -} - -body > .container { - padding: 0 !important; - margin: 0 !important; - margin-right: 0 !important; -} - -*:not(#orgy-file-container) { - resize: none !important; -} - -#orgy-file-container > :not(video) { - height: 90% !important; - width: 95% !important; - max-width: 95% !important; - overflow-y: clip; -} - -@media (max-width: 768px) { - #orgy-file-container > :not(video) { - height: 100% !important; - width: 100% !important; - max-width: 100% !important; - } -} - -#orgy-file-container > iframe { - aspect-ratio: 16/9; -} diff --git a/files/assets/css/orgy.css b/files/assets/css/orgy.css new file mode 100644 index 000000000..c024dc5d6 --- /dev/null +++ b/files/assets/css/orgy.css @@ -0,0 +1,90 @@ + +@media (min-width: 768px) { + lite-youtube { /* fix overflow */ + max-width: 25vw !important; + } +} + +.orgy-top-container { + display: flex; + justify-content: space-around; +} + +@media (max-width: 768px) { + .orgy-top-container { + flex-flow: column wrap; + } + #chat-window { + max-height: 34vh !important; + } +} + +.orgy-chat-window-item { + flex-grow: 2; +} + +#orgy-file-container { + width: 65vw; + max-height: 80vh !important; + max-width: 100vw !important; +} + +#orgy-file-container > * { + max-height: 80vh !important; + margin: 0 !important; + height: 98% !important; + width: 98% !important; +} + +@media (max-width: 768px) { + #orgy-file-container { + width: 100% !important; + } + #orgy-title { + display: none; + } + #orgy-col { + padding: 0px; + } + #orgy-file-container > * { + height: 100% !important; + width: 100% !important; + } + .orgy-chat-window-item { + max-width: 100% + } +} + + +#cursormarsey, #cursormarsey-heart { + display: none; +} + +body > .container { + padding: 0 !important; + margin: 0 !important; + margin-right: 0 !important; +} + +*:not(#orgy-file-container) { + resize: none !important; +} + +#orgy-file-container > :not(video) { + height: 90% !important; + width: 95% !important; + max-width: 95% !important; + overflow-y: clip; +} + +@media (max-width: 768px) { + #orgy-file-container > :not(video) { + height: 100% !important; + width: 100% !important; + max-width: 100% !important; + } +} + +#orgy-file-container > iframe { + aspect-ratio: 16/9; +} diff --git a/files/assets/css/transparent.css b/files/assets/css/transparent.css index 75b3968ad..9b51a6145 100644 --- a/files/assets/css/transparent.css +++ b/files/assets/css/transparent.css @@ -6,7 +6,7 @@ --gray-900: transparent; } -.container, #userpage > div.container-fluid, #root > div.App, .chat-window-item { +.container, #userpage > div.container-fluid, #root > div.App, .orgy-chat-window-item { background: rgba(var(--background), 0.9) !important; } diff --git a/files/routes/chat.py b/files/routes/chat.py index 4fa7fdc27..71ad6d074 100644 --- a/files/routes/chat.py +++ b/files/routes/chat.py @@ -1,6 +1,7 @@ import atexit import time import uuid +from hashlib import md5 from flask_socketio import SocketIO, emit, join_room, leave_room from flask import request @@ -86,6 +87,16 @@ def chat(v): displayed_messages = {k: val for k, val in messages[f"{SITE_FULL}/chat"].items() if val["user_id"] not in v.userblocks} + orgy = get_orgy(v) + if orgy: + m = md5() + with open('files/assets/subtitles.vtt', "rb") as f: + data = f.read() + m.update(data) + subtitles_hash = m.hexdigest() + + return render_template("orgy.html", v=v, messages=displayed_messages, orgy=orgy, subtitles_hash=subtitles_hash) + return render_template("chat.html", v=v, messages=displayed_messages) @socketio.on('speak') diff --git a/files/routes/jinja2.py b/files/routes/jinja2.py index 08cdf6dde..ba0d1be3b 100644 --- a/files/routes/jinja2.py +++ b/files/routes/jinja2.py @@ -2,7 +2,6 @@ import time import math from os import environ, listdir, path -from hashlib import md5 from flask import g, session, has_request_context, request from jinja2 import pass_context @@ -118,13 +117,6 @@ def bar_position(): return [int((vaxxed * 100) / total), int((zombie * 100) / total), vaxxed, zombie] -def subtitles_hash(): - m = md5() - with open('files/assets/subtitles.vtt', "rb") as f: - data = f.read() - m.update(data) - return m.hexdigest() - @app.context_processor def inject_constants(): return {"environ":environ, "SITE":SITE, "SITE_NAME":SITE_NAME, "SITE_FULL":SITE_FULL, @@ -154,5 +146,5 @@ def inject_constants(): "CHUD_PHRASES":CHUD_PHRASES, "hasattr":hasattr, "calc_users":calc_users, "HOLE_INACTIVITY_DELETION":HOLE_INACTIVITY_DELETION, "LIGHT_THEMES":LIGHT_THEMES, "MAX_IMAGE_AUDIO_SIZE_MB":MAX_IMAGE_AUDIO_SIZE_MB, "MAX_IMAGE_AUDIO_SIZE_MB_PATRON":MAX_IMAGE_AUDIO_SIZE_MB_PATRON, "MAX_VIDEO_SIZE_MB":MAX_VIDEO_SIZE_MB, "MAX_VIDEO_SIZE_MB_PATRON":MAX_VIDEO_SIZE_MB_PATRON, - "CURSORMARSEY_DEFAULT":CURSORMARSEY_DEFAULT, "SNAPPY_ID":SNAPPY_ID, "get_orgy":get_orgy, "TRUESCORE_CC_CHAT_MINIMUM":TRUESCORE_CC_CHAT_MINIMUM, "bar_position":bar_position, "subtitles_hash":subtitles_hash, + "CURSORMARSEY_DEFAULT":CURSORMARSEY_DEFAULT, "SNAPPY_ID":SNAPPY_ID, "get_orgy":get_orgy, "TRUESCORE_CC_CHAT_MINIMUM":TRUESCORE_CC_CHAT_MINIMUM, "bar_position":bar_position, } diff --git a/files/templates/chat.html b/files/templates/chat.html index cc98e981e..fa5e18258 100644 --- a/files/templates/chat.html +++ b/files/templates/chat.html @@ -9,34 +9,12 @@ {% include "modals/emoji.html" %} {% include "util/macros.html" %} {% set vlink = ' - {% set orgy = get_orgy(v) %} +
+
+
- {% if orgy %} -
-

{{orgy.title}}

-
-

- {% if orgy.type == 'youtube' %} - - {% elif orgy.type == 'rumble' %} - - {% elif orgy.type == 'twitch' %} - - {% elif orgy.type == 'file' %} - - - - - {% endif %} -

-
-
- {% endif %} + {{macros.chat_users_online()}} -
{{macros.chat_group_template()}}
@@ -46,7 +24,6 @@ {{macros.chat_line_template()}}
- {{macros.chat_users_online()}} {{macros.chat_window(vlink)}}
diff --git a/files/templates/orgy.html b/files/templates/orgy.html new file mode 100644 index 000000000..2fb0d492b --- /dev/null +++ b/files/templates/orgy.html @@ -0,0 +1,59 @@ +{%- extends 'root.html' -%} +{% block pagetitle -%}Chat{%- endblock %} +{% block pagetype %}chat{% endblock %} +{% block body_attributes %}class="has_header"{% endblock %} +{% block body %} + + + {% include "header.html" %} + {% include "modals/expanded_image.html" %} + {% include "modals/emoji.html" %} + {% include "util/macros.html" %} + {% set vlink = '
+
+

{{orgy.title}}

+
+

+ {% if orgy.type == 'youtube' %} + + {% elif orgy.type == 'rumble' %} + + {% elif orgy.type == 'twitch' %} + + {% elif orgy.type == 'file' %} + + + + + {% endif %} +

+
+
+ +
+
+ {{macros.chat_group_template()}} +
+
+ +
+ {{macros.chat_line_template()}} +
+ {{macros.chat_users_online()}} + {{macros.chat_window(vlink)}} +
+
+ + + + + + + + + + +{% endblock %}