Skip to content

Commit

Permalink
Merge pull request #41 from gisachris/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
gisachris authored Nov 14, 2023
2 parents 7f46415 + 26c0d03 commit 1f746ca
Show file tree
Hide file tree
Showing 14 changed files with 488 additions and 7 deletions.
75 changes: 75 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"dependencies": {
"@emailjs/browser": "^3.11.0",
"framer-motion": "^10.16.4",
"nuka-carousel": "^6.0.3",
"prop-types": "^15.8.1",
"react": "^18.2.0",
Expand Down
5 changes: 4 additions & 1 deletion src/components/home.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Link } from 'react-scroll';
import AnimatedText from './shared/animatedText';
import emblemOne from '/icons/emblem-one.png';
import emblemTwo from '/icons/emblem-two.png';
import emblemThree from '/icons/emblem-three.png';
Expand Down Expand Up @@ -47,7 +48,9 @@ const HomePage = () => {
<div className="textHolder">
<span className="creative">Creative Designer</span>
<span className="and">&</span>
<span className='stack'>FullStack Developer</span>
<div className="stack">
<AnimatedText />
</div>
</div>
</div>
<div className="headerpart3">
Expand Down
43 changes: 43 additions & 0 deletions src/components/shared/animatedText.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { useState, useRef, useEffect } from 'react';
import '../../styles/css/aniText.css';

const AnimatedText = () => {
const titles = ['Web Developer', 'Api Developer', 'Backend Engineer', 'FrontEnd Developer', 'Rails Enthusiast', 'Rails Developer', 'Web Enthusiast', 'FullStack Developer'];
const textHolderRef = useRef();
const textRef = useRef();
const [index, setIndex] = useState(0);
const [text1, setText1] = useState(titles[0]);

useEffect(() => {
const locations = ['top', 'right', 'bottom', 'left'];
const currentLocation = locations[Math.floor(Math.random() * 4)];

if (index < titles.length) {
setText1(titles[index]);
textHolderRef.current.classList.add(`style-border-${currentLocation}`);
textRef.current.classList.add(`drop-text-from-${currentLocation}`);

setTimeout(() => {
textHolderRef.current.classList.remove(`style-border-${currentLocation}`);
textRef.current.classList.remove(`drop-text-from-${currentLocation}`);
setIndex((prevIndex) => prevIndex + 1);
}, 3500);
}

if(index === titles.length - 1){
setText1(titles[index]);
textHolderRef.current.classList.add('holderStay');
textRef.current.classList.add('textStay');
}
}, [index]);

return (
<div className={`animatedTextHolder`} ref={textHolderRef}>
<span className={`textFirst`} ref={textRef}>
{text1}
</span>
</div>
);
};

export default AnimatedText;
1 change: 1 addition & 0 deletions src/styles/css/aniText.css

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

1 change: 1 addition & 0 deletions src/styles/css/aniText.css.map

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

2 changes: 1 addition & 1 deletion src/styles/css/app.css

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

2 changes: 1 addition & 1 deletion src/styles/css/app.css.map

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

Loading

0 comments on commit 1f746ca

Please sign in to comment.