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

Update header #86

Merged
merged 18 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,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>
alifeee marked this conversation as resolved.
Show resolved Hide resolved
</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" }}}
alifeee marked this conversation as resolved.
Show resolved Hide resolved
</ul>
<!-- search bar -->
<!-- <form onsubmit="">
Expand Down
27 changes: 0 additions & 27 deletions lipu-ante.hbs

This file was deleted.

32 changes: 0 additions & 32 deletions public/stylesheet-lipu-ante.css

This file was deleted.

41 changes: 41 additions & 0 deletions public/stylesheet-sona.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@
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;
filter: invert(100%) sepia(7%) saturate(0%) hue-rotate(112deg)
brightness(106%) contrast(109%);
}

.ni-li-seme {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -117,6 +128,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
Loading