diff options
Diffstat (limited to 'priv/discord_activity.html.eex')
-rw-r--r-- | priv/discord_activity.html.eex | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/priv/discord_activity.html.eex b/priv/discord_activity.html.eex deleted file mode 100644 index cfdba73..0000000 --- a/priv/discord_activity.html.eex +++ /dev/null @@ -1,95 +0,0 @@ -<!DOCTYPE html> -<% -import Mediasync.Constants -home_url="/.proxy/?#{query_param_discord_activity_inner()}" -%> -<html lang="en"> - -<head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta name="robots" content="noindex, nofollow"> - <title>discord activity | mediasync</title> - <style> - :root { - /* Based on https://discord.com/developers/docs/activities/development-guides#mobile-safe-areas */ - --sait: var(--discord-safe-area-inset-top, env(safe-area-inset-top, 0px)); - --sair: var(--discord-safe-area-inset-right, env(safe-area-inset-right, 0px)); - --saib: var(--discord-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)); - --sail: var(--discord-safe-area-inset-left, env(safe-area-inset-left, 0px)); - - --saiv: calc(var(--sait) + var(--saib)); - --saih: calc(var(--sair) + var(--sail)); - - --instance-room-info-height: 20%; - --instance-room-info-remainder: calc(100% - var(--instance-room-info-height)); - - box-sizing: border-box; - height: calc(100% - var(--saiv)); - width: calc(100% - var(--saih)); - } - - *, - *::before, - *::after { - box-sizing: inherit; - } - - body { - background-color: black; - color: white; - font-family: monospace; - height: 100%; - margin: var(--sait) var(--sair) var(--saib) var(--sail); - overflow: hidden; - width: 100%; - } - - iframe { - border: none; - height: 100%; - width: 100%; - } - - iframe.at-home { - height: var(--instance-room-info-remainder); - } - - div#instance-room-info { - border-bottom: 1px solid white; - display: none; - height: var(--instance-room-info-height); - overflow: auto; - padding: 8px 8px 0px 8px; - width: 100%; - } - - body:has(> iframe.at-home) > div#instance-room-info { - display: block; - } - </style> -</head> - -<body data-csrf-token="<%= Plug.CSRFProtection.get_csrf_token() %>"> - <div id="instance-room-info"> - <span style="font-weight: bold;">currently hosting:</span> - <div id="instance-room-info-content"></div> - </div> - <iframe src="<%= home_url %>" style="display: none;" class="at-home" name="activity-inner-iframe"></iframe> - <script> - const QUERY_PARAM_DISCORD_ACTIVITY_INNER = "<%= query_param_discord_activity_inner() %>"; - const DISCORD_CLIENT_ID = "<%= Application.fetch_env!(:mediasync, :discord_client_id) %>"; - const ACCESS_TOKEN_URL = `/.proxy/discord_activity/access_token?${QUERY_PARAM_DISCORD_ACTIVITY_INNER}`; - const HOME_URL = "<%= home_url %>"; - const roomsForInstanceUrl = (instanceId) => { - return `/.proxy/discord_activity/rooms_for_instance?${QUERY_PARAM_DISCORD_ACTIVITY_INNER}&<%= query_param_instance_id() %>=${instanceId}`; - }; - const roomUrl = (roomId) => { - return `/.proxy/room/${roomId}?${QUERY_PARAM_DISCORD_ACTIVITY_INNER}`; - }; - </script> - <script src="/static/discord-embedded-app-sdk/Discord.js" type="module"></script> - <script src="/static/discordActivity.js" type="module"></script> -</body> - -</html> |