Animated Form by codepeek
Zoom
Saved
1 line⌘Z Undo
1<!--2 Author: @codepeek3 License: MIT4 Tags: #animated #form #light #radio #serif5-->6<form class="trf" action="#" method="post">7 <h3 class="trf__title">Reserve a table</h3>8 <p class="trf__sub">Osteria Lume · Calle Mayor 14</p>9 <div class="trf__row">10 <label class="trf__field">11 <span>Date</span>12 <input type="date" name="date" value="2026-11-21" required/>13 </label>14 <label class="trf__field">15 <span>Time</span>16 <select name="time">17 <option>19:00</option>18 <option selected>19:30</option>19 <option>20:00</option>20 <option>20:30</option>21 <option>21:00</option>22 </select>23 </label>24 </div>25 <fieldset class="trf__party">26 <legend>Guests</legend>27 <div class="trf__seats">28 <span class="trf__thumb" aria-hidden="true">29 </span>30 <label>31 <input type="radio" name="guests" value="1"/>32 133 </label>34 <label>35 <input type="radio" name="guests" value="2" checked/>36 237 </label>38 <label>39 <input type="radio" name="guests" value="3"/>40 341 </label>42 <label>43 <input type="radio" name="guests" value="4"/>44 445 </label>46 <label>47 <input type="radio" name="guests" value="5"/>48 549 </label>50 <label>51 <input type="radio" name="guests" value="6"/>52 653 </label>54 </div>55 </fieldset>56 <button class="trf__submit" type="submit">57 Reserve a table58 <span>held 15 min</span>59 </button>60</form>
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
<!--
Author: @codepeek
License: MIT
Tags: #animated #form #light #radio #serif
-->
<form class="trf" action="#" method="post">
<h3 class="trf__title">Reserve a table</h3>
<p class="trf__sub">Osteria Lume · Calle Mayor 14</p>
<div class="trf__row">
<label class="trf__field">
<span>Date</span>
<input type="date" name="date" value="2026-11-21" required/>
</label>
<label class="trf__field">
<span>Time</span>
<select name="time">
<option>19:00</option>
<option selected>19:30</option>
<option>20:00</option>
<option>20:30</option>
<option>21:00</option>
</select>
</label>
</div>
<fieldset class="trf__party">
<legend>Guests</legend>
<div class="trf__seats">
<span class="trf__thumb" aria-hidden="true">
</span>
<label>
<input type="radio" name="guests" value="1"/>
1
</label>
<label>
<input type="radio" name="guests" value="2" checked/>
2
</label>
<label>
<input type="radio" name="guests" value="3"/>
3
</label>
<label>
<input type="radio" name="guests" value="4"/>
4
</label>
<label>
<input type="radio" name="guests" value="5"/>
5
</label>
<label>
<input type="radio" name="guests" value="6"/>
6
</label>
</div>
</fieldset>
<button class="trf__submit" type="submit">
Reserve a table
<span>held 15 min</span>
</button>
</form>1/* * Author: @codepeek * License: MIT * Tags: #animated #form #light #radio #serif */2.trf {3 width: 360px;4 padding: 22px 22px 20px;5 box-sizing: border-box;6 border: 1px solid #e2d9c3;7 border-radius: 2px;8 background: #f6f1e4;9 color: #2a2a1f;10 font: 14px/1.3 "Helvetica Neue", Arial, sans-serif;11 box-shadow: 0 16px 30px -18px rgba(60, 60, 20, 0.45);12}13.trf__title {14 margin: 0;15 font: 600 24px/1.1 ui-serif, Georgia, serif;16 letter-spacing: -0.01em;17}18.trf__sub {19 margin: 4px 0 16px;20 color: #7a7660;21 font-size: 12px;22}23.trf__row {24 display: grid;25 grid-template-columns: 1.3fr 1fr;26 gap: 10px;27}28.trf__field {29 display: grid;30 gap: 5px;31}32.trf__field span, .trf__party legend {33 color: #5b6b2e;34 font-size: 11px;35 font-weight: 600;36 letter-spacing: 0.1em;37 text-transform: uppercase;38}39.trf__field input, .trf__field select {40 width: 100%;41 min-width: 0;42 height: 38px;43 padding: 0 10px;44 box-sizing: border-box;45 border: 1.5px solid #d6ccb3;46 border-radius: 6px;47 background: #fffdf7;48 color: #2a2a1f;49 font: inherit;50 accent-color: #5b6b2e;51 outline: none;52 transition: border-color 150ms ease, box-shadow 150ms ease;53}54.trf__field input:focus, .trf__field select:focus {55 border-color: #5b6b2e;56 box-shadow: 0 0 0 3px rgba(91, 107, 46, 0.2);57}58.trf__party {59 min-width: 0;60 margin: 14px 0 0;61 padding: 0;62 border: 0;63}64.trf__party legend {65 margin-bottom: 6px;66 padding: 0;67}68.trf__seats {69 --trf-n: 1;70 position: relative;71 display: grid;72 grid-template-columns: repeat(6, 1fr);73 padding: 3px;74 border-radius: 999px;75 background: #ebe3cf;76 box-shadow: inset 0 1px 2px rgba(60, 50, 20, 0.15);77}78.trf__seats:has(input[value="1"]:checked) {79 --trf-n: 0;80}81.trf__seats:has(input[value="2"]:checked) {82 --trf-n: 1;83}84.trf__seats:has(input[value="3"]:checked) {85 --trf-n: 2;86}87.trf__seats:has(input[value="4"]:checked) {88 --trf-n: 3;89}90.trf__seats:has(input[value="5"]:checked) {91 --trf-n: 4;92}93.trf__seats:has(input[value="6"]:checked) {94 --trf-n: 5;95}96.trf__thumb {97 position: absolute;98 top: 3px;99 bottom: 3px;100 left: 3px;101 width: calc((100% - 6px) / 6);102 border-radius: 999px;103 background: #5b6b2e;104 box-shadow: 0 2px 6px -2px rgba(40, 50, 10, 0.6);105 transform: translateX(calc(var(--trf-n) * 100%));106 transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);107}108.trf__seats label {109 position: relative;110 z-index: 1;111 display: grid;112 place-items: center;113 height: 32px;114 border-radius: 999px;115 color: #5d5a48;116 font: 600 14px/1 ui-monospace, SFMono-Regular, Menlo, monospace;117 cursor: pointer;118 transition: color 200ms ease;119}120.trf__seats label:hover {121 color: #2a2a1f;122}123.trf__seats label:has(input:checked) {124 color: #f6f1e4;125}126.trf__seats label:has(input:focus-visible) {127 outline: 2px solid #5b6b2e;128 outline-offset: 1px;129}130.trf__seats input {131 position: absolute;132 width: 1px;133 height: 1px;134 margin: -1px;135 padding: 0;136 border: 0;137 overflow: hidden;138 clip: rect(0 0 0 0);139 white-space: nowrap;140}141.trf__submit {142 display: flex;143 align-items: center;144 justify-content: space-between;145 width: 100%;146 height: 46px;147 margin-top: 16px;148 padding: 0 16px;149 border: 0;150 border-radius: 6px;151 background: #5b6b2e;152 color: #f6f1e4;153 font: 600 15px/1 ui-serif, Georgia, serif;154 cursor: pointer;155 box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2);156 transition: transform 120ms ease, box-shadow 120ms ease, background 200ms ease;157}158.trf__submit span {159 font: 500 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;160 letter-spacing: 0.04em;161 opacity: 0.75;162}163.trf__submit:hover {164 background: color-mix(in oklab, #5b6b2e, #000 14%);165}166.trf__submit:active {167 transform: translateY(2px);168 box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.2);169}170.trf__submit:focus-visible {171 outline: 2px solid #5b6b2e;172 outline-offset: 3px;173}
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
/* * Author: @codepeek * License: MIT * Tags: #animated #form #light #radio #serif */
.trf {
width: 360px;
padding: 22px 22px 20px;
box-sizing: border-box;
border: 1px solid #e2d9c3;
border-radius: 2px;
background: #f6f1e4;
color: #2a2a1f;
font: 14px/1.3 "Helvetica Neue", Arial, sans-serif;
box-shadow: 0 16px 30px -18px rgba(60, 60, 20, 0.45);
}
.trf__title {
margin: 0;
font: 600 24px/1.1 ui-serif, Georgia, serif;
letter-spacing: -0.01em;
}
.trf__sub {
margin: 4px 0 16px;
color: #7a7660;
font-size: 12px;
}
.trf__row {
display: grid;
grid-template-columns: 1.3fr 1fr;
gap: 10px;
}
.trf__field {
display: grid;
gap: 5px;
}
.trf__field span, .trf__party legend {
color: #5b6b2e;
font-size: 11px;
font-weight: 600;
letter-spacing: 0.1em;
text-transform: uppercase;
}
.trf__field input, .trf__field select {
width: 100%;
min-width: 0;
height: 38px;
padding: 0 10px;
box-sizing: border-box;
border: 1.5px solid #d6ccb3;
border-radius: 6px;
background: #fffdf7;
color: #2a2a1f;
font: inherit;
accent-color: #5b6b2e;
outline: none;
transition: border-color 150ms ease, box-shadow 150ms ease;
}
.trf__field input:focus, .trf__field select:focus {
border-color: #5b6b2e;
box-shadow: 0 0 0 3px rgba(91, 107, 46, 0.2);
}
.trf__party {
min-width: 0;
margin: 14px 0 0;
padding: 0;
border: 0;
}
.trf__party legend {
margin-bottom: 6px;
padding: 0;
}
.trf__seats {
--trf-n: 1;
position: relative;
display: grid;
grid-template-columns: repeat(6, 1fr);
padding: 3px;
border-radius: 999px;
background: #ebe3cf;
box-shadow: inset 0 1px 2px rgba(60, 50, 20, 0.15);
}
.trf__seats:has(input[value="1"]:checked) {
--trf-n: 0;
}
.trf__seats:has(input[value="2"]:checked) {
--trf-n: 1;
}
.trf__seats:has(input[value="3"]:checked) {
--trf-n: 2;
}
.trf__seats:has(input[value="4"]:checked) {
--trf-n: 3;
}
.trf__seats:has(input[value="5"]:checked) {
--trf-n: 4;
}
.trf__seats:has(input[value="6"]:checked) {
--trf-n: 5;
}
.trf__thumb {
position: absolute;
top: 3px;
bottom: 3px;
left: 3px;
width: calc((100% - 6px) / 6);
border-radius: 999px;
background: #5b6b2e;
box-shadow: 0 2px 6px -2px rgba(40, 50, 10, 0.6);
transform: translateX(calc(var(--trf-n) * 100%));
transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.trf__seats label {
position: relative;
z-index: 1;
display: grid;
place-items: center;
height: 32px;
border-radius: 999px;
color: #5d5a48;
font: 600 14px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
cursor: pointer;
transition: color 200ms ease;
}
.trf__seats label:hover {
color: #2a2a1f;
}
.trf__seats label:has(input:checked) {
color: #f6f1e4;
}
.trf__seats label:has(input:focus-visible) {
outline: 2px solid #5b6b2e;
outline-offset: 1px;
}
.trf__seats input {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
border: 0;
overflow: hidden;
clip: rect(0 0 0 0);
white-space: nowrap;
}
.trf__submit {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 46px;
margin-top: 16px;
padding: 0 16px;
border: 0;
border-radius: 6px;
background: #5b6b2e;
color: #f6f1e4;
font: 600 15px/1 ui-serif, Georgia, serif;
cursor: pointer;
box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2);
transition: transform 120ms ease, box-shadow 120ms ease, background 200ms ease;
}
.trf__submit span {
font: 500 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
letter-spacing: 0.04em;
opacity: 0.75;
}
.trf__submit:hover {
background: color-mix(in oklab, #5b6b2e, #000 14%);
}
.trf__submit:active {
transform: translateY(2px);
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}
.trf__submit:focus-visible {
outline: 2px solid #5b6b2e;
outline-offset: 3px;
}Changes made here are only a live preview and will not be saved.
Save to GitHub
GitHub opens a new file in your repository with this element filled in. Review it there and press Commit changes. Nothing is sent from codepeek and no GitHub access is needed.
◉ 1 views
Build it with AIA ready prompt with the code, the credit and how to adapt it to your project.
An olive and cream booking card for a small osteria. Pick a date and time, and a guest-count rail slides its pill to your seat with a springy :has() offset.
Choose where to donate
Select a platform to continue.
Community
Comments 0
Code copied
SUPPORT THE CREATOR
Would you like to donate to the creator to help them keep creating content?
You need to sign in before you can write a comment.