Commit 7e77fa91 authored by lunasorcery's avatar lunasorcery
Browse files

move to preprocessing css with sass

parent a376988b
......@@ -2,6 +2,7 @@
import os
import json
import sass
import shutil
import chevron
import binascii
......@@ -63,7 +64,6 @@ if not os.path.exists('gen/favicon.ico'):
print("copying static assets...")
staticAssets = [
'fonts.css',
'style.css',
'script.js',
'manifest.json',
'Muli-Regular.ttf',
......@@ -74,6 +74,17 @@ for asset in staticAssets:
shutil.copyfile(f'static/{asset}', f'gen/{asset}')
print("processing CSS...")
cssFiles = [
'style.scss'
]
for asset in cssFiles:
with open(asset) as fIn:
print(f"gen/{asset.replace('.scss','.css')}")
with open(f"gen/{asset.replace('.scss','.css')}", 'w') as fOut:
fOut.write(sass.compile(string=fIn.read()))
print("converting images...")
for idx,prod in enumerate(prods):
slug = prod['slug']
......
......@@ -81,60 +81,62 @@ a {
}
.navbar {
margin-left: auto;
margin-right: auto;
padding: 8px 16px;
}
.navbar,
.content {
margin: 24px auto;
width: 100%;
}
.navbar,
.content {
width: 100%;
margin: 24px auto;
}
.navbar .entry {
.navbar {
margin-left: auto;
margin-right: auto;
padding: 8px 16px;
color: var(--main-text-color);
transition: color var(--theme-transition-duration) var(--theme-transition-easing);
}
.navbar .entry.active {
font-weight: 600;
}
.navbar .entry.active,
.navbar .entry:hover,
.navbar .entry:focus {
border-bottom: 1px solid var(--main-text-color);
transition:
color var(--theme-transition-duration) var(--theme-transition-easing),
border-color var(--theme-transition-duration) var(--theme-transition-easing);
.entry {
padding: 8px 16px;
color: var(--main-text-color);
transition: color var(--theme-transition-duration) var(--theme-transition-easing);
&.active {
font-weight: 600;
}
&.active,
&:hover,
&:focus {
border-bottom: 1px solid var(--main-text-color);
transition:
color var(--theme-transition-duration) var(--theme-transition-easing),
border-color var(--theme-transition-duration) var(--theme-transition-easing);
}
}
}
.switch {
position: absolute;
top: 12px;
}
.switch .label {
/* vertically center text */
display: flex;
align-items: center;
.label {
/* vertically center text */
display: flex;
align-items: center;
padding: 4px;
cursor: pointer;
text-transform: lowercase;
padding: 4px;
cursor: pointer;
text-transform: lowercase;
color: var(--main-text-color);
transition: color var(--theme-transition-duration) var(--theme-transition-easing);
}
.switch .label span {
opacity: 0;
transition: opacity 150ms ease-in-out;
color: var(--main-text-color);
transition: color var(--theme-transition-duration) var(--theme-transition-easing);
span {
opacity: 0;
transition: opacity 150ms ease-in-out;
}
}
}
......@@ -250,97 +252,106 @@ a {
width: -moz-fit-content;
max-width: 100%;
transition: background-color var(--theme-transition-duration) var(--theme-transition-easing);
}
.content-thing.slim {
max-width: 760px;
margin-left: auto;
margin-right: auto;
}
.content-thing .meteorik {
padding: 8px;
text-align: center;
font-weight: 600;
float: right;
border: 0px solid transparent;
border-bottom-width: 1px;
border-left-width: 1px;
margin-top: -4px;
margin-right: 12px;
box-shadow:
0px 1px 2px rgba(0,0,0,0.3),
0px 2px 5px rgba(0,0,0,0.05);
color: var(--main-text-color);
transition:
color var(--theme-transition-duration) var(--theme-transition-easing),
background-color var(--theme-transition-duration) var(--theme-transition-easing);
}
.content-thing .meteorik-nominee {
background: var(--meteorik-nominee-bg-color);
}
.content-thing .meteorik-winner {
background: var(--meteorik-winner-bg-color);
}
.content-thing .text {
padding: 12px;
}
&.slim {
max-width: 760px;
margin-left: auto;
margin-right: auto;
}
.content-thing .text,
.content-thing .text a {
color: var(--main-text-color);
transition: color var(--theme-transition-duration) var(--theme-transition-easing);
}
.meteorik {
padding: 8px;
text-align: center;
font-weight: 600;
float: right;
border: 0px solid transparent;
border-bottom-width: 1px;
border-left-width: 1px;
margin-top: -4px;
margin-right: 12px;
box-shadow:
0px 1px 2px rgba(0,0,0,0.3),
0px 2px 5px rgba(0,0,0,0.05);
color: var(--main-text-color);
transition:
color var(--theme-transition-duration) var(--theme-transition-easing),
background-color var(--theme-transition-duration) var(--theme-transition-easing);
&.meteorik-nominee {
background: var(--meteorik-nominee-bg-color);
}
&.meteorik-winner {
background: var(--meteorik-winner-bg-color);
}
}
.content-thing .text .author {
font-weight: 400;
}
.content-thing .text .title {
font-size: 15pt;
font-weight: 800;
font-style: italic;
}
.content-thing .text .author,
.content-thing .text .title,
.content-thing .text .party,
.content-thing .text .subtitle {
margin-bottom: 0.3em;
display: inline-block;
}
.content-thing .text > *:last-child {
margin-bottom: 0;
}
.content-thing:hover .text .title,
.content-thing a:focus .text .title {
text-decoration: underline;
}
.image {
padding: var(--image-margin);
padding-top: 0;
.content-thing .image {
padding: var(--image-margin);
padding-top: 0;
}
.content-thing .image img {
display: block;
max-width: 100%;
max-height: 80vh;
}
img {
display: block;
max-width: 100%;
max-height: 80vh;
}
}
.content-thing .text .question {
font-size: 14pt;
font-weight: 600;
}
.content-thing .text .answer p {
margin-block-end: 0;
.text {
padding: 12px;
color: var(--main-text-color);
transition: color var(--theme-transition-duration) var(--theme-transition-easing);
a {
color: inherit;
}
.author {
font-weight: 400;
}
.title {
font-size: 15pt;
font-weight: 800;
font-style: italic;
}
.author,
.title,
.party,
.subtitle {
margin-bottom: 0.3em;
display: inline-block;
}
& > *:last-child {
margin-bottom: 0;
}
.question {
font-size: 14pt;
font-weight: 600;
}
.answer p {
margin-block-end: 0;
a[href] {
text-decoration: underline;
text-decoration-style: dotted;
text-decoration-thickness: from-font;
&:hover,
&:focus {
text-decoration-style: solid;
}
}
}
}
}
.content-thing .text p a[href] {
.content-thing:hover .text .title,
.content-thing a:focus .text .title {
text-decoration: underline;
text-decoration-style: dotted;
text-decoration-thickness: from-font;
}
.content-thing .text p a[href]:hover,
.content-thing .text p a[href]:focus {
text-decoration-style: solid;
}
.footer {
......@@ -386,27 +397,34 @@ a {
--content-thing-border-radius: 10px;
--image-margin: 5px;
}
.navbar .entry {
&.active,
&:hover,
&:focus {
border: none;
border-radius: 5px;
background-color: var(--panel-bg-color);
box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
transition: background-color var(--theme-transition-duration) var(--theme-transition-easing);
}
}
.content-thing {
border-radius: var(--content-thing-border-radius);
box-shadow:
0px 3px 5px rgba(0,0,0,0.05),
0px 6px 10px rgba(0,0,0,0.05);
}
.content-thing .meteorik {
border-radius: calc(var(--content-thing-border-radius) - var(--image-margin));
border-width: 0px;
margin: var(--image-margin);
box-shadow: none;
}
.content-thing img {
border-radius: calc(var(--content-thing-border-radius) - var(--image-margin));
}
.content-thing .text {
padding: 10px;
.meteorik {
border-radius: calc(var(--content-thing-border-radius) - var(--image-margin));
border-width: 0px;
margin: var(--image-margin);
box-shadow: none;
}
img {
border-radius: calc(var(--content-thing-border-radius) - var(--image-margin));
}
.text {
padding: 10px;
}
}*/
/* april fools theme */
[data-theme="pouet"] {
--main-text-color: #ffffff;
......@@ -417,130 +435,157 @@ a {
--dropdown-divider-color: #000000;
font-family: 'Tahoma', 'Verdana', 'Arial', 'Helvetica', sans-serif;
font-size: 9pt;
}
[data-theme="pouet"] body {
padding: 12px 0px;
background: var(--main-bg-color) url('https://content.pouet.net/styles/001/gfx/trumpet.svg');
}
[data-theme="pouet"] #switch-theme {
display: none;
}
[data-theme="pouet"] #switch-lang svg {
display: none;
}
[data-theme="pouet"] #switch-lang span {
opacity: 1;
font-weight: bold;
text-transform: none;
display: inline-block !important;
}
[data-theme="pouet"] .switch-dropdown .mousetrap {
top: 100%;
}
[data-theme="pouet"] .switch-dropdown .dropdown {
border: 1px solid #000000;
border-top: none;
border-radius: 0px;
box-shadow: none;
}
[data-theme="pouet"] .switch-dropdown .dropdown .item {
color: #9FCFFF;
font-weight: bold;
padding: 4px;
}
[data-theme="pouet"] .switch-dropdown .dropdown .item:hover,
[data-theme="pouet"] .switch-dropdown .dropdown .item:focus {
text-decoration: underline;
}
[data-theme="pouet"] .navbar {
background-color: #224488;
border-top: 1px solid #ffffff;
border-bottom: 1px solid #ffffff;
padding: 0px;
}
[data-theme="pouet"] .navbar .entry {
display: inline-block;
border: none;
font-weight: bold;
padding: 3px 4px;
}
[data-theme="pouet"] .navbar .entry:hover,
[data-theme="pouet"] .navbar .entry:focus {
text-decoration: underline;
}
[data-theme="pouet"] .navbar .entry:first-letter {
color: #9FCFFF;
}
[data-theme="pouet"] .content {
padding: 0px 12px;
}
[data-theme="pouet"] .content-thing {
box-shadow: none;
border: 2px solid #000000;
max-width: 760px;
}
[data-theme="pouet"] .content-thing.slim {
max-width: 500px;
}
[data-theme="pouet"] .content-thing .text {
padding: 3px;
}
[data-theme="pouet"] .content-thing .text,
[data-theme="pouet"] .content-thing .text .author,
[data-theme="pouet"] .content-thing .text .title,
[data-theme="pouet"] .content-thing .text .party,
[data-theme="pouet"] .content-thing .text .subtitle,
[data-theme="pouet"] .content-thing .text .question {
font-size: 9pt;
font-weight: normal;
font-style: normal;
}
[data-theme="pouet"] .content-thing .text a[href] {
font-weight: bold;
color: #9FCFFF;
text-decoration: none;
}
[data-theme="pouet"] .content-thing .text a[href]:hover,
[data-theme="pouet"] .content-thing .text a[href]:focus {
text-decoration: underline;
text-decoration-style: solid;
}
[data-theme="pouet"] .content-thing .text .title,
[data-theme="pouet"] .content-thing .text .question {
font-weight: bold;
}
[data-theme="pouet"] .content-thing:not(.content-thing.slim) .text {
background: #224488;
}
[data-theme="pouet"] .content-thing .image {
border-top: 1px solid #000000;
}
[data-theme="pouet"] .content-thing .meteorik {
background-color: transparent;
background-position: top right;
background-repeat: no-repeat;
font-size: 11px;
border: 0;
padding: 0;
padding-top: 2px;
padding-right: 22px;
margin: 8px;
height: 16px;
box-shadow: none;
}
[data-theme="pouet"] .content-thing .meteorik.meteorik-winner {
background-image: url('https://content.pouet.net/gfx/sceneorg/meteorikwinner.gif');
}
[data-theme="pouet"] .content-thing .meteorik.meteorik-nominee {
background-image: url('https://content.pouet.net/gfx/sceneorg/meteoriknominee.gif');
}
[data-theme="pouet"] .content-thing .text .question {
display: block;
margin: -4px;
padding: 3px;
border: 1px solid #000000;
background: #224488;
}
[data-theme="pouet"] .content-thing .text .answer p {
margin-block-start: 6px;
body {
padding: 12px 0px;
background: var(--main-bg-color) url('https://content.pouet.net/styles/001/gfx/trumpet.svg');
}
#switch-theme {
display: none;
}
#switch-lang svg {
display: none;
}
#switch-lang span {
opacity: 1;
font-weight: bold;
text-transform: none;
display: inline-block !important;
}
.switch-dropdown .mousetrap {
top: 100%;
}
.switch-dropdown .dropdown {
border: 1px solid #000000;
border-top: none;
border-radius: 0px;
box-shadow: none;
}
.switch-dropdown .dropdown .item {
color: #9FCFFF;
font-weight: bold;
padding: 4px;
}
.switch-dropdown .dropdown .item:hover,
.switch-dropdown .dropdown .item:focus {
text-decoration: underline;
}
.navbar {
background-color: #224488;
border-top: 1px solid #ffffff;
border-bottom: 1px solid #ffffff;
padding: 0px;
.entry {
display: inline-block;
border: none;
font-weight: bold;
padding: 3px 4px;
&:hover,
&:focus {
text-decoration: underline;
}
&:first-letter {
color: #9FCFFF;
}
}
}
.content {
padding: 0px 12px;
}
.content-thing {
box-shadow: none;
border: 2px solid #000000;
max-width: 760px;
&.slim {
max-width: 500px;
}
.text {
padding: 3px;
&,
.author,
.title,
.party,
.subtitle,
.question {
font-size: 9pt;
font-weight: normal;
font-style: normal;
}
a[href] {
font-weight: bold;
color: #9FCFFF;
text-decoration: none;
&:hover,
&:focus {
text-decoration: underline;
text-decoration-style: solid;
}
}
.title,
.question {
font-weight: bold;
}
.question {
display: block;
margin: -4px;
padding: 3px;
border: 1px solid #000000;
background: #224488;
}
.answer p {
margin-block-start: 6px;
}
}
.image {
border-top: 1px solid #000000;
}
.meteorik {
background-color: transparent;
background-position: top right;
background-repeat: no-repeat;
font-size: 11px;
border: 0;