fix: improve RODA dosen cards on mobile

This commit is contained in:
Raditya_Indra_Putranto
2026-06-04 18:19:11 +07:00
parent 48ff6250ab
commit 6f1e7d744b
3 changed files with 36 additions and 4 deletions
+31
View File
@@ -0,0 +1,31 @@
import { readFileSync } from 'node:fs';
const rodaPage = readFileSync('groups/RODA/index.html', 'utf8');
const gridMatch = rodaPage.match(/<div id="dosen-grid" class="([^"]+)"/);
if (!gridMatch) {
throw new Error('Missing dosen-grid container.');
}
const gridClasses = gridMatch[1].split(/\s+/);
if (gridClasses.includes('sm:grid-cols-2')) {
throw new Error('Dosen cards must stay single-column at the 390px mobile breakpoint.');
}
if (!gridClasses.includes('grid-cols-1') || !gridClasses.includes('md:grid-cols-2')) {
throw new Error('Dosen cards must use one mobile column and switch to two columns at md.');
}
const viewMembersMatch = rodaPage.match(/<span class="([^"]+)"[^>]*>\s*\$\{translations\[currentLang\]\.viewMembers\}/);
if (!viewMembersMatch) {
throw new Error('Missing view members link in dosen card template.');
}
if (viewMembersMatch[1].split(/\s+/).includes('whitespace-nowrap')) {
throw new Error('View members link must be allowed to wrap instead of clipping on narrow cards.');
}
console.log('Mobile layout classes keep dosen cards readable on phone viewports.');