Sketchy Box
How do I make an sketchy box?
What is a sketchy box? How do you make a sketchy box? This script and codes were developed by Mnicpt on 30 July 2022, Saturday.
Sketchy Box - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Sketchy Box</title> <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> <div class="wrapper"> <div class="sketchy box"> <div class="content"> Content section with a hidden overflow when there is a massive amount of text </div> <div class="ellipsis">...</div> </div> <div class="sketchy box"> <div class="content"> Some other content that </div> <div class="ellipsis">...</div> </div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Sketchy Box - Script Codes CSS Codes
.wrapper { margin: 20px auto; width: 80%; text-align: center;
}
.sketchy { margin: 20px; font-size: 12px; float: left;
}
.sketchy.box { position: relative; box-sizing: border-box; display: inline-block; padding: 1.4%; width: 100px; height: 100px;
}
.sketchy.box .content { position: relative; width: 100%; height: 96%; max-height: 100px; overflow: hidden; text-overflow: ""; z-index: 100;
}
.ellipsis { display: none; content: '...'; position: absolute; bottom: 17px; right: 2px; width: 2em; height: 1em;
}
.sketchy:before { position: absolute; top: 3px; left: 3px; width: 88px; height: 96px; border-left: 3px double #444; border-right: 3px double #444; transform: rotate(-1deg); -webkit-transform: rotate(-1deg); -moz-transform: rotate(-1deg); content: ""; z-index: 50;
}
.sketchy:after { position: absolute; background-color: rgba(255, 212, 84, 0.5); top: 8px; left: 1px; width: 98px; height: 80px; border-top: 3px double #444; border-bottom: 3px double #444; transform: rotate(-1deg); -webkit-transform: rotate(-1deg); -moz-transform: rotate(-1deg); content: ""; z-index: 50;
}
Sketchy Box - Script Codes JS Codes
(function() { var content = document.querySelectorAll(".sketchy.box .content"), box = document.querySelectorAll(".sketchy.box"); for(var i = 0; i < content.length; i++) { var thisContent = content[i], clientHeight = thisContent.clientHeight, text = thisContent.nextSibling, boxHeight = box[i].clientHeight, fontSize = window.getComputedStyle(content[0]).getPropertyValue("font-size").split("px")[0], rows = (boxHeight - (fontSize * 2)) / fontSize, contentLength = thisContent.innerHTML.split("").length; if (contentLength > parseInt(fontSize, 0) * rows) { thisContent.nextSibling.nextSibling.style.display = "block"; } else { thisContent.nextSibling.nextSibling.style.display = "none"; } }
})();
Developer | Mnicpt |
Username | mnicpt |
Uploaded | July 30, 2022 |
Rating | 3 |
Size | 3,033 Kb |
Views | 52,624 |
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 |
IOS 7 Layering | 2,931 Kb |
Graph API | 4,456 Kb |
Trinary Tree | 2,282 Kb |
Plain JavaScript Calculator | 3,600 Kb |
Simple Grid | 4,606 Kb |
First 100 Prime Numbers | 1,615 Kb |
Solve Intersecting Lines | 1,792 Kb |
JavaScript Aspect | 1,648 Kb |
3,268 Kb | |
SerializedAsyncQueue | 2,800 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 |
Fading gradient button | Insprd | 1,713 Kb |
SCSS Unit Conversion | Jakob-e | 8,210 Kb |
Update CSS Variables with JS | Wesbos | 2,335 Kb |
Canvas snow | Win7killer | 2,572 Kb |
Fullscreen Parallax | Bassta | 3,313 Kb |
Tab panels | Accessibility | 0 Kb |
Canvas Background Effect | Sonick | 3,513 Kb |
Rotate Demo | Agelber | 3,061 Kb |
CSS3 Button Examples | Volusion | 3,377 Kb |
Scroll using CSS | Casperovic | 2,159 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!