forked from izu/student-web-if-development-kit
fix: improve RODA dosen cards on mobile
This commit is contained in:
@@ -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.');
|
||||
Reference in New Issue
Block a user