Skip to content

Commit 0580a5c

Browse files
committed
fix: update script load url
1 parent 43fc8e5 commit 0580a5c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

scripts/main.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ function drawLines(canvas, ctx) {
5959
function drawText(canvas, ctx) {
6060
const margin = canvas.height / 20;
6161

62-
ctx.font = "25px Satoshi Bold, sans-serif";
63-
ctx.textAlign = "start";
64-
ctx.textBaseline = "bottom";
62+
6563
const year = new Date().getFullYear();
6664
const text = ${year} NEI/AAC`;
65+
const size = window.innerWidth < 500 ? 20 : 25;
66+
ctx.font = `${size}px Satoshi Bold`;
67+
ctx.textAlign = "start";
68+
ctx.textBaseline = "bottom";
6769

6870
ctx.fillText(text, margin + margin / 2, canvas.height - (1.5 * margin));
6971
}
@@ -95,7 +97,7 @@ function main() {
9597
const canvas = document.getElementById("canvas");
9698
const ctx = canvas.getContext("2d");
9799

98-
const font = new FontFace("Satoshi Bold", "url(../assets/fonts/satoshi-bold.otf)");
100+
const font = new FontFace("Satoshi Bold", "url(./assets/fonts/satoshi-bold.otf)");
99101

100102
font.load().then((loadedFont) => {
101103
document.fonts.add(loadedFont);

0 commit comments

Comments
 (0)