CSS move up / wipe up vertically animation? On scroll? - html

I'm working in React js and am trying to emulate the vertical move up animation you see on the text "A DIGITAL DESIGN STUDIO
DRIVEN BY RESEARCH &
STRATEGY" here - https://dashdigital.studio/
From inspecting this site I have tried working with their translation CSS -
transition-delay: .9s;
transition: transform 1.3s cubic-bezier(.075, .82, .165, 1);
transform: translateY(0%);
However there is the "moving up from behind a wall" effect in use that I can't find a starting point for. Ideally I'd have this occur to elements on scroll - is there a package or starting point for anything like this?
How can I create this vertical wipe from behind a wall effect?

You can create vertically animation by following this code
html, body {
height: 100%;
}
body {
font-family: "Baloo Paaji", cursive;
background: #1e90ff;
display: flex;
justify-content: center;
align-items: center;
}
.container {
width: 400px;
height: 220px;
position: relative;
}
h1, h2 {
font-size: 75px;
text-transform: uppercase;
}
h1 span, h2 span {
width: 100%;
float: left;
color: #ffffff;
-webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 80%);
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 80%);
transform: translateY(-150px);
opacity: 0;
-webkit-animation-name: titleAnimation;
animation-name: titleAnimation;
-webkit-animation-timing-function: ease;
animation-timing-function: ease;
-webkit-animation-duration: 3s;
animation-duration: 3s;
}
h1 span {
-webkit-animation-delay: 0.6s;
animation-delay: 0.6s;
-webkit-animation-fill-mode: forwards;
}
h1 span:first-child {
-webkit-animation-delay: 0.7s;
animation-delay: 0.7s;
}
h1 span:last-child {
color: #ffe221;
-webkit-animation-delay: 0.5s;
animation-delay: 0.5s;
}
h2 {
top: 0;
position: absolute;
}
h2 span {
-webkit-animation-delay: 4.1s;
animation-delay: 4.1s;
-webkit-animation-fill-mode: forwards;
}
h2 span:first-child {
-webkit-animation-delay: 4.2s;
animation-delay: 4.2s;
}
h2 span:last-child {
color: #ffe221;
-webkit-animation-delay: 4s;
animation-delay: 4s;
}
.usechrome {
font-size: 10px;
color: #fff;
font-family: helvetica, arial;
position: absolute;
bottom: 20px;
width: 100%;
text-align: center;
left: 0;
}
#-webkit-keyframes titleAnimation {
0% {
transform: translateY(-50px);
opacity: 0;
-webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 80%);
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 80%);
}
20% {
transform: translateY(0);
opacity: 1;
-webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 15%);
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 15%);
}
80% {
transform: translateY(0);
opacity: 1;
-webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 15%);
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 15%);
}
100% {
transform: translateY(50px);
opacity: 0;
-webkit-clip-path: polygon(100% 0, 100% 0%, 0 100%, 0 100%);
clip-path: polygon(100% 0, 100% 0%, 0 100%, 0 100%);
}
}
#keyframes titleAnimation {
0% {
transform: translateY(-50px);
opacity: 0;
-webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 80%);
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 80%);
}
20% {
transform: translateY(0);
opacity: 1;
-webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 15%);
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 15%);
}
80% {
transform: translateY(0);
opacity: 1;
-webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 15%);
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 15%);
}
100% {
transform: translateY(50px);
opacity: 0;
-webkit-clip-path: polygon(100% 0, 100% 0%, 0 100%, 0 100%);
clip-path: polygon(100% 0, 100% 0%, 0 100%, 0 100%);
}
}/*# sourceMappingURL=style.css.map */
<section class="container">
<h1 class="title">
<span>Hi, nice</span>
<span>to see</span>
<span>you here</span>
</h1>
<h2 class="title">
<span>This is</span>
<span>a long</span>
<span>sub title</span>
</h2>
</section>
<span class="usechrome">Use Chrome for a better experience</span>

Related

Why does my animation add artefacts to my spinner in Moz Firefox?

