diff --git a/README.md b/README.md index 987dc62..378190f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -# Some cool CSS effects +# Snake Cube Loader Animation Effects -Check my branches and have fun! - -View [DEMOS](https://codepen.io/filippoerbisti) on Codepen. +View and try [DEMO](https://codepen.io/filippoerbisti/pen/MWQoEXV) on Codepen. diff --git a/index.html b/index.html new file mode 100644 index 0000000..97602cd --- /dev/null +++ b/index.html @@ -0,0 +1,19 @@ + + + + + + + Snake Cube Loader Animation Effects + + + + +
+ + + + +
+ + \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..1f206a2 --- /dev/null +++ b/style.css @@ -0,0 +1,114 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + display: flex; + align-items: center; + justify-content: center; + min-height: 100vh; + background: #000; +} + +.loader { + position: relative; + width: 200px; + height: 200px; + overflow: hidden; + -webkit-box-reflect: below 1px linear-gradient(transparent, #0005); +} + +.loader:hover { + background: #03e9f4; + box-shadow: 0 0 5px #03e9f4, + 0 0 25px #03e9f4, + 0 0 50px #03e9f4, + 0 0 200px #03e9f4; +} + +.loader span { + position: absolute; + display: block; +} + +.loader span:nth-child(1) { + top: 0; + left: -100%; + width: 100%; + height: 40px; + background: linear-gradient(90deg, transparent, #03e9f4); + animation: animate1 1s linear infinite; + animation-delay: 0s; +} + +@keyframes animate1 { + 0% { + left: -100%; + } + + 100% { + left: 100%; + } +} + +.loader span:nth-child(2) { + right: 0; + top: -100%; + height: 100%; + width: 40px; + background: linear-gradient(180deg, transparent, #03e9f4); + animation: animate2 1s linear infinite; + animation-delay: 0.5s; +} + +@keyframes animate2 { + 0% { + top: -100%; + } + + 100% { + top: 100%; + } +} + +.loader span:nth-child(3) { + bottom: 0; + left: -100%; + width: 100%; + height: 40px; + background: linear-gradient(270deg, transparent, #03e9f4); + animation: animate3 1s linear infinite; + animation-delay: 0s; +} + +@keyframes animate3 { + 0% { + left: 100%; + } + + 100% { + left: -100%; + } +} + +.loader span:nth-child(4) { + left: 0; + top: 100%; + height: 100%; + width: 40px; + background: linear-gradient(360deg, transparent, #03e9f4); + animation: animate4 1s linear infinite; + animation-delay: 0.5s; +} + +@keyframes animate4 { + 0% { + top: 100%; + } + + 100% { + top: -100%; + } +}