-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
68 lines (65 loc) · 2.49 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
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/custom-style.css">
<style>
@media only screen and (max-width: 768px) {
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
}
.flex-container {
display: flex;
justify-content: center;
}
</style>
</head>
<body>
<header id="header">
<center>
<img id="header-img" src="https://smallbizsilverlining.com/wp-content/uploads/2018/04/Silver-Lining-Grow-You-Small-Business-Logo.png"/>
<nav id="nav-bar">
<a class="nav-link" href="#learn-more">Learn More</a>
<a class="nav-link" href="#request-coupon">Request Coupon</a>
<a class="nav-link" href="#buy-on-amazon">Buy on Online Store</a>
</nav>
</center>
</header>
<section id="learn-more">
<center>
<h1>My Silver Linings</h1>
<iframe id="video" width="560" height="315" src="https://www.youtube.com/embed/DKL4X0PZz7M" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</center>
</section>
<section id="request-coupon">
<center>
<h2>Request a Coupon</h2>
<form id="form" action="https://www.freecodecamp.com/email-submit">
<input id="email" type="email" name="email" placeholder="you@you.com">
<input id="submit" type="submit"></input>
</form>
</center>
</section>
<section id="buy-on-amazon">
<div class="flex-container">
<div><a href="amazon-affiliate-link">Buy on Amazon</a></div>
<div><a href="mercari-affiliate-link">Buy on Mercari</a></div>
<div><a href="silver-liningsjj-affiliate-link">Buy on Silver Linings</a></div>
</div>
</section>
</body>
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<script>
window.onscroll = function() {myFunction()};
var header = document.getElementById("header");
var sticky = header.offsetTop;
function myFunction() {
console.log("scroll triggered")
if (window.pageYOffset > sticky) {
header.classList.add("sticky");
} else {
header.classList.remove("sticky");
}
}
</script>
</html>