Create 10 different style buttons using raw CSS & Tailwind CSS
Browse files
README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title: Button Bonanza Extravaganza
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Button Bonanza Extravaganza π
|
| 3 |
+
colorFrom: green
|
| 4 |
+
colorTo: green
|
| 5 |
+
emoji: π³
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite-v3
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Welcome to your new DeepSite project!
|
| 13 |
+
This project was created with [DeepSite](https://huggingface.co/deepsite).
|
index.html
CHANGED
|
@@ -1,19 +1,91 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Button Bonanza</title>
|
| 7 |
+
<link rel="stylesheet" href="style.css">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 10 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 11 |
+
<style>
|
| 12 |
+
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
|
| 13 |
+
</style>
|
| 14 |
+
</head>
|
| 15 |
+
<body class="bg-gray-100 font-poppins">
|
| 16 |
+
<div class="container mx-auto px-4 py-12">
|
| 17 |
+
<h1 class="text-4xl font-bold text-center mb-12 text-gray-800">Button Bonanza π</h1>
|
| 18 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
| 19 |
+
<!-- Button 1: Classic Elegance -->
|
| 20 |
+
<div class="bg-white p-6 rounded-xl shadow-md">
|
| 21 |
+
<h2 class="text-xl font-semibold mb-4">Classic Elegance</h2>
|
| 22 |
+
<button class="btn-classic">Click Me</button>
|
| 23 |
+
</div>
|
| 24 |
+
|
| 25 |
+
<!-- Button 2: Modern Gradient -->
|
| 26 |
+
<div class="bg-white p-6 rounded-xl shadow-md">
|
| 27 |
+
<h2 class="text-xl font-semibold mb-4">Modern Gradient</h2>
|
| 28 |
+
<button class="btn-gradient">Hover Over Me</button>
|
| 29 |
+
</div>
|
| 30 |
+
|
| 31 |
+
<!-- Button 3: 3D Effect -->
|
| 32 |
+
<div class="bg-white p-6 rounded-xl shadow-md">
|
| 33 |
+
<h2 class="text-xl font-semibold mb-4">3D Effect</h2>
|
| 34 |
+
<button class="btn-3d">Press Me</button>
|
| 35 |
+
</div>
|
| 36 |
+
|
| 37 |
+
<!-- Button 4: Outline with Icon -->
|
| 38 |
+
<div class="bg-white p-6 rounded-xl shadow-md">
|
| 39 |
+
<h2 class="text-xl font-semibold mb-4">Outline with Icon</h2>
|
| 40 |
+
<button class="btn-outline-icon">
|
| 41 |
+
<i data-feather="star" class="mr-2"></i> Star Me
|
| 42 |
+
</button>
|
| 43 |
+
</div>
|
| 44 |
+
|
| 45 |
+
<!-- Button 5: Animated Fill -->
|
| 46 |
+
<div class="bg-white p-6 rounded-xl shadow-md">
|
| 47 |
+
<h2 class="text-xl font-semibold mb-4">Animated Fill</h2>
|
| 48 |
+
<button class="btn-animated-fill">Slide Over</button>
|
| 49 |
+
</div>
|
| 50 |
+
|
| 51 |
+
<!-- Button 6: Glass Morphism -->
|
| 52 |
+
<div class="bg-white p-6 rounded-xl shadow-md">
|
| 53 |
+
<h2 class="text-xl font-semibold mb-4">Glass Morphism</h2>
|
| 54 |
+
<button class="btn-glass">See Through</button>
|
| 55 |
+
</div>
|
| 56 |
+
|
| 57 |
+
<!-- Button 7: Neumorphic -->
|
| 58 |
+
<div class="bg-white p-6 rounded-xl shadow-md">
|
| 59 |
+
<h2 class="text-xl font-semibold mb-4">Neumorphic</h2>
|
| 60 |
+
<button class="btn-neumorphic">Soft Press</button>
|
| 61 |
+
</div>
|
| 62 |
+
|
| 63 |
+
<!-- Button 8: Bounce Animation -->
|
| 64 |
+
<div class="bg-white p-6 rounded-xl shadow-md">
|
| 65 |
+
<h2 class="text-xl font-semibold mb-4">Bounce Animation</h2>
|
| 66 |
+
<button class="btn-bounce">Bounce Me</button>
|
| 67 |
+
</div>
|
| 68 |
+
|
| 69 |
+
<!-- Button 9: Ripple Effect -->
|
| 70 |
+
<div class="bg-white p-6 rounded-xl shadow-md">
|
| 71 |
+
<h2 class="text-xl font-semibold mb-4">Ripple Effect</h2>
|
| 72 |
+
<button class="btn-ripple">Make Waves</button>
|
| 73 |
+
</div>
|
| 74 |
+
|
| 75 |
+
<!-- Button 10: Social Media -->
|
| 76 |
+
<div class="bg-white p-6 rounded-xl shadow-md">
|
| 77 |
+
<h2 class="text-xl font-semibold mb-4">Social Media</h2>
|
| 78 |
+
<button class="btn-social">
|
| 79 |
+
<i data-feather="twitter" class="mr-2"></i> Tweet This
|
| 80 |
+
</button>
|
| 81 |
+
</div>
|
| 82 |
+
</div>
|
| 83 |
+
</div>
|
| 84 |
+
|
| 85 |
+
<script src="script.js"></script>
|
| 86 |
+
<script>
|
| 87 |
+
feather.replace();
|
| 88 |
+
</script>
|
| 89 |
+
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
|
| 90 |
+
</body>
|
| 91 |
+
</html>
|
script.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Ripple effect for Button 9
|
| 2 |
+
document.querySelectorAll('.btn-ripple').forEach(button => {
|
| 3 |
+
button.addEventListener('click', function(e) {
|
| 4 |
+
e.preventDefault();
|
| 5 |
+
|
| 6 |
+
const x = e.clientX - e.target.getBoundingClientRect().left;
|
| 7 |
+
const y = e.clientY - e.target.getBoundingClientRect().top;
|
| 8 |
+
|
| 9 |
+
const ripple = document.createElement('span');
|
| 10 |
+
ripple.className = 'ripple-effect';
|
| 11 |
+
ripple.style.left = `${x}px`;
|
| 12 |
+
ripple.style.top = `${y}px`;
|
| 13 |
+
|
| 14 |
+
this.appendChild(ripple);
|
| 15 |
+
|
| 16 |
+
setTimeout(() => {
|
| 17 |
+
ripple.remove();
|
| 18 |
+
}, 1000);
|
| 19 |
+
});
|
| 20 |
+
});
|
| 21 |
+
|
| 22 |
+
// Style for ripple effect
|
| 23 |
+
const style = document.createElement('style');
|
| 24 |
+
style.textContent = `
|
| 25 |
+
.ripple-effect {
|
| 26 |
+
position: absolute;
|
| 27 |
+
border-radius: 50%;
|
| 28 |
+
background-color: rgba(255, 255, 255, 0.7);
|
| 29 |
+
transform: scale(0);
|
| 30 |
+
animation: ripple 0.6s linear;
|
| 31 |
+
pointer-events: none;
|
| 32 |
+
width: 20px;
|
| 33 |
+
height: 20px;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
@keyframes ripple {
|
| 37 |
+
to {
|
| 38 |
+
transform: scale(4);
|
| 39 |
+
opacity: 0;
|
| 40 |
+
}
|
| 41 |
+
}
|
| 42 |
+
`;
|
| 43 |
+
document.head.appendChild(style);
|
style.css
CHANGED
|
@@ -1,28 +1,158 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
}
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
| 9 |
}
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
margin-top: 5px;
|
| 16 |
}
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
}
|
| 25 |
|
| 26 |
-
.
|
| 27 |
-
|
|
|
|
| 28 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Base styles for all buttons */
|
| 2 |
+
button {
|
| 3 |
+
transition: all 0.3s ease;
|
| 4 |
+
font-weight: 500;
|
| 5 |
+
padding: 0.75rem 1.5rem;
|
| 6 |
+
border-radius: 0.5rem;
|
| 7 |
+
cursor: pointer;
|
| 8 |
+
outline: none;
|
| 9 |
+
font-size: 1rem;
|
| 10 |
+
position: relative;
|
| 11 |
+
overflow: hidden;
|
| 12 |
+
text-transform: uppercase;
|
| 13 |
+
letter-spacing: 0.5px;
|
| 14 |
}
|
| 15 |
|
| 16 |
+
/* Button 1: Classic Elegance */
|
| 17 |
+
.btn-classic {
|
| 18 |
+
background-color: #4f46e5;
|
| 19 |
+
color: white;
|
| 20 |
+
border: none;
|
| 21 |
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
| 22 |
}
|
| 23 |
|
| 24 |
+
.btn-classic:hover {
|
| 25 |
+
background-color: #4338ca;
|
| 26 |
+
transform: translateY(-2px);
|
| 27 |
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
|
|
|
| 28 |
}
|
| 29 |
|
| 30 |
+
/* Button 2: Modern Gradient */
|
| 31 |
+
.btn-gradient {
|
| 32 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 33 |
+
color: white;
|
| 34 |
+
border: none;
|
| 35 |
+
background-size: 200% auto;
|
| 36 |
}
|
| 37 |
|
| 38 |
+
.btn-gradient:hover {
|
| 39 |
+
background-position: right center;
|
| 40 |
+
transform: scale(1.05);
|
| 41 |
}
|
| 42 |
+
|
| 43 |
+
/* Button 3: 3D Effect */
|
| 44 |
+
.btn-3d {
|
| 45 |
+
background-color: #3b82f6;
|
| 46 |
+
color: white;
|
| 47 |
+
border: none;
|
| 48 |
+
box-shadow: 0 5px 0 #1d4ed8;
|
| 49 |
+
transform: translateY(0);
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
.btn-3d:active {
|
| 53 |
+
transform: translateY(5px);
|
| 54 |
+
box-shadow: none;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
/* Button 4: Outline with Icon */
|
| 58 |
+
.btn-outline-icon {
|
| 59 |
+
background: transparent;
|
| 60 |
+
color: #3b82f6;
|
| 61 |
+
border: 2px solid #3b82f6;
|
| 62 |
+
display: flex;
|
| 63 |
+
align-items: center;
|
| 64 |
+
justify-content: center;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
.btn-outline-icon:hover {
|
| 68 |
+
background-color: #3b82f6;
|
| 69 |
+
color: white;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
/* Button 5: Animated Fill */
|
| 73 |
+
.btn-animated-fill {
|
| 74 |
+
background: linear-gradient(to right, white 50%, #10b981 50%);
|
| 75 |
+
background-size: 200% 100%;
|
| 76 |
+
background-position: right bottom;
|
| 77 |
+
color: #10b981;
|
| 78 |
+
border: 2px solid #10b981;
|
| 79 |
+
transition: all 0.5s ease-out;
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
.btn-animated-fill:hover {
|
| 83 |
+
background-position: left bottom;
|
| 84 |
+
color: white;
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
/* Button 6: Glass Morphism */
|
| 88 |
+
.btn-glass {
|
| 89 |
+
background: rgba(255, 255, 255, 0.2);
|
| 90 |
+
backdrop-filter: blur(10px);
|
| 91 |
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
| 92 |
+
color: white;
|
| 93 |
+
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
|
| 94 |
+
background-color: rgba(99, 102, 241, 0.7);
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
.btn-glass:hover {
|
| 98 |
+
background-color: rgba(79, 70, 229, 0.8);
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
/* Button 7: Neumorphic */
|
| 102 |
+
.btn-neumorphic {
|
| 103 |
+
background: #e0e5ec;
|
| 104 |
+
border: none;
|
| 105 |
+
color: #4a5568;
|
| 106 |
+
box-shadow: 5px 5px 10px #b8b9be, -5px -5px 10px #ffffff;
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
.btn-neumorphic:active {
|
| 110 |
+
box-shadow: inset 5px 5px 10px #b8b9be, inset -5px -5px 10px #ffffff;
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
/* Button 8: Bounce Animation */
|
| 114 |
+
.btn-bounce {
|
| 115 |
+
background-color: #f59e0b;
|
| 116 |
+
color: white;
|
| 117 |
+
border: none;
|
| 118 |
+
animation: pulse 2s infinite;
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
@keyframes pulse {
|
| 122 |
+
0% { transform: scale(1); }
|
| 123 |
+
50% { transform: scale(1.05); }
|
| 124 |
+
100% { transform: scale(1); }
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
/* Button 9: Ripple Effect */
|
| 128 |
+
.btn-ripple {
|
| 129 |
+
background-color: #ef4444;
|
| 130 |
+
color: white;
|
| 131 |
+
border: none;
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
.btn-ripple:hover {
|
| 135 |
+
background-color: #dc2626;
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
/* Button 10: Social Media */
|
| 139 |
+
.btn-social {
|
| 140 |
+
background-color: #1da1f2;
|
| 141 |
+
color: white;
|
| 142 |
+
border: none;
|
| 143 |
+
display: flex;
|
| 144 |
+
align-items: center;
|
| 145 |
+
justify-content: center;
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
.btn-social:hover {
|
| 149 |
+
background-color: #1a8cd8;
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
/* Responsive adjustments */
|
| 153 |
+
@media (max-width: 768px) {
|
| 154 |
+
button {
|
| 155 |
+
padding: 0.5rem 1rem;
|
| 156 |
+
font-size: 0.875rem;
|
| 157 |
+
}
|
| 158 |
+
}
|