A Pen by Julius Caesar on CodePen.
Created
November 10, 2025 05:17
-
-
Save rsp2k/86cce82102abdef42f452cdd9acb7587 to your computer and use it in GitHub Desktop.
Honeycomb Grid
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="container"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let container = document.querySelector(".container"); | |
| let fragment = document.createDocumentFragment(); | |
| for (let i = 0; i < 12; i++) { | |
| let row = document.createElement("div"); | |
| row.classList.add("row"); | |
| for (let j = 0; j < 20; j++) { | |
| let box = document.createElement("div"); | |
| box.classList.add("box"); | |
| box.style.filter = `hue-rotate(${i * 36}deg)`; | |
| row.appendChild(box); | |
| } | |
| fragment.appendChild(row); | |
| } | |
| container.appendChild(fragment); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * { | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| } | |
| body { | |
| background: #000; | |
| overflow: hidden; | |
| } | |
| .container { | |
| position: relative; | |
| height: 100vh; | |
| } | |
| .row { | |
| display: inline-flex; | |
| margin-top: -32px; | |
| margin-left: -50px; | |
| } | |
| .row:nth-child(even) { | |
| margin-left: 1px; | |
| } | |
| .row .box { | |
| position: relative; | |
| width: 100px; | |
| height: 110px; | |
| background: #0c0c0c; | |
| margin: 2px; | |
| transition: 2s; | |
| clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); | |
| } | |
| .row .box:hover { | |
| transition: 0s; | |
| background: #0f0; | |
| } | |
| .row .box:before { | |
| content: ""; | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| width: 100%; | |
| height: 100%; | |
| background: rgba(255, 255, 255, 0.02); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment