1
Fork 0

Add HTML and setup code.

This commit is contained in:
Bauke 2023-05-30 12:10:17 +02:00
parent e43d18a363
commit 26a9841557
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
3 changed files with 43 additions and 0 deletions

12
source/app.tsx Normal file
View File

@ -0,0 +1,12 @@
// Third-party imports.
import {Component} from "preact";
export class App extends Component {
render() {
return (
<>
<p class="subtitle">Today is:</p>
</>
);
}
}

15
source/assets/index.html Normal file
View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Today</title>
</head>
<body>
<script type="module" src="./setup.js"></script>
</body>
</html>

16
source/setup.tsx Normal file
View File

@ -0,0 +1,16 @@
// Third-party imports.
import {render} from "preact";
// CSS imports.
import "modern-normalize/modern-normalize.css";
import "./global.scss";
// First-party imports.
import {App} from "./app.js";
if ($dev) {
await import("./date/date.test.js");
}
const preactRoot = document.createElement("div");
preactRoot.classList.add("preact-root");
document.body.append(preactRoot);
render(<App />, preactRoot);