Start Coding
All
Accordion
Buttons
Cards
Carousel
Css Animation
Hexagons
Hover
Layout
Loaders
Menu
Navigation
Slider
Tables
Wave
Hexagons
:root { --sqrt3: 1.73205080757; /* Square root of 3 */ --time: 11; /* Duration of animation */ --gap: 1; /* Horizontal gap between hexagons */ --radius: 3; /* Radius of inscribed circle */ --Gap: var(--gap) / 2 * var(--sqrt3); /* Vertical gap between hexagons */ --Radius: 2 / var(--sqrt3) * var(--radius); /* Radius of circumcircle */ } @keyframes odd-animation { 0% { transform: translate(calc( 0.5 * var(--offset-x) ), calc( 0.5 * var(--offset-y) )) scale(0) } 33% { transform: translate(calc( 1 * var(--offset-x) ), calc( 1 * var(--offset-y) )) scale(1) } 66% { transform: translate(calc( 2 * var(--offset-x) ), calc( 2 * var(--offset-y) )) scale(1) } 100% { transform: translate(calc( 3 * var(--offset-x) ), calc( 3 * var(--offset-y) )) scale(0) } } @keyframes even-animation { 50% { transform: translate(calc( 1 * var(--offset-x) ), calc( 1 * var(--offset-y) )) scale(1) } 100% { transform: translate(calc( 2 * var(--offset-x) ), calc( 2 * var(--offset-y) )) scale(0) } } body { align-items: center; background-color: black; display: flex; height: 100vh; justify-content: center; overflow: hidden; margin: 0; } .hex { color: white; display: flex; font-size: 3vmin; height: calc(2em * var(--Radius)); width: calc(2em * var(--radius)); } .hex::before { border: calc(0.5em * var(--Radius)) solid transparent; border-left: 0; border-right: calc(1em * var(--radius)) solid currentColor; content: ""; height: var(--Radius); } .hex::after { border: calc(0.5em * var(--Radius)) solid transparent; border-left: calc(1em * var(--radius)) solid currentColor; border-right: 0; content: ""; height: var(--Radius); } .center { position: relative; } .odd, .even { --global-offset-x: calc( 0.5em * var(--gap) + var(--radius) * 1em); --global-offset-y: calc( 1.5em * var(--Radius) + var(--Gap) * 1em); animation: infinite cubic-bezier(.21, .61, .01, .89); position: absolute; transform: translate(0, 0) scale(0); } .odd { animation-duration: 11s; } .even { animation-duration: 7.333333333s; } .hex.first { animation-delay: -6.2857142857s; } .hex.second { animation-delay: -2.619047619s; } .hex.third { animation-delay: 1.0476190476s; } @supports (animation-delay: calc(1 * 1s)) and (animation-duration: calc(1 * 1s)) { .odd { animation-duration: calc(var(--time) * 1s); } .even { animation-duration: calc( var(--time) * 2 / 3 * 1s); } .hex.first { animation-delay: calc( var(--time) / -1.75 * 1s ); } .hex.second { animation-delay: calc( var(--time) * 1.25 / -5.25 * 1s ); } .hex.third { animation-delay: calc( var(--time) * -0.25 / -2.625 * 1s ); } } .hex.one { --offset-x: calc( var(--global-offset-x) * 1 ); --offset-y: calc( var(--global-offset-y) * -1 ); animation-name: odd-animation; bottom: 0; left: 0; } .hex.two { --offset-x: calc( var(--global-offset-x) * 1.5 ); --offset-y: calc( var(--global-offset-y) * -0.5 ); animation-name: even-animation; bottom: calc( var(--global-offset-y) * 0.5 ); left: calc( var(--global-offset-x) * 1.5 ); } .hex.three { --offset-x: calc( var(--global-offset-x) * 2 ); --offset-y: calc( var(--global-offset-y) * 0 ); animation-name: odd-animation; bottom: 0; right: 0; } .hex.four { --offset-x: calc( var(--global-offset-x) * 1.5 ); --offset-y: calc( var(--global-offset-y) * 0.5 ); animation-name: even-animation; top: calc( var(--global-offset-y) * 0.5 ); left: calc( var(--global-offset-x) * 1.5 ); } .hex.five { --offset-x: calc( var(--global-offset-x) * 1 ); --offset-y: calc( var(--global-offset-y) * 1 ); animation-name: odd-animation; top: 0; left: 0; } .hex.six { --offset-x: calc( var(--global-offset-x) * 0 ); --offset-y: calc( var(--global-offset-y) * 1 ); animation-name: even-animation; top: calc( var(--global-offset-y) * 1 ); left: 0; } .hex.seven { --offset-x: calc( var(--global-offset-x) * -1 ); --offset-y: calc( var(--global-offset-y) * 1 ); animation-name: odd-animation; top: 0; right: 0; } .hex.eight { --offset-x: calc( var(--global-offset-x) * -1.5 ); --offset-y: calc( var(--global-offset-y) * 0.5 ); animation-name: even-animation; top: calc( var(--global-offset-y) * 0.5 ); right: calc( var(--global-offset-x) * 1.5 ); } .hex.nine { --offset-x: calc( var(--global-offset-x) * -2 ); --offset-y: calc( var(--global-offset-y) * 0 ); animation-name: odd-animation; top: 0; right: 0; } .hex.ten { --offset-x: calc( var(--global-offset-x) * -1.5 ); --offset-y: calc( var(--global-offset-y) * -0.5 ); animation-name: even-animation; bottom: calc( var(--global-offset-y) * 0.5 ); right: calc( var(--global-offset-x) * 1.5 ); } .hex.eleven { --offset-x: calc( var(--global-offset-x) * -1 ); --offset-y: calc( var(--global-offset-y) * -1 ); animation-name: odd-animation; bottom: 0; right: 0; } .hex.twelve { --offset-x: calc( var(--global-offset-x) * 0 ); --offset-y: calc( var(--global-offset-y) * -1 ); animation-name: even-animation; bottom: calc( var(--global-offset-y) * 1 ); left: 0; }
4
Hexagon Animation
By:
rald_dev
Front
body{ width: 1366px; height:1366px; background:; } .first{ width: 475px; height: 217px; background: green; transform: rotate(90deg) rotateX(90deg) rotateZ(0deg) translate3d(4px,0px,-87px); overflow: hidden; visibility: hidden; position: absolute; transition: all 0.5s ease; } .first2{ width: 475px; height: 217px; background: green; transform: rotate(90deg) rotateX(90deg) rotateZ(0deg) translate3d(4px,0px,-238px); overflow: hidden; visibility: hidden; position: absolute; transition: all 0.5s ease; } .second{ width: 500px; height: 216px; background: red; transform: rotate(-60deg); overflow: hidden; } .third{ width: 500px; height: 216px; background:orange; background-position: center; background-size: 80%; transform: rotate(-60deg); overflow: hidden; visibility: visible; } .sides{ width: 150px; height: 125px; background: gray; position: absolute; } .s1{ transform: rotateX(60deg) translate3d(0px,31px,-162px); background: red; } .sides.s2 { transform: rotateX(-60deg)translate3d(0px, 31px, -54px); background: blue; } .s3{ transform: rotateX(60deg) translate3d(0px, 32px, 54px); background: green; } .s4{ transform: rotateX(-60deg) translate3d(0px, 32px, 161px); background: #9C27B0; } .s5{ background: gray; transform: translate3d(0px, 62px, 108px); } .s6{ background: darkgray; } .sides.S6{ transform: translate3d(0px, 62px, -109px); } @keyframes rotate{ 0%{transform: rotateY(0deg) rotateX(0deg) ;} 100%{transform: rotateY(360deg) rotateX(360deg);} } .main{ width: 250px; height: 250px; perspective: 800px; } .cube{ width: 150px; height: 250px; margin-left: 250px; background:; transform-style: preserve-3d; transform: rotateY(70deg); animation: rotate 15s linear infinite; }
3
3D Hexagon Animation
By:
rald_dev