I have developed a unique welcome feature using HTML and CSS that I would like to showcase intermittently.
--------------------------- My Desired Outcome ---------------------------
Initially, this feature should be triggered once (when a user first accesses this page on a browser).
Then, every 8 hours thereafter (even if the page is refreshed), the feature should be activated again.
Here is my customized welcome message:
HTML:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="stylesheet" href="../fontawesome-free-5.13.0-web/css/all.min.css" />
<link rel="stylesheet" href="./style.css" />
<title>greeting</title>
</head>
<body>
<section id="welcome_greeting">
<div id="welcome_greeting_inner">
<div id="welcome_row_1">
<div>hello</div>
<div>world</div>
</div>
<div id="welcome_row_2">welcome</div>
<div id="welcome_row_3">to</div>
<div id="welcome_row_4">
<div>
<p>our website</p>
</div>
</div>
</div>
</section>
</body>
</html>
CSS:
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
section#welcome_greeting{
padding: 0 20px;
height: 100vh;
}
div#welcome_greeting_inner{
font-family: 'Segoe UI';
text-transform: capitalize;
}
div#welcome_greeting_inner div#welcome_row_1{
font-size: 100px;
display: flex;
justify-content: space-evenly;
}
div#welcome_greeting_inner div#welcome_row_1 div:first-child{
transform: translateY(-500px);
opacity: 0;
visibility: hidden;
animation: rowOneA 2000ms ease 100ms forwards;
}
@keyframes rowOneA{
100%{
transform: translateY(0px);
opacity: 1;
visibility: visible;
}
}
div#welcome_greeting_inner div#welcome_row_1 div:last-child{
transform: translateY(-500px);
opacity: 0;
visibility: hidden;
animation: rowOneB 2000ms ease 700ms forwards;
}
@keyframes rowOneB{
100%{
transform: translateY(0px);
opacity: 1;
visibility: visible;
}
}
div#welcome_greeting_inner div#welcome_row_2{
font-size: 120px;
display: flex;
justify-content: space-evenly;
transform: rotateX(90deg);
opacity: 0;
visibility: hidden;
animation: rowTwo 5000ms ease 1600ms forwards;
}
@keyframes rowTwo{
100%{
transform: rotateX(0deg);
opacity: 1;
visibility: visible;
}
}
div#welcome_greeting_inner div#welcome_row_3{
font-size: 100px;
display: flex;
justify-content: space-evenly;
opacity: 0;
visibility: hidden;
animation: rowThree 6750ms ease 2600ms forwards;
}
@keyframes rowThree{
100%{
opacity: 1;
visibility: visible;
}
}
div#welcome_greeting_inner div#welcome_row_4{
font-size: 160px;
display: flex;
justify-content: space-evenly;
}
div#welcome_greeting_inner div#welcome_row_4 > div > p{
width: 0;
opacity: 0;
visibility: hidden;
white-space: nowrap;
overflow: hidden;
animation: rowFour 6000ms ease 3300ms forwards;
}
@keyframes rowFour{
100%{
width: 100%;
opacity: 1;
visibility: visible;
}
}
Your guidance in helping me implement this functionality will be highly appreciated. Thank you :)