Triangle Peeker
How do I make an triangle peeker?
Images rotate slightly to reveal short bit of text.. What is a triangle peeker? How do you make a triangle peeker? This script and codes were developed by Derek Wheelden on 10 August 2022, Wednesday.
Triangle Peeker - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Triangle Peeker</title> <script src="http://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! */ @import url(http://fonts.googleapis.com/css?family=Lato:100,400);
.triangle { position: relative; width: 30rem; height: 15rem; margin: 2rem; padding: 0 40px; background: #9da6af; overflow: hidden; float: left; transition: all 0.5s ease-in-out;
}
.triangle.inactive { opacity: 0.5;
}
.triangle p { margin: 10px 0;
}
.triangle :before { content: ' '; position: absolute; top: 0; left: 0; bottom: 0; right: 0; border: 15rem solid #d5d9dd; border-top-color: transparent; z-index: 1000;
}
.triangle.rotate:hover img { -webkit-transform: rotate(-12deg); -moz-transform: rotate(-12deg); -ms-transform: rotate(-12deg); -o-transform: rotate(-12deg); transform: rotate(-12deg); -webkit-transform-origin: top right; -moz-transform-origin: top right; -ms-transform-origin: top right; -o-transform-origin: top right; transform-origin: top right;
}
.triangle.slide:hover img { -webkit-transform: translateY(40px); -moz-transform: translateY(40px); -ms-transform: translateY(40px); -o-transform: translateY(40px); transform: translateY(40px);
}
.triangle img { position: absolute; top: 0; left: -5%; width: 110%; z-index: 100; transition: all 0.5s ease-in-out;
}
.lt-ie9 .triangle:hover img { top: 40px;
}
/* General page styles */
* { box-sizing: border-box;
}
html { background: #d5d9dd; font-size: 62.5%;
}
body { width: 102rem; margin: 0 auto; font: 400 1.5rem Lato, sans-serif; color: white; backface-visibility: hidden;
}
h1 { margin: 20px 0 0; font: 100 4rem Lato, sans-serif; color: #394046; text-align: center; letter-spacing: 0.25rem; text-transform: uppercase;
}
body > p { margin: 10px 0; text-align: center; color: #9da6af;
}
.preload * { -webkit-transition: none !important; -moz-transition: none !important; -ms-transition: none !important; -o-transition: none !important;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <body class="preload"> <h1>Triangle Peeker</h1> <p>You know the drill. Hover over the cats.</p> <div class="triangle rotate"> <p>So you could</p> <img src="http://placekitten.com/500/500" /> </div> <div class="triangle rotate"> <p>put some text</p> <img src="http://placekitten.com/g/300/300" /> </div> <div class="triangle rotate"> <p>in these guys,</p> <img src="http://placekitten.com/500/500" /> </div> <div class="triangle slide"> <p>maybe a name for example,</p> <img src="http://placekitten.com/g/300/300" /> </div> <div class="triangle slide"> <p>and then when you hover over</p> <img src="http://placekitten.com/500/500" /> </div> <div class="triangle slide"> <p>the text peeks out a little.</p> <img src="http://placekitten.com/g/300/300" /> </div>
</body> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Triangle Peeker - Script Codes CSS Codes
@import url(http://fonts.googleapis.com/css?family=Lato:100,400);
.triangle { position: relative; width: 30rem; height: 15rem; margin: 2rem; padding: 0 40px; background: #9da6af; overflow: hidden; float: left; transition: all 0.5s ease-in-out;
}
.triangle.inactive { opacity: 0.5;
}
.triangle p { margin: 10px 0;
}
.triangle :before { content: ' '; position: absolute; top: 0; left: 0; bottom: 0; right: 0; border: 15rem solid #d5d9dd; border-top-color: transparent; z-index: 1000;
}
.triangle.rotate:hover img { -webkit-transform: rotate(-12deg); -moz-transform: rotate(-12deg); -ms-transform: rotate(-12deg); -o-transform: rotate(-12deg); transform: rotate(-12deg); -webkit-transform-origin: top right; -moz-transform-origin: top right; -ms-transform-origin: top right; -o-transform-origin: top right; transform-origin: top right;
}
.triangle.slide:hover img { -webkit-transform: translateY(40px); -moz-transform: translateY(40px); -ms-transform: translateY(40px); -o-transform: translateY(40px); transform: translateY(40px);
}
.triangle img { position: absolute; top: 0; left: -5%; width: 110%; z-index: 100; transition: all 0.5s ease-in-out;
}
.lt-ie9 .triangle:hover img { top: 40px;
}
/* General page styles */
* { box-sizing: border-box;
}
html { background: #d5d9dd; font-size: 62.5%;
}
body { width: 102rem; margin: 0 auto; font: 400 1.5rem Lato, sans-serif; color: white; backface-visibility: hidden;
}
h1 { margin: 20px 0 0; font: 100 4rem Lato, sans-serif; color: #394046; text-align: center; letter-spacing: 0.25rem; text-transform: uppercase;
}
body > p { margin: 10px 0; text-align: center; color: #9da6af;
}
.preload * { -webkit-transition: none !important; -moz-transition: none !important; -ms-transition: none !important; -o-transition: none !important;
}
Triangle Peeker - Script Codes JS Codes
$(window).load(function() { $("body").removeClass("preload");
});
// I had to do this because the CSS sibling selector is bullshit
$( ".triangle" ).hover( function() { $( this ).siblings().addClass("inactive"); }, function() { $( this ).siblings().removeClass("inactive"); }
);
Developer | Derek Wheelden |
Username | frxnz |
Uploaded | August 10, 2022 |
Rating | 3.5 |
Size | 4,339 Kb |
Views | 28,336 |
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!
Name | Size |
Sliding Tab Box Things | 5,366 Kb |
User Listing | 5,274 Kb |
Live LESS Compilation | 3,251 Kb |
Dumb Triangle Thing | 3,280 Kb |
Folding Panels | 3,134 Kb |
Off-Screen Mobile Nav | 4,428 Kb |
JavaScript Templates | 4,381 Kb |
Fantastic Mr. Fox | 7,290 Kb |
Google Maps Geolocation Test | 4,439 Kb |
File Browser Mockup | 7,337 Kb |
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!
Name | Username | Size |
Loading animation | Codeams | 2,408 Kb |
A Pen by Anoop | Anoopjohn | 330,760 Kb |
A Pen by Moeid Saleem | Moeidsaleem | 1,862 Kb |
Reading Grid | Tappily | 4,306 Kb |
Website Concept | Sagoza | 3,104 Kb |
CSS3 Diamond | Rendro | 1,960 Kb |
Direction-icon | Alexandremasy | 3,323 Kb |
Fluid Responsive Typography | Jonmilner | 4,205 Kb |
LeMandinque | Aadesida | 9,046 Kb |
Animated bar chart | CreativePunch | 3,124 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!