[HTML] Clean up layouts and styles

pull/278/head
Alexey Golub 5 years ago
parent 539f57f455
commit aa50dd6dc7

@ -1,4 +1,4 @@
/* === General === */ /* General */
@font-face { @font-face {
font-family: Whitney; font-family: Whitney;
@ -58,10 +58,10 @@ img {
} }
.quote { .quote {
margin: 0.5em 0;
padding-left: 0.6em;
border-left: 4px solid; border-left: 4px solid;
border-radius: 3px; border-radius: 3px;
margin: 8px 0;
padding-left: 10px;
} }
.pre { .pre {
@ -69,8 +69,8 @@ img {
} }
.pre--multiline { .pre--multiline {
margin-top: 4px; margin-top: 0.25em;
padding: 8px; padding: 0.5em;
border: 2px solid; border: 2px solid;
border-radius: 5px; border-radius: 5px;
} }
@ -78,7 +78,7 @@ img {
.pre--inline { .pre--inline {
padding: 2px; padding: 2px;
border-radius: 3px; border-radius: 3px;
font-size: 85%; font-size: 0.85em;
} }
.mention { .mention {
@ -86,79 +86,69 @@ img {
} }
.emoji { .emoji {
width: 1.45em; width: 1.25em;
height: 1.45em; height: 1.25em;
margin: 0 1px; margin: 0 0.06em;
vertical-align: -0.4em; vertical-align: -0.4em;
} }
.emoji--small { .emoji--small {
width: 1rem; width: 1em;
height: 1rem; height: 1em;
} }
.emoji--large { .emoji--large {
width: 2rem; width: 2.8em;
height: 2rem; height: 2.8em;
} }
/* === Preamble === */ /* Preamble */
.info { .preamble {
display: flex; display: grid;
margin: 0 0.3em 0.6em 0.3em;
max-width: 100%; max-width: 100%;
margin: 0 5px 10px 5px; grid-template-columns: auto 1fr;
} }
.info__guild-icon-container { .preamble__guild-icon-container {
flex: 0; grid-column: 1;
} }
.info__guild-icon { .preamble__guild-icon {
max-width: 88px; max-width: 88px;
max-height: 88px; max-height: 88px;
} }
.info__metadata { .preamble__entries-container {
flex: 1; grid-column: 2;
margin-left: 10px; margin-left: 0.6em;
} }
.info__guild-name { .preamble__entry {
font-size: 1.4em; font-size: 1.4em;
} }
.info__channel-name { .preamble__entry--small {
font-size: 1.2em; font-size: 1em;
}
.info__channel-topic {
margin-top: 2px;
}
.info__channel-message-count {
margin-top: 2px;
}
.info__channel-date-range {
margin-top: 2px;
} }
/* === Chatlog === */ /* Chatlog */
.chatlog { .chatlog {
max-width: 100%; max-width: 100%;
} }
.chatlog__message-group { .chatlog__message-group {
display: flex; display: grid;
margin: 0 10px; margin: 0 0.6em;
padding: 15px 0; padding: 0.9em 0;
border-top: 1px solid; border-top: 1px solid;
grid-template-columns: auto 1fr;
} }
.chatlog__author-avatar-container { .chatlog__author-avatar-container {
flex: 0; grid-column: 1;
width: 40px; width: 40px;
height: 40px; height: 40px;
} }
@ -170,55 +160,53 @@ img {
} }
.chatlog__messages { .chatlog__messages {
flex: 1; grid-column: 2;
margin-left: 1.2em;
min-width: 50%; min-width: 50%;
margin-left: 20px;
} }
.chatlog__author-name { .chatlog__author-name {
font-size: 1em;
font-weight: 500; font-weight: 500;
} }
.chatlog__timestamp { .chatlog__timestamp {
margin-left: 5px; margin-left: 0.3em;
font-size: .75em; font-size: 0.75em;
} }
.chatlog__message { .chatlog__message {
padding: 2px 5px; padding: 0.1em 0.3em;
margin-right: -5px; margin: 0 -0.3em;
margin-left: -5px;
background-color: transparent; background-color: transparent;
transition: background-color 1s ease; transition: background-color 1s ease;
} }
.chatlog__content { .chatlog__content {
font-size: .9375em; font-size: 0.95em;
word-wrap: break-word; word-wrap: break-word;
} }
.chatlog__edited-timestamp { .chatlog__edited-timestamp {
margin-left: 3px; margin-left: 0.15em;
font-size: .8em; font-size: 0.8em;
} }
.chatlog__attachment-thumbnail { .chatlog__attachment-thumbnail {
margin-top: 5px; margin-top: 0.3em;
max-width: 50%; max-width: 50%;
max-height: 500px; max-height: 500px;
border-radius: 3px; border-radius: 3px;
} }
.chatlog__embed { .chatlog__embed {
margin-top: 5px;
display: flex; display: flex;
margin-top: 0.3em;
max-width: 520px; max-width: 520px;
} }
.chatlog__embed-color-pill { .chatlog__embed-color-pill {
flex-shrink: 0; flex-shrink: 0;
width: 4px; width: 0.25em;
border-top-left-radius: 3px; border-top-left-radius: 3px;
border-bottom-left-radius: 3px; border-bottom-left-radius: 3px;
} }
@ -226,15 +214,15 @@ img {
.chatlog__embed-content-container { .chatlog__embed-content-container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 8px 10px; padding: 0.5em 0.6em;
border: 1px solid; border: 1px solid;
border-top-right-radius: 3px; border-top-right-radius: 3px;
border-bottom-right-radius: 3px; border-bottom-right-radius: 3px;
} }
.chatlog__embed-content { .chatlog__embed-content {
width: 100%;
display: flex; display: flex;
width: 100%;
} }
.chatlog__embed-text { .chatlog__embed-text {
@ -243,31 +231,31 @@ img {
.chatlog__embed-author { .chatlog__embed-author {
display: flex; display: flex;
margin-bottom: 0.3em;
align-items: center; align-items: center;
margin-bottom: 5px;
} }
.chatlog__embed-author-icon { .chatlog__embed-author-icon {
margin-right: 0.5em;
width: 20px; width: 20px;
height: 20px; height: 20px;
margin-right: 9px;
border-radius: 50%; border-radius: 50%;
} }
.chatlog__embed-author-name { .chatlog__embed-author-name {
font-size: .875em; font-size: 0.875em;
font-weight: 600; font-weight: 600;
} }
.chatlog__embed-title { .chatlog__embed-title {
margin-bottom: 4px; margin-bottom: 0.2em;
font-size: .875em; font-size: 0.875em;
font-weight: 600; font-weight: 600;
} }
.chatlog__embed-description { .chatlog__embed-description {
font-weight: 500; font-weight: 500;
font-size: 14px; font-size: 0.85em;
} }
.chatlog__embed-fields { .chatlog__embed-fields {
@ -279,7 +267,8 @@ img {
flex: 0; flex: 0;
min-width: 100%; min-width: 100%;
max-width: 506px; max-width: 506px;
padding-top: 10px; padding-top: 0.6em;
font-size: 0.875em;
} }
.chatlog__embed-field--inline { .chatlog__embed-field--inline {
@ -289,26 +278,24 @@ img {
} }
.chatlog__embed-field-name { .chatlog__embed-field-name {
margin-bottom: 4px; margin-bottom: 0.2em;
font-size: .875em;
font-weight: 600; font-weight: 600;
} }
.chatlog__embed-field-value { .chatlog__embed-field-value {
font-size: .875em;
font-weight: 500; font-weight: 500;
} }
.chatlog__embed-thumbnail { .chatlog__embed-thumbnail {
flex: 0; flex: 0;
margin-left: 20px; margin-left: 1.2em;
max-width: 80px; max-width: 80px;
max-height: 80px; max-height: 80px;
border-radius: 3px; border-radius: 3px;
} }
.chatlog__embed-image-container { .chatlog__embed-image-container {
margin-top: 10px; margin-top: 0.6em;
} }
.chatlog__embed-image { .chatlog__embed-image {
@ -318,11 +305,11 @@ img {
} }
.chatlog__embed-footer { .chatlog__embed-footer {
margin-top: 10px; margin-top: 0.6em;
} }
.chatlog__embed-footer-icon { .chatlog__embed-footer-icon {
margin-right: 4px; margin-right: 0.2em;
width: 20px; width: 20px;
height: 20px; height: 20px;
border-radius: 50%; border-radius: 50%;
@ -330,8 +317,8 @@ img {
} }
.chatlog__embed-footer-text { .chatlog__embed-footer-text {
font-size: 0.75em;
font-weight: 500; font-weight: 500;
font-size: .75em;
} }
.chatlog__reactions { .chatlog__reactions {
@ -341,35 +328,35 @@ img {
.chatlog__reaction { .chatlog__reaction {
display: flex; display: flex;
align-items: center; align-items: center;
margin: 6px 2px 2px 2px; margin: 0.35em 0.1em 0.1em 0.1em;
padding: 3px 6px; padding: 0.2em 0.35em;
border-radius: 3px; border-radius: 3px;
} }
.chatlog__reaction-count { .chatlog__reaction-count {
min-width: 9px; min-width: 9px;
margin-left: 6px; margin-left: 0.35em;
font-size: .875em; font-size: 0.875em;
} }
.chatlog__bot-tag { .chatlog__bot-tag {
position: relative;
top: -.2em;
margin-left: 0.3em; margin-left: 0.3em;
padding: 0.05em 0.3em;
border-radius: 3px;
vertical-align: middle;
line-height: 1.3;
background: #7289da; background: #7289da;
color: #ffffff; color: #ffffff;
font-size: 0.625em; font-size: 0.625em;
font-weight: 500; font-weight: 500;
padding: 1px 2px;
border-radius: 3px;
vertical-align: middle;
line-height: 1.3;
position: relative;
top: -.2em;
} }
/* Postamble */ /* Postamble */
.postamble { .postamble {
margin: 24px 5px 10px 5px; margin: 1.4em 0.3em 0.6em 0.3em;
padding: 16px; padding: 1em;
border-top: 1px solid; border-top: 1px solid;
} }

@ -1,4 +1,4 @@
/* === General === */ /* General */
body { body {
background-color: #36393e; background-color: #36393e;
@ -32,19 +32,11 @@ a {
/* === Preamble === */ /* === Preamble === */
.info__guild-name { .preamble__entry {
color: #ffffff; color: #ffffff;
} }
.info__channel-name { /* Chatlog */
color: #ffffff;
}
.info__channel-topic {
color: #ffffff;
}
/* === Chatlog === */
.chatlog__message-group { .chatlog__message-group {
border-color: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.1);
@ -115,12 +107,12 @@ a {
color: rgba(255, 255, 255, 0.3); color: rgba(255, 255, 255, 0.3);
} }
/* === Postamble === */ /* Postamble */
.postamble { .postamble {
border-color: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.1);
} }
.postamble__info { .postamble__entry {
color: #ffffff; color: #ffffff;
} }

@ -49,20 +49,20 @@
<body> <body>
{{~ # Preamble ~}} {{~ # Preamble ~}}
<div class="info"> <div class="preamble">
<div class="info__guild-icon-container"> <div class="preamble__guild-icon-container">
<img class="info__guild-icon" src="{{ Context.Guild.IconUrl }}" /> <img class="preamble__guild-icon" src="{{ Context.Guild.IconUrl }}" alt="Guild icon" />
</div> </div>
<div class="info__metadata"> <div class="preamble__entries-container">
<div class="info__guild-name">{{ Context.Guild.Name | html.escape }}</div> <div class="preamble__entry">{{ Context.Guild.Name | html.escape }}</div>
<div class="info__channel-name">{{ Context.Channel.Name | html.escape }}</div> <div class="preamble__entry">{{ Context.Channel.Name | html.escape }}</div>
{{~ if Context.Channel.Topic ~}} {{~ if Context.Channel.Topic ~}}
<div class="info__channel-topic">{{ Context.Channel.Topic | html.escape }}</div> <div class="preamble__entry preamble__entry--small">{{ Context.Channel.Topic | html.escape }}</div>
{{~ end ~}} {{~ end ~}}
{{~ if Context.After || Context.Before ~}} {{~ if Context.After || Context.Before ~}}
<div class="info__channel-date-range"> <div class="preamble__entry preamble__entry--small">
{{~ if Context.After && Context.Before ~}} {{~ if Context.After && Context.Before ~}}
Between {{ Context.After | FormatDate | html.escape }} and {{ Context.Before | FormatDate | html.escape }} Between {{ Context.After | FormatDate | html.escape }} and {{ Context.Before | FormatDate | html.escape }}
{{~ else if Context.After ~}} {{~ else if Context.After ~}}
@ -82,9 +82,7 @@
{{~ # Postamble ~}} {{~ # Postamble ~}}
<div class="postamble"> <div class="postamble">
<div class="postamble__info"> <div class="postamble__entry">Exported {{ MessageCount | object.format "N0" }} message(s)</div>
Exported {{ MessageCount | object.format "N0" }} message(s)
</div>
</div> </div>
</body> </body>

@ -1,4 +1,4 @@
/* === General === */ /* General */
body { body {
background-color: #ffffff; background-color: #ffffff;
@ -32,21 +32,13 @@ a {
color: #7289da; color: #7289da;
} }
/* === Preamble === */ /* Preamble */
.info__guild-name { .preamble__entry {
color: #2f3136; color: #2f3136;
} }
.info__channel-name { /* Chatlog */
color: #2f3136;
}
.info__channel-topic {
color: #2f3136;
}
/* === Chatlog === */
.chatlog__message-group { .chatlog__message-group {
border-color: #eceeef; border-color: #eceeef;
@ -118,12 +110,12 @@ a {
color: #747f8d; color: #747f8d;
} }
/* === Postamble === */ /* Postamble */
.postamble { .postamble {
border-color: #eceeef; border-color: #eceeef;
} }
.postamble__info { .postamble__entry {
color: #2f3136; color: #2f3136;
} }

@ -1,7 +1,7 @@
<div class="chatlog__message-group"> <div class="chatlog__message-group">
{{~ # Avatar ~}} {{~ # Avatar ~}}
<div class="chatlog__author-avatar-container"> <div class="chatlog__author-avatar-container">
<img class="chatlog__author-avatar" src="{{ MessageGroup.Author.AvatarUrl }}" /> <img class="chatlog__author-avatar" src="{{ MessageGroup.Author.AvatarUrl }}" alt="Avatar" />
</div> </div>
<div class="chatlog__messages"> <div class="chatlog__messages">
{{~ # Author name and timestamp ~}} {{~ # Author name and timestamp ~}}
@ -35,7 +35,7 @@
<a href="{{ attachment.Url }}"> <a href="{{ attachment.Url }}">
{{ # Image }} {{ # Image }}
{{~ if attachment.IsImage ~}} {{~ if attachment.IsImage ~}}
<img class="chatlog__attachment-thumbnail" src="{{ attachment.Url }}" /> <img class="chatlog__attachment-thumbnail" src="{{ attachment.Url }}" alt="Attachment" />
{{~ # Non-image ~}} {{~ # Non-image ~}}
{{~ else ~}} {{~ else ~}}
Attachment: {{ attachment.FileName }} ({{ attachment.FileSize }}) Attachment: {{ attachment.FileName }} ({{ attachment.FileSize }})
@ -59,7 +59,7 @@
{{~ if embed.Author ~}} {{~ if embed.Author ~}}
<div class="chatlog__embed-author"> <div class="chatlog__embed-author">
{{~ if embed.Author.IconUrl ~}} {{~ if embed.Author.IconUrl ~}}
<img class="chatlog__embed-author-icon" src="{{ embed.Author.IconUrl }}" /> <img class="chatlog__embed-author-icon" src="{{ embed.Author.IconUrl }}" alt="Author icon" />
{{~ end ~}} {{~ end ~}}
{{~ if embed.Author.Name ~}} {{~ if embed.Author.Name ~}}
@ -111,7 +111,7 @@
{{~ if embed.Thumbnail ~}} {{~ if embed.Thumbnail ~}}
<div class="chatlog__embed-thumbnail-container"> <div class="chatlog__embed-thumbnail-container">
<a class="chatlog__embed-thumbnail-link" href="{{ embed.Thumbnail.Url }}"> <a class="chatlog__embed-thumbnail-link" href="{{ embed.Thumbnail.Url }}">
<img class="chatlog__embed-thumbnail" src="{{ embed.Thumbnail.Url }}" /> <img class="chatlog__embed-thumbnail" src="{{ embed.Thumbnail.Url }}" alt="Thumbnail" />
</a> </a>
</div> </div>
{{~ end ~}} {{~ end ~}}
@ -121,7 +121,7 @@
{{~ if embed.Image ~}} {{~ if embed.Image ~}}
<div class="chatlog__embed-image-container"> <div class="chatlog__embed-image-container">
<a class="chatlog__embed-image-link" href="{{ embed.Image.Url }}"> <a class="chatlog__embed-image-link" href="{{ embed.Image.Url }}">
<img class="chatlog__embed-image" src="{{ embed.Image.Url }}" /> <img class="chatlog__embed-image" src="{{ embed.Image.Url }}" alt="Image" />
</a> </a>
</div> </div>
{{~ end ~}} {{~ end ~}}
@ -131,7 +131,7 @@
<div class="chatlog__embed-footer"> <div class="chatlog__embed-footer">
{{~ if embed.Footer ~}} {{~ if embed.Footer ~}}
{{~ if embed.Footer.Text && embed.Footer.IconUrl ~}} {{~ if embed.Footer.Text && embed.Footer.IconUrl ~}}
<img class="chatlog__embed-footer-icon" src="{{ embed.Footer.IconUrl }}" /> <img class="chatlog__embed-footer-icon" src="{{ embed.Footer.IconUrl }}" alt="Footer icon" />
{{~ end ~}} {{~ end ~}}
{{~ end ~}} {{~ end ~}}

@ -8,6 +8,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Changelog.md = Changelog.md Changelog.md = Changelog.md
License.txt = License.txt License.txt = License.txt
Readme.md = Readme.md Readme.md = Readme.md
DiscordChatExporter.props = DiscordChatExporter.props
Dockerfile = Dockerfile
EndProjectSection EndProjectSection
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DiscordChatExporter.Core.Markdown", "DiscordChatExporter.Core.Markdown\DiscordChatExporter.Core.Markdown.csproj", "{14D02A08-E820-4012-B805-663B9A3D73E9}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DiscordChatExporter.Core.Markdown", "DiscordChatExporter.Core.Markdown\DiscordChatExporter.Core.Markdown.csproj", "{14D02A08-E820-4012-B805-663B9A3D73E9}"

Loading…
Cancel
Save