Add accent color preview and dark mode by default

This commit is contained in:
Melon 2022-03-29 23:12:26 +01:00
parent 4adf0ce931
commit 13c5ea6f02
Signed by: melon
GPG Key ID: B0ADD5395BCDAAB6
2 changed files with 18 additions and 1 deletions

View File

@ -120,12 +120,14 @@ func (m *Module) homepage(rw http.ResponseWriter, req *http.Request, state *util
err = tmp.Execute(rw, struct {
User *discordgo.User
UserAccent string
Avatar template.HTMLAttr
Guilds []*discordgo.UserGuild
GuildIcons []template.HTMLAttr
Connections []*discordgo.UserConnection
}{
User: myUser,
UserAccent: fmt.Sprintf("#%06x", myUser.AccentColor),
Avatar: template.HTMLAttr(fmt.Sprintf("src=\"/discord/user/avatar/%s/%s\"", myUser.ID, myUser.Avatar)),
Guilds: myGuilds,
GuildIcons: guildIcons,

View File

@ -3,6 +3,15 @@
<head>
<title>Discord | Melon Tools</title>
<style>
html, body {
background-color: #2a2c2d;
color: #d8d4d0;
}
a {
color: #4699fa;
}
.page-content {
display: flex;
flex-direction: row;
@ -20,6 +29,12 @@
padding: 8px;
border-radius: 8px;
}
.colour-block {
display: inline-block;
width: 18px;
height: 18px;
}
</style>
</head>
<body>
@ -38,7 +53,7 @@
<li>Verified: {{.Verified}}</li>
<li>MFA: {{.MFAEnabled}}</li>
<li>Banner: {{.Banner}}</li>
<li>Accent Color: {{.AccentColor}}</li>
<li>Accent Color: {{$.UserAccent}} <span class="colour-block" style="background-color: {{$.UserAccent}}">&nbsp;</span></li>
<li>Bot: {{.Bot}}</li>
<li>Premium: {{.PremiumType}}</li>
<li>System: {{.System}}</li>