-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
209 lines (191 loc) · 8.22 KB
/
Copy pathindex.html
File metadata and controls
209 lines (191 loc) · 8.22 KB
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Web Accessibility</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous" />
</head>
<style>
* {
padding: 0px;
margin: 0px;
box-sizing: border-box;
}
#skip-button {
top: -200px;
left: 10px;
z-index: 999;
border: none;
width: fit-content;
color: #fff;
&:focus {
top: 20px;
}
}
</style>
<body style="height:max(auto, 100vh); width:100vw; display:flex; flex-direction: column;">
<a href="#main-content" id="skip-button" tabindex="1"
class="container-fluid py-4 px-4 flex flex-column bg-primary position-absolute border z-3">
Skip to the main content</a>
<div class="container-fluid border-5 border-dander z-0" tabindex="3" style="height:100vh">
<!-- Tabbing -->
<!-- start of navbar -->
<nav class="navbar navbar-expand-lg navbar-light bg-transparent py-4 px-4">
<div class="container-fluid">
<a class="navbar-brand" href="#">Outside</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown"
aria-expanded="false">
Dropdown
</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li>
<hr class="dropdown-divider" />
</li>
<li>
<a class="dropdown-item" href="#">Something else here</a>
</li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
<form class="d-flex">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search" />
<button class="btn btn-outline-success" type="submit">
Search
</button>
</form>
</div>
</div>
</nav>
<!-- end of navbar -->
<!-- start of form seciton -->
<section class="container mt-[500px] h-100 border" tabindex="2" id="main-content" style="margin-top: 700px;">
<form>
<fieldset>
<legend>Contact us</legend>
<div class="row">
<section class="left col-12 col-md-6">
<div class="row g-2">
<div class="form-floating mb-3 col-12 col-sm-6">
<input type="firstname" class="form-control" id="floatingInput" placeholder="firstname" />
<label for="floatingInput">First name <strong>*</strong></label>
</div>
<div class="form-floating mb-3 col-12 col-sm-6 rounded-2">
<input type="text" class="form-control" id="floatingLastname" placeholder="Password" />
<label for="floatingLastname">Last name <strong>*</strong></label>
</div>
<div class="form-floating mb-3 col-12 col-sm-6">
<input type="email" class="form-control" id="floatingEmail" placeholder="Password" />
<label for="floatingEmail">Work email</label>
</div>
<div class="form-floating mb-3 col-12 col-sm-6">
<input type="text" id="floatingInputtCompany" placeholder="Company" class="form-control"
name="floatingcompany" />
<label for="floatingInputtCompany">Company <strong>*</strong></label>
</div>
<div class="form-floating mb-3 col-12 col-sm-6">
<input type="text" id="floatingJobTitle" placeholder="Job Title" name="job" class="form-control" />
<label for="floatingJobTitle">Job Title <strong>*</strong></label>
</div>
<div class="form-floating mb-3 col-12 col-sm-6">
<input type="number" class="form-control" name="number" id="floatingNumber" placeholder="number " />
<label for="floatingNumber">Phone Number (optional)</label>
</div>
<div class="mb-3 form-check">
<input type="checkbox" class="form-check-input" id="exampleCheck1" />
<label class="form-check-label" for="exampleCheck1">I agree with the privacy notice.</label>
</div>
</div>
</section>
<section class="right col-12 col-md-6 row gx-2 mb-3">
<div class="form-floating">
<textarea class="form-control" placeholder="Leave a comment here" id="floatingTextarea"
style="height: 220px"></textarea>
<label for="floatingTextarea">How can we help you?</label>
</div>
</section>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</fieldset>
</form>
</section>
<!-- end of form section -->
</div>
<!-- scripts -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"></script>
<script>
document.addEventListener("DOMContentLoaded", () => {
const dropdown = document.querySelector(".dropdown")
const dropdownToggle = dropdown.querySelector(".dropdown-toggle")
const dropdownMenu = dropdown.querySelector(".dropdown-menu")
const dropdownItems = dropdownMenu.querySelectorAll(".dropdown-item")
const skipButton = document.getElementById('skip-button')
// Ensure focus goes to main content
skipButton.addEventListener('click', (event) => {
event.preventDefault();
const mainContent = document.getElementById('main-content');
if (mainContent) {
mainContent.focus();
}
});
document.addEventListener("keydown", function (event) {
if (event.key === "Enter") {
if (skipButton) {
skipButton.click();
}
}
});
// Show dropdown menu on focus
dropdownToggle.addEventListener("focus", () => {
dropdown.classList.add("show")
dropdownMenu.classList.add("show")
dropdownToggle.setAttribute("aria-expanded", "true")
})
// Keep dropdown menu open while tabbing through items
dropdownItems.forEach((item) => {
item.addEventListener("focus", () => {
dropdown.classList.add("show")
dropdownMenu.classList.add("show")
dropdownToggle.setAttribute("aria-expanded", "true")
})
item.addEventListener("blur", (e) => {
if (!dropdownMenu.contains(e.relatedTarget)) {
dropdown.classList.remove("show")
dropdownMenu.classList.remove("show")
dropdownToggle.setAttribute("aria-expanded", "false")
}
})
})
// Hide dropdown menu when leaving the dropdown
dropdownToggle.addEventListener("blur", (e) => {
if (!dropdownMenu.contains(e.relatedTarget)) {
dropdown.classList.remove("show")
dropdownMenu.classList.remove("show")
dropdownToggle.setAttribute("aria-expanded", "false")
}
})
})
</script>
</body>
</html>