mirror of
https://github.com/dong-nz/cv.git
synced 2026-11-22 16:10:40 +07:00
fix(hero): single download CTA, no click flash, mobile lazer beam
One trigger at every width opens the language dialog: the details dropdown markup, its CSS, both chevron rules and the hero-download desktop/mobile variants are gone, and @media (max-width: 768px) lets the trigger fill the CTA column like the other two buttons. The trigger carries an open class so the :hover accent fill does not fire at the click instant behind the overlay, and the scrim is a plain colour mix instead of backdrop-filter: blur(4px), which used to repaint the page under the fading overlay. transition: all became explicit background/color transitions. The lazer split was geometric: inset: -200% resolved against the wrapper, so the rotating layer measured 1710x265 for the 342x53 mobile wrapper, and once its short half-side (132.5px) is narrower than the wrapper half-diagonal (173px) the layer stops covering the wrapper's own edges, cutting the beam in two for part of every cycle (14/72 angles). Both layers are now inset: 0 and the spin animates a registered @property --lazer-angle (0deg -> 360deg) instead of rotating a box: 1 lit segment at 72/72 angles on both 342x53 and 167x53, same 4s cycle, and the blurred glow layer shrinks to the wrapper box. Also carries the nav chrome this feature needs: .nav-resume, the borderless .nav-resume-trigger (border-color transparent at rest, hover and open, matching the home icon beside it while keeping the 44px target, hover fill and :focus-visible ring), and the 420px gap plus new 360px padding tightening so six controls fit a 320px viewport. AGENTS.md and docs/design/specs/v3/spec-v3-resume-redesign.md follow-ups 13-17 record all of it.
This commit is contained in:
1 parent
4f1d4ebe30
commit
affca525b4
3 files changed
+180
-81
No files matched your search
+166
-74
@@ -54,6 +54,13 @@
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* The bar's resume entry reuses the `.nav-control` chrome; the wrapper only has to sit in the
|
||||
brand row like the other items. Its class is also the hook that ties the trigger to the
|
||||
`#resume-modal-nav` dialog it expands. */
|
||||
.nav-resume {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.nav-menu {
|
||||
display: flex;
|
||||
gap: 32px;
|
||||
@@ -126,6 +133,18 @@
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* The resume entry keeps the `.nav-control` 44px target and its hover fill, but carries no
|
||||
outline: it sits in the brand group beside the borderless home icon, and a framed box there
|
||||
reads as a second frame next to the home glyph. `:focus-visible` above still rings it. */
|
||||
.nav-resume-trigger {
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
.nav-resume-trigger:hover,
|
||||
.nav-resume-trigger.open {
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
.mobile-menu-btn {
|
||||
display: none;
|
||||
background: none;
|
||||
@@ -312,16 +331,25 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* Four controls share the bar at ≤1024px. At 320px: hamburger 40 + 12 + home icon 44 + 44×3
|
||||
controls + 12×2 gaps = 252px inside 288px of content, so the row keeps 36px of slack — the
|
||||
wordmark's 8px brand-gap tightening is no longer needed. */
|
||||
/* Six controls share the bar at ≤1024px: hamburger, home, resume, then the three appearance
|
||||
controls. At 390px the old gaps leave the row flush (260px of controls + 48px of gaps inside
|
||||
358px of content), so the brand and action gaps both drop to 8px here: 292px used, 66px slack. */
|
||||
@media (max-width: 420px) {
|
||||
.nav-container {
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.nav-brand,
|
||||
.nav-actions {
|
||||
gap: 12px;
|
||||
gap: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 320px keeps every 44px target intact and pays for them out of the gutter instead: 12px padding
|
||||
leaves 296px of content for 260px of controls + 32px of gaps — 4px of slack. */
|
||||
@media (max-width: 360px) {
|
||||
.nav-container {
|
||||
padding: 0 12px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -951,8 +979,8 @@
|
||||
border-color: var(--border) !important;
|
||||
}
|
||||
|
||||
/* ===== Download Resume Dropdown ===== */
|
||||
.download-resume-dropdown {
|
||||
/* ===== Download Resume (one trigger, modal picker) ===== */
|
||||
.download-resume {
|
||||
position: relative;
|
||||
width: fit-content;
|
||||
}
|
||||
@@ -968,7 +996,7 @@
|
||||
border-radius: var(--radius-md);
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
transition: all var(--transition-fast);
|
||||
transition: background var(--transition-fast), color var(--transition-fast);
|
||||
border: none;
|
||||
background: transparent;
|
||||
width: 100%;
|
||||
@@ -977,71 +1005,146 @@
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.download-resume-summary::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.download-resume-summary:hover {
|
||||
border-color: var(--accent);
|
||||
background: var(--accent);
|
||||
color: var(--text-on-accent);
|
||||
}
|
||||
|
||||
.download-resume-summary.open {
|
||||
background: var(--accent);
|
||||
color: var(--text-on-accent);
|
||||
/* The dialog is the open state. The trigger keeps its resting colour while the modal is up:
|
||||
the pointer is still on it after the click, so without this the :hover accent fill lands at
|
||||
the instant of the click and reads as a colour flash behind the overlay. */
|
||||
.download-resume-summary.open,
|
||||
.download-resume-summary.open:hover {
|
||||
background: transparent;
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.download-resume-summary .chevron {
|
||||
margin-left: auto;
|
||||
transition: transform 0.2s;
|
||||
/* Touch devices keep :hover stuck after a tap, so the accent fill would sit on the trigger
|
||||
until the next tap somewhere else. */
|
||||
@media (hover: none) {
|
||||
.download-resume-summary:hover {
|
||||
background: transparent;
|
||||
color: var(--accent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.download-resume-dropdown .download-resume-options {
|
||||
display: none;
|
||||
/* Language picker — a dialog, not a dropdown: one trigger serves every width */
|
||||
.resume-modal-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 1100;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
padding: 24px;
|
||||
/* No backdrop-filter: the blur would apply at full strength on the first frame while the
|
||||
opacity is still animating, so the page behind jumps before the dialog arrives. */
|
||||
background: color-mix(in srgb, var(--bg-primary) 78%, transparent);
|
||||
}
|
||||
|
||||
.download-resume-dropdown .download-resume-options.open {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.download-resume-dropdown .download-resume-summary.open .chevron {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.download-resume-options {
|
||||
position: absolute;
|
||||
top: calc(100% + 4px);
|
||||
left: 0;
|
||||
width: fit-content;
|
||||
.resume-modal {
|
||||
width: min(420px, 100%);
|
||||
background: var(--bg-elevated);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 12px var(--shadow);
|
||||
z-index: 100;
|
||||
overflow: hidden;
|
||||
border-radius: var(--radius-lg);
|
||||
padding: 24px;
|
||||
box-shadow: 0 12px 32px var(--shadow);
|
||||
}
|
||||
|
||||
.download-resume-option {
|
||||
display: block;
|
||||
padding: 10px 20px;
|
||||
text-decoration: none;
|
||||
color: var(--text-primary);
|
||||
font-size: 14px;
|
||||
transition: background 0.15s, color 0.15s;
|
||||
.resume-modal:focus-visible {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: 4px;
|
||||
}
|
||||
|
||||
.download-resume-option:hover {
|
||||
background: var(--accent);
|
||||
color: var(--text-on-accent);
|
||||
.resume-modal-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
/* Shared wrapper for lazer + dropdown positioning context */
|
||||
.download-resume-shared-wrapper {
|
||||
position: relative;
|
||||
|
||||
.resume-modal-head h3 {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.resume-modal-close {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-md);
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
cursor: pointer;
|
||||
transition: border-color var(--transition-fast), color var(--transition-fast);
|
||||
}
|
||||
|
||||
.resume-modal-close:hover {
|
||||
border-color: var(--accent);
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.resume-modal-close:focus-visible {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.resume-modal-hint {
|
||||
margin-top: 4px;
|
||||
font-size: var(--text-meta);
|
||||
line-height: 1.5;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.resume-modal-options {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.resume-modal-option {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
padding: 14px 16px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-md);
|
||||
text-decoration: none;
|
||||
color: var(--text-primary);
|
||||
transition: border-color var(--transition-fast), background var(--transition-fast);
|
||||
}
|
||||
|
||||
.resume-modal-option:hover {
|
||||
border-color: var(--accent);
|
||||
background: var(--accent-tint);
|
||||
}
|
||||
|
||||
.resume-modal-option:focus-visible {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.resume-modal-option-label {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.resume-modal-option-file {
|
||||
font-size: 14px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
/* The spin animates the gradient angle, not a rotating box. A box rotated inside a wide, short
|
||||
wrapper stops covering the wrapper's own edges as soon as its short side is narrower than the
|
||||
wrapper is wide (inset -200% made the layer 1710x265 against a 342x53 wrapper), and the beam
|
||||
gets cut into two segments for part of every cycle. */
|
||||
@property --lazer-angle {
|
||||
syntax: '<angle>';
|
||||
inherits: false;
|
||||
initial-value: 0deg;
|
||||
}
|
||||
|
||||
/* ===== Download Resume Lazer Border ===== */
|
||||
@@ -1055,9 +1158,9 @@
|
||||
|
||||
.download-resume-lazer-border {
|
||||
position: absolute;
|
||||
inset: -200%;
|
||||
inset: 0;
|
||||
background: conic-gradient(
|
||||
from 0deg,
|
||||
from var(--lazer-angle, 0deg),
|
||||
transparent 60%,
|
||||
var(--accent) 80%,
|
||||
var(--accent-hover) 95%,
|
||||
@@ -1069,9 +1172,9 @@
|
||||
|
||||
.download-resume-lazer-glow {
|
||||
position: absolute;
|
||||
inset: -200%;
|
||||
inset: 0;
|
||||
background: conic-gradient(
|
||||
from 0deg,
|
||||
from var(--lazer-angle, 0deg),
|
||||
transparent 60%,
|
||||
var(--accent) 80%,
|
||||
var(--accent-hover) 95%,
|
||||
@@ -1092,8 +1195,8 @@
|
||||
}
|
||||
|
||||
@keyframes download-resume-lazer-spin {
|
||||
from { rotate: 0deg; }
|
||||
to { rotate: 360deg; }
|
||||
from { --lazer-angle: 0deg; }
|
||||
to { --lazer-angle: 360deg; }
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
@@ -1113,26 +1216,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Desktop: show dropdown, hide mobile buttons */
|
||||
.hero-download-desktop {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.hero-download-mobile {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Mobile: show 2 buttons, hide dropdown */
|
||||
/* Mobile: the single trigger fills the CTA column like the other two buttons */
|
||||
@media (max-width: 768px) {
|
||||
.hero-download-desktop {
|
||||
display: none;
|
||||
.hero-cta .download-resume,
|
||||
.hero-cta .download-resume-lazer-wrapper {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.hero-download-mobile {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
.hero-cta .download-resume-summary {
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user