This Pen isn't using 3D-transforms. :)
A Pen by Yusuke Nakaya on CodePen.
| .sky | |
| - for (i = 0; i < 200; i++) | |
| .star |
This Pen isn't using 3D-transforms. :)
A Pen by Yusuke Nakaya on CodePen.
| body { | |
| background: radial-gradient(ellipse at center, #1b2749 0%, #090a0f 80%); | |
| height: 100vh; | |
| overflow: hidden; | |
| } | |
| .sky { | |
| position: absolute; | |
| top: calc(50% - 100px); | |
| left: calc(50% - 100px); | |
| width: 200px; | |
| height: 200px; | |
| clip-path: circle(200px at center); | |
| } | |
| .star { | |
| position: absolute; | |
| top: 50%; | |
| left: 50%; | |
| width: 20px; | |
| height: 20px; | |
| background: #fff; | |
| clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); | |
| // => https://bennettfeely.com/clippy/ | |
| animation: bling 6000ms linear infinite; | |
| @for $i from 1 through 200 { | |
| &:nth-child(#{$i}) { | |
| top: calc(50% - #{random(400) - 200px}); | |
| left: calc(50% - #{random(400) - 200px}); | |
| animation-delay: random(6000) * -1ms; | |
| } | |
| } | |
| } | |
| @keyframes bling { | |
| 0% { | |
| transform: scale(0) rotateZ(45deg) translate(-300px); | |
| background: #ff00ff; | |
| } | |
| 50% { | |
| transform: scale(1) rotateZ(45deg) translate(0); | |
| background: #ffffff; | |
| } | |
| 100% { | |
| transform: scale(0) rotateZ(45deg) translate(300px); | |
| background: #0000ff; | |
| } | |
| } |
| <link href="https://fonts.googleapis.com/css?family=Anton" rel="stylesheet" /> |