I wanted to customise a nice spinner in CSS to indicate loading and it works nicely and looks great in everything except for Mozilla. Can anyone explain to me why, and how to fix it? Or at least point me in the right direction.
<style>
.loader {
display: inline-flex;
width: 0.75em;
height: 0.75em;
border-radius: 50%;
outline: none;
position: relative;
animation: rotate 1s linear infinite
}
.loader::before {
content: "";
box-sizing: border-box;
position: absolute;
inset: 0px;
border-radius: 50%;
border: 0.15em solid;
animation: prixClipFix 1.8s linear infinite;
}
:is(h1, h2, h3, h4, h5) .loader::before {
border-width: 0.1em;
}
#keyframes rotate {
100% {
transform: rotate(360deg)
}
}
#keyframes prixClipFix {
0% {
clip-path: polygon(50% 50%, 0 0, 10% 0, 10% 0, 10% 0, 10% 0)
}
25% {
clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 0, 100% 0, 100% 0)
}
50% {
clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 100% 100%, 100% 100%)
}
75% {
clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 0, 100% 0, 100% 0)
}
100% {
clip-path: polygon(50% 50%, 0 0, 10% 0, 10% 0, 10% 0, 10% 0)
}
}
</style>
<div>
<!-- <div class="spin"></div> -->
<h1>Loading
<div class="loader"></div>
</h1>
<h2>Loading
<div class="loader"></div>
</h2>
<h3>Loading
<div class="loader"></div>
</h3>
<h4>Loading
<div class="loader"></div>
</h4>
<h5>Loading
<div class="loader"></div>
</h5>
Loading
<div class="loader"></div>
</div>
Looking into it, I found that FF doesn't appreciate the div rotating while the polygon grows and shrinks. Turning either one off solves the problem however I would like it to do both.
Thanks to Miriam it is now fixed! I added border-radius: 0.01px; and overflow: hidden; to the .loader parent class.

Css import and page style

