Skip to content

Commit 20c29b5

Browse files
committed
refactor(index.html): update title and adjust layout styles
- Changed the title to "Galactic Odyssey MPV2 - Even Row Unified Engine". - Adjusted padding and font sizes for better visual consistency. - Refactored scrolling logic to improve performance and readability. - Implemented even row height distribution for grid layout.
1 parent bd0022f commit 20c29b5

1 file changed

Lines changed: 17 additions & 12 deletions

File tree

index.html

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
6-
<title>Galactic Odyssey MPV2 - Unified Engine</title>
6+
<title>Galactic Odyssey MPV2 - Even Row Unified Engine</title>
77
<link rel="preconnect" href="https://fonts.googleapis.com" />
88
<link
99
href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;500;700;900&display=swap"
@@ -271,7 +271,6 @@
271271
background: var(--cell-bg);
272272
position: relative;
273273
box-shadow: inset 0 0 0 0.5px var(--border);
274-
min-height: 60px;
275274
display: flex;
276275
flex-direction: column;
277276
transition: background 0.4s ease;
@@ -331,19 +330,19 @@
331330
flex-direction: column;
332331
justify-content: space-between;
333332
align-items: center;
334-
padding: 12px 4px;
333+
padding: 8px 4px;
335334
z-index: 2;
336335
pointer-events: none;
337336
}
338337
.info-meta {
339-
font-size: clamp(7px, 0.9dvh, 8px);
338+
font-size: clamp(6px, 0.8dvh, 8px);
340339
text-transform: uppercase;
341340
font-weight: 600;
342341
color: var(--text-muted);
343342
letter-spacing: 0.1em;
344343
}
345344
.date-num {
346-
font-size: clamp(18px, 3dvh, 26px);
345+
font-size: clamp(14px, 2.5dvh, 22px);
347346
font-weight: 300;
348347
line-height: 1;
349348
color: var(--text-main);
@@ -789,6 +788,7 @@
789788
const vw = window.innerWidth,
790789
vh = window.innerHeight;
791790
let cols, gO;
791+
792792
if (this.#isRandomMode && vw >= 600) {
793793
cols = Math.ceil(Math.sqrt(365 * (vw / vh)));
794794
gO = Math.floor(jan1.getTime() / 86400000) % cols;
@@ -797,15 +797,16 @@
797797
gO = (jan1.getDay() + 6) % 7;
798798
}
799799
const rows = Math.ceil((daysInYear + gO) / cols);
800-
if (vh / rows < 60) block.classList.add('is-scrolling');
800+
const isSc = vh / rows < 60;
801+
if (isSc) block.classList.add('is-scrolling');
801802

802803
const itD = new Date(year, 0, 1 - gO);
803804
const tS = this.#today.toDateString();
804805

805806
const fragment = document.createDocumentFragment();
806807
const container = document.createElement('div');
807808
container.className = 'grid-container';
808-
container.style.overflowY = block.classList.contains('is-scrolling') ? 'auto' : 'hidden';
809+
container.style.overflowY = isSc ? 'auto' : 'hidden';
809810

810811
const wm = document.createElement('div');
811812
wm.className = 'watermark-embedded';
@@ -814,8 +815,10 @@
814815

815816
const grid = document.createElement('div');
816817
grid.className = 'grid-layer';
818+
// Perubahan Utama: Menggunakan 1fr untuk baris agar tinggi terbagi rata (Even Rows)
817819
grid.style.gridTemplateColumns = `repeat(${cols}, 1fr)`;
818-
grid.style.height = block.classList.contains('is-scrolling') ? 'auto' : '100%';
820+
grid.style.gridTemplateRows = isSc ? `repeat(${rows}, minmax(60px, 1fr))` : `repeat(${rows}, 1fr)`;
821+
grid.style.height = isSc ? 'auto' : '100%';
819822

820823
for (let s = 0; s < cols * rows; s++) {
821824
const isM = itD.getFullYear() === year,
@@ -829,11 +832,13 @@
829832
} ${isM && (dY === 0 || dY === 6) ? 'weekend' : ''} ${isM && dY === 1 ? 'week-start' : ''}`;
830833

831834
const showMonth = isM && (dD === 1 || s === gO);
832-
cell.innerHTML = `<div class="cell-content"><span class="info-meta ${dD === 1 && isM ? 'top-label' : ''}">${
835+
cell.innerHTML = `<div class="cell-content">
836+
<span class="info-meta ${dD === 1 && isM ? 'top-label' : ''}">${
833837
showMonth ? this.#months[dM] : ''
834-
}</span><span class="date-num">${dD}</span><span class="info-meta">${
835-
isM ? this.#days[dY] : ''
836-
}</span></div>`;
838+
}</span>
839+
<span class="date-num">${dD}</span>
840+
<span class="info-meta">${isM ? this.#days[dY] : ''}</span>
841+
</div>`;
837842
grid.append(cell);
838843
itD.setDate(dD + 1);
839844
}

0 commit comments

Comments
 (0)