mirror of
https://github.com/uiverse-io/galaxy.git
synced 2025-11-28 05:00:22 +08:00
81 lines
1.4 KiB
HTML
81 lines
1.4 KiB
HTML
<div class="newtons-cradle">
|
|
<div class="newtons-cradle__dot"></div>
|
|
<div class="newtons-cradle__dot"></div>
|
|
<div class="newtons-cradle__dot"></div>
|
|
<div class="newtons-cradle__dot"></div>
|
|
</div>
|
|
<style>
|
|
/* From Uiverse.io by G4b413l - Tags: loader */
|
|
.newtons-cradle {
|
|
--uib-size: 50px;
|
|
--uib-speed: 1.2s;
|
|
--uib-color: #474554;
|
|
position: relative;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: var(--uib-size);
|
|
height: var(--uib-size);
|
|
}
|
|
|
|
.newtons-cradle__dot {
|
|
position: relative;
|
|
display: flex;
|
|
align-items: center;
|
|
height: 100%;
|
|
width: 25%;
|
|
transform-origin: center top;
|
|
}
|
|
|
|
.newtons-cradle__dot::after {
|
|
content: '';
|
|
display: block;
|
|
width: 100%;
|
|
height: 25%;
|
|
border-radius: 50%;
|
|
background-color: var(--uib-color);
|
|
}
|
|
|
|
.newtons-cradle__dot:first-child {
|
|
animation: swing var(--uib-speed) linear infinite;
|
|
}
|
|
|
|
.newtons-cradle__dot:last-child {
|
|
animation: swing2 var(--uib-speed) linear infinite;
|
|
}
|
|
|
|
@keyframes swing {
|
|
0% {
|
|
transform: rotate(0deg);
|
|
animation-timing-function: ease-out;
|
|
}
|
|
|
|
25% {
|
|
transform: rotate(70deg);
|
|
animation-timing-function: ease-in;
|
|
}
|
|
|
|
50% {
|
|
transform: rotate(0deg);
|
|
animation-timing-function: linear;
|
|
}
|
|
}
|
|
|
|
@keyframes swing2 {
|
|
0% {
|
|
transform: rotate(0deg);
|
|
animation-timing-function: linear;
|
|
}
|
|
|
|
50% {
|
|
transform: rotate(0deg);
|
|
animation-timing-function: ease-out;
|
|
}
|
|
|
|
75% {
|
|
transform: rotate(-70deg);
|
|
animation-timing-function: ease-in;
|
|
}
|
|
}
|
|
|
|
</style>
|