codepens/profusion-2/dist/style.css

258 lines
4.9 KiB
CSS

:root {
--tile-length: 17.5vmin;
--animation-duration: 338s;
--bg:
hsla(314,100%,50%,1);
--bg2:
hsla(314,100%,50%,1);
--ease:
cubic-bezier(1.00,1.33,.10,-1.33);
--ease2:
cubic-bezier(1,-1.33,.10,1.33);
--ease3:
cubic-bezier(0.59,15.33,.10,14.33);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
section {
height: 100vh;
width: 100vw;
background: var(--bg);
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-evenly;
overflow: hidden;
opacity: 0;
-webkit-animation: appear 1050s 1s var(--ease3) 1 forwards;
animation: appear 1050s 1s var(--ease3) 1 forwards;
}
@-webkit-keyframes appear {
100% {
opacity: 1;
}
}
@keyframes appear {
100% {
opacity: 1;
}
}
.dg {
display: none;
opacity: 0;
z-index: 200 !important;
}
canvas {
display: block;
height: 100%;
width: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 101;
mix-blend-mode: exclusion;
filter: invert(1) contrast(2);
-webkit-animation: appear2 57s 7s var(--ease2) 1 forwards;
animation: appear2 57s 7s var(--ease2) 1 forwards;
}
@-webkit-keyframes appear2 {
100% {
mix-blend-mode: difference;
filter: invert(1) contrast(1);
}
}
@keyframes appear2 {
100% {
mix-blend-mode: difference;
filter: invert(1) contrast(1);
}
}
.kaleidoscope {
position: relative;
width: calc(6 * .866 * var(--tile-length));
height: 90vmin;
-webkit-animation: rotation var(--animation-duration) var(--ease) infinite;
animation: rotation var(--animation-duration) var(--ease) infinite;
border-radius: 50%;
overflow: hidden;
}
.kaleidoscope:after {
content: "";
position: absolute;
height: inherit;
width: inherit;
background: radial-gradient(circle at center, transparent 15%, var(--bg2) 60%);
z-index: 100;
}
.container {
position: absolute;
width: calc(2 * var(--tile-length));
height: calc(2 * var(--tile-length));
border-radius: 50%;
overflow: hidden;
transform: translate(calc(var(--tile-length) * -0.134 ), -50%);
}
.container:nth-child(1) {
top: 50%;
left: 0%;
}
.container:nth-child(2) {
top: 50%;
left: calc(2 * calc(var(--tile-length) * 0.866 ));
}
.container:nth-child(3) {
top: 50%;
left: calc(4 * calc(var(--tile-length) * 0.866 ));
}
.container:nth-child(4) {
top: calc(50% - calc(1.5 * var(--tile-length)));
left: calc(var(--tile-length) * 0.866 );
}
.container:nth-child(5) {
top: calc(50% - calc(1.5 * var(--tile-length)));
left: calc(3 * var(--tile-length) * 0.866 );
}
.container:nth-child(6) {
top: calc(50% + calc(1.5 * var(--tile-length)));
left: calc(var(--tile-length) * 0.866 );
}
.container:nth-child(7) {
top: calc(50% + calc(1.5 * var(--tile-length)));
left: calc(3 * var(--tile-length) * 0.866 );
}
@-webkit-keyframes rotation {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@keyframes rotation {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.tile {
position: absolute;
top: 28%;
left: 25%;
width: var(--tile-length);
height: calc(var(--tile-length) * 0.866);
-webkit-clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
}
.tile:nth-child(1) {
transform: rotate(30deg) translateY(50%) scaleX(-1);
}
.tile:nth-child(2) {
transform: rotate(90deg) translateY(50%);
}
.tile:nth-child(3) {
transform: rotate(150deg) translateY(50%) scaleX(-1);
}
.tile:nth-child(4) {
transform: rotate(210deg) translateY(50%);
}
.tile:nth-child(5) {
transform: rotate(270deg) translateY(50%) scaleX(-1);
}
.tile:nth-child(6) {
transform: rotate(330deg) translateY(50%);
}
.texture {
position: absolute;
height: calc(1.75 * var(--tile-length));
width: calc(1.75 * var(--tile-length));
background-image: url(https://assets.codepen.io/194946/panneau-garden-party-rifle-paper-co.jpg);
background-size: 100%;
-webkit-animation: rotation var(--animation-duration) var(--ease2) infinite;
animation: rotation var(--animation-duration) var(--ease2) infinite;
}
.link {
position: fixed;
z-index: 10;
left: calc(2.5vmin - .75rem);
bottom: calc(2.5vmin - .75rem);
font-size: 1.5rem;
font-family: arial, sans-serif;
color: whitesmoke;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.my-name {
position: relative;
}
.before, .after {
overflow: hidden;
width: 0px;
transition: width 0.5s;
transform-origin: right;
}
.before-text {
display: inline-block;
width: auto;
text-align: right;
}
.after-text {
display: flex;
align-items: center;
width: auto;
height: 3rem;
transform-origin: top center;
}
.link:hover .before {
width: 2.5rem;
}
.link:hover .after {
width: 4rem;
}
.link:hover .spin {
display: inline-block;
transition: 0.5s transform 0.5s ease-in-out;
transform: rotate(360deg);
}