File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -47,19 +47,17 @@ function rgbToHex(color){
4747 return hex ;
4848}
4949const fontHex = rgbToHex ( asciiStyle . color )
50+ ctx . fillStyle = fontHex
51+
5052window . setInterval ( ( ) => {
5153 ctx . clearRect ( 0 , 0 , overlay . width , overlay . height )
52- for ( let i = 0 ; i < overlay . height / h ; i ++ ) {
53- for ( let j = 0 ; j < overlay . width / w ; j ++ ) {
54- let alpha = Math . floor ( i / ( overlay . height / h ) * 255 ) . toString ( 16 )
55- if ( alpha . length == 1 ) {
56- alpha = '0' + alpha
57- }
58- ctx . fillStyle = `${ fontHex } ${ alpha } `
59- ctx . fillText ( choose ( overlayChars ) , j * w , ( i + 1 ) * h ) ;
54+ for ( let i = 0 ; i < screenHeightChars ; i ++ ) {
55+ for ( let j = 0 ; j < screenWidthChars ; j ++ ) {
56+
57+ ctx . fillText ( choose ( overlayChars ) , w * j , ( h ) * ( i + 1 ) )
6058 }
6159 }
62- } , 1000 / 5 )
60+ } , 1000 / 8 )
6361
6462function setOptimizedInterval ( element , render , tps ) {
6563 render ( )
You can’t perform that action at this time.
0 commit comments