Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

light theme experimentation #113

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
21 changes: 20 additions & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ module.exports = function (eleventyConfig) {
b += str.charCodeAt(i) * (i + 1);
}
function cap(x) {
return 100 + (x % 156);
// make sure all RGB values are below 156 to keep colours dark
return x % 156;
}
return `rgb(${cap(r)}, ${cap(g)}, ${cap(b)})`;
});
Expand All @@ -189,6 +190,24 @@ module.exports = function (eleventyConfig) {
// use like {{ eleventyImage "images/blah.jpg" "classes" "alt" 300 }}
eleventyConfig.addShortcode("eleventyImage", imageShortcode);

eleventyConfig.addShortcode("nav", function (url, label) {
let isActive = false;
if (url == "/") {
isActive = this.page.url == "/" || this.page.url.startsWith("/lipu/");
} else {
isActive = this.page.url.startsWith(url);
}
const content = label
.split(" ")
.map((word) => {
return `<span class="sitelen-tu" data-text="${word}">${word}</span>`;
})
.join(" ");
return `<li class="${
isActive ? "active" : ""
}"><a href="${url}">${content}</a></li>`;
});

return {
markdownTemplateEngine: "hbs",
};
Expand Down
53 changes: 12 additions & 41 deletions _includes/page.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,6 @@ scripts: []
<link rel="stylesheet" href="/{{ this }}" />
{{/each}}

<!-- patreon banner -->
<script>
// check if cookie exists
if (document.cookie.indexOf('patreon-banner-closed=1') == -1) {
// cookie doesn't exist, show banner
setTimeout(() => {
document.getElementById('patreon-banner').classList.add('visible')
}, 1500)
}
closeBanner = () => {
// set cookie
document.cookie = 'patreon-banner-closed=1; path=/; max-age=2628000'
document.getElementById('patreon-banner').classList.remove('visible')
}
</script>

<!-- analytics -->
<script data-goatcounter="https://liputenpo.goatcounter.com/count"
async src="//gc.zgo.at/count.js"></script>
Expand All @@ -67,34 +51,21 @@ scripts: []
</head>

<body>
<article id="patreon-banner" class="patreon-banner">
<div>
<p>
lipu tenpo li lon ma Patreon!
<a href="https://www.patreon.com/liputenpo">o lukin!</a>
</p>
<button class="close" onclick="closeBanner()">&#10006;</button>
</div>
</article>
<header>
<div id="banner"></div>
<a href="/" class="title">
<img src="/logo.png" alt="lipu tenpo logo" width="475" height="497" />
<h1>lipu tenpo</h1>
</a>
<div class="sewi-lipu">
<a href="/">
<img src="/logo.png" alt="lipu tenpo logo" class="logo" />
</a>
<div>
<h1><a href="/">lipu tenpo</a></h1>
<div class="subtitle"><a href="/sona#faq">li alasa e jan pali sin</a></div>
</div>
</div>
<nav>
<ul>
<li>
<a href="/">open</a>
<li>
<a href="/toki">toki</a>
</li>
<li>
<a href="/sona">sona</a>
</li>
<li>
<a href="/lipu-ante">lipu ante</a>
</li>
{{{ nav "/" "lipu" }}}
{{{ nav "/toki/" "toki" }}}
{{{ nav "/sona/" "sona" }}}
</ul>
<!-- search bar -->
<!-- <form onsubmit="">
Expand Down
27 changes: 0 additions & 27 deletions lipu-ante.hbs

This file was deleted.

6 changes: 3 additions & 3 deletions public/stylesheet-index.css
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
font-weight: bold;
}
.lipuwan .date {
color: gray;
color: var(--text-subtle);
}
.lipuwan a:hover {
text-decoration: underline;
Expand All @@ -186,9 +186,9 @@
font-size: 1.7rem;
}
#lipu-nanpa-lon .lipuwan img {
margin-top: .7rem;
margin-top: 0.7rem;
max-width: 12rem;
}
#lipu-nanpa-lon .jan-pali {
padding: 0 .5rem;
padding: 0 0.5rem;
}
32 changes: 0 additions & 32 deletions public/stylesheet-lipu-ante.css

This file was deleted.

8 changes: 5 additions & 3 deletions public/stylesheet-lipu.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ h2 {
}
.pdfs li a {
flex: 1 0;
border: 3px solid var(--logo-secondary-dark);
border: 3px solid var(--colour-kiwen-pimeja);
background-color: var(--logo-primary-dark);
padding: 1rem;
border-radius: 1.5rem;
Expand Down Expand Up @@ -127,7 +127,6 @@ h2 {
justify-content: center;
align-items: center;
text-decoration: none;
color: var(--text-colour);
}
.article .nimi-suli {
font-size: 1rem;
Expand Down Expand Up @@ -167,7 +166,10 @@ h2 {
background-color: var(--logo-primary-dark);
border-radius: 1rem;
text-decoration: none;
color: var(--logo-secondary);
color: var(--text-contrast);
}
.prevnext a:hover {
color: var(--text-contrast-subtle);
}
.prevnext .disabled {
color: var(--text-subtle);
Expand Down
43 changes: 41 additions & 2 deletions public/stylesheet-sona.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
border-radius: var(--blob-border-radius-03);
}

.esun-tawa-ni {
text-align: center;
font-size: 2rem;
}
.esun-tawa-ni img.icon {
height: 2rem;
width: auto;
}

.ni-li-seme {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -94,10 +103,10 @@
border-radius: var(--blob-border-radius-01);
}
.jan-pali .jan {
color: var(--colour-pimeja-lili);
color: var(--text-subtle);
}
.jan-pali .active {
color: var(--logo-secondary);
color: var(--colour-loje-pimeja);
}
.jan-pali .lists {
display: flex;
Expand All @@ -117,6 +126,36 @@
overflow-y: auto;
}

.lipu-ante {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.lipu-ante h3 {
margin: 4rem 0 1rem;
font-size: 2rem;
padding: 0.5rem 2rem;
background-color: var(--colour-unu-walo);
color: var(--colour-unu-pimeja);
border-radius: var(--blob-border-radius-01);
}
.lipu-ante h4 {
text-align: center;
}
.lipu-ante .lists {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin-top: 1rem;
}
.lipu-ante .lipu-ante-wan {
margin: 0.5rem;
}
.lipu-ante li {
margin: 0.5rem;
}

.sona {
text-align: center;
margin-bottom: 2rem;
Expand Down
3 changes: 2 additions & 1 deletion public/stylesheet-toki-wan.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
flex-direction: column;
justify-content: center;
align-items: center;
margin: 1rem 1rem 3rem;
margin: 0 1rem 3rem;
}

h1 {
font-size: 3rem;
margin-bottom: 0;
margin-top: 0;
text-align: center;
}

Expand Down
1 change: 0 additions & 1 deletion public/stylesheet-toki.css
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ search > input {
justify-content: center;
align-items: center;
text-decoration: none;
color: var(--text-colour);
}

.article.hidden {
Expand Down
Loading
Loading