Halftone button

Developer
Size
3,257 Kb
Views
20,240

How do I make an halftone button?

Something I made for Contrast-O-Vision, that seemed neat enough for its own pen.. What is a halftone button? How do you make a halftone button? This script and codes were developed by Taylor Hunt on 29 September 2022, Thursday.

Halftone button Previews

Halftone button - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Halftone button</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <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> <button> <svg class="button_svg" viewBox="-312 -312 624 624" width="600" height="600" aria-hidden="true" stroke="darkgray"> <circle r="10" stroke-width="22em"/> <circle r="40" stroke-width="20em"/> <circle r="70" stroke-width="18em"/> <circle r="100" stroke-width="16em"/> <circle r="130" stroke-width="14em"/> <circle r="160" stroke-width="12em"/> <circle r="190" stroke-width="10em"/> <circle r="220" stroke-width="8em"/> <circle r="250" stroke-width="6em"/> <circle r="280" stroke-width="4em"/> <circle r="310" stroke-width="2em"/> </svg> <span class="button_text">ACHTUNG</span>
</button> <script src="js/index.js"></script>
</body>
</html>

Halftone button - Script Codes CSS Codes

body { text-align: center; background: #ccc;
}
button { font-size: 8vmin; border: 0; background: #eee; width: 10em; height: 10em; border-radius: 50%; border-bottom: 0.5em gray solid; margin: 1em; -webkit-transition: 0.5s cubic-bezier(0.1, 1, 0.22, 1); transition: 0.5s cubic-bezier(0.1, 1, 0.22, 1); box-shadow: 0 15px 10px rgba(0, 0, 0, 0.7); position: relative; outline: none; -webkit-perspective: 1000px; perspective: 1000px;
}
.button_text { position: absolute; top: 50%; left: 50%; width: 100%; -webkit-transform: translate(-50%, -55%) scaleY(1.5) rotateX(30deg); transform: translate(-50%, -55%) scaleY(1.5) rotateX(30deg); -webkit-transform-style: preserve-3d; transform-style: preserve-3d; font-size: 1.8em; font-weight: 600; letter-spacing: -0.05em; font-family: Verdana;
}
.pressed > .button_text { color: rgba(221, 221, 221, 0.95);
}
svg { width: 100%; height: 100%;
}
.button_svg { font-size: 0.5px; -webkit-transition: 0.2s font-size cubic-bezier(0.1, 1, 0.22, 1); transition: 0.2s font-size cubic-bezier(0.1, 1, 0.22, 1); stroke-linecap: round; fill: none; stroke-dasharray: 0 31.415 0 31.415;
}
button:hover:not(.pressed),
button:focus:not(.pressed) { -webkit-transform: translateY(-2px); transform: translateY(-2px); box-shadow: 0 17px 10px rgba(0, 0, 0, 0.7);
}
button:hover:not(.pressed) > .button_svg,
button:focus:not(.pressed) > .button_svg { font-size: 0.7px;
}
button:active:not(.pressed) { -webkit-transform: translateY(-4px); transform: translateY(-4px); background: #ddd;
}
button:active:not(.pressed) > .button_svg { font-size: 0.3px;
}
button.pressed { background-color: #000; -webkit-transform: translateY(15px); transform: translateY(15px); box-shadow: 0 0 0.2em 0.1em #0f0; border-bottom-width: 0;
}
button.pressed > .button_svg { font-size: 2.5px; stroke: #0f0;
}
button.pressed > .button_svg text { fill: white !important;
}

Halftone button - Script Codes JS Codes

document.querySelector('button').addEventListener('click', function() { this.classList.toggle('pressed');
});
Halftone button - Script Codes
Halftone button - Script Codes
Home Page Home
Developer Taylor Hunt
Username tigt
Uploaded September 29, 2022
Rating 3.5
Size 3,257 Kb
Views 20,240
Do you need developer help for Halftone button?

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!

Taylor Hunt (tigt) 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!