Hexagona

Size
3,420 Kb
Views
24,288

How do I make an hexagona?

Playing with SVG and CSS3. What is a hexagona? How do you make a hexagona? This script and codes were developed by François Chazal on 21 September 2022, Wednesday.

Hexagona Previews

Hexagona - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Hexagona</title> <script src="https://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ #clipboard { display: none;
}
.row { height: 154px; overflow: hidden;
}
.row:nth-of-type(2n) { margin-left: -66.95191px;
}
.row:nth-of-type(2n+1) { margin-top: -37.5px; margin-bottom: -37.5px;
}
.hexagon { position: relative; display: inline-block; margin: 2px; width: 129.90381px; height: 150px; perspective: 800px;
}
.hexagon:hover > .container { transform: rotate3d(0.5, 0.86603, 0, 180deg); transition: 0s 0s all ease-in;
}
.hexagon:hover .front { fill: #888; transition: 0s 0s all ease-in;
}
.container { position: relative; transform-style: preserve-3d; transform-origin: 64.95191px 75px; transition: 0.5s 1s all ease;
}
.face { position: absolute; backface-visibility: hidden; transition: 1s 1s all ease;
}
.face.front { fill: #EEE;
}
.face.back { fill: #D30B00; transform: rotate3d(0, 1, 0, 180deg);
}
path { stroke-width: 10px; stroke-linecap: round; stroke-linejoin: round; backface-visibility: hidden;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div id="clipboard"> <div class="row"></div> <div class="hexagon"> <div class="container"> <svg class="face front" width="100%" height="100%" viewBox="0 0 100 100" preserveAspectRatio="none"> <path d="M25,12.5 C 50,0 50,0 75,12.5 C 100,25 100,25 100,50 C 100,75 100,75 75,87.5 C 50,100 50,100 25,87.5 C 0,75 0,75 0,50 C0,25 0,25 25,12.5 Z" /> </svg> <svg class="face back" width="100%" height="100%" viewBox="0 0 100 100" preserveAspectRatio="none"> <path d="M25,12.5 C 50,0 50,0 75,12.5 C 100,25 100,25 100,50 C 100,75 100,75 75,87.5 C 50,100 50,100 25,87.5 C 0,75 0,75 0,50 C0,25 0,25 25,12.5 Z" /> </svg> <div> </div>
</div> <script src="js/index.js"></script>
</body>
</html>

Hexagona - Script Codes CSS Codes

#clipboard { display: none;
}
.row { height: 154px; overflow: hidden;
}
.row:nth-of-type(2n) { margin-left: -66.95191px;
}
.row:nth-of-type(2n+1) { margin-top: -37.5px; margin-bottom: -37.5px;
}
.hexagon { position: relative; display: inline-block; margin: 2px; width: 129.90381px; height: 150px; perspective: 800px;
}
.hexagon:hover > .container { transform: rotate3d(0.5, 0.86603, 0, 180deg); transition: 0s 0s all ease-in;
}
.hexagon:hover .front { fill: #888; transition: 0s 0s all ease-in;
}
.container { position: relative; transform-style: preserve-3d; transform-origin: 64.95191px 75px; transition: 0.5s 1s all ease;
}
.face { position: absolute; backface-visibility: hidden; transition: 1s 1s all ease;
}
.face.front { fill: #EEE;
}
.face.back { fill: #D30B00; transform: rotate3d(0, 1, 0, 180deg);
}
path { stroke-width: 10px; stroke-linecap: round; stroke-linejoin: round; backface-visibility: hidden;
}

Hexagona - Script Codes JS Codes

(function() { var row = document.querySelector('#clipboard>.row'); var hexagon = document.querySelector('#clipboard>.hexagon'); for (var j=0; j<20; j++) { var curr_row = row.cloneNode(true); for (var i=0; i<20; i++) { curr_row.appendChild(hexagon.cloneNode(true)); } document.body.appendChild(curr_row); }
})();
Hexagona - Script Codes
Hexagona - Script Codes
Home Page Home
Developer François Chazal
Username fchazal
Uploaded September 21, 2022
Rating 3
Size 3,420 Kb
Views 24,288
Do you need developer help for Hexagona?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

François Chazal (fchazal) Script Codes
Create amazing sales emails with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!