File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -59,11 +59,13 @@ function drawLines(canvas, ctx) {
59
59
function drawText ( canvas , ctx ) {
60
60
const margin = canvas . height / 20 ;
61
61
62
- ctx . font = "25px Satoshi Bold, sans-serif" ;
63
- ctx . textAlign = "start" ;
64
- ctx . textBaseline = "bottom" ;
62
+
65
63
const year = new Date ( ) . getFullYear ( ) ;
66
64
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" ;
67
69
68
70
ctx . fillText ( text , margin + margin / 2 , canvas . height - ( 1.5 * margin ) ) ;
69
71
}
@@ -95,7 +97,7 @@ function main() {
95
97
const canvas = document . getElementById ( "canvas" ) ;
96
98
const ctx = canvas . getContext ( "2d" ) ;
97
99
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)" ) ;
99
101
100
102
font . load ( ) . then ( ( loadedFont ) => {
101
103
document . fonts . add ( loadedFont ) ;
You can’t perform that action at this time.
0 commit comments