File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -11,19 +11,25 @@ function setup() {
1111 var height = $ ( 'body' ) . height ( ) ;
1212 var width = $ ( 'body' ) . width ( ) ;
1313 var size = 150 ;
14- var padding = 20 ;
14+ var padding = 50 ;
15+ var rows = Math . floor ( height / size ) ;
16+ var cols = Math . floor ( width / size ) ;
17+ var radius = Math . floor ( Math . max ( width , height ) / Math . max ( rows - 1 , cols - 1 ) ) / 2 ;
1518
16- var isMobile = window . matchMedia ( "only screen and (max-width: 850px )" ) . matches ||
19+ var isMobile = window . matchMedia ( "only screen and (max-width: 450px )" ) . matches ||
1720 / 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 ) ;
1821 var isOtherMediaQuery = window . matchMedia ( "only screen and (min-width:1080px)" ) . matches ;
1922 if ( isMobile && ! isOtherMediaQuery ) {
20- size = 250 ;
21- padding = 40 ;
23+ size = 300 ;
24+ padding = 80 ;
25+ radius = Math . floor ( height / rows ) / 2 ;
2226 }
2327
24- var rows = Math . floor ( height / size ) ;
25- var cols = Math . floor ( width / size ) ;
26- var radius = Math . floor ( Math . max ( width , height ) / Math . max ( rows , cols ) ) / 2 ;
28+ console . log ( width ) ;
29+ console . log ( isMobile ) ;
30+ console . log ( rows ) ;
31+ console . log ( cols ) ;
32+ console . log ( radius ) ;
2733
2834 makeGrid ( rows , cols ) ;
2935 shapes = makeFlowers ( radius ) ;
You can’t perform that action at this time.
0 commit comments