Skip to content

Commit b6c2eaf

Browse files
committed
resolution fix mobile
1 parent bb8478d commit b6c2eaf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ let randomizeButton = document.getElementById('randomize');
2626

2727
const resetParamValues = () => {
2828
let scaleLen = .3+ Math.random()*0.5
29+
let winRatio = Math.min(window.innerWidth, window.innerHeight)/900;
2930
paramValues = {
30-
'lineWidth' : (5 + Math.random()*3)*(Math.min(window.innerWidth, window.innerHeight)/900)**0.7,
31+
'lineWidth' : (6 + Math.random()*3)*((winRatio**0.5)*(winRatio<1)+(winRatio**0.8)*(winRatio>=1)) ,
3132
'scaleFactorLen' : scaleLen,
3233
'scaleFactorWidth' : (0.3+ Math.random()*0.4)/((1+scaleLen)),
3334

0 commit comments

Comments
 (0)