@@ -116,23 +116,25 @@ class TerminalBg {
116116 }
117117
118118 initLines ( ) {
119- const lineCount = Math . max ( 20 , Math . floor ( this . width / 80 ) )
119+ const lineCount = Math . max ( 15 , Math . floor ( this . width / 120 ) )
120+ const rowCount = Math . max ( 8 , Math . floor ( this . height / 100 ) )
120121 const texts = this . texts
121122 this . lines = [ ]
122123 const angle = Math . PI / 6
123- for ( let i = 0 ; i < lineCount ; i ++ ) {
124- const progress = i / lineCount
125- const startX = - this . width * 0.5 + progress * ( this . width * 1.5 )
126- const startY = - this . height * 0.3 + progress * ( this . height * 1.3 ) - Math . random ( ) * 150
127- this . lines . push ( {
128- x : startX ,
129- y : startY ,
130- angle,
131- speed : ( 0.3 + Math . random ( ) * 0.4 ) * this . speed ,
132- text : texts [ Math . floor ( Math . random ( ) * texts . length ) ] ,
133- opacity : 0.08 + Math . random ( ) * 0.1 ,
134- fontSize : this . fontSize + Math . floor ( Math . random ( ) * 6 )
135- } )
124+ for ( let row = 0 ; row < rowCount ; row ++ ) {
125+ for ( let col = 0 ; col < lineCount ; col ++ ) {
126+ const startX = - this . width * 0.3 + col * ( this . width * 1.6 / lineCount ) + Math . random ( ) * 30
127+ const startY = - this . height * 0.3 + row * ( this . height * 1.6 / rowCount ) + Math . random ( ) * 30
128+ this . lines . push ( {
129+ x : startX ,
130+ y : startY ,
131+ angle,
132+ speed : ( 0.3 + Math . random ( ) * 0.4 ) * this . speed ,
133+ text : texts [ Math . floor ( Math . random ( ) * texts . length ) ] ,
134+ opacity : 0.08 + Math . random ( ) * 0.1 ,
135+ fontSize : this . fontSize + Math . floor ( Math . random ( ) * 6 )
136+ } )
137+ }
136138 }
137139 }
138140
0 commit comments