mirror of
https://github.com/dong-nz/cv.git
synced 2026-11-23 00:20:40 +07:00
feat: add lazer border effect to download resume buttons
- Add rotating conic gradient border animation using pure CSS - Apply to both Hero section dropdown and Contact section dropdown - Shared wrapper for proper positioning context - Flex layout for correct height calculation - Respects prefers-reduced-motion
This commit is contained in:
1 parent
f1d249061e
commit
21311d311d
3 files changed
+139
-57
No files matched your search
+70
-4
@@ -691,7 +691,7 @@
|
||||
/* ===== Download Resume Dropdown ===== */
|
||||
.download-resume-dropdown {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
.download-resume-summary {
|
||||
@@ -706,8 +706,8 @@
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
transition: all var(--transition-fast);
|
||||
border: 1px solid var(--border);
|
||||
background: transparent;
|
||||
border: none;
|
||||
width: 100%;
|
||||
color: var(--accent);
|
||||
list-style: none;
|
||||
user-select: none;
|
||||
@@ -745,7 +745,7 @@
|
||||
position: absolute;
|
||||
top: calc(100% + 4px);
|
||||
left: 0;
|
||||
width: 100%;
|
||||
width: fit-content;
|
||||
background: var(--bg-surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
@@ -767,6 +767,72 @@
|
||||
background: var(--accent);
|
||||
color: #fff;
|
||||
}
|
||||
/* Shared wrapper for lazer + dropdown positioning context */
|
||||
.download-resume-shared-wrapper {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
/* ===== Download Resume Lazer Border ===== */
|
||||
.download-resume-lazer-wrapper {
|
||||
position: relative;
|
||||
padding: 2px;
|
||||
width: fit-content;
|
||||
overflow: hidden;
|
||||
border-radius: calc(var(--radius-md) + 2px);
|
||||
}
|
||||
|
||||
.download-resume-lazer-border {
|
||||
position: absolute;
|
||||
inset: -200%;
|
||||
background: conic-gradient(
|
||||
from 0deg,
|
||||
transparent 60%,
|
||||
var(--accent) 80%,
|
||||
var(--accent-hover) 95%,
|
||||
transparent 100%
|
||||
);
|
||||
animation: download-resume-lazer-spin 4s linear infinite;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.download-resume-lazer-glow {
|
||||
position: absolute;
|
||||
inset: -200%;
|
||||
background: conic-gradient(
|
||||
from 0deg,
|
||||
transparent 60%,
|
||||
var(--accent) 80%,
|
||||
var(--accent-hover) 95%,
|
||||
transparent 100%
|
||||
);
|
||||
animation: download-resume-lazer-spin 4s linear infinite;
|
||||
pointer-events: none;
|
||||
filter: blur(12px);
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
.download-resume-lazer-inner {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
background: var(--bg-surface);
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
|
||||
@keyframes download-resume-lazer-spin {
|
||||
from { rotate: 0deg; }
|
||||
to { rotate: 360deg; }
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.download-resume-lazer-border,
|
||||
.download-resume-lazer-glow {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Desktop: show dropdown, hide mobile buttons */
|
||||
|
||||
@@ -56,31 +56,39 @@ function DownloadDropdown() {
|
||||
|
||||
return (
|
||||
<div ref={ref} className="download-resume-dropdown">
|
||||
<button
|
||||
className={`download-resume-summary ${open ? 'open' : ''}`}
|
||||
onClick={() => setOpen(!open)}
|
||||
type="button"
|
||||
>
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" width="20" height="20">
|
||||
<path d="M12 3v10m0 0l-3-3m3 3l3-3" />
|
||||
<path d="M3 17h18" />
|
||||
</svg>
|
||||
<span>Download Resume</span>
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" width="16" height="16" className="chevron">
|
||||
<polyline points="6 9 12 15 18 9" />
|
||||
</svg>
|
||||
</button>
|
||||
<div className={`download-resume-options ${open ? 'open' : ''}`}>
|
||||
{resumeLanguages.map(lang => (
|
||||
<a
|
||||
key={lang}
|
||||
href={resumeUrlFor(lang)}
|
||||
download
|
||||
className="download-resume-option"
|
||||
>
|
||||
{langLabels[lang]}
|
||||
</a>
|
||||
))}
|
||||
<div className="download-resume-shared-wrapper">
|
||||
<div className="download-resume-lazer-wrapper">
|
||||
<div className="download-resume-lazer-border" />
|
||||
<div className="download-resume-lazer-glow" />
|
||||
<div className="download-resume-lazer-inner">
|
||||
<button
|
||||
className={`download-resume-summary ${open ? 'open' : ''}`}
|
||||
onClick={() => setOpen(!open)}
|
||||
type="button"
|
||||
>
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" width="20" height="20">
|
||||
<path d="M12 3v10m0 0l-3-3m3 3l3-3" />
|
||||
<path d="M3 17h18" />
|
||||
</svg>
|
||||
<span>Download Resume</span>
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" width="16" height="16" className="chevron">
|
||||
<polyline points="6 9 12 15 18 9" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div className={`download-resume-options ${open ? 'open' : ''}`}>
|
||||
{resumeLanguages.map(lang => (
|
||||
<a
|
||||
key={lang}
|
||||
href={resumeUrlFor(lang)}
|
||||
download
|
||||
className="download-resume-option"
|
||||
>
|
||||
{langLabels[lang]}
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -5,8 +5,8 @@ import { resumeAvailable, resumeLanguages, resumeUrlFor } from "@/data/resume"
|
||||
import type { Language } from '@/types'
|
||||
|
||||
const langLabels: Record<Language, string> = {
|
||||
en: 'EN',
|
||||
vi: 'VI',
|
||||
en: 'English',
|
||||
vi: 'Tiếng Việt',
|
||||
}
|
||||
function HeroDownloadDropdown() {
|
||||
const [open, setOpen] = useState(false)
|
||||
@@ -29,32 +29,40 @@ function HeroDownloadDropdown() {
|
||||
|
||||
return (
|
||||
<div ref={ref} className="download-resume-dropdown hero-download-dropdown">
|
||||
<button
|
||||
className={`download-resume-summary hero-download-summary ${open ? 'open' : ''}`}
|
||||
onClick={() => setOpen(!open)}
|
||||
type="button"
|
||||
>
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" width="18" height="18">
|
||||
<path d="M12 3v10m0 0l-3-3m3 3l3-3" />
|
||||
<path d="M3 17h18" />
|
||||
</svg>
|
||||
<span>Download Resume</span>
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" width="14" height="14" className="chevron">
|
||||
<polyline points="6 9 12 15 18 9" />
|
||||
</svg>
|
||||
</button>
|
||||
<div className={`download-resume-options ${open ? 'open' : ''}`}>
|
||||
{resumeLanguages.map(lang => (
|
||||
<a
|
||||
key={lang}
|
||||
href={resumeUrlFor(lang)}
|
||||
download
|
||||
target="_blank"
|
||||
className="download-resume-option"
|
||||
>
|
||||
{langLabels[lang]}
|
||||
</a>
|
||||
))}
|
||||
<div className="download-resume-shared-wrapper">
|
||||
<div className="download-resume-lazer-wrapper">
|
||||
<div className="download-resume-lazer-border" />
|
||||
<div className="download-resume-lazer-glow" />
|
||||
<div className="download-resume-lazer-inner">
|
||||
<button
|
||||
className={`download-resume-summary hero-download-summary ${open ? 'open' : ''}`}
|
||||
onClick={() => setOpen(!open)}
|
||||
type="button"
|
||||
>
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" width="18" height="18">
|
||||
<path d="M12 3v10m0 0l-3-3m3 3l3-3" />
|
||||
<path d="M3 17h18" />
|
||||
</svg>
|
||||
<span>Download Resume</span>
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" width="14" height="14" className="chevron">
|
||||
<polyline points="6 9 12 15 18 9" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div className={`download-resume-options ${open ? 'open' : ''}`}>
|
||||
{resumeLanguages.map(lang => (
|
||||
<a
|
||||
key={lang}
|
||||
href={resumeUrlFor(lang)}
|
||||
download
|
||||
target="_blank"
|
||||
className="download-resume-option"
|
||||
>
|
||||
{langLabels[lang]}
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user