diff options
author | 2019-08-22 15:44:06 +0200 | |
---|---|---|
committer | 2019-08-23 15:40:52 +0200 | |
commit | 8da376b0ebff72db9f72b7026b6f2fef4dff4f13 (patch) | |
tree | c0ac005706e4976d810ef8dbac8187a43f63bcca /pydis_site/static | |
parent | Adding message display to frontend (diff) |
Making the deleted-messages-frontend functional with changes, including:
- Adding support for embeds to both the template and the css;
- Adding Discord fonts to create a Discord-realistic rendering;
- Adding Discord color int to html hex filter for use in templates;
- Removing unnecessary int -> hex property from role model (see previous point);
- Adding support to compute timestamp from snowflake int in the message model;
- Forcing the order of deleted messages list view to snowflake `id` to guarantee chronological order.
Diffstat (limited to 'pydis_site/static')
-rw-r--r-- | pydis_site/static/css/staff/logs.css | 215 |
1 files changed, 212 insertions, 3 deletions
diff --git a/pydis_site/static/css/staff/logs.css b/pydis_site/static/css/staff/logs.css index ef271e1e..a09d33ac 100644 --- a/pydis_site/static/css/staff/logs.css +++ b/pydis_site/static/css/staff/logs.css @@ -1,16 +1,31 @@ main.site-content { background-color: hsl(220, 8%, 23%); color: #dcddde; - font-family: sans-serif; font-size: 0.9375rem; font-weight: 400; line-height: 1.3; letter-spacing: 0; text-rendering: optimizeLegibility; + padding: 1rem; + font-family: Whitney,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; +} + +.has-small-margin { + margin: 1rem 0; +} + +.deleted-header { + font-weight: 700; + margin-top: 1rem; } .discord-message { - margin: 1rem; + margin-bottom: 15px; +} + +.discord-message:first-child { + border-top: 1px; + } .discord-message-header { @@ -20,7 +35,7 @@ main.site-content { .discord-username { font-size: 1rem; - font-weight: 500; + font-weight: 600; } .discord-message-metadata { @@ -40,4 +55,198 @@ main.site-content { color: #dcddde; font-weight: 300; margin-left: 0.3rem; +} + +.discord-embed { + + position: relative; + margin-top: 5px; + max-width: 520px; + display: flex; +} + +.discord-embed a { + text-decoration: none; + color: hsl(197, 100%, 41%); +} + +.discord-embed a:hover { + text-decoration: underline; + color: hsl(197, 100%, 41%); +} + +.discord-embed-color { + width: 4px; + border-radius: 3px 0 0 3px; + flex-shrink: 0; +} + +.discord-embed-inner { + background-color: #34363b; + padding: 8px 10px; + border-radius: 0 3px 3px 0; + box-sizing: border-box; + border: 1px solid hsla(225, 8%, 20%, 0.6); + display: flex; + flex-direction: column; +} + +.discord-embed-content { + width: 100%; + display: flex; +} + +.discord-embed-main { + flex: 1; +} + +.discord-embed-thumbnail > img { + max-width: 80px; + max-height: 80px; + border-radius: 3px; + width: auto; + object-fit: contain; + margin-left: 20px; + flex-shrink: 0; + border-style: none; +} + +.discord-embed-author { + display: flex; + align-items: center; + margin-bottom: 5px; + font-weight: 600; + font-size: 14px; + line-height: 1.15; +} + +.discord-embed-author-icon { + margin-right: 9px; + width: 20px; + height: 20px; + object-fit: contain; + border-radius: 50%; +} + +.discord-embed-author a { + color: white; +} + +.discord-embed-author a:hover { + color: white; +} + +.discord-embed-title { + margin-bottom: 5px; + font-size: 14px; + display: inline-block; + font-weight: 600; +} + +.discord-embed-description { + margin-bottom: 10px; +} + +.discord-embed-fields { + display: flex; + flex-direction: row; + flex-wrap: wrap; + margin-top: -10px; + margin-bottom: 10px; +} + +.discord-embed-field { + flex: 0; + padding-top: 5px; + min-width: 100%; + max-width: 506px; +} + +.discord-embed-field-name { + margin-bottom: 4px; + font-weight: 600; +} + +.discord-embed-field-value { + font-weight: 500; +} + +.discord-embed-field-inline { + flex: 1; + min-width: 150px; + flex-basis: auto; +} + +.discord-embed-main > :last-child { + margin-bottom: 0 !important; +} + +.discord-embed-image { + position: relative; + display: inline-block; + margin-bottom: 10px; +} + +.discord-embed-image > img { + margin: 0; + vertical-align: bottom; + max-width: 300px; + display: flex; + overflow: hidden; + border-radius: 2px; +} + +.discord-embed-footer-text { + font-size: .70rem !important; + letter-spacing: 0; + display: inline-block; +} + +.discord-embed-footer-icon { + margin-right: 10px; + height: 18px; + width: 18px; + object-fit: contain; + float: left; + border-radius: 50%; +} + +.discord-embed-content { + margin-bottom: 10px; +} + +.discord-embed-inner > :last-child { + margin-bottom: 0 !important; +} + +/* Discord Font definitions */ +@font-face { + font-family: Whitney; + font-style: light; + font-weight:300; + src:url(https://discordapp.com/assets/6c6374bad0b0b6d204d8d6dc4a18d820.woff) format("woff") +} +@font-face { + font-family: Whitney; + font-style: normal; + font-weight:500; + src:url(https://discordapp.com/assets/e8acd7d9bf6207f99350ca9f9e23b168.woff) format("woff") +} +@font-face { + font-family:Whitney; + font-style: medium; + font-weight:600; + src:url(https://discordapp.com/assets/3bdef1251a424500c1b3a78dea9b7e57.woff) format("woff") +} +@font-face { + font-family: WhitneyMedium; + font-style: medium; + font-weight: 600; + src:url(https://discordapp.com/assets/be0060dafb7a0e31d2a1ca17c0708636.woff) format("woff") +} +@font-face { + font-family: Whitney; + font-style: bold; + font-weight: 700; + src:url(https://discordapp.com/assets/8e12fb4f14d9c4592eb8ec9f22337b04.woff) format("woff") }
\ No newline at end of file |