mirror of
https://github.com/Spythere/spythere-portfolio.git
synced 2026-05-03 05:28:16 +00:00
gsap scroll events
This commit is contained in:
@@ -5,7 +5,6 @@ export const StyledAbout = styled.section`
|
|||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(2, 1fr);
|
grid-template-columns: repeat(2, 1fr);
|
||||||
gap: 3em;
|
gap: 3em;
|
||||||
margin-top: 100px;
|
|
||||||
|
|
||||||
img {
|
img {
|
||||||
border-radius: 1em;
|
border-radius: 1em;
|
||||||
|
|||||||
@@ -16,9 +16,7 @@ export const GlobalStyles = createGlobalStyle`
|
|||||||
scroll-behavior: smooth;
|
scroll-behavior: smooth;
|
||||||
}
|
}
|
||||||
|
|
||||||
* {
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@@ -62,44 +60,14 @@ export const GlobalStyles = createGlobalStyle`
|
|||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: white;
|
|
||||||
text-decoration: none;
|
|
||||||
|
|
||||||
transition: all 0.25s;
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: ${({ theme }) => theme.colors.accent};
|
color: ${({ theme }) => theme.colors.accent};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
img, svg {
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
button {
|
button {
|
||||||
font-family: ${({ theme }) => theme.fonts.primary};
|
font-family: ${({ theme }) => theme.fonts.primary};
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul {
|
|
||||||
list-style: none;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes typing {
|
|
||||||
to { left: 100% }
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes blinking {
|
|
||||||
0% { opacity: 0 }
|
|
||||||
50% { opacity: 1 }
|
|
||||||
100% { opacity: 0 }
|
|
||||||
}
|
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
* {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
list-style: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes typing {
|
||||||
|
to {
|
||||||
|
left: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes blinking {
|
||||||
|
0% {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
img,
|
||||||
|
svg {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: white;
|
||||||
|
text-decoration: none;
|
||||||
|
transition: all 0.25s;
|
||||||
|
}
|
||||||
|
|||||||
+5
-1
@@ -3,9 +3,13 @@ import ReactDOM from 'react-dom/client';
|
|||||||
import App from './App.tsx';
|
import App from './App.tsx';
|
||||||
import './index.scss';
|
import './index.scss';
|
||||||
|
|
||||||
|
import { gsap } from 'gsap';
|
||||||
|
import { ScrollTrigger } from 'gsap/ScrollTrigger';
|
||||||
|
|
||||||
|
gsap.registerPlugin(ScrollTrigger);
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById('root')!).render(
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<App />
|
<App />
|
||||||
</React.StrictMode>
|
</React.StrictMode>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,29 @@ import { StyledCursor } from '../components/styles/Cursor.styled';
|
|||||||
import { StyledSectionHeader } from '../components/styles/SectionHeader.styled';
|
import { StyledSectionHeader } from '../components/styles/SectionHeader.styled';
|
||||||
import { SiNestjs } from 'react-icons/si';
|
import { SiNestjs } from 'react-icons/si';
|
||||||
|
|
||||||
|
import { useGSAP } from '@gsap/react';
|
||||||
|
import { gsap } from 'gsap';
|
||||||
|
|
||||||
function AboutSection() {
|
function AboutSection() {
|
||||||
|
useGSAP(() => {
|
||||||
|
const tl = gsap.timeline({
|
||||||
|
scrollTrigger: {
|
||||||
|
trigger: '.about-grid',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
tl.from('.about-gif', { opacity: 0 });
|
||||||
|
tl.from('.about-content', { opacity: 0 });
|
||||||
|
tl.from('.stat-item', {
|
||||||
|
duration: 0.5,
|
||||||
|
ease: 'power1.in',
|
||||||
|
opacity: 0,
|
||||||
|
stagger: {
|
||||||
|
each: 0.5,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledAbout id="about">
|
<StyledAbout id="about">
|
||||||
<div className="about-grid">
|
<div className="about-grid">
|
||||||
|
|||||||
Reference in New Issue
Block a user