Direction Aware Tiles using clip-path Pure CSS

Developer
Size
3,904 Kb
Views
2,024

How do I make an direction aware tiles using clip-path pure css?

Quick explanation in my blog ~\m/. What is a direction aware tiles using clip-path pure css? How do you make a direction aware tiles using clip-path pure css? This script and codes were developed by Elmer Balbin on 22 January 2023, Sunday.

Direction Aware Tiles using clip-path Pure CSS Previews

Direction Aware Tiles using clip-path Pure CSS - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Direction Aware Tiles using clip-path Pure CSS</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class='tiles'> <div class='col'> <a href="#"></a> <a href="#"></a> <a href="#"></a> <a href="#"></a> <div class='box'></div> </div> <div class='col'> <a href="#"></a> <a href="#"></a> <a href="#"></a> <a href="#"></a> <div class='box'></div> </div> <div class='col'> <a href="#"></a> <a href="#"></a> <a href="#"></a> <a href="#"></a> <div class='box'></div> </div> <div class='col'> <a href="#"></a> <a href="#"></a> <a href="#"></a> <a href="#"></a> <div class='box'></div> </div> <div class='col'> <a href="#"></a> <a href="#"></a> <a href="#"></a> <a href="#"></a> <div class='box'></div> </div> <div class='col'> <a href="#"></a> <a href="#"></a> <a href="#"></a> <a href="#"></a> <div class='box'></div> </div> <div class='col'> <a href="#"></a> <a href="#"></a> <a href="#"></a> <a href="#"></a> <div class='box'></div> </div> <div class='col'> <a href="#"></a> <a href="#"></a> <a href="#"></a> <a href="#"></a> <div class='box'></div> </div> <div class='col'> <a href="#"></a> <a href="#"></a> <a href="#"></a> <a href="#"></a> <div class='box'></div> </div> <div class='col'> <a href="#"></a> <a href="#"></a> <a href="#"></a> <a href="#"></a> <div class='box'></div> </div> <div class='col'> <a href="#"></a> <a href="#"></a> <a href="#"></a> <a href="#"></a> <div class='box'></div> </div> <div class='col'> <a href="#"></a> <a href="#"></a> <a href="#"></a> <a href="#"></a> <div class='box'></div> </div> <div class='col'> <a href="#"></a> <a href="#"></a> <a href="#"></a> <a href="#"></a> <div class='box'></div> </div> <div class='col'> <a href="#"></a> <a href="#"></a> <a href="#"></a> <a href="#"></a> <div class='box'></div> </div> <div class='col'> <a href="#"></a> <a href="#"></a> <a href="#"></a> <a href="#"></a> <div class='box'></div> </div>
</div>
</body>
</html>

Direction Aware Tiles using clip-path Pure CSS - Script Codes CSS Codes

