File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,20 @@ var two = new Two({
55} ) . appendTo ( document . body ) ;
66document . body . style . background = 'black' ;
77
8- var rows = Math . floor ( two . height / 150 ) ;
9- var cols = Math . floor ( two . width / 150 ) ;
10- var radius = Math . floor ( Math . max ( two . width , two . height ) / Math . max ( rows , cols ) ) / 2 ;
8+
9+ var radius = 0 , rows = 0 , cols = 0 ;
10+ var isMobile = window . matchMedia ( "only screen and (max-width: 850px)" ) . matches ||
11+ / A n d r o i d | w e b O S | i P h o n e | i P a d | i P o d | B l a c k B e r r y | I E M o b i l e | O p e r a M i n i / i. test ( navigator . userAgent ) ;
12+ var isOtherMediaQuery = window . matchMedia ( "only screen and (min-width:1080px)" ) . matches ;
13+ if ( isMobile && ! isOtherMediaQuery ) {
14+ rows = Math . floor ( two . height / 200 ) ;
15+ cols = Math . floor ( two . width / 200 ) ;
16+ radius = Math . floor ( two . height / rows ) * .62 ;
17+ } else {
18+ rows = Math . floor ( two . height / 150 ) ;
19+ cols = Math . floor ( two . width / 150 ) ;
20+ radius = Math . floor ( Math . max ( two . width , two . height ) / Math . max ( rows , cols ) ) / 2 ;
21+ }
1122var shapes = makeFlowers ( ) ;
1223var container = two . makeGroup ( ) ;
1324
You can’t perform that action at this time.
0 commit comments