Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 64 additions & 38 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { OverlayScrollbars } from 'overlayscrollbars';
import gsap from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';
gsap.registerPlugin(ScrollTrigger);
import { ArrowDown, ArrowUpRight, X } from 'lucide-react';
import { ArrowDown, ArrowUp, ArrowUpRight, X } from 'lucide-react';

const linkedin = 'https://www.linkedin.com/in/varellio-louis-tinangon-4172702a0/';
const socials = [
Expand Down Expand Up @@ -53,9 +53,9 @@ const momentColumns = [
function Marquee() {
return <div className="hero-marquee" aria-hidden="true">{marqueeWords.map((word, i) => <div className={`marquee-row marquee-row-${i + 1}`} key={word}><div className="marquee-track"><span>{word} · {word} · </span><span>{word} · {word} · </span></div></div>)}</div>;
}
function PhotoTiles({ seed = 0, className = '' }) {
return <span className={`nav-photo-tiles ${className}`} aria-hidden="true">{Array.from({ length: 36 }, (_, tile) => <span key={tile} style={{ '--tile-delay': `${((tile * 17 + seed * 7) % 36) * 16}ms` }} />)}</span>;
}
function PhotoTiles({ seed = 0, className = '' }) {
return <span className={`nav-photo-tiles ${className}`} aria-hidden="true">{Array.from({ length: 36 }, (_, tile) => <span key={tile} style={{ '--tile-delay': `${((tile * 17 + seed * 7) % 36) * 16}ms` }} />)}</span>;
}
function AnimatedLabel({ text }) {
return <span className="button-roll"><span className="button-roll-sr">{text}</span><span className="button-roll-letters" aria-hidden="true">{Array.from(text, (letter, index) => <span className="button-roll-char" key={index} data-char={letter === ' ' ? '\u00a0' : letter} style={{ '--roll-index': Math.min(index, 18) }}>{letter === ' ' ? '\u00a0' : letter}</span>)}</span></span>;
}
Expand All @@ -64,8 +64,8 @@ export default function App() {
const reducedMotion = useReducedMotion();
const [intro, setIntro] = useState(() => !window.matchMedia('(prefers-reduced-motion: reduce)').matches);
const [menuOpen, setMenuOpen] = useState(false);
const [menuClosing, setMenuClosing] = useState(false);
const [curtainClosing, setCurtainClosing] = useState(false);
const [menuClosing, setMenuClosing] = useState(false);
const [curtainClosing, setCurtainClosing] = useState(false);
const curtainTimer = useRef(null);
const menuCloseTimer = useRef(null);
const [activeProject, setActiveProject] = useState(null);
Expand Down Expand Up @@ -165,24 +165,24 @@ export default function App() {
ScrollTrigger.clearScrollMemory('manual');
ScrollTrigger.update();
}, [intro]);
const closeMenu = useCallback(() => {
if (menuCloseTimer.current !== null) return;
if (reducedMotion || window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
setMenuOpen(false);
return;
}
setMenuClosing(true);
menuCloseTimer.current = window.setTimeout(() => {
setCurtainClosing(true);
curtainTimer.current = window.setTimeout(() => setCurtainClosing(false), 900);
setMenuOpen(false);
setMenuClosing(false);
menuCloseTimer.current = null;
}, 850);
}, [reducedMotion]);
useEffect(() => () => { window.clearTimeout(menuCloseTimer.current); window.clearTimeout(curtainTimer.current); }, []);
useEffect(() => {
if (!menuOpen) return;
const closeMenu = useCallback(() => {
if (menuCloseTimer.current !== null) return;
if (reducedMotion || window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
setMenuOpen(false);
return;
}
setMenuClosing(true);
menuCloseTimer.current = window.setTimeout(() => {
setCurtainClosing(true);
curtainTimer.current = window.setTimeout(() => setCurtainClosing(false), 900);
setMenuOpen(false);
setMenuClosing(false);
menuCloseTimer.current = null;
}, 850);
}, [reducedMotion]);
useEffect(() => () => { window.clearTimeout(menuCloseTimer.current); window.clearTimeout(curtainTimer.current); }, []);
useEffect(() => {
if (!menuOpen) return;
menuRef.current?.focus({ preventScroll: true });
const handleKey = event => {
if (event.key === 'Escape') { closeMenu(); window.requestAnimationFrame(() => menuRef.current?.focus({ preventScroll: true })); return; }
Expand Down Expand Up @@ -221,19 +221,19 @@ export default function App() {
});
return () => media.revert();
}, [menuOpen, reducedMotion]);
useEffect(() => {
if (reducedMotion || window.matchMedia('(prefers-reduced-motion: reduce)').matches || !('IntersectionObserver' in window)) return;
const photos = document.querySelectorAll('.photo-filled, .project-art.has-image');
const observer = new IntersectionObserver(entries => {
for (const entry of entries) {
if (!entry.isIntersecting) continue;
entry.target.classList.add('tile-revealed');
observer.unobserve(entry.target);
}
}, { threshold: 0.1 });
photos.forEach(photo => { photo.classList.add('tile-reveal-enabled'); observer.observe(photo); });
return () => { observer.disconnect(); photos.forEach(photo => photo.classList.remove('tile-reveal-enabled', 'tile-revealed')); };
}, [reducedMotion]);
useEffect(() => {
if (reducedMotion || window.matchMedia('(prefers-reduced-motion: reduce)').matches || !('IntersectionObserver' in window)) return;
const photos = document.querySelectorAll('.photo-filled, .project-art.has-image');
const observer = new IntersectionObserver(entries => {
for (const entry of entries) {
if (!entry.isIntersecting) continue;
entry.target.classList.add('tile-revealed');
observer.unobserve(entry.target);
}
}, { threshold: 0.1 });
photos.forEach(photo => { photo.classList.add('tile-reveal-enabled'); observer.observe(photo); });
return () => { observer.disconnect(); photos.forEach(photo => photo.classList.remove('tile-reveal-enabled', 'tile-revealed')); };
}, [reducedMotion]);
useEffect(() => { if (activeProject) dialogRef.current?.showModal(); }, [activeProject]);
useEffect(() => {
if (reducedMotion || window.matchMedia('(prefers-reduced-motion: reduce)').matches || !('IntersectionObserver' in window) || !Element.prototype.animate) return;
Expand Down Expand Up @@ -285,6 +285,32 @@ export default function App() {
return () => media.revert();
}, [reducedMotion]);

useEffect(() => {
if (reducedMotion || window.matchMedia('(prefers-reduced-motion: reduce)').matches) return;
const selector = '.button, .text-link, .underlined-link, .linkedin-link, .dialog-close, .back-to-top';
const press = (target, x, y) => {
const rect = target.getBoundingClientRect();
target.style.setProperty('--press-x', `${((x - rect.left) / rect.width) * 100}%`);
target.style.setProperty('--press-y', `${((y - rect.top) / rect.height) * 100}%`);
target.classList.remove('is-pressed');
void target.offsetWidth;
target.classList.add('is-pressed');
};
const onPointerDown = event => {
const target = event.target.closest?.(selector);
if (target) press(target, event.clientX, event.clientY);
};
const onKeyDown = event => {
if (event.key !== 'Enter' && event.key !== ' ') return;
const target = event.target.closest?.(selector);
if (!target) return;
const rect = target.getBoundingClientRect();
press(target, rect.left + rect.width / 2, rect.top + rect.height / 2);
};
document.addEventListener('pointerdown', onPointerDown);
document.addEventListener('keydown', onKeyDown);
return () => { document.removeEventListener('pointerdown', onPointerDown); document.removeEventListener('keydown', onKeyDown); };
}, [reducedMotion]);
const closeProject = () => { dialogRef.current?.close(); setActiveProject(null); };
const navigateFromMenu = (event, target) => { event.preventDefault(); if (menuCloseTimer.current !== null) return; pendingNavigation.current = target; closeMenu(); };
return <>
Expand Down Expand Up @@ -322,7 +348,7 @@ export default function App() {
<section id="work" className="work-section section-wrap"><div className="section-heading"><div><div className="section-index">04 / Explorations</div><h2>Selected <span>possibilities.</span></h2></div><p>A space for ideas and what comes next.</p></div><div className="project-grid">{concepts.map(project => { const Card = project.href ? 'a' : 'button'; return <Card key={project.number} className="project-card" {...(project.href ? { href: project.href, target: '_blank', rel: 'noopener noreferrer', 'aria-label': 'Watch Godspeed on Instagram in a new tab' } : { type: 'button', onClick: () => setActiveProject(project), 'aria-label': `View concept placeholder ${project.number}: ${project.title}` })}><div className={`project-art ${project.style}${project.image ? ' has-image' : ''}`}>{project.image ? <><img src={project.image} alt="" loading="lazy" /><PhotoTiles className="scroll-photo-tiles" /></> : <><span>EXPLORATION {project.number}</span><span className="concept-symbol" aria-hidden="true">{project.style === 'orbit' ? '◉' : project.style === 'type' ? '↗' : '✳'}</span><span className="placeholder-label">CONCEPT / PLACEHOLDER</span></>}</div><div className="project-info"><span>{project.href ? 'Graduation Film, Film Editor' : 'Concept / Placeholder'}</span><h3 className={project.href ? 'project-title-reveal' : undefined}>{project.title}</h3><p><AnimatedLabel text={project.href ? 'Watch on Instagram' : 'Explore the idea'} /> <ArrowUpRight size={15} /></p></div></Card>; })}</div></section>
<section id="contact" className="contact-section section-wrap"><div className="contact-copy"><div className="section-index">05 / Contact</div><h2>Let’s stay<br /><span>connected.</span></h2><p>Find me online and let’s start a conversation.</p></div><div className="contact-socials" role="group" aria-label="Social media profiles">{socials.map(social => <a className="contact-social" key={social.name} href={social.href} target="_blank" rel="noreferrer"><span className="contact-social-icon"><img src={`/social/${social.icon}.svg`} alt="" width="24" height="24" loading="lazy" /></span><span className="contact-social-label"><strong><AnimatedLabel text={social.name} /></strong><small>{social.handle}</small></span><ArrowUpRight className="contact-social-arrow" size={20} aria-hidden="true" /></a>)}</div></section>
</main>
<footer className="site-footer section-wrap" inert={menuOpen}><span>© {new Date().getFullYear()} Varellio Louis Tinangon</span><a href="#home"><AnimatedLabel text="Back to top ↑" /></a></footer>
<footer className="site-footer section-wrap" inert={menuOpen}><span>© {new Date().getFullYear()} Varellio Louis Tinangon</span><a href="#home" className="back-to-top"><AnimatedLabel text="Back to top" /><ArrowUp size={16} className="back-to-top-arrow" aria-hidden="true" /></a></footer>
<dialog data-lenis-prevent ref={dialogRef} onCancel={closeProject} onClick={e => { if (e.target === e.currentTarget) closeProject(); }} className="project-dialog" aria-labelledby="project-title">{activeProject && <><button className="dialog-close" onClick={closeProject} aria-label="Close project"><X /></button><div className="eyebrow">CONCEPT {activeProject.number} / PLACEHOLDER</div><h2 id="project-title">{activeProject.title}</h2><p>{activeProject.description}</p><p>This is sample portfolio content; no completed project, client relationship, or result is claimed.</p><button className="button button-dark" onClick={closeProject}><AnimatedLabel text="Back to exploring" /></button></>}</dialog>
</>;
}
Expand Down
3 changes: 2 additions & 1 deletion src/InterestOverlap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ export default function InterestOverlap() {
const [hovered, setHovered] = useState(false);
const [expanded, setExpanded] = useState(false);
const open = hovered || expanded;
const reducedMotion = typeof window !== 'undefined' && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
return <div className="interest-overlap-wrap">
<p>Areas of interest</p>
<button type="button" className="interest-overlap" aria-label="Expand or collapse interest icons" aria-pressed={expanded} onClick={() => setExpanded(value => !value)} onMouseEnter={() => setHovered(true)} onMouseLeave={() => setHovered(false)} onFocus={() => setHovered(true)} onBlur={() => setHovered(false)}>
{icons.map((Icon, index) => <span className="interest-overlap-icon" key={index} style={{ transform: `translateX(${overlapOffset(index, open)}px)` }}><Icon size={21} aria-hidden="true" /></span>)}
{icons.map((Icon, index) => <span className="interest-overlap-icon" key={index} style={{ transform: `translate(${overlapOffset(index, open)}px, ${open && !reducedMotion ? (index % 2 === 0 ? -3 : 3) : 0}px)` }}><Icon size={21} aria-hidden="true" /></span>)}
</button>
<small>Technology · Digital transformation · Entrepreneur · Creative media</small>
</div>;
Expand Down
18 changes: 17 additions & 1 deletion src/styles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading