File size: 5,282 Bytes
1230357
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Animated Button with Ripple Effect</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <style>
        .ripple {
            position: relative;
            overflow: hidden;
        }
        
        .ripple-effect {
            position: absolute;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.7);
            transform: scale(0);
            animation: ripple 600ms linear;
            pointer-events: none;
        }
        
        @keyframes ripple {
            to {
                transform: scale(4);
                opacity: 0;
            }
        }
        
        .btn-glow:hover {
            box-shadow: 0 0 15px rgba(99, 102, 241, 0.7);
        }
        
        .btn-transform:hover {
            transform: translateY(-2px);
        }
    </style>
</head>
<body class="min-h-screen bg-gradient-to-br from-indigo-50 to-purple-100 flex items-center justify-center p-4">
    <div class="text-center">
        <h1 class="text-4xl font-bold text-indigo-900 mb-8">Interactive Button Showcase</h1>
        
        <div class="space-y-8">
            <!-- Primary Animated Button -->
            <div>
                <h2 class="text-xl font-semibold text-indigo-800 mb-4">Primary Button</h2>
                <button id="primaryBtn" class="ripple btn-glow btn-transform px-8 py-3 bg-indigo-600 text-white font-medium rounded-lg shadow-md hover:bg-indigo-700 transition-all duration-300 ease-in-out">
                    Click Me
                </button>
            </div>
            
            <!-- Outline Button -->
            <div>
                <h2 class="text-xl font-semibold text-indigo-800 mb-4">Outline Button</h2>
                <button id="outlineBtn" class="ripple px-8 py-3 border-2 border-indigo-600 text-indigo-600 font-medium rounded-lg hover:bg-indigo-50 transition-all duration-200 ease-in-out">
                    Hover Effect
                </button>
            </div>
            
            <!-- Gradient Button -->
            <div>
                <h2 class="text-xl font-semibold text-indigo-800 mb-4">Gradient Button</h2>
                <button id="gradientBtn" class="ripple px-8 py-3 bg-gradient-to-r from-purple-500 to-indigo-600 text-white font-medium rounded-lg hover:shadow-lg transition-all duration-300 ease-in-out">
                    Cool Gradient
                </button>
            </div>
        </div>
    </div>

    <script>
        // Function to create ripple effect
        function createRipple(event) {
            const button = event.currentTarget;
            
            const circle = document.createElement("span");
            const diameter = Math.max(button.clientWidth, button.clientHeight);
            const radius = diameter / 2;
            
            circle.style.width = circle.style.height = `${diameter}px`;
            circle.style.left = `${event.clientX - button.getBoundingClientRect().left - radius}px`;
            circle.style.top = `${event.clientY - button.getBoundingClientRect().top - radius}px`;
            circle.classList.add("ripple-effect");
            
            const ripple = button.getElementsByClassName("ripple-effect")[0];
            if (ripple) {
                ripple.remove();
            }
            
            button.appendChild(circle);
            
            // Remove the ripple element after animation completes
            setTimeout(() => {
                circle.remove();
            }, 600);
        }
        
        // Add click event listeners to all buttons
        document.querySelectorAll('.ripple').forEach(button => {
            button.addEventListener('click', createRipple);
            
            // Add click feedback
            button.addEventListener('mousedown', () => {
                button.classList.add('scale-95');
            });
            
            button.addEventListener('mouseup', () => {
                button.classList.remove('scale-95');
            });
            
            button.addEventListener('mouseleave', () => {
                button.classList.remove('scale-95');
            });
        });
        
        // Add special functionality to primary button
        document.getElementById('primaryBtn').addEventListener('click', () => {
            setTimeout(() => {
                alert('Button clicked! Great job!');
            }, 300);
        });
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=ishaqsaviani/first" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>