Skip to content

Commit 1745692

Browse files
committed
Add mobile column adjustment for improved layout in secrets.js
- Enhanced the setup function to include an additional column for mobile devices, ensuring better coverage and visibility on smaller screens. - This change complements previous mobile lyric display functionality, further optimizing the user experience across different devices.
1 parent 8ebe500 commit 1745692

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

js/secrets.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,11 @@ function setup() {
306306
var rows = Math.floor(height / svgSize) + 1.5; // Add 1.5 rows: 1 full + 0.5 for 1/4 cutoff
307307
rows = Math.ceil(rows); // Round up to ensure we have enough rows
308308
var cols = Math.floor(width / svgSize) + 1; // Add extra column for better coverage
309+
310+
// Add one more column for mobile devices
311+
if(isMobile && !isOtherMediaQuery) {
312+
cols += 1;
313+
}
309314
var radius = Math.floor(Math.max(width, height) / Math.max(rows, cols)) / 2;
310315

311316
shapes = makeFlowers(radius);

0 commit comments

Comments
 (0)