Button style

Size
2,644 Kb
Views
22,264

How do I make an button style?

Using spin.js by fgnass: https://github.com/fgnass/spin.js. What is a button style? How do you make a button style? This script and codes were developed by Hampus Persson on 13 September 2022, Tuesday.

Button style Previews

Button style - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Button style</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> <section> <button class="Button"> <span class="Button-label">BUTTON</span> </button> <button class="Button js-spinnerButton"> <span class="Button-spinner"></span> <span class="Button-label">SPINNER</span> </button>
</section> <script src='https://fgnass.github.io/spin.js/spin.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Button style - Script Codes CSS Codes

body { background-color: #2ecc71;
}
section { padding-top: 40px; text-align: center;
}
.Button { display: inline-block; position: relative; margin: 15px 30px; padding: 25px 80px; background: #333; color: #fff; box-shadow: 0 4px #111; border: none; cursor: pointer; text-transform: uppercase; letter-spacing: 2px; font-size: 14px; font-weight: 700; outline: none; -webkit-transition: none; transition: none;
}
.Button:hover { background: #2b2b2b;
}
.Button:active { background: #2b2b2b; box-shadow: 0 0px #111; top: 4px;
}
.Button-spinner { opacity: 0;
}
.Button-spinner.is-visible { opacity: 1;
}

Button style - Script Codes JS Codes

var button = document.querySelector('.js-spinnerButton');
button.addEventListener('click', function(e) { var spinner = this.querySelector('.Button-spinner'); new Spinner({color:'#fff', length: 4, width: 2, radius: 4, lines: 12, left: '50px'}).spin(spinner); spinner.classList.add('is-visible'); setTimeout(function() { spinner.classList.remove('is-visible'); },3000)
});
Button style - Script Codes
Button style - Script Codes
Home Page Home
Developer Hampus Persson
Username hmps
Uploaded September 13, 2022
Rating 3
Size 2,644 Kb
Views 22,264
Do you need developer help for Button style?

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!

Hampus Persson (hmps) Script Codes
Create amazing art & images 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!