Flexagons

Developer
Size
5,023 Kb
Views
38,456

How do I make an flexagons?

A number of methods to create fluid hexagons that also support transparent backgrounds, each method having distinct advantages and disadvantages. Browser support varies.. What is a flexagons? How do you make a flexagons? This script and codes were developed by Joey Hoer on 14 September 2022, Wednesday.

Flexagons Previews

Flexagons - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Flexagons</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"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <!-- Border Method -->
<div class="hex hex-border"> <div class="hook before"></div> <div class="hook after"></div> <div class="center">border</div>
</div>
<!-- Clip-path Method -->
<div class="hex hex-clip"> <div class="center">clip-path</div>
</div>
<!-- Transform Method -->
<div class="hex hex-rotate"> <div class="hook"> <div class="hook"> <div class="center">rotate</div> </div> </div>
</div>
<!-- Skew Method -->
<div class="hex hex-skew"> <div class="center">skew</div>
</div>
<!-- Rotate Method 2 -->
<div class="hex hex-rotate2"> <div class="hook"></div> <div class="center">rotate 2</div>
</div>
</body>
</html>

Flexagons - Script Codes CSS Codes

.hex-border { background: rgba(191, 64, 64, 0.85); border-color: rgba(191, 64, 64, 0.85);
}
.hex-clip { background: rgba(191, 191, 64, 0.85);
}
.hex-rotate { background: rgba(64, 191, 64, 0.85);
}
.hex-skew { background: rgba(64, 191, 191, 0.85);
}
.hex-rotate2 { background: #4040bf;
}
.hex-rotate2 > .hook { opacity: 0.85;
}
.hex { display: inline-block; vertical-align: middle; width: 15%; position: relative; text-transform: uppercase; font-weight: bold; font-size: 2vw;
}
.center { text-align: center; position: absolute; top: 50%; left: 0; right: 0; -webkit-transform: translateY(-50%); transform: translateY(-50%);
}
.hex-border:before { content: ''; display: block; padding-bottom: 57.7350269%;
}
.hex-border .before,
.hex-border .after { border-color: inherit; overflow: hidden; position: absolute; width: 100%;
}
.hex-border .before:before, .hex-border .before:after,
.hex-border .after:before,
.hex-border .after:after { content: ''; display: block;
}
.hex-border .before:before,
.hex-border .after:before { padding-bottom: 28.86751345%;
}
.hex-border .before:after,
.hex-border .after:after { position: absolute; left: 50%; -webkit-transform: translateX(-50%); transform: translateX(-50%); border: 100in solid transparent;
}
.hex-border .before { bottom: 100%;
}
.hex-border .before:after { top: 0; border-top: 0; border-bottom-width: 57.7350269in; border-bottom-color: inherit;
}
.hex-border .after { top: 100%;
}
.hex-border .after:after { bottom: 0; border-bottom: 0; border-top-width: 57.7350269in; border-top-color: inherit;
}
.hex-border.horizontal { width: 7.5%; margin-left: 3.75%; margin-right: 3.75%;
}
.hex-border.horizontal .center { margin-left: -50%; margin-right: -50%;
}
.hex-border.horizontal:before { padding-bottom: 173.2050808%;
}
.hex-border.horizontal .before,
.hex-border.horizontal .after { top: 0; width: 50%;
}
.hex-border.horizontal .before:before,
.hex-border.horizontal .after:before { padding-bottom: 346.4101616%;
}
.hex-border.horizontal .before:after,
.hex-border.horizontal .after:after { top: 50%; left: auto; -webkit-transform: translateY(-50%); transform: translateY(-50%); border: 100in solid transparent;
}
.hex-border.horizontal .before { bottom: auto; right: 100%;
}
.hex-border.horizontal .before:after { border-left: 0; border-right-width: 57.7350269in; border-right-color: inherit;
}
.hex-border.horizontal .after { left: 100%;
}
.hex-border.horizontal .after:after { bottom: auto; right: 0; border-right: 0; border-left-width: 57.7350269in; border-left-color: inherit;
}
.hex-clip { -webkit-clip-path: polygon(0% 25%, 50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%); clip-path: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxkZWZzPjxjbGlwUGF0aCBpZD0iaCIgY2xpcFBhdGhVbml0cz0ib2JqZWN0Qm91bmRpbmdCb3giPjxwb2x5Z29uIHBvaW50cz0iMCAuMjUgLjUgMCAxIC4yNSAxIC43NSAuNSAxIDAgLjc1Ij48L3BvbHlnb24+PC9jbGlwUGF0aD48L2RlZnM+PC9zdmc+Cg==#h);
}
.hex-clip:after { content: ''; display: block; padding-top: 115.4734411%;
}
.hex-clip.horizontal { -webkit-clip-path: polygon(0% 50%, 25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%); clip-path: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz1odHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Zz48ZGVmcz48Y2xpcFBhdGggaWQ9aCBjbGlwUGF0aFVuaXRzPW9iamVjdEJvdW5kaW5nQm94Pjxwb2x5Z29uIHBvaW50cz0wIC41MCAuMjUgMCAuNzUgMCAxIC41MCAuNzUgMSAuMjUgMT48L3BvbHlnb24+PC9jbGlwUGF0aD48L2RlZnM+PC9zdmc+Cg==#h);
}
.hex-clip.horizontal:after { padding-top: 86.6025404%;
}
.hex-rotate { visibility: hidden; overflow: hidden; -webkit-transform: rotate(120deg); transform: rotate(120deg);
}
.hex-rotate:after { content: ''; display: block; padding-top: 115.4734411%;
}
.hex-rotate > * { position: absolute; top: 0; left: 0;
}
.hex-rotate .hook { overflow: hidden; width: 100%; height: 100%; background: inherit; -webkit-transform: rotate(-60deg); transform: rotate(-60deg);
}
.hex-rotate > .hook > .hook { visibility: visible;
}
.hex-rotate.horizontal:after { padding-top: 86.6025404%;
}
.hex-skew { position: relative; overflow: hidden; visibility: hidden;
}
.hex-skew:before { content: ''; position: absolute; visibility: visible; top: 0; bottom: 0; right: 0; left: 0; -webkit-transform: rotate(-30deg) skewX(30deg) scale(1.155, 0.866); transform: rotate(-30deg) skewX(30deg) scale(1.155, 0.866); background: inherit;
}
.hex-skew:after { content: ''; display: block; padding-top: 115.4734411%;
}
.hex-skew > * { visibility: visible;
}
.hex-skew.horizontal:before { -webkit-transform: rotate(30deg) skewY(30deg) scale(0.866, 1.155); transform: rotate(30deg) skewY(30deg) scale(0.866, 1.155);
}
.hex-skew.horizontal:after { padding-top: 86.6025404%;
}
.hex-rotate2 { position: relative; visibility: hidden;
}
.hex-rotate2:after { content: ''; display: block; padding-top: 115.4734411%;
}
.hex-rotate2 > * { visibility: visible;
}
.hex-rotate2 .hook { position: absolute; height: 50%; width: 100%; top: 25%; background-color: inherit;
}
.hex-rotate2 .hook:before, .hex-rotate2 .hook:after { content: ''; background-color: inherit; position: absolute; height: 100%; width: 100%; top: 0; left: 0;
}
.hex-rotate2 .hook:before { -webkit-transform: rotate(60deg); transform: rotate(60deg);
}
.hex-rotate2 .hook:after { -webkit-transform: rotate(-60deg); transform: rotate(-60deg);
}
.hex-rotate2.horizontal:after { padding-top: 86.6025404%;
}
.hex-rotate2.horizontal .hook { height: 100%; width: 50%; top: auto; left: 25%;
}
/* Checkerboard */
body { background-image: -webkit-linear-gradient(45deg, #ccc 25%, rgba(204, 204, 204, 0) 25%, rgba(204, 204, 204, 0) 75%, #ccc 75%, #ccc), -webkit-linear-gradient(45deg, #ccc 25%, rgba(204, 204, 204, 0) 25%, rgba(204, 204, 204, 0) 75%, #ccc 75%, #ccc); background-image: linear-gradient(45deg, #ccc 25%, rgba(204, 204, 204, 0) 25%, rgba(204, 204, 204, 0) 75%, #ccc 75%, #ccc), linear-gradient(45deg, #ccc 25%, rgba(204, 204, 204, 0) 25%, rgba(204, 204, 204, 0) 75%, #ccc 75%, #ccc); background-size: 30px 30px; background-position: 0 0, 15px 15px;
}
/* Center */
html, body { height: 100%;
}
html { display: table; width: 100%;
}
body { display: table-cell; vertical-align: middle; text-align: center;
}
Flexagons - Script Codes
Flexagons - Script Codes
Home Page Home
Developer Joey Hoer
Username joeyhoer
Uploaded September 14, 2022
Rating 3
Size 5,023 Kb
Views 38,456
Do you need developer help for Flexagons?

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!

Joey Hoer (joeyhoer) Script Codes
Create amazing marketing copy 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!