mirror of
https://github.com/neosubhamoy/neosubhamoy-portfolio.git
synced 2025-12-19 19:23:02 +05:30
(refactor): improved homepage hello text in out animation
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
/* --- Scrollbar Styling--- */
|
||||||
|
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
width: 4px;
|
width: 4px;
|
||||||
}
|
}
|
||||||
@@ -14,7 +16,38 @@ background: rgba(56, 189, 248, 0.30);
|
|||||||
background: #38BDF8;
|
background: #38BDF8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --- Hello Container Styling --- */
|
||||||
|
|
||||||
|
#helloContainer {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slideUpFade {
|
||||||
|
display: inline-block;
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(0px);
|
||||||
|
animation: slideUpFade 4s ease-in-out;
|
||||||
|
animation-fill-mode: forwards;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes slideUpFade {
|
||||||
|
0% {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
30% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
70% {
|
||||||
|
opacity: 0.9;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(-20px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- Scrool Down to Explore Btn Styling --- */
|
||||||
|
|
||||||
@keyframes scroll {
|
@keyframes scroll {
|
||||||
0% {
|
0% {
|
||||||
@@ -44,6 +77,8 @@ background: #38BDF8;
|
|||||||
animation: slide-up 0.5s ease-in-out;
|
animation: slide-up 0.5s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --- Hover Animated Container Styling --- */
|
||||||
|
|
||||||
.hoverAnimatedContainer:hover::before {
|
.hoverAnimatedContainer:hover::before {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
@@ -77,7 +112,7 @@ background: #38BDF8;
|
|||||||
fill: red;
|
fill: red;
|
||||||
} */
|
} */
|
||||||
|
|
||||||
/* --- floatingbar styling --- */
|
/* --- Floating Bar Styling --- */
|
||||||
|
|
||||||
.floatingbar-slide-down {
|
.floatingbar-slide-down {
|
||||||
transform: translateY(20vh);
|
transform: translateY(20vh);
|
||||||
|
|||||||
@@ -2,20 +2,22 @@
|
|||||||
function animate_hello() {
|
function animate_hello() {
|
||||||
const texts = ["Namaste! 🙏", "Hello! 👋", "Konnichiwa! 😄", "Anyeonghaseyo! 😊", "Hola! 😃", "Bonjour! 😄", "Zdravstvuyte! 🙂", "Marhabaan! 😊", "Olá! 😃", "Salve! 🤠"];
|
const texts = ["Namaste! 🙏", "Hello! 👋", "Konnichiwa! 😄", "Anyeonghaseyo! 😊", "Hola! 😃", "Bonjour! 😄", "Zdravstvuyte! 🙂", "Marhabaan! 😊", "Olá! 😃", "Salve! 🤠"];
|
||||||
const textContainer = document.getElementById("helloContainer");
|
const textContainer = document.getElementById("helloContainer");
|
||||||
|
|
||||||
let currentIndex = 0;
|
let currentIndex = 0;
|
||||||
|
|
||||||
function animateText() {
|
function animateText() {
|
||||||
textContainer.textContent = texts[currentIndex];
|
textContainer.innerHTML = texts[currentIndex].split(' ').map(word => `<span class="slideUpFade">${word}</span>`).join(' ');
|
||||||
currentIndex = (currentIndex + 1) % texts.length;
|
currentIndex = (currentIndex + 1) % texts.length;
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
animateText();
|
animateText();
|
||||||
}, 3000);
|
}, 4000);
|
||||||
}
|
}
|
||||||
|
|
||||||
animateText();
|
animateText();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(document.getElementById("helloContainer")) {
|
if (document.getElementById("helloContainer")) {
|
||||||
animate_hello();
|
animate_hello();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user