Upload web code

This commit is contained in:
Cadence Ember
2024-09-22 15:42:15 +12:00
parent 1d2daf2504
commit b6c23c30fb
22 changed files with 765 additions and 6 deletions
+46
View File
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
aria-hidden="true"
class="svg-icon iconItalic"
width="18"
height="18"
viewBox="0 0 18 18"
version="1.1"
id="svg1"
sodipodi:docname="hash.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1" />
<path
style="opacity:1;stroke-width:24.2222;stroke-linecap:square;paint-order:stroke fill markers"
d="m 13.949463,2.0417087 c 0,0 0.664304,0.00704 0.854464,0.00134 0.19016,-0.0057 0.924873,0.2384962 0.57664,0.9863413 -0.288846,0.6203095 -5.045042,11.035358 -5.4783833,11.984378 -0.4333415,0.949021 -0.7881247,0.945761 -1.3553087,0.945761 -0.567184,0 -0.3175392,0 -0.734375,0 -0.4168358,0 -0.7985231,-0.467356 -0.5770328,-0.951217 C 7.4569576,14.524452 12.479729,3.5512928 12.725807,3.0070042 13.022379,2.3510304 13.336114,2.0361844 13.949463,2.0417087 Z"
id="path4"
sodipodi:nodetypes="czszzzzsc" />
<rect
style="opacity:1;stroke-width:27.7591;stroke-linecap:square;paint-order:stroke fill markers"
id="rect4"
width="11.987322"
height="2"
x="2.002677"
y="11.007812"
rx="1"
ry="1" />
<rect
style="opacity:1;stroke-width:27.7591;stroke-linecap:square;paint-order:stroke fill markers"
id="rect5"
width="11.987322"
height="2"
x="4.0100012"
y="5.007813"
rx="1"
ry="1" />
<path
style="opacity:1;stroke-width:24.2222;stroke-linecap:square;paint-order:stroke fill markers"
d="m 9.1764922,2.0417087 c 0,0 0.664304,0.00704 0.8544638,0.00134 0.19016,-0.0057 0.924873,0.2384962 0.57664,0.9863413 -0.288846,0.6203095 -5.0450418,11.035358 -5.4783831,11.984378 -0.4333415,0.949021 -0.7881247,0.945761 -1.3553087,0.945761 -0.567184,0 -0.3175392,0 -0.734375,0 -0.4168358,0 -0.7985231,-0.467356 -0.5770328,-0.951217 C 2.6839868,14.524452 7.7067582,3.5512928 7.9528362,3.0070042 8.2494082,2.3510304 8.5631432,2.0361844 9.1764922,2.0417087 Z"
id="path1"
sodipodi:nodetypes="czszzzzsc" />
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

+66
View File
@@ -0,0 +1,66 @@
mixin guild(guild)
span.s-avatar.s-avatar__32.s-user-card--avatar
if guild.icon
img.s-avatar--image(src=`https://cdn.discordapp.com/icons/${guild.id}/${guild.icon}.png?size=32`)
else
.s-avatar--letter.bg-silver-400.bar-md(aria-hidden="true")= guild.name[0]
.s-user-card--info.ai-start
strong= guild.name
ul.s-user-card--awards
li #{discord.guildChannelMap.get(guild.id).filter(c => [0, 5, 15, 16].includes(discord.channels.get(c).type)).length} channels
doctype html
html(lang="en")
head
title Out Of Your Element
link(rel="stylesheet" type="text/css" href="/static/stacks.min.css")
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 80%22><text y=%22.83em%22 font-size=%2283%22>💬</text></svg>">
meta(name="htmx-config" content='{"indicatorClass":"is-loading"}')
style.
.themed {
--theme-base-primary-color-h: 266;
--theme-base-primary-color-s: 53%;
--theme-base-primary-color-l: 63%;
--theme-dark-primary-color-h: 266;
--theme-dark-primary-color-s: 53%;
--theme-dark-primary-color-l: 63%;
}
body.themed.theme-system
header.s-topbar
.s-topbar--skip-link(href="#content") Skip to main content
.s-topbar--container.wmx9
a.s-topbar--logo(href="/")
img.s-avatar.s-avatar__32(src="/icon.png")
nav.s-topbar--navigation
ul.s-topbar--content
li.ps-relative
if !session.data.managedGuilds || session.data.managedGuilds.length === 0
a.s-btn.s-btn__icon.as-center(href="/oauth")
!= icons.Icons.IconDiscord
= ` Log in`
else if guild_id && session.data.managedGuilds.includes(guild_id) && discord.guilds.has(guild_id)
button.s-topbar--item.s-btn.s-btn__muted.s-user-card(popovertarget="guilds")
+guild(discord.guilds.get(guild_id))
else if session.data.managedGuilds
button.s-topbar--item.s-btn.s-btn__muted.s-btn__dropdown.pr24.s-user-card.s-label(popovertarget="guilds")
| Your servers
#guilds(popover data-popper-placement="bottom" style="display: revert; width: revert;").s-popover.overflow-visible
.s-popover--arrow.s-popover--arrow__tc
.s-popover--content.overflow-y-auto.overflow-x-hidden
ul.s-menu(role="menu")
each guild in (session.data.managedGuilds || []).map(id => discord.guilds.get(id)).filter(g => g)
li(role="menuitem")
a.s-topbar--item.s-user-card.d-flex.p4(href=`/guild?guild_id=${guild.id}`)
+guild(guild)
.mx-auto.w100.wmx9.py24#content
block body
script.
document.querySelectorAll("[popovertarget]").forEach(e => {
e.addEventListener("click", () => {
const rect = e.getBoundingClientRect()
const t = `:popover-open { position: absolute; top: ${Math.floor(rect.bottom)}px; left: ${Math.floor(rect.left + rect.width / 2)}px; width: ${Math.floor(rect.width)}px; transform: translateX(-50%); box-sizing: content-box; margin: 0 }`
// console.log(t)
document.styleSheets[0].insertRule(t)
})
})
script(src="/static/htmx.min.js")