Skip to content

Commit dcfa0a1

Browse files
Added Send Message Button (#1327)
1 parent 33b6e4b commit dcfa0a1

File tree

3 files changed

+385
-0
lines changed

3 files changed

+385
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
<link rel="stylesheet" href="styles.css">
7+
<title>Send Message Button</title>
8+
</head>
9+
<body>
10+
<button class="button">
11+
<div class="outline"></div>
12+
<div class="state state--default">
13+
<div class="icon">
14+
<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
15+
<g style="filter: url(#shadow)">
16+
<path d="M14.2199 21.63C13.0399 21.63 11.3699 20.8 10.0499 16.83L9.32988 14.67L7.16988 13.95C3.20988 12.63 2.37988 10.96 2.37988 9.78001C2.37988 8.61001 3.20988 6.93001 7.16988 5.60001L15.6599 2.77001C17.7799 2.06001 19.5499 2.27001 20.6399 3.35001C21.7299 4.43001 21.9399 6.21001 21.2299 8.33001L18.3999 16.82C17.0699 20.8 15.3999 21.63 14.2199 21.63ZM7.63988 7.03001C4.85988 7.96001 3.86988 9.06001 3.86988 9.78001C3.86988 10.5 4.85988 11.6 7.63988 12.52L10.1599 13.36C10.3799 13.43 10.5599 13.61 10.6299 13.83L11.4699 16.35C12.3899 19.13 13.4999 20.12 14.2199 20.12C14.9399 20.12 16.0399 19.13 16.9699 16.35L19.7999 7.86001C20.3099 6.32001 20.2199 5.06001 19.5699 4.41001C18.9199 3.76001 17.6599 3.68001 16.1299 4.19001L7.63988 7.03001Z" fill="currentColor"></path>
17+
<path d="M10.11 14.4C9.92005 14.4 9.73005 14.33 9.58005 14.18C9.29005 13.89 9.29005 13.41 9.58005 13.12L13.16 9.53C13.45 9.24 13.93 9.24 14.22 9.53C14.51 9.82 14.51 10.3 14.22 10.59L10.64 14.18C10.5 14.33 10.3 14.4 10.11 14.4Z" fill="currentColor"></path>
18+
</g>
19+
<defs>
20+
<filter id="shadow">
21+
<feDropShadow dx="0" dy="1" stdDeviation="0.6" flood-opacity="0.5"></feDropShadow>
22+
</filter>
23+
</defs>
24+
</svg>
25+
</div>
26+
<p>
27+
<span style="--i:0">S</span>
28+
<span style="--i:1">e</span>
29+
<span style="--i:2">n</span>
30+
<span style="--i:3">d</span>
31+
<span style="--i:4">M</span>
32+
<span style="--i:5">e</span>
33+
<span style="--i:6">s</span>
34+
<span style="--i:7">s</span>
35+
<span style="--i:8">a</span>
36+
<span style="--i:9">g</span>
37+
<span style="--i:10">e</span>
38+
</p>
39+
</div>
40+
<div class="state state--sent">
41+
<div class="icon">
42+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" height="1em" width="1em" stroke-width="0.5px" stroke="black">
43+
<g style="filter: url(#shadow)">
44+
<path fill="currentColor" d="M12 22.75C6.07 22.75 1.25 17.93 1.25 12C1.25 6.07 6.07 1.25 12 1.25C17.93 1.25 22.75 6.07 22.75 12C22.75 17.93 17.93 22.75 12 22.75ZM12 2.75C6.9 2.75 2.75 6.9 2.75 12C2.75 17.1 6.9 21.25 12 21.25C17.1 21.25 21.25 17.1 21.25 12C21.25 6.9 17.1 2.75 12 2.75Z"></path>
45+
<path fill="currentColor" d="M10.5795 15.5801C10.3795 15.5801 10.1895 15.5001 10.0495 15.3601L7.21945 12.5301C6.92945 12.2401 6.92945 11.7601 7.21945 11.4701C7.50945 11.1801 7.98945 11.1801 8.27945 11.4701L10.5795 13.7701L15.7195 8.6301C16.0095 8.3401 16.4895 8.3401 16.7795 8.6301C17.0695 8.9201 17.0695 9.4001 16.7795 9.6901L11.1095 15.3601C10.9695 15.5001 10.7795 15.5801 10.5795 15.5801Z"></path>
46+
</g>
47+
</svg>
48+
</div>
49+
<p>
50+
<span style="--i:5">S</span>
51+
<span style="--i:6">e</span>
52+
<span style="--i:7">n</span>
53+
<span style="--i:8">t</span>
54+
</p>
55+
</div>
56+
</button>
57+
</body>
58+
</html>
Lines changed: 314 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,314 @@
1+
/* From Uiverse.io by marcelodolza */
2+
body {
3+
display: flex;
4+
justify-content: center;
5+
align-items: center;
6+
height: 100vh;
7+
margin: 0;
8+
background-color: #f0f0f0;
9+
}
10+
.button {
11+
--primary: #ff5569;
12+
--neutral-1: #f7f8f7;
13+
--neutral-2: #e7e7e7;
14+
--radius: 14px;
15+
16+
cursor: pointer;
17+
border-radius: var(--radius);
18+
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
19+
border: none;
20+
box-shadow: 0 0.5px 0.5px 1px rgba(255, 255, 255, 0.2),
21+
0 10px 20px rgba(0, 0, 0, 0.2), 0 4px 5px 0px rgba(0, 0, 0, 0.05);
22+
display: flex;
23+
align-items: center;
24+
justify-content: center;
25+
position: relative;
26+
transition: all 0.3s ease;
27+
min-width: 200px;
28+
padding: 20px;
29+
height: 68px;
30+
font-family: "Galano Grotesque", Poppins, Montserrat, sans-serif;
31+
font-style: normal;
32+
font-size: 18px;
33+
font-weight: 600;
34+
}
35+
.button:hover {
36+
transform: scale(1.02);
37+
box-shadow: 0 0 1px 2px rgba(255, 255, 255, 0.3),
38+
0 15px 30px rgba(0, 0, 0, 0.3), 0 10px 3px -3px rgba(0, 0, 0, 0.04);
39+
}
40+
.button:active {
41+
transform: scale(1);
42+
box-shadow: 0 0 1px 2px rgba(255, 255, 255, 0.3),
43+
0 10px 3px -3px rgba(0, 0, 0, 0.2);
44+
}
45+
.button:after {
46+
content: "";
47+
position: absolute;
48+
inset: 0;
49+
border-radius: var(--radius);
50+
border: 2.5px solid transparent;
51+
background: linear-gradient(var(--neutral-1), var(--neutral-2)) padding-box,
52+
linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.45))
53+
border-box;
54+
z-index: 0;
55+
transition: all 0.4s ease;
56+
}
57+
.button:hover::after {
58+
transform: scale(1.05, 1.1);
59+
box-shadow: inset 0 -1px 3px 0 rgba(255, 255, 255, 1);
60+
}
61+
.button::before {
62+
content: "";
63+
inset: 7px 6px 6px 6px;
64+
position: absolute;
65+
background: linear-gradient(to top, var(--neutral-1), var(--neutral-2));
66+
border-radius: 30px;
67+
filter: blur(0.5px);
68+
z-index: 2;
69+
}
70+
.state p {
71+
display: flex;
72+
align-items: center;
73+
justify-content: center;
74+
}
75+
.state .icon {
76+
position: absolute;
77+
left: 0;
78+
top: 0;
79+
bottom: 0;
80+
margin: auto;
81+
transform: scale(1.25);
82+
transition: all 0.3s ease;
83+
display: flex;
84+
align-items: center;
85+
justify-content: center;
86+
}
87+
.state .icon svg {
88+
overflow: visible;
89+
}
90+
91+
/* Outline */
92+
.outline {
93+
position: absolute;
94+
border-radius: inherit;
95+
overflow: hidden;
96+
z-index: 1;
97+
opacity: 0;
98+
transition: opacity 0.4s ease;
99+
inset: -2px -3.5px;
100+
}
101+
.outline::before {
102+
content: "";
103+
position: absolute;
104+
inset: -100%;
105+
background: conic-gradient(
106+
from 180deg,
107+
transparent 60%,
108+
white 80%,
109+
transparent 100%
110+
);
111+
animation: spin 2s linear infinite;
112+
animation-play-state: paused;
113+
}
114+
@keyframes spin {
115+
0% {
116+
transform: rotate(0deg);
117+
}
118+
100% {
119+
transform: rotate(360deg);
120+
}
121+
}
122+
.button:hover .outline {
123+
opacity: 1;
124+
}
125+
.button:hover .outline::before {
126+
animation-play-state: running;
127+
}
128+
129+
/* Letters */
130+
.state p span {
131+
display: block;
132+
opacity: 0;
133+
animation: slideDown 0.8s ease forwards calc(var(--i) * 0.03s);
134+
}
135+
.button:hover p span {
136+
opacity: 1;
137+
animation: wave 0.5s ease forwards calc(var(--i) * 0.02s);
138+
}
139+
.button:focus p span {
140+
opacity: 1;
141+
animation: disapear 0.6s ease forwards calc(var(--i) * 0.03s);
142+
}
143+
@keyframes wave {
144+
30% {
145+
opacity: 1;
146+
transform: translateY(4px) translateX(0) rotate(0);
147+
}
148+
50% {
149+
opacity: 1;
150+
transform: translateY(-3px) translateX(0) rotate(0);
151+
color: var(--primary);
152+
}
153+
100% {
154+
opacity: 1;
155+
transform: translateY(0) translateX(0) rotate(0);
156+
}
157+
}
158+
@keyframes slideDown {
159+
0% {
160+
opacity: 0;
161+
transform: translateY(-20px) translateX(5px) rotate(-90deg);
162+
color: var(--primary);
163+
filter: blur(5px);
164+
}
165+
30% {
166+
opacity: 1;
167+
transform: translateY(4px) translateX(0) rotate(0);
168+
filter: blur(0);
169+
}
170+
50% {
171+
opacity: 1;
172+
transform: translateY(-3px) translateX(0) rotate(0);
173+
}
174+
100% {
175+
opacity: 1;
176+
transform: translateY(0) translateX(0) rotate(0);
177+
}
178+
}
179+
@keyframes disapear {
180+
from {
181+
opacity: 1;
182+
}
183+
to {
184+
opacity: 0;
185+
transform: translateX(5px) translateY(20px);
186+
color: var(--primary);
187+
filter: blur(5px);
188+
}
189+
}
190+
191+
/* Plane */
192+
.state--default .icon svg {
193+
animation: land 0.6s ease forwards;
194+
}
195+
.button:hover .state--default .icon {
196+
transform: rotate(45deg) scale(1.25);
197+
}
198+
.button:focus .state--default svg {
199+
animation: takeOff 0.8s linear forwards;
200+
}
201+
.button:focus .state--default .icon {
202+
transform: rotate(0) scale(1.25);
203+
}
204+
@keyframes takeOff {
205+
0% {
206+
opacity: 1;
207+
}
208+
60% {
209+
opacity: 1;
210+
transform: translateX(70px) rotate(45deg) scale(2);
211+
}
212+
100% {
213+
opacity: 0;
214+
transform: translateX(160px) rotate(45deg) scale(0);
215+
}
216+
}
217+
@keyframes land {
218+
0% {
219+
transform: translateX(-60px) translateY(30px) rotate(-50deg) scale(2);
220+
opacity: 0;
221+
filter: blur(3px);
222+
}
223+
100% {
224+
transform: translateX(0) translateY(0) rotate(0);
225+
opacity: 1;
226+
filter: blur(0);
227+
}
228+
}
229+
230+
/* Contrail */
231+
.state--default .icon:before {
232+
content: "";
233+
position: absolute;
234+
top: 50%;
235+
height: 2px;
236+
width: 0;
237+
left: -5px;
238+
background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.5));
239+
}
240+
.button:focus .state--default .icon:before {
241+
animation: contrail 0.8s linear forwards;
242+
}
243+
@keyframes contrail {
244+
0% {
245+
width: 0;
246+
opacity: 1;
247+
}
248+
8% {
249+
width: 15px;
250+
}
251+
60% {
252+
opacity: 0.7;
253+
width: 80px;
254+
}
255+
100% {
256+
opacity: 0;
257+
width: 160px;
258+
}
259+
}
260+
261+
/* States */
262+
.state {
263+
padding-left: 29px;
264+
z-index: 2;
265+
display: flex;
266+
position: relative;
267+
}
268+
.state--default span:nth-child(4) {
269+
margin-right: 5px;
270+
}
271+
.state--sent {
272+
display: none;
273+
}
274+
.state--sent svg {
275+
transform: scale(1.25);
276+
margin-right: 8px;
277+
}
278+
.button:focus .state--default {
279+
position: absolute;
280+
}
281+
.button:focus .state--sent {
282+
display: flex;
283+
}
284+
.button:focus .state--sent span {
285+
opacity: 0;
286+
animation: slideDown 0.8s ease forwards calc(var(--i) * 0.2s);
287+
}
288+
.button:focus .state--sent .icon svg {
289+
opacity: 0;
290+
animation: appear 1.2s ease forwards 0.8s;
291+
}
292+
@keyframes appear {
293+
0% {
294+
opacity: 0;
295+
transform: scale(4) rotate(-40deg);
296+
color: var(--primary);
297+
filter: blur(4px);
298+
}
299+
30% {
300+
opacity: 1;
301+
transform: scale(0.6);
302+
filter: blur(1px);
303+
}
304+
50% {
305+
opacity: 1;
306+
transform: scale(1.2);
307+
filter: blur(0);
308+
}
309+
100% {
310+
opacity: 1;
311+
transform: scale(1);
312+
}
313+
}
314+

assets/html_files/buttons.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,19 @@ <h1>Swipe Right Button</h1>
622622
</a>
623623
</div>
624624
</div>
625+
<div class="box">
626+
<h1>Send Message Button</h1>
627+
<div class="preview">
628+
<a href="../../Components/Buttons/Send-Message-Button/index.html" title="Live Preview" target="_blank">
629+
<img src="../images/link.png">
630+
</a>
631+
</div>
632+
<div class="source">
633+
<a href="https://github.com/Rakesh9100/Beautiify/tree/main/Components/Buttons/Send-Message-Button" title="Source Code" target="_blank">
634+
<img src="../images/github.png">
635+
</a>
636+
</div>
637+
</div>
625638
<div class="box">
626639
<h1>Swipe Right Button-2</h1>
627640
<div class="preview">

0 commit comments

Comments
 (0)