-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
92 lines (77 loc) · 3.35 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Dave Quah (@Milleus)">
<link rel="icon" type="image/png" sizes="32x32" href="./assets/favicon-32x32.png">
<title>Frontend Mentor | Pod request access landing page</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Chivo:wght@400;900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/global.css">
<script async src="https://www.googletagmanager.com/gtag/js?id=G-5W6QZZYV2W"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-5W6QZZYV2W');
</script>
</head>
<body>
<main class="landing">
<img class="logo" src="assets/desktop/logo.svg" alt="pod">
<div class="intro grid">
<h1 class="fs-800 fw-400 text-teal-400 uppercase">
Publish your podcasts <span class="text-neutral-100">everywhere.</span>
</h1>
<p class="description">
Upload your audio to Pod with a single click. We’ll then distribute your podcast to Spotify,
Apple Podcasts, Google Podcasts, Pocket Casts and more!
</p>
<ul class="podcasts flex">
<li><img src="assets/desktop/spotify.svg" alt="spotify"></li>
<li><img src="assets/desktop/apple-podcast.svg" alt="apple podcast"></li>
<li><img src="assets/desktop/google-podcasts.svg" alt="google podcasts"></li>
<li><img src="assets/desktop/pocket-casts.svg" alt="pocket casts"></li>
</ul>
<form id="sign-up-form">
<label for="email-input" class="sr-only">Email</label>
<input id="email-input" class="input" data-variant="primary" type="email" placeholder="Email address"
maxlength="255" aria-describedby="email-error" pattern="^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$"
required>
<p id="email-error" aria-live="polite" class="error fs-200 text-red-400"></p>
<button class="button" data-variant="primary" type="submit">Request Access</button>
</form>
</div>
</main>
<script>
const signUpForm = document.querySelector("#sign-up-form");
const emailInput = document.querySelector("#email-input");
const emailError = document.querySelector("#email-error");
signUpForm.noValidate = true;
emailInput.addEventListener("input", (event) => {
if (!emailInput.validity.valueMissing && !emailInput.validity.patternMismatch) {
emailInput.setAttribute("aria-invalid", false);
emailError.textContent = "";
}
});
signUpForm.addEventListener("submit", (event) => {
event.preventDefault();
if (emailInput.validity.valueMissing || emailInput.validity.patternMismatch) {
emailInput.setAttribute("aria-invalid", true);
emailError.textContent = "Oops! Please check your email";
emailInput.focus();
return;
};
try {
alert("Thanks for subscribing!");
emailInput.setAttribute("aria-invalid", false);
emailError.textContent = "";
} catch (e) {
alert("Oops! Something went wrong. Please try again later.");
}
});
</script>
</body>
</html>