Skip to content

Commit 4d1dfeb

Browse files
authored
feat: ⚡ Vanilla app (#16)
1 parent 6bf07b7 commit 4d1dfeb

File tree

12 files changed

+185
-50
lines changed

12 files changed

+185
-50
lines changed

demo/react-app/README.md

-50
This file was deleted.

demo/react-app/src/index.css

+37
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,40 @@
22
color: rgba(255, 255, 255, 0.87);
33
background-color: #242424;
44
}
5+
6+
p {
7+
font-size: x-large;
8+
}
9+
10+
.google-poppins {
11+
font-family: "Poppins", sans-serif;
12+
}
13+
14+
.google-press-start {
15+
font-family: "Press Start 2P", sans-serif;
16+
}
17+
18+
.bunny-aclonica {
19+
font-family: "Aclonica", sans-serif;
20+
}
21+
22+
.bunny-allan {
23+
font-family: "Allan", sans-serif;
24+
}
25+
26+
.font-share-panchang {
27+
font-family: "Panchang", sans-serif;
28+
}
29+
30+
.font-source-luckiest {
31+
font-family: "Luckiest Guy", sans-serif;
32+
}
33+
34+
@font-face {
35+
font-family: "Black Fox";
36+
src: url("./black-fox.ttf");
37+
}
38+
39+
.local {
40+
font-family: "Black Fox", sans-serif;
41+
}

demo/vanilla-app/.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

demo/vanilla-app/index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + TS</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.ts"></script>
12+
</body>
13+
</html>

demo/vanilla-app/package.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "vanilla-app",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc && vite build",
9+
"preview": "vite preview"
10+
},
11+
"devDependencies": {
12+
"typescript": "~5.6.2",
13+
"vite": "^6.0.5"
14+
}
15+
}

demo/vanilla-app/public/vite.svg

+1
Loading

demo/vanilla-app/src/black-fox.ttf

59.3 KB
Binary file not shown.

demo/vanilla-app/src/main.ts

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import './style.css';
2+
3+
document.querySelector<HTMLDivElement>('#app')!.innerHTML = `
4+
<div>
5+
<h1>Google</h1>
6+
<p class="poppins">Poppins</p>
7+
<p class="press-start">Press Start 2P</p>
8+
9+
<h1>Bunny</h1>
10+
<p class="bunny-aclonica">Aclonica</p>
11+
<p class="bunny-allan">Allan</p>
12+
13+
<h1>FontShare</h1>
14+
<p class="font-share-panchang">Panchang</p>
15+
16+
<h1>FontSource</h1>
17+
<p class="font-source-luckiest">Luckiest</p>
18+
19+
<h1>Local</h1>
20+
<p class="local">Local font</p>
21+
</div>
22+
`;

demo/vanilla-app/src/style.css

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
:root {
2+
color: rgba(255, 255, 255, 0.87);
3+
background-color: #242424;
4+
}
5+
6+
p {
7+
font-size: x-large;
8+
}
9+
10+
.google-poppins {
11+
font-family: "Poppins", sans-serif;
12+
}
13+
14+
.google-press-start {
15+
font-family: "Press Start 2P", sans-serif;
16+
}
17+
18+
.bunny-aclonica {
19+
font-family: "Aclonica", sans-serif;
20+
}
21+
22+
.bunny-allan {
23+
font-family: "Allan", sans-serif;
24+
}
25+
26+
.font-share-panchang {
27+
font-family: "Panchang", sans-serif;
28+
}
29+
30+
.font-source-luckiest {
31+
font-family: "Luckiest Guy", sans-serif;
32+
}
33+
34+
@font-face {
35+
font-family: "Black Fox";
36+
src: url("./black-fox.ttf");
37+
}
38+
39+
.local {
40+
font-family: "Black Fox", sans-serif;
41+
}

demo/vanilla-app/src/vite-env.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="vite/client" />

demo/vanilla-app/tsconfig.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2020",
4+
"useDefineForClassFields": true,
5+
"module": "ESNext",
6+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
7+
"skipLibCheck": true,
8+
9+
/* Bundler mode */
10+
"moduleResolution": "bundler",
11+
"allowImportingTsExtensions": true,
12+
"isolatedModules": true,
13+
"moduleDetection": "force",
14+
"noEmit": true,
15+
16+
/* Linting */
17+
"strict": true,
18+
"noUnusedLocals": true,
19+
"noUnusedParameters": true,
20+
"noFallthroughCasesInSwitch": true,
21+
"noUncheckedSideEffectImports": true
22+
},
23+
"include": ["src"]
24+
}

demo/vanilla-app/vite.config.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig } from 'vite';
2+
import { fontless } from '../../lib/vite/plugin';
3+
4+
// https://vite.dev/config/
5+
export default defineConfig({
6+
plugins: [fontless()],
7+
});

0 commit comments

Comments
 (0)