Commit ce17ed16 authored by HungTQ's avatar HungTQ

fix(ui): restore cv preview and scroll reveal

parent d31f77fc
...@@ -387,7 +387,10 @@ h3 { ...@@ -387,7 +387,10 @@ h3 {
.phone-frame img { .phone-frame img {
display: block; display: block;
filter: saturate(1.02) contrast(1.07); filter: saturate(1.02) contrast(1.07);
height: auto;
position: relative;
width: 100%; width: 100%;
z-index: 1;
} }
.floating-note { .floating-note {
...@@ -772,10 +775,19 @@ footer { ...@@ -772,10 +775,19 @@ footer {
} }
.reveal { .reveal {
animation: revealIn 760ms cubic-bezier(0.2, 0.8, 0.2, 1) var(--delay, 0ms) both; opacity: 1;
transform: none;
} }
.reveal.is-visible { .has-reveal .reveal {
opacity: 0;
transform: translateY(30px);
transition:
opacity 760ms cubic-bezier(0.2, 0.8, 0.2, 1) var(--delay, 0ms),
transform 760ms cubic-bezier(0.2, 0.8, 0.2, 1) var(--delay, 0ms);
}
.has-reveal .reveal.is-visible {
opacity: 1; opacity: 1;
transform: translateY(0); transform: translateY(0);
} }
...@@ -939,7 +951,6 @@ footer { ...@@ -939,7 +951,6 @@ footer {
} }
.reveal { .reveal {
animation: none !important;
opacity: 1; opacity: 1;
transform: none; transform: none;
} }
......
...@@ -116,6 +116,7 @@ function App() { ...@@ -116,6 +116,7 @@ function App() {
) )
useEffect(() => { useEffect(() => {
document.documentElement.classList.add('has-reveal')
const revealItems = document.querySelectorAll<HTMLElement>('.reveal') const revealItems = document.querySelectorAll<HTMLElement>('.reveal')
const observer = new IntersectionObserver( const observer = new IntersectionObserver(
(entries) => { (entries) => {
...@@ -130,7 +131,10 @@ function App() { ...@@ -130,7 +131,10 @@ function App() {
) )
revealItems.forEach((item) => observer.observe(item)) revealItems.forEach((item) => observer.observe(item))
return () => observer.disconnect() return () => {
observer.disconnect()
document.documentElement.classList.remove('has-reveal')
}
}, []) }, [])
function handleAsk(nextQuestion = question) { function handleAsk(nextQuestion = question) {
...@@ -196,7 +200,15 @@ function App() { ...@@ -196,7 +200,15 @@ function App() {
<div className="phone-frame"> <div className="phone-frame">
<div className="phone-speaker" /> <div className="phone-speaker" />
<div className="screen-scan" aria-hidden="true" /> <div className="screen-scan" aria-hidden="true" />
<img src="/cv-preview.png" alt="Tran Quang Hung CV preview" /> <img
src="/cv-preview.png?v=2"
alt="Tran Quang Hung CV preview"
width="894"
height="1264"
loading="eager"
decoding="sync"
fetchPriority="high"
/>
</div> </div>
<div className="floating-note"> <div className="floating-note">
<Sparkles size={18} /> <Sparkles size={18} />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment