Remove darkmode selector

This commit is contained in:
Tanner Collin 2021-05-30 05:08:37 +00:00
parent 5bcad7eb77
commit b5b9e68df0
5 changed files with 13 additions and 129 deletions

View File

@ -54,10 +54,10 @@ AUTHORS_SAVE_AS = ''
CATEGORIES_SAVE_AS = '' CATEGORIES_SAVE_AS = ''
TAGS_SAVE_AS = '' TAGS_SAVE_AS = ''
INDEX_SAVE_AS = 'index.php' INDEX_SAVE_AS = 'index.html'
ARTICLE_URL = '{slug}/' ARTICLE_URL = '{slug}/'
ARTICLE_SAVE_AS = '{slug}/index.php' ARTICLE_SAVE_AS = '{slug}/index.html'
PAGE_URL = '{slug}/' PAGE_URL = '{slug}/'
PAGE_SAVE_AS = '{slug}/index.php' PAGE_SAVE_AS = '{slug}/index.html'
PROD = True PROD = True

View File

@ -31,9 +31,6 @@
<a href="https://t.me/tannercollin" target="_blank" rel="noreferrer noopener"><img alt="telegram" src="/theme/telegram.svg" width="20" height="20" /></a> <a href="https://t.me/tannercollin" target="_blank" rel="noreferrer noopener"><img alt="telegram" src="/theme/telegram.svg" width="20" height="20" /></a>
<a href="https://github.com/tannercollin" target="_blank" rel="noreferrer noopener"><img alt="github" src="/theme/github.svg" width="20" height="20" /></a> <a href="https://github.com/tannercollin" target="_blank" rel="noreferrer noopener"><img alt="github" src="/theme/github.svg" width="20" height="20" /></a>
</p> </p>
<p class='theme-select'>
<a onClick="setTheme('light')">Light</a> / <a onClick="setTheme('dark')">Dark</a>
</p>
{% endblock %} {% endblock %}
{% block content %} {% block content %}

View File

@ -36,22 +36,9 @@
</style> </style>
<script defer src="/theme/instant-page.js"></script> <script defer src="/theme/instant-page.js"></script>
<noscript>
<style type="text/css">
.theme-select {
display: none !important;
}
</style>
</noscript>
</head> </head>
{% if PROD %}
<body class="<?php echo $themeClass; ?>">
{% else %}
<body> <body>
{% endif %}
<div class="container"> <div class="container">
<div class="bar"> <div class="bar">
{% block info %} {% block info %}
@ -65,24 +52,6 @@
<p class="copyright"> <p class="copyright">
© 20122021 Tanner Collin © 20122021 Tanner Collin
</p> </p>
<script>
function setTheme(theme) {
console.log('Setting theme to', theme);
if (theme == 'dark') {
document.body.classList.add('dark');
document.body.classList.remove('light');
} else if (theme == 'light') {
document.body.classList.add('light');
document.body.classList.remove('dark');
}
document.cookie = 'theme=' + theme + '; Max-Age=31536000; Path=/; SameSite=Lax';
}
</script>
</body> </body>
</html> </html>

View File

@ -16,9 +16,6 @@
<a href="https://t.me/tannercollin" target="_blank" rel="noreferrer noopener"><img alt="telegram" src="/theme/telegram.svg" width="20" height="20" /></a> <a href="https://t.me/tannercollin" target="_blank" rel="noreferrer noopener"><img alt="telegram" src="/theme/telegram.svg" width="20" height="20" /></a>
<a href="https://github.com/tannercollin" target="_blank" rel="noreferrer noopener"><img alt="github" src="/theme/github.svg" width="20" height="20" /></a> <a href="https://github.com/tannercollin" target="_blank" rel="noreferrer noopener"><img alt="github" src="/theme/github.svg" width="20" height="20" /></a>
</p> </p>
<p class='theme-select'>
<a onClick="setTheme('light')">Light</a> / <a onClick="setTheme('dark')">Dark</a>
</p>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -46,12 +46,6 @@ pre {
text-align: center; text-align: center;
} }
.theme-select {
font-size: 1rem;
margin-bottom: 0;
cursor: pointer;
}
.toc { .toc {
float: right; float: right;
padding: 0.75rem; padding: 0.75rem;
@ -184,12 +178,7 @@ pre {
height: 1.5rem; height: 1.5rem;
margin-right: 1rem; margin-right: 1rem;
} }
.bar .theme-select {
margin-top: 0.5rem;
} }
}
body { body {
@ -218,75 +207,7 @@ pre {
color: #555; color: #555;
} }
body.dark {
background-color: #000;
color: #eee;
}
body.dark a {
color: #eee;
border-bottom: 1px solid #eee;
}
body.dark pre {
background-color: #222;
}
body.dark :not(pre)>code {
background-color: #222;
}
body.dark .toc {
background-color: #222;
}
body.dark .content p.metadata {
color: #aaa;
}
body.dark .content img {
filter: brightness(75%);
}
body.dark .contact-icons img {
filter: invert(1);
}
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
body.light {
background-color: #eee;
color: #000;
}
body.light a {
color: #000;
border-bottom: 1px solid #000;
}
body.light pre {
background-color: #ddd;
}
body.light :not(pre)>code {
background-color: #ddd;
}
body.light .toc {
background-color: #ddd;
}
body.light .content p.metadata {
color: #555;
}
body.light .contact-icons img {
filter: none;
}
body.light .content img {
filter: none;
}
body { body {
background-color: #000; background-color: #000;
color: #eee; color: #eee;