-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.js
83 lines (72 loc) · 1.81 KB
/
home.js
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
// Create a home button
var homeButton = document.createElement('a');
homeButton.href = '../index.html';
homeButton.textContent = 'Home';
homeButton.id = 'home-button';
// Create a link Fonts
var linkElement = document.createElement('link');
linkElement.rel = 'stylesheet';
linkElement.href = 'https://fonts.googleapis.com/css2?family=Indie+Flower&display=swap';
// Create a style
var styleElement = document.createElement('style');
styleElement.innerHTML = `
/* width */
::-webkit-scrollbar {
width: 8px;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: grey;
border-radius: 15px;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: rgb(90, 90, 90);
}
#home-button {
position: fixed;
top: 10px;
left: 10px;
padding: 10px;
background-color: #007bff;
color: #fff;
text-decoration: none;
border-radius: 5px;
font-family: Arial, 'sans-serif';
font-size: 16px;
font-weight: bold;
}
footer {
position: fixed;
bottom: 0;
left: 0;
padding: 10px;
background-color: #f2f2f2;
font-size: 16px;
font-family: 'Indie Flower', cursive;
}
@media only screen and (max-width: 600px) {
#home-button {
top: 5px;
left: 5px;
padding: 5px;
}
footer {
padding: 8px 10px;
}
}
@media only screen and (max-width: 400px) {
#home-button {
top: 2px;
left: 2px;
}
}
`;
// Create a footer
var footerElement = document.createElement('footer');
footerElement.textContent = 'Created by Mohsin Gabru';
// Append the elements to the head and body
document.head.appendChild(linkElement);
document.head.appendChild(styleElement);
document.body.appendChild(homeButton);
document.body.appendChild(footerElement);