Skip to content

Commit

Permalink
feat: use @pesca-dev/atomicity and custom font
Browse files Browse the repository at this point in the history
  • Loading branch information
H1ghBre4k3r committed Dec 23, 2024
1 parent d638596 commit e9c6c24
Show file tree
Hide file tree
Showing 27 changed files with 203 additions and 53 deletions.
13 changes: 13 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,17 @@ export default [
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
{
rules: {
// note you must disable the base rule
// as it can report incorrect errors
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn", // or "error"
{
varsIgnorePattern: "^a$",
},
],
},
},
];
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/styles/fonts.css" />
<title>Vite + TS</title>
</head>
<body>
Expand Down
111 changes: 60 additions & 51 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@
"typescript": "~5.6.2",
"typescript-eslint": "^8.18.1",
"vite": "^6.0.3"
},
"dependencies": {
"@pesca-dev/atomicity": "^0.1.1"
}
}
Binary file added public/fonts/FliegeMono-Black.woff
Binary file not shown.
Binary file added public/fonts/FliegeMono-Black.woff2
Binary file not shown.
Binary file added public/fonts/FliegeMono-Bold.woff
Binary file not shown.
Binary file added public/fonts/FliegeMono-Bold.woff2
Binary file not shown.
Binary file added public/fonts/FliegeMono-ExtraBold.woff
Binary file not shown.
Binary file added public/fonts/FliegeMono-ExtraBold.woff2
Binary file not shown.
Binary file added public/fonts/FliegeMono-ExtraLight.woff
Binary file not shown.
Binary file added public/fonts/FliegeMono-ExtraLight.woff2
Binary file not shown.
Binary file added public/fonts/FliegeMono-Light.woff
Binary file not shown.
Binary file added public/fonts/FliegeMono-Light.woff2
Binary file not shown.
Binary file added public/fonts/FliegeMono-Medium.woff
Binary file not shown.
Binary file added public/fonts/FliegeMono-Medium.woff2
Binary file not shown.
Binary file added public/fonts/FliegeMono-Regular.woff
Binary file not shown.
Binary file added public/fonts/FliegeMono-Regular.woff2
Binary file not shown.
Binary file added public/fonts/FliegeMono-SemiBold.woff
Binary file not shown.
Binary file added public/fonts/FliegeMono-SemiBold.woff2
Binary file not shown.
Binary file added public/fonts/FliegeMono-Thin.woff
Binary file not shown.
Binary file added public/fonts/FliegeMono-Thin.woff2
Binary file not shown.
89 changes: 89 additions & 0 deletions public/styles/fonts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
@font-face {
font-family: "Fliege Mono";
src:
url("/fonts/FliegeMono-Black.woff2") format("woff2"),
url("/fonts/FliegeMono-Black.woff") format("woff");
font-weight: 900;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "Fliege Mono";
src:
url("/fonts/FliegeMono-Light.woff2") format("woff2"),
url("/fonts/FliegeMono-Light.woff") format("woff");
font-weight: 300;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "Fliege Mono";
src:
url("/fonts/FliegeMono-ExtraLight.woff2") format("woff2"),
url("/fonts/FliegeMono-ExtraLight.woff") format("woff");
font-weight: 200;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "Fliege Mono";
src:
url("/fonts/FliegeMono-Bold.woff2") format("woff2"),
url("/fonts/FliegeMono-Bold.woff") format("woff");
font-weight: bold;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "Fliege Mono 100";
src:
url("/fonts/FliegeMono-Thin.woff2") format("woff2"),
url("/fonts/FliegeMono-Thin.woff") format("woff");
font-weight: 100;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "Fliege Mono";
src:
url("/fonts/FliegeMono-Medium.woff2") format("woff2"),
url("/fonts/FliegeMono-Medium.woff") format("woff");
font-weight: 500;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "Fliege Mono";
src:
url("/fonts/FliegeMono-ExtraBold.woff2") format("woff2"),
url("/fonts/FliegeMono-ExtraBold.woff") format("woff");
font-weight: bold;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "Fliege Mono";
src:
url("/fonts/FliegeMono-SemiBold.woff2") format("woff2"),
url("/fonts/FliegeMono-SemiBold.woff") format("woff");
font-weight: 600;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "Fliege Mono";
src:
url("/fonts/FliegeMono-Regular.woff2") format("woff2"),
url("/fonts/FliegeMono-Regular.woff") format("woff");
font-weight: normal;
font-style: normal;
font-display: swap;
}
2 changes: 2 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import "./style.css";
import typescriptLogo from "./typescript.svg";
import viteLogo from "/vite.svg";
import { setupCounter } from "./counter.ts";
import "./test";

document.querySelector<HTMLDivElement>("#app")!.innerHTML = `
<div>
Expand All @@ -18,6 +19,7 @@ document.querySelector<HTMLDivElement>("#app")!.innerHTML = `
<p class="read-the-docs">
Click on the Vite and TypeScript logos to learn more
</p>
<my-test name="H1ghBre4k3r"></my-test>
</div>
`;

Expand Down
3 changes: 2 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
/* font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; */
font-family: Fliege Mono;
line-height: 1.5;
font-weight: 400;

Expand Down
29 changes: 29 additions & 0 deletions src/test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import {
AbstractElement,
ObservedAttributes,
Transformers,
a,
} from "@pesca-dev/atomicity";

type Attributes = {
name: string;
};
const transformers: Transformers<Attributes> = {
name: [(arg) => arg, ""],
};

export class Test extends AbstractElement<Attributes> {
constructor() {
super(transformers);
}

public static get observedAttributes(): ObservedAttributes<Attributes> {
return ["name"];
}

render() {
return <div>Hello, {this.attrs.name}</div>;
}
}

customElements.define("my-test", Test);
Loading

0 comments on commit e9c6c24

Please sign in to comment.