增加手机自适应
This commit is contained in:
@@ -550,7 +550,8 @@ function initMatrixRain() {
|
||||
function resize() {
|
||||
w = canvas.width = window.innerWidth;
|
||||
h = canvas.height = window.innerHeight;
|
||||
const colCount = Math.min(48, Math.ceil(w / fontSize));
|
||||
const maxCols = w < 640 ? 22 : 48;
|
||||
const colCount = Math.min(maxCols, Math.ceil(w / fontSize));
|
||||
columns = Array.from({ length: colCount }, () => ({
|
||||
y: Math.random() * h,
|
||||
speed: 0.8 + Math.random() * 2.2,
|
||||
|
||||
Reference in New Issue
Block a user