Hello and thank you in advance.
I have 3D cube on my site.
When I import external CSS file, it just makes my cube go wrong. Cube goes to left, and I can't move it again.
When I delete external css, everything works as it should.
#import url("mojmeni.css"); - located in head
body { font-family: sans-serif;
font-family: monospace;
text-transform: uppercase;
backgroud: #999;
}
.container {
height: 100vh;
width: 100vw;
display: flex;
justify-content: center;
align-items: center;
}
ul {
display: flex;
flex-direction: row;
font-size: 22px;
}
li {
position: relative;
list-style-type: none;
margin-right: 50px;
cursor: pointer;
color: black;
}
li:last-child {
margin-right: 0px;
}
li:after {
content: "";
position: absolute;
z-index: -1;
left: 50%;
transform: translateX(-50%) rotate(0deg);
}
li:nth-child(1):after {
background: #ED4337;
}
li:nth-child(2):after {
background: #A1D3A2;
}
li:nth-child(3):after {
background: #50B8E7;
}
li:nth-child(4):after {
background: #efe200;
}
li:nth-child(1):after {
clip-path: polygon(6% 10%, 100% 0, 64% 65%, 28% 65%);
height: 85px;
width: 75px;
bottom: -47px;
animation: stretch 2s ease infinite;
}
#keyframes stretch {
25% {
transform: translateX(-50%) rotate(2deg) scaleY(0.93);
}
50% {
transform: translateX(-50%) rotate(-2deg) scaleX(0.93);
clip-path: polygon(6% 20%, 100% 0, 64% 65%, 28% 65%);
}
75% {
transform: translateX(-50%) rotate(3deg) scale(1.05);
}
}
li:nth-child(2):after {
clip-path: polygon(61% 0%, 100% 19%, 71% 100%, 0% 100%);
height: 55px;
width: 75px;
bottom: -18px;
animation: stretch2 1.5s ease infinite;
}
#keyframes stretch2 {
25% {
transform: translateX(-50%) rotate(-2deg) scaleY(1.05);
}
50% {
transform: translateX(-50%) rotate(2deg) scaleY(0.93) scaleX(1.06);
clip-path: polygon(61% 0%, 100% 19%, 71% 100%, 12% 100%);
}
75% {
transform: translateX(-50%) rotate(3deg) scale(1.05);
clip-path: polygon(61% 0%, 80% 19%, 71% 100%, 12% 100%);
}
}
li:nth-child(3):after {
clip-path: polygon(0% 0%, 100% 0%, 100% 99%, 0% 57%);
height: 55px;
width: 45px;
bottom: -18px;
animation: stretch3 2s ease infinite;
}
#keyframes stretch3 {
25% {
transform: translateX(-50%) rotate(-2deg) scaleY(1.05);
}
50% {
transform: translateX(-50%) rotate(2deg) scaleY(0.93) scaleX(1.06);
clip-path: polygon(10% 5%, 100% 0%, 100% 99%, 0% 57%);
}
75% {
transform: translateX(-50%) rotate(3deg) scale(1.05);
clip-path: polygon(0% 0%, 100% 0%, 100% 99%, 10% 37%);
}
}
li:nth-child(4):after {
clip-path: polygon(0% 40%, 100% 0%, 100% 99%, 19% 100%);
height: 55px;
width: 45px;
bottom: -18px;
animation: stretch4 2s ease infinite;
}
#keyframes stretch4 {
25% {
transform: translateX(-50%) rotate(-2deg) scaleY(1.05);
}
50% {
transform: translateX(-50%) rotate(2deg) scaleY(0.93) scaleX(1.06);
clip-path: polygon(0% 40%, 100% 0%, 100% 99%, 19% 100%);
}
75% {
transform: translateX(-50%) rotate(3deg) scaleY(1.05);
clip-path: polygon(0% 40%, 100% 0%, 100% 99%, 19% 100%);
}
}
li:hover:after {
animation: boink 1s ease forwards 1;
}
#keyframes boink {
80% {
transform: scaleX(1.9) scaleY(0.6) translateX(-30%);
}
}
#media (max-width: 600px) {
li {
font-size: 15px;
}
}
This is external css file
What is wrong with external css file so I can't insert it properly ? Thank you.
I have been stucked with this code.
Thank you very much.
https://www.jqueryscript.net/slider/3D-Cube-Slider-jQuery-cubeGallery.html
When I insert cube, everything works as it should be. But not when I insert external css.
Thank you.

Why are my shapes flat after I added animation

