JSCSS
How do I make an jscss?
What is a jscss? How do you make a jscss? This script and codes were developed by Hampus Persson on 23 December 2022, Friday.
JSCSS - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>JSCSS</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <a class="MovingButton" href="#" data-title="Moving Button"></a> <script src="js/index.js"></script>
</body>
</html>
JSCSS - Script Codes CSS Codes
.MovingButton { position: relative; display: inline-block; padding: 10rem 15rem; text-decoration: none; text-align: center; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; color: #212121; font-size: var(--fontSize, 4rem);
}
.MovingButton::before { content: ''; position: absolute; top: 0; bottom: 0; left: 0; right: 0; will-change: transform; box-shadow: 0 2px 5px rgba(0, 0, 0, .2); background: rgba(210,255,82,1); background: -webkit-linear-gradient(left, rgba(210,255,82,1) 0%, rgba(145,232,66,1) 100%); background: linear-gradient(to right, rgba(210,255,82,1) 0%, rgba(145,232,66,1) 100%); -webkit-transform: translateY(var(--translateY, 0)) rotateX(var(--rotateX, 0)) rotateY(var(--rotateY, 0)) translateZ(var(--translateZ, -12px)); transform: translateY(var(--translateY, 0)) rotateX(var(--rotateX, 0)) rotateY(var(--rotateY, 0)) translateZ(var(--translateZ, -12px));
}
.MovingButton:hover::before { box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
}
.MovingButton::after { content: attr(data-title); display: inline-block; position: relative; font-weight: 300; -webkit-transition: -webkit-transform .1s ease; transition: -webkit-transform .1s ease; transition: transform .1s ease; transition: transform .1s ease, -webkit-transform .1s ease; -webkit-transform: translateY(var(--translateY, 0)) rotateX(var(--rotateX, 0)) rotateY(var(--rotateY, 0)); transform: translateY(var(--translateY, 0)) rotateX(var(--rotateX, 0)) rotateY(var(--rotateY, 0));
}
body { height: 100vh; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-transform-style: preserve-3d; transform-style: preserve-3d; -webkit-transform: perspective(800px); transform: perspective(800px); font-family: sans-serif;
}
JSCSS - Script Codes JS Codes
'use strict';
var docStyle = document.documentElement.style;
var MovingButton = document.querySelector('.MovingButton');
var boundingClientRect = MovingButton.getBoundingClientRect();
// React to every mouse move over the moving button
MovingButton.addEventListener('mousemove', function (e) { // Get the cursor position in relation to the button var x = e.clientX - boundingClientRect.left; var y = e.clientY - boundingClientRect.top; // Get the center points of the button var xc = boundingClientRect.width / 2; var yc = boundingClientRect.height / 2; // Get the delta between cursor and center var dx = x - xc; var dy = y - yc; // Set rotation transformations // -15 and 60 are magical numbers that made it look good docStyle.setProperty('--rotateX', dy / -20 + 'deg'); docStyle.setProperty('--rotateY', dx / 80 + 'deg');
});
// Reset the styling when the cursor is leaves the button
MovingButton.addEventListener('mouseleave', function () { docStyle.setProperty('--translateY', '0'); docStyle.setProperty('--rotateX', '0'); docStyle.setProperty('--rotateY', '0');
});
// Add a click effect on mouse down
MovingButton.addEventListener('mousedown', function () { docStyle.setProperty('--translateZ', '-20px'); docStyle.setProperty('--fontSize', '3.8rem');
});
// Reset the click effect
document.body.addEventListener('mouseup', function () { docStyle.setProperty('--translateZ', '-12px'); docStyle.setProperty('--fontSize', '4rem');
});
Developer | Hampus Persson |
Username | hmps |
Uploaded | December 23, 2022 |
Rating | 3 |
Size | 3,963 Kb |
Views | 16,192 |
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 |
Pure CSS GitHub ribbon | 3,395 Kb |
Inputs with floating labels | 3,078 Kb |
Drill down table | 2,989 Kb |
A Pen by Hampus Persson | 1,560 Kb |
Notifications | 4,111 Kb |
FlowText.js | 3,728 Kb |
Slide like Mailbox | 3,758 Kb |
Pulsating heart | 2,765 Kb |
Z-level shadows | 2,311 Kb |
Filter list | 3,517 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... | Adamjacob | 2,384 Kb |
Masonry | Uriuriuriu | 5,005 Kb |
Vue Transition | Chenming142 | 4,561 Kb |
Birthday Party Starter | Aussieyang | 1,629 Kb |
Fun form with currentColor | Bnthor | 2,713 Kb |
Social buttons | Flacu | 2,022 Kb |
Classy Blockquote Styling | Andrewwright | 3,212 Kb |
Product item | Mymahesh11 | 2,256 Kb |
Toggling Divs with jQuery | Yying6 | 1,967 Kb |
Flat design iframe | Damienpm | 1,819 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!