This commit is contained in:
Simon Martens
2024-10-17 14:05:01 +02:00
commit 3e06b0af76
54 changed files with 16934 additions and 0 deletions

37
src/transform/main.js Normal file
View File

@@ -0,0 +1,37 @@
import "./site.css";
function setup() {
let templates = document.querySelectorAll("template[simple]");
templates.forEach((template) => {
let templateId = template.getAttribute("id");
let templateContent = template.content;
customElements.define(
templateId,
class extends HTMLElement {
constructor() {
super();
this.appendChild(templateContent.cloneNode(true));
this.slots = this.querySelectorAll("slot");
}
connectedCallback() {
let toremove = [];
this.slots.forEach((tslot) => {
let slotName = tslot.getAttribute("name");
let slotContent = this.querySelector(`[slot="${slotName}"]`);
if (slotContent) {
tslot.replaceWith(slotContent.cloneNode(true));
toremove.push(slotContent);
}
});
toremove.forEach((element) => {
element.remove();
});
}
},
);
});
}
export { setup };

90
src/transform/site.css Normal file
View File

@@ -0,0 +1,90 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
@font-face {
font-family: "Rancho";
font-style: normal;
font-weight: 500;
font-display: swap;
src: url(/fonts/Rancho-Regular.ttf) format("truetype");
}
@font-face {
font-family: "Merriweather";
font-style: normal;
font-weight: 500;
font-display: swap;
src: url(/fonts/Merriweather-Regular.ttf) format("truetype");
}
@font-face {
font-family: "Merriweather";
font-style: italic;
font-weight: 500;
font-display: swap;
src: url(/fonts/Merriweather-Italic.ttf) format("truetype");
}
@font-face {
font-family: "Merriweather";
font-style: normal;
font-weight: bold;
font-display: swap;
src: url(/fonts/Merriweather-Bold.ttf) format("truetype");
}
@font-face {
font-family: "Merriweather";
font-style: italic;
font-weight: bold;
font-display: swap;
src: url(/fonts/SourceSans3-BoldItalic.ttf) format("truetype");
}
@font-face {
font-family: "Source Sans 3";
font-style: normal;
font-weight: 500;
font-display: swap;
src: url(/fonts/SourceSans3-Medium.ttf) format("truetype");
}
@font-face {
font-family: "Source Sans 3";
font-style: italic;
font-weight: 500;
font-display: swap;
src: url(/fonts/SourceSans3-MediumItalic.ttf) format("truetype");
}
@font-face {
font-family: "Source Sans 3";
font-style: normal;
font-weight: bold;
font-display: swap;
src: url(/fonts/SourceSans3-Bold.ttf) format("truetype");
}
@font-face {
font-family: "Source Sans 3";
font-style: italic;
font-weight: bold;
font-display: swap;
src: url(/fonts/SourceSans3-BoldItalic.ttf) format("truetype");
}
}
@layer components {
a {
@apply underline decoration-dotted hover:decoration-solid text-zinc-800 hover:text-zinc-900;
}
h2 {
@apply font-bold;
}
p {
@apply mt-2 mb-3;
}
}