I have a 3D triangle with a base color for every shape, but I want the base (aka the square) to have an animated color, but after adding the animation, the triangles all lay flat all of the sudden. When I remove the animation, the shapes readjust as they should.
For the animation I hue-rotate the linear-gradient color of the square in #keframes animate.
Here is the html code:
<div class="wrapper">
<div class="pyramid">
<div class="square">
<div class="triangle"></div>
<div class="triangle"></div>
<div class="triangle"></div>
<div class="triangle"></div>
</div>
</div>
</div>
And CSS:
#-webkit-keyframes animate {
0%, 100% {
filter: hue-rotate(0deg);
}
50% {
filter: hue-rotate(360deg);
}
}
#keyframes animate {
0%, 100% {
filter: hue-rotate(0deg);
}
50% {
filter: hue-rotate(360deg);
}
}
#-webkit-keyframes rotate {
from {
transform: rotateX(120deg) rotateZ(0deg);
}
50% {
transform: rotateX(120deg) rotateZ(180deg);
}
to {
transform: rotateX(120deg) rotateZ(360deg);
}
}
#keyframes rotate {
from {
transform: rotateX(120deg) rotateZ(0deg);
}
50% {
transform: rotateX(120deg) rotateZ(180deg);
}
to {
transform: rotateX(120deg) rotateZ(360deg);
}
}
.wrapper {
position: relative;
display: flex;
justify-content: center;
align-items: center;
top: 500px;
left: 50%;
margin-bottom: 0;
transform-style: preserve-3d;
width: 3.75rem;
height: 3.75rem;
transform-origin: 1.875rem 1.875rem;
transform: rotateX(120deg) rotateZ(45deg);
-webkit-animation: rotate 4s linear infinite;
animation: rotate 4s linear infinite;
}
.pyramid {
position: absolute;
perspective: 500px;
transform-style: preserve-3d;
}
.square {
width: 3.75rem;
height: 3.75rem;
transform-style: preserve-3d;
background: linear-gradient(to left, #008aff, #00ffe7);
-webkit-animation: animate 5s linear infinite;
animation: animate 5s linear infinite;
}
.triangle {
position: absolute;
width: 5rem;
height: 5rem;
}
.triangle:nth-child(1) {
width: 3.75rem;
top: -33%;
background: #f1ecfb;
-webkit-clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
transform-origin: 50% 100%;
transform: rotateX(-68deg);
}
.triangle:nth-child(2) {
width: 3.75rem;
background: #f1ecfb;
-webkit-clip-path: polygon(50% 100%, 0 0, 100% 0);
clip-path: polygon(50% 100%, 0 0, 100% 0);
transform-origin: 50% 0%;
transform: rotateX(68deg);
}
.triangle:nth-child(3) {
height: 3.75rem;
left: -33%;
background: white;
transform-origin: 100% 50%;
-webkit-clip-path: polygon(100% 100%, 0 50%, 100% 0);
clip-path: polygon(100% 100%, 0 50%, 100% 0);
transform: rotateY(68deg);
}
.triangle:nth-child(4) {
height: 3.75rem;
background: white;
transform-origin: 0% 50%;
-webkit-clip-path: polygon(0 100%, 100% 50%, 0 0);
clip-path: polygon(0 100%, 100% 50%, 0 0);
transform: rotateY(-68deg);
}
I changed it so that the animation changes the background color which resolves the issue.
#-webkit-keyframes animate {
0%, 100%{
background: #ffadad;
}
12.5%{
background: #ffd6a5;
}
25%{
background: #fdffb6;
}
37.5%{
background: #caffbf;
}
50%{
background: #9bf6ff;
}
62.5%{
background: #a0c4ff;
}
75%{
background: #bdb2ff;
}
87.5%{
background: #ffc6ff;
}
}
#keyframes animate {
0%, 100%{
background: #ffadad;
}
12.5%{
background: #ffd6a5;
}
25%{
background: #fdffb6;
}
37.5%{
background: #caffbf;
}
50%{
background: #9bf6ff;
}
62.5%{
background: #a0c4ff;
}
75%{
background: #bdb2ff;
}
87.5%{
background: #ffc6ff;
}
}

CSS Animation Stop on last part and remain to its default style

How to stop the animation and keep the text when it comes to the 100% in keyframes, because it disappear when it reach 100%, well I did try infinite but it seems it wasn't fit for my taste, what I want is only two or more then display remain to its default style.
p span {
width: 100%;
float: left;
color: #ec1839;
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 80%);
transform: translateY(-50px);
opacity: 0;
animation-name: titleAnimation;
animation-timing-function:ease;
animation-iteration-count: 1;
animation-duration: 3s;
animation-delay: 1s;
animation-fill-mode: forwards;
}
#keyframes titleAnimation {
0% {
transform: translateY(-50px);
opacity: 0;
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 80%);
}
20% {
transform: translateY(0);
opacity: 1;
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 15%);
}
80% {
transform: translateY(0);
opacity: 1;
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 15%);
}
90% {
transform: translateY(50px);
opacity: 0;
clip-path: polygon(100% 0, 100% -0%, 0 100%, 0 100%);
}
}
<p><span>< Hi >, Nice to see you here</span></p>
The animation ends at 100%
Set 100% to desired end state for the animation
p span {
width: 100%;
float: left;
color: #ec1839;
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 80%);
transform: translateY(-50px);
opacity: 0;
animation-name: titleAnimation;
animation-timing-function:ease;
animation-iteration-count: 1;
animation-duration: 3s;
animation-delay: 1s;
animation-fill-mode: forwards;
}
#keyframes titleAnimation {
0% { // Starting condition
transform: translateY(-50px);
opacity: 0;
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 80%);
}
20% {
transform: translateY(0);
opacity: 1;
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 15%);
}
100% { // This where the animation will end and stay at
transform: translateY(0);
opacity: 1;
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 15%);
}
}
<p><span>< Hi >, Nice to see you here</span></p>

