Add darkmode

This commit is contained in:
Tanner Collin 2020-06-09 19:40:38 +00:00
parent 5abcd6f672
commit b8f02d92da
7 changed files with 62 additions and 29 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,18 +1,21 @@
@font-face { @font-face {
font-family: 'Apparatus SIL'; font-family: 'Apparatus SIL';
src: url('AppSILR.ttf') format('truetype'); src: url('AppSILR.ttf') format('truetype');
font-display: swap;
} }
@font-face { @font-face {
font-family: 'Apparatus SIL'; font-family: 'Apparatus SIL';
font-style: italic; font-style: italic;
src: url('AppSILI.ttf') format('truetype'); src: url('AppSILI.ttf') format('truetype');
font-display: swap;
} }
@font-face { @font-face {
font-family: 'Apparatus SIL'; font-family: 'Apparatus SIL';
font-weight: bold; font-weight: bold;
src: url('AppSILB.ttf') format('truetype'); src: url('AppSILB.ttf') format('truetype');
font-display: swap;
} }
@font-face { @font-face {
@ -20,6 +23,7 @@
font-weight: bold; font-weight: bold;
font-style: italic; font-style: italic;
src: url('AppSILBI.ttf') format('truetype'); src: url('AppSILBI.ttf') format('truetype');
font-display: swap;
} }
@font-face { @font-face {
@ -27,6 +31,7 @@
font-style: italic; font-style: italic;
font-weight: 400; font-weight: 400;
src: local('Lato Italic'), local('Lato-Italic'), url('Lato-Italic.ttf') format('truetype'); src: local('Lato Italic'), local('Lato-Italic'), url('Lato-Italic.ttf') format('truetype');
font-display: swap;
} }
@font-face { @font-face {
@ -34,6 +39,7 @@
font-style: italic; font-style: italic;
font-weight: 700; font-weight: 700;
src: local('Lato Bold Italic'), local('Lato-BoldItalic'), url('Lato-BoldItalic.ttf') format('truetype'); src: local('Lato Bold Italic'), local('Lato-BoldItalic'), url('Lato-BoldItalic.ttf') format('truetype');
font-display: swap;
} }
@font-face { @font-face {
@ -41,6 +47,7 @@
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
src: local('Lato Regular'), local('Lato-Regular'), url('Lato-Regular.ttf') format('truetype'); src: local('Lato Regular'), local('Lato-Regular'), url('Lato-Regular.ttf') format('truetype');
font-display: swap;
} }
@font-face { @font-face {
@ -48,4 +55,5 @@
font-style: normal; font-style: normal;
font-weight: 700; font-weight: 700;
src: local('Lato Bold'), local('Lato-Bold'), url('Lato-Bold.ttf') format('truetype'); src: local('Lato Bold'), local('Lato-Bold'), url('Lato-Bold.ttf') format('truetype');
font-display: swap;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -1,6 +1,7 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
<p><a href="/">← Return to Home</a></p>
<header> <header>
<h1>{{ article.title }}</h1> <h1>{{ article.title }}</h1>
<div class="summary"> <div class="summary">

View File

@ -16,7 +16,7 @@
<body> <body>
<div class="container"> <div class="container">
<div class="sidebar"> <div class="sidebar">
<img src="/theme/me.jpg" /> <img src="/theme/me.jpg" alt="A picture of me smiling" />
<p> <p>
Tanner Collin Tanner Collin
</p> </p>
@ -24,14 +24,25 @@
<div class="content"> <div class="content">
<div class="topbar"> <div class="topbar">
<p> <p>
<img src="/theme/logo.png" /> <img src="/theme/logo.png" alt="My name in handwriting" />
</p> </p>
</div> </div>
{% block content %} {% block content %}
{% endblock %} {% endblock %}
</div> </div>
</div> </div>
</body>
<script src="/theme/darkmode-js.min.js"></script>
<script>
const options = {
bottom: '16px',
right: '16px',
buttonColorDark: '#666',
buttonColorLight: '#aaa',
label: '🌙',
};
new Darkmode(options).showWidget();
</script>
</body>
</html> </html>

View File

@ -49,6 +49,7 @@ pre {
} }
.content .topbar img { .content .topbar img {
filter: invert(100%);
width: 14rem; width: 14rem;
height: auto; height: auto;
} }
@ -90,8 +91,7 @@ pre {
} }
.content ul { .content ul {
padding-left: 0; padding-left: 1.1rem;
list-style-position: inside;
} }
.content li { .content li {
@ -127,3 +127,15 @@ pre {
display: none; display: none;
} }
} }
.darkmode-toggle {
z-index: 500;
}
.darkmode--activated .content img {
filter: brightness(75%);
}
.darkmode--activated video {
mix-blend-mode: difference;
}