@import url("https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css");
html, body { margin: 0; padding: 0; background: #f1deb9;
}
.tiles { position: absolute; top: 50%; left: 50%; transform: translateX(-50%) translateY(-50%); width: 750px; height: 450px; perspective: 1000px;
}
.col { position: relative; float: left; margin: 6px; width: calc(150px - 12px); height: calc(150px - 12px);
}
.col a { position: absolute; width: 100%; height: 100%; z-index: 2;
}
.col a:nth-child(1) { -webkit-clip-path: polygon(0 0, 100% 0, 50% 50%); clip-path: polygon(0 0, 100% 0, 50% 50%);
}
.col a:nth-child(2) { -webkit-clip-path: polygon(100% 0, 100% 100%, 50% 50%); clip-path: polygon(100% 0, 100% 100%, 50% 50%);
}
.col a:nth-child(3) { -webkit-clip-path: polygon(0 100%, 50% 50%, 100% 100%); clip-path: polygon(0 100%, 50% 50%, 100% 100%);
}
.col a:nth-child(4) { -webkit-clip-path: polygon(0 0, 50% 50%, 0 100%); clip-path: polygon(0 0, 50% 50%, 0 100%);
}
.col a:hover { z-index: 3; -webkit-clip-path: none; clip-path: none;
}
.col a:nth-child(1):hover ~ .box { transform: rotateX(180deg);
}
.col a:nth-child(2):hover ~ .box { transform: rotateY(180deg);
}
.col a:nth-child(3):hover ~ .box { transform: rotateX(-180deg);
}
.col a:nth-child(4):hover ~ .box { transform: rotateY(-180deg);
}
.col a:nth-child(1):hover ~ .box:after, .col a:nth-child(3):hover ~ .box:after { transform: rotateX(-180deg);
}
.col a:nth-child(2):hover ~ .box:after, .col a:nth-child(4):hover ~ .box:after { transform: rotateY(-180deg);
}
.col .box { position: absolute; width: 100%; height: 100%; font-family: "Open Sans", sans-serif; box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12); transform-style: preserve-3d; transition: transform .3s ease-in-out;
}
.col .box:before { content: ""; position: absolute; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #FFF; font: normal normal normal 14px/1 FontAwesome; font-size: 40px; text-rendering: auto; -webkit-font-smoothing: antialiased; border-radius: 2px; z-index: 2; backface-visibility: hidden;
}
.col .box:after { content: 'Hi!'; position: absolute; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #333; color: #FFF; font-size: 48px; border-radius: 2px; transition-delay: .15s;
}
.col:nth-child(1) .box:before { content: "\f09a"; background: #3f51b5;
}
.col:nth-child(1) .box:after { background: #3f51b5;
}
.col:nth-child(2) .box:before { content: "\f099"; background: #1da1f2;
}
.col:nth-child(2) .box:after { background: #1da1f2;
}
.col:nth-child(3) .box:before { content: "\f0d5"; background: #dc4a38;
}
.col:nth-child(3) .box:after { background: #dc4a38;
}
.col:nth-child(4) .box:before { content: "\f0e1"; background: #006699;
}
.col:nth-child(4) .box:after { background: #006699;
}
.col:nth-child(5) .box:before { content: "\f173"; background: #36465d;
}
.col:nth-child(5) .box:after { background: #36465d;
}
.col:nth-child(6) .box:before { content: "\f13b"; background: #f16528;
}
.col:nth-child(6) .box:after { background: #f16528;
}
.col:nth-child(7) .box:before { content: "\f13c"; background: #0170ba;
}
.col:nth-child(7) .box:after { background: #0170ba;
}
.col:nth-child(8) .box:before { content: "\f19a"; background: #21759b;
}
.col:nth-child(8) .box:after { background: #21759b;
}
.col:nth-child(9) .box:before { content: "\f09b"; background: #323131;
}
.col:nth-child(9) .box:after { background: #323131;
}
.col:nth-child(10) .box:before { content: "\f1cb"; background: #000000;
}
.col:nth-child(10) .box:after { background: #000000;
}
.col:nth-child(11) .box:before { content: "\f268"; background: #fec540;
}
.col:nth-child(11) .box:after { background: #fec540;
}
.col:nth-child(12) .box:before { content: "\f269"; background: #ef8043;
}
.col:nth-child(12) .box:after { background: #ef8043;
}
.col:nth-child(13) .box:before { content: "\f282"; background: #2c74be;
}
.col:nth-child(13) .box:after { background: #2c74be;
}
.col:nth-child(14) .box:before { content: "\f267"; background: #409ed4;
}
.col:nth-child(14) .box:after { background: #409ed4;
}
.col:nth-child(15) .box:before { content: "\f26a"; background: #cc0f15;
}
.col:nth-child(15) .box:after { background: #cc0f15;
}
Direction Aware Tiles using clip-path Pure CSS - Script Codes
Direction Aware Tiles using clip-path Pure CSS - Script Codes
Home Page Home
Developer Elmer Balbin
Username elmzarnsi
Uploaded January 22, 2023
Rating 4.5
Size 3,904 Kb
Views 2,024
Do you need developer help for Direction Aware Tiles using clip-path Pure CSS?

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!

Elmer Balbin (elmzarnsi) Script Codes
Create amazing blog posts 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!