feat: добавить лоадеры Dots, Rotating Text и DNA Strain

— Добавлен dots-pulsating (минимализм на CSS-переменных)
— Добавлен rotating-text (эффект переворота букв с использованием JS)
— Добавлен dna-strain (научная анимация цепочки ДНК)
— Обновлен общий README.md: коллекция расширена до 8 элементов
This commit is contained in:
2026-04-04 22:31:42 +03:00
parent 29324fca97
commit 4145ca07c4
12 changed files with 590 additions and 7 deletions
Executable
+15
View File
@@ -0,0 +1,15 @@
# 🧬 DNA Strain Loader
Элегантная двумерная анимация цепочки ДНК, реализованная на чистом CSS. Имитирует вращение за счет динамического изменения ширины соединительных линий и масштабирования узлов.
### Особенности
- **Pure CSS**: Вся логика вращения построена на `@keyframes` без использования сторонних скриптов.
- **Pseudo-elements**: Узлы цепочки реализованы через `:before` и `:after`, что минимизирует количество HTML-разметки.
- **Cascading Delay**: Эффект плавной волны достигается за счет точечной настройки `animation-delay` для 12 последовательных элементов.
### Технические детали
- **Rotation Illusion**: Анимация `rotate-strain` циклически меняет ширину линии от 155px до 0.
- **Sync Scaling**: Узлы меняют размер (`scale`) и положение синхронно с линией, создавая иллюзию объема.
- **Webkit Support**: Включены префиксы для стабильной работы в старых версиях браузеров.
+26
View File
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>DNA</title>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<!-- partial:index.partial.html -->
<div class="strain"></div>
<div class="strain"></div>
<div class="strain"></div>
<div class="strain"></div>
<div class="strain"></div>
<div class="strain"></div>
<div class="strain"></div>
<div class="strain"></div>
<div class="strain"></div>
<div class="strain"></div>
<div class="strain"></div>
<div class="strain"></div>
<!-- partial -->
</body>
</html>
+228
View File
@@ -0,0 +1,228 @@
html, body {
width: 100%;
height: 100%;
background-color: #292929;
padding-top: 50px;
}
*, *:before, *:after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
.strain {
width: 155px;
height: 1px;
background-color: #dbdbdb;
position: relative;
margin: 0px auto;
margin-top: 28px;
margin-bottom: 28px;
-webkit-animation-name: rotate-strain;
animation-name: rotate-strain;
-webkit-animation-duration: 1.7s;
animation-duration: 1.7s;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-animation-play-state: running;
animation-play-state: running;
}
.strain:before {
content: "";
display: block;
position: absolute;
width: 18px;
height: 18px;
border-radius: 50%;
background-color: #13b6e2;
left: 0;
margin-top: -9px;
margin-left: -9px;
-webkit-animation-name: strain-size-left;
animation-name: strain-size-left;
-webkit-animation-duration: 1.7s;
animation-duration: 1.7s;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-animation-play-state: running;
animation-play-state: running;
}
.strain:after {
content: "";
display: block;
position: absolute;
width: 18px;
height: 18px;
border-radius: 50%;
background-color: #13b6e2;
right: 0;
margin-top: -9px;
margin-right: -9px;
-webkit-animation-name: strain-size-right;
animation-name: strain-size-right;
-webkit-animation-duration: 1.7s;
animation-duration: 1.7s;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-animation-play-state: running;
animation-play-state: running;
}
.strain:nth-child(1), .strain:nth-child(1):before, .strain:nth-child(1):after {
-webkit-animation-delay: 0.15s;
animation-delay: 0.15s;
}
.strain:nth-child(2), .strain:nth-child(2):before, .strain:nth-child(2):after {
-webkit-animation-delay: 0.3s;
animation-delay: 0.3s;
}
.strain:nth-child(3), .strain:nth-child(3):before, .strain:nth-child(3):after {
-webkit-animation-delay: 0.45s;
animation-delay: 0.45s;
}
.strain:nth-child(4), .strain:nth-child(4):before, .strain:nth-child(4):after {
-webkit-animation-delay: 0.6s;
animation-delay: 0.6s;
}
.strain:nth-child(5), .strain:nth-child(5):before, .strain:nth-child(5):after {
-webkit-animation-delay: 0.75s;
animation-delay: 0.75s;
}
.strain:nth-child(6), .strain:nth-child(6):before, .strain:nth-child(6):after {
-webkit-animation-delay: 0.9s;
animation-delay: 0.9s;
}
.strain:nth-child(7), .strain:nth-child(7):before, .strain:nth-child(7):after {
-webkit-animation-delay: 1.05s;
animation-delay: 1.05s;
}
.strain:nth-child(8), .strain:nth-child(8):before, .strain:nth-child(8):after {
-webkit-animation-delay: 1.2s;
animation-delay: 1.2s;
}
.strain:nth-child(9), .strain:nth-child(9):before, .strain:nth-child(9):after {
-webkit-animation-delay: 1.35s;
animation-delay: 1.35s;
}
.strain:nth-child(10), .strain:nth-child(10):before, .strain:nth-child(10):after {
-webkit-animation-delay: 1.5s;
animation-delay: 1.5s;
}
.strain:nth-child(11), .strain:nth-child(11):before, .strain:nth-child(11):after {
-webkit-animation-delay: 1.65s;
animation-delay: 1.65s;
}
.strain:nth-child(12), .strain:nth-child(12):before, .strain:nth-child(12):after {
-webkit-animation-delay: 1.8s;
animation-delay: 1.8s;
}
@-webkit-keyframes rotate-strain {
0% {
width: 155px;
}
25% {
width: 0;
}
50% {
width: 155px;
}
75% {
width: 0;
}
100% {
width: 155px;
}
}
@keyframes rotate-strain {
0% {
width: 155px;
}
25% {
width: 0;
}
50% {
width: 155px;
}
75% {
width: 0;
}
100% {
width: 155px;
}
}
@-webkit-keyframes strain-size-left {
0% {
transform: scale(1) translateX(0px);
}
25% {
transform: scale(0.5);
}
50% {
transform: scale(1) translateX(155px);
}
75% {
transform: scale(1.5);
}
100% {
transform: scale(1) translateX(0px);
}
}
@keyframes strain-size-left {
0% {
transform: scale(1) translateX(0px);
}
25% {
transform: scale(0.5);
}
50% {
transform: scale(1) translateX(155px);
}
75% {
transform: scale(1.5);
}
100% {
transform: scale(1) translateX(0px);
}
}
@-webkit-keyframes strain-size-right {
0% {
transform: scale(1) translateX(0px);
}
25% {
transform: scale(1.5);
}
50% {
transform: scale(1) translateX(-155px);
}
75% {
transform: scale(0.5);
}
100% {
transform: scale(1) translateX(0px);
}
}
@keyframes strain-size-right {
0% {
transform: scale(1) translateX(0px);
}
25% {
transform: scale(1.5);
}
50% {
transform: scale(1) translateX(-155px);
}
75% {
transform: scale(0.5);
}
100% {
transform: scale(1) translateX(0px);
}
}
+101
View File
@@ -0,0 +1,101 @@
$bg: #292929;
$blue: #13b6e2;
$gray: #dbdbdb;
@mixin animation-delay($time) {
animation-delay: $time;
}
html, body {
width: 100%;
height: 100%;
background-color: $bg;
padding-top: 50px;
}
*, *:before, *:after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
.strain {
width: 155px;
height: 1px;
background-color: $gray;
position: relative;
margin: 0px auto;
margin-top: 28px;
margin-bottom: 28px;
animation-name: rotate-strain;
animation-duration: 1.7s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-play-state: running;
&:before {
content: "";
display: block;
position: absolute;
width: 18px;
height: 18px;
border-radius: 50%;
background-color: $blue;
left: 0;
margin-top: -9px;
margin-left: -9px;
animation-name: strain-size-left;
animation-duration: 1.7s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-play-state: running;
}
&:after {
content: "";
display: block;
position: absolute;
width: 18px;
height: 18px;
border-radius: 50%;
background-color: $blue;
right: 0;
margin-top: -9px;
margin-right: -9px;
animation-name: strain-size-right;
animation-duration: 1.7s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-play-state: running;
}
@for $i from 1 through 12 {
&:nth-child(#{$i}), &:nth-child(#{$i}):before, &:nth-child(#{$i}):after {
@include animation-delay((.15s * $i));
}
}
}
@keyframes rotate-strain {
0% {width: 155px;}
25% {width: 0;}
50% {width: 155px;}
75% {width: 0;}
100% {width: 155px;}
}
@keyframes strain-size-left {
0% {transform: scale(1) translateX(0px);}
25% {transform: scale(.5);}
50% {transform: scale(1) translateX(155px);}
75% {transform: scale(1.5);}
100% {transform: scale(1) translateX(0px);}
}
@keyframes strain-size-right {
0% {transform: scale(1) translateX(0px);}
25% {transform: scale(1.5);}
50% {transform: scale(1) translateX(-155px);}
75% {transform: scale(.5);}
100% {transform: scale(1) translateX(0px);}
}