Skip to content

Commit 17ac48e

Browse files
committed
Corrige superposición de certificados en móvil
1 parent 72e9b90 commit 17ac48e

3 files changed

Lines changed: 62 additions & 4 deletions

File tree

‎css/xp-apps.css‎

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,13 +1012,17 @@
10121012
overflow-x: auto;
10131013
overflow-y: hidden;
10141014
scroll-snap-type: x proximity;
1015+
overscroll-behavior-x: contain;
10151016
}
10161017

10171018
.xp-certificate-item {
1018-
width: 214px;
1019-
min-width: 214px;
1019+
box-sizing: border-box;
1020+
width: clamp(232px, 76vw, 280px);
1021+
min-width: clamp(232px, 76vw, 280px);
1022+
height: 83px;
10201023
min-height: 83px;
10211024
grid-template-columns: 78px minmax(0, 1fr);
1025+
overflow: hidden;
10221026
scroll-snap-align: start;
10231027
}
10241028

@@ -1031,6 +1035,30 @@
10311035
height: 60px;
10321036
}
10331037

1038+
.xp-certificate-item-copy {
1039+
max-height: 69px;
1040+
display: grid;
1041+
grid-template-rows: minmax(0, auto) auto auto;
1042+
gap: 1px;
1043+
overflow: hidden;
1044+
}
1045+
1046+
.xp-certificate-item-copy strong {
1047+
display: -webkit-box;
1048+
margin-bottom: 1px;
1049+
overflow: hidden;
1050+
-webkit-box-orient: vertical;
1051+
-webkit-line-clamp: 2;
1052+
line-clamp: 2;
1053+
}
1054+
1055+
.xp-certificate-item-copy span,
1056+
.xp-certificate-item-copy time {
1057+
overflow: hidden;
1058+
text-overflow: ellipsis;
1059+
white-space: nowrap;
1060+
}
1061+
10341062
.xp-certificate-detail {
10351063
grid-template-rows: minmax(140px, 0.82fr) minmax(185px, 1.18fr);
10361064
}

‎index.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
<link rel="stylesheet" href="css/about-me.css">
143143
<link rel="stylesheet" href="css/contacto.css">
144144
<link rel="stylesheet" href="css/proyectos-explorer.css?v=zaratexp-20260712-i18n2">
145-
<link rel="stylesheet" href="css/xp-apps.css?v=zaratexp-20260820-mobile-home1">
145+
<link rel="stylesheet" href="css/xp-apps.css?v=zaratexp-20260820-mobile-certificates2">
146146
<link rel="stylesheet" href="css/clippy.css?v=zaratexp-20260712-clippy-mobile1">
147147
<link rel="stylesheet" href="css/crtEffect.css">
148148

‎scripts/smoke-playwright.mjs‎

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,27 +431,57 @@ async function exerciseCertificates(page) {
431431
await waitForWindowAnimation(page, 'certificates');
432432
const mobileRoot = appWindow.locator('[data-certificates-root]');
433433
await mobileRoot.locator('[data-certificate-preview]').waitFor({ state: 'visible' });
434+
await mobileRoot.locator('[data-certificate-filter="security"]').click();
435+
await mobileRoot.locator('[data-certificate-id="asis-security-defense"]').click();
436+
await page.waitForFunction(() => {
437+
const detail = document.querySelector('.window[data-window-id="certificates"] [data-certificate-detail]');
438+
return detail && detail.getAnimations({ subtree: true }).every((animation) => animation.playState === 'finished');
439+
});
434440
const mobile = await mobileRoot.evaluate((rootNode) => {
435441
const appRect = rootNode.getBoundingClientRect();
436442
const filters = rootNode.querySelector('.xp-certificate-filters');
443+
const list = rootNode.querySelector('.xp-certificate-list');
437444
const detail = rootNode.querySelector('[data-certificate-detail]');
438445
const preview = rootNode.querySelector('[data-certificate-preview]');
439446
const caption = rootNode.querySelector('.xp-certificate-preview figcaption');
440447
const actions = Array.from(rootNode.querySelectorAll('.xp-certificate-actions a:not([hidden])'));
448+
const visibleItems = Array.from(rootNode.querySelectorAll('[data-certificate-id]'))
449+
.filter((item) => getComputedStyle(item).display !== 'none');
441450
const previewRect = preview.getBoundingClientRect();
442451
const captionRect = caption.getBoundingClientRect();
443452
const detailRect = detail.getBoundingClientRect();
453+
const listRect = list.getBoundingClientRect();
454+
const cardsContained = visibleItems.every((item) => {
455+
const itemRect = item.getBoundingClientRect();
456+
const copyRect = item.querySelector('.xp-certificate-item-copy').getBoundingClientRect();
457+
return itemRect.top >= listRect.top - 1
458+
&& itemRect.bottom <= listRect.bottom + 1
459+
&& copyRect.top >= itemRect.top - 1
460+
&& copyRect.bottom <= itemRect.bottom + 1
461+
&& getComputedStyle(item).overflow === 'hidden';
462+
});
444463
return {
445464
noPageOverflow: document.documentElement.scrollWidth <= window.innerWidth + 1,
446465
appContained: appRect.left >= -1 && appRect.right <= window.innerWidth + 1,
447466
appRect: { left: appRect.left, right: appRect.right, width: appRect.width, viewport: window.innerWidth },
448467
filtersScrollable: filters.scrollWidth >= filters.clientWidth,
468+
securityCards: visibleItems.length,
469+
cardsContained,
470+
listSeparated: listRect.bottom <= detailRect.top + 1,
449471
previewContained: previewRect.left >= detailRect.left - 1 && previewRect.right <= detailRect.right + 1,
450472
captionSeparated: previewRect.bottom <= captionRect.top + 0.5 && captionRect.height >= 23.5,
451473
actionsReachable: actions.every((action) => action.getBoundingClientRect().height >= 39.5)
452474
};
453475
});
454-
ensure(mobile.noPageOverflow && mobile.appContained && mobile.filtersScrollable && mobile.previewContained && mobile.captionSeparated && mobile.actionsReachable, `Certificados no se adaptó al viewport móvil (${JSON.stringify(mobile)})`);
476+
ensure(mobile.noPageOverflow
477+
&& mobile.appContained
478+
&& mobile.filtersScrollable
479+
&& mobile.securityCards === 2
480+
&& mobile.cardsContained
481+
&& mobile.listSeparated
482+
&& mobile.previewContained
483+
&& mobile.captionSeparated
484+
&& mobile.actionsReachable, `Certificados no se adaptó al viewport móvil (${JSON.stringify(mobile)})`);
455485

456486
await page.evaluate(() => window.zarateXP.windowManager.closeWindow('certificates'));
457487
await appWindow.waitFor({ state: 'detached' });

0 commit comments

Comments
 (0)