Seamless CSS Animations

I have a html program with a css and js file, and i have a continuously looping spin animation on one of my elements, when i hover over it it changes its animation to a different animation, but when i hover it, it instantly moves back to 0deg causing a uncomfortable jump, is there a way for the animation to know where it is currently to start at that position?
here's my code, its all of it so its a bit long
body{
background: #808080;
}
.Glow{
transform: rotate(90deg);
background:blue;
position: absolute;
border-radius: 50%;
overflow: hidden;
}
.Glow:nth-child(1){
width: 300px;
height: 300px;
background: #ffffff;
-webkit-clip-path: polygon(00% 100%, 50% 50%, 100% 100%);
}
.Glow:nth-child(2){
width: 300px;
height: 300px;
background: #ffffff;
-webkit-clip-path: polygon(0% 0%, 50% 50%, 100% 0%);
}
.Glow:nth-child(3){
width: 270px;
height: 270px;
margin: 15px;
background: #808080;
}
.Glow:nth-child(4){
width: 300px;
height: 300px;
-webkit-clip-path: polygon(30% 100%, 45% 85%, 50% 50%, 55% 85%, 70% 100%);
background: #ffffff;
}
.Glow:nth-child(5){
width: 300px;
height: 300px;
-webkit-clip-path: polygon(30% 0%, 45% 15%, 50% 50%, 55% 15%, 70% 0%);
background: #ffffff;
}
.Glow:nth-child(6){
left: 45%;
top: 19%;
border-radius: 0%;
width: 3px;
height: 100px;
background: linear-gradient(#808080, #cccccc);
animation: null;
transform: rotate(0deg);
}
.Glow:nth-child(7){
left: 46.6%;
top: 19%;
border-radius: 0%;
width: 3px;
height: 100px;
background: linear-gradient(#808080, #cccccc);
animation: null;
transform: rotate(0deg);
}
.Glow:nth-child(8){
width: 150px;
height: 150px;
margin: 75px;
-webkit-clip-path: polygon(0% 0%, 0% 30%, 8% 39%, 8% 61%, 0% 70%, 0% 100%, 100% 100%, 100% 70%, 92% 61%, 92% 39%, 100% 30%, 100% 0%);
background: #ffffff;
}
.Glow:nth-child(9){
width: 150px;
height: 150px;
margin: 75px;
-webkit-clip-path: polygon(6% 41%, 6% 60%, 0% 66%, 0% 34%);
background: #ffffff;
}
.Glow:nth-child(10){
width: 150px;
height: 150px;
margin: 75px;
-webkit-clip-path: polygon(94% 41%, 94% 60%, 100% 66%, 100% 34%);
background: #ffffff;
}
.Glower:hover{
left: 37%;
top: 20%;
animation: spin1 2s linear 0s infinite;
}
.Glower{
transform: rotate(0deg);
position: absolute;
left: 37%;
top: 20%;
width: 300px;
height: 300px;
animation: spin 4s linear 0s infinite forwards;
}
#-webkit-keyframes spin{
100%{
-webkit-transform: rotate(450deg);
}
}
#-webkit-keyframes spinside{
100%{
-webkit-transform: rotate(270deg);
}
}
#-webkit-keyframes openCircle1{
100%{
top: 40%;
}
}
#-webkit-keyframes openCircle2{
100%{
top: 10%;
}
}
#-webkit-keyframes spin1{
0%{
-webkit-transform: scale(1) rotate(0deg);
}
25%{
-webkit-transform: scale(.9) rotate(120deg);
}
75%{
-webkit-transform: scale(1.1) rotate(240deg);
}
100%{
-webkit-transform: scale(1) rotate(360deg);
}
}
Edit: i use the spin1 and the spin animation btw
Edit 2: here's the codepen upload https://codepen.io/Inertiality/pen/mEBkvN
Edit 3: am i able to use transitions? cause i dont see how those could work with the animations