forked from dostonnabotov/quicksnip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request dostonnabotov#149 from AlsoKnownAs-Ax/feature/css-…
…animations [Feature - CSS] Feature/css animations
- Loading branch information
Showing
5 changed files
with
152 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
title: Blink Animation | ||
description: Adds an infinite blinking animation to an element | ||
author: AlsoKnownAs-Ax | ||
tags: animation,blink,infinite | ||
--- | ||
|
||
```css | ||
.blink { | ||
animation: blink 1s linear infinite; | ||
} | ||
|
||
@keyframes blink{ | ||
0%{ | ||
opacity: 0; | ||
} | ||
50%{ | ||
opacity: 1; | ||
} | ||
100%{ | ||
opacity: 0; | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
title: Pulse Animation | ||
description: Adds a smooth pulsing animation with opacity and scale effects | ||
author: AlsoKnownAs-Ax | ||
tags: animation,pulse,pulse-scale | ||
--- | ||
|
||
```css | ||
.pulse { | ||
animation: pulse 2s ease-in-out infinite; | ||
} | ||
|
||
@keyframes pulse { | ||
0% { | ||
opacity: 0.5; | ||
transform: scale(1); | ||
} | ||
50% { | ||
opacity: 1; | ||
transform: scale(1.05); | ||
} | ||
100% { | ||
opacity: 0.5; | ||
transform: scale(1); | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
title: Shake Animation | ||
description: Adds a shake animation ( commonly used to mark invalid fields ) | ||
author: AlsoKnownAs-Ax | ||
tags: shake,shake-horizontal | ||
--- | ||
|
||
```css | ||
.shake { | ||
animation: shake .5s ease-in-out; | ||
} | ||
|
||
@keyframes shake { | ||
0%, 100% { | ||
transform: translateX(0); | ||
} | ||
25% { | ||
transform: translateX(-10px); | ||
} | ||
50% { | ||
transform: translateX(10px); | ||
} | ||
75% { | ||
transform: translateX(-10px); | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
title: Slide-in Animation | ||
description: Adds a slide-in from the right side of the screen | ||
author: AlsoKnownAs-Ax | ||
tags: animation,slide-in,slide-right | ||
--- | ||
|
||
```css | ||
.slide-in { | ||
animation: slide-in 1s ease-in-out; | ||
} | ||
|
||
@keyframes slide-in { | ||
from { | ||
scale: 300% 1; | ||
translate: 150vw 0; | ||
} | ||
|
||
to { | ||
scale: 100% 1; | ||
translate: 0 0; | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
title: Typewriter Animation | ||
description: Adds a typewriter animation + blinking cursor | ||
author: AlsoKnownAs-Ax | ||
tags: blinking,typewriter | ||
--- | ||
|
||
```html | ||
<div class="typewriter"> | ||
<div> | ||
<p>Typerwriter Animation</p> | ||
</div> | ||
</div> | ||
``` | ||
|
||
```css | ||
.typewriter{ | ||
display: flex; | ||
justify-content: center; | ||
} | ||
|
||
.typewriter p { | ||
overflow: hidden; | ||
font-size: 1.5rem; | ||
font-family: monospace; | ||
border-right: 1px solid; | ||
margin-inline: auto; | ||
white-space: nowrap; | ||
/* The cursor will inherit the text's color by default */ | ||
/* border-color: red */ | ||
/* Steps: number of chars (better to set directly in js)*/ | ||
animation: typing 3s steps(21) forwards, | ||
blink 1s step-end infinite; | ||
} | ||
|
||
@keyframes typing{ | ||
from{ | ||
width: 0% | ||
} | ||
to{ | ||
width: 100% | ||
} | ||
} | ||
|
||
@keyframes blink{ | ||
50%{ | ||
border-color: transparent; | ||
} | ||
} | ||
``` |