Frontend Forever App
We have a mobile app for you to download and use. And you can unlock many features in the app.
Get it now
Intall Later
Run
HTML
CSS
Javascript
Output
Document
x1
x2
x3
x4
x5
x6
x7
y1
y2
y3
y4
y5
y6
y7
x1
x2
x3
x4
x5
x6
x7
y1
y2
y3
y4
y5
y6
y7
@charset "UTF-8"; @import url(https://fonts.googleapis.com/css?family=Nunito+Sans:300,400,600,700,800); *, :after, :before { box-sizing: border-box; padding: 0; margin: 0; } $blk: #581845; $none: rgba(#fff, 0); $grid: 8vh; html,body { height: 100%; font-size: 1.5vh; text-align: center; margin: 0; background: #9cec5b; font-family: sans-serif; } div, div u, div > u:before, label, .sig { aspect-ratio: 1/1; width: $grid; } div > u:before, label, label:before, label:hover, label:focus { transition: all 0.25s ease-in-out; } div, div > u:before, label, label:before{ position: absolute; inset: 0; margin: auto; } div > u:before, label:before{ color: $blk; } // grid div { display: flex; flex-wrap: wrap; width: calc(#{$grid} * 7); transform: translate3d(0, -($grid * 1.25), 0); u { box-shadow: 0 0 1px $blk; &:nth-of-type(odd) { background: rgba($blk, 0.1); } } & > u { text-decoration: none; position: relative; &:before { font-size: $grid; content: "♟"; transform: scale(0); } } } // buttons label { transform: translate3d(0, 0, 0) scale(.1); top: auto; bottom: ($grid + 3); background: lighten($blk, 90); border-radius: 50%; color: $none; filter: brightness(1) drop-shadow(0 0.2rem 0 rgba($blk, 0.5)); cursor: pointer; &:hover, &:focus { filter: brightness(0.9) drop-shadow(0 0.1rem 0 rgba($blk, 0.5)); &:before { transform: scale(1.3); } } &:before { content: "\2191"; font-size: $grid; } } //movement @for $i from 1 through 8 { // x & y loops #x#{$i}-input:checked ~ { #x#{$i - 1}-label { // left transform: translate3d(-#{$grid}, 0, 0) rotate(-90deg) scale(1); } #x#{$i + 1}-label { // right transform: translate3d(#{$grid}, 0, 0) rotate(90deg) scale(1); } } #y#{$i}-input:checked ~ { #y#{$i + 1}-label { // down transform: translate3d(0, #{$grid}, 0) rotate(180deg) scale(1); } #y#{$i - 1}-label { // up transform: translate3d(0, -#{$grid}, 0) scale(1); } } } @for $x from 1 through 8 { body:has(#x#{$x}-input:checked) { @for $y from 1 through 8 { &:has(#y#{$y}-input:checked) { $yn1: ($y - 1); div > u:nth-of-type(#{$yn1 * 7 + $x}):before { transform: scale(1); } } } } } //logo .sig { width: 4em; background: linear-gradient(45deg, $blk 25%, $none 25%), linear-gradient(135deg, $blk 25%, $none 25%), linear-gradient(45deg, $blk 25%, $none 25%), linear-gradient(135deg, $blk 25%, $none 25%), linear-gradient(45deg, $blk 25%, $none 25%), linear-gradient(135deg, $blk 25%, $none 25%), linear-gradient(45deg, $blk 25%, $none 25%), linear-gradient(135deg, $blk 25%, $none 25%); background-position: -0.1em -2.8em, -0.1em 1.2em, -0.1em -1em, -0.1em 2.99em, 2.3em -1.8em, 2.3em 0, 2.3em 0, 2.3em 1.8em; background-repeat: no-repeat; position: absolute; left: 0; top: -.7em; transform: scaleY(0.6) scale(0.7); border-radius: 0.5em; overflow: hidden; }
console.log("Event Fired") // Super simple grid movement // With the smallest code possible? // Just for fun