-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
173 lines (164 loc) · 5.08 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
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
<!doctype html>
<html lang="en-US">
<head>
<!-- Meta -->
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="shortcut icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="shortcut icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<link rel="manifest" href="inspirofy.webmanifest">
<link rel="mask-icon" href="safari-pinned-tab.svg" color="#8c52ff">
<meta name="msapplication-TileColor" content="#8c52ff">
<meta name="msapplication-TileImage" content="mstile-144x144.png">
<meta name="theme-color" content="#000000">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5" />
<meta name="description" content="Inspirofy is a random inspirational quote generator." />
<meta name="keywords" content="inspirofy by pagalprogrammer,pagalprogrammer, pagal programmer, Ankit Beniwal, Ank._t, Ankit, Beniwal" />
<meta name="author" content="Ankit Beniwal (pagalprogrammer)" />
<!-- Title -->
<title>Inspirofy by pagalprogrammer</title>
<link rel="preload" href="https://fonts.googleapis.com/css?family=Aladin|Grand+Hotel&display=swap" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Aladin|Grand+Hotel&display=swap">
</noscript>
<script defer src="https://kit.fontawesome.com/2aef0cec41.js" crossorigin="anonymous"></script>
<style>
@font-face {
font-family: "Aladin";
src: url("https://fonts.gstatic.com/s/aladin/v8/ZgNSjPJFPrvJV5fF7i35.woff2") format("woff2");
font-style: normal;
font-display:swap;
font-weight: 500;
unicode-range: U+0-FF, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
font-family: "Grand Hotel";
src: url("https://fonts.gstatic.com/s/grandhotel/v7/7Au7p_IgjDKdCRWuR1azplQKGFw.woff2") format("woff2");
font-style: normal;
font-display:swap;
font-weight: 400;
unicode-range: U+0-FF, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
body,html{
margin:0;
scroll-behavior: smooth;
height:100%;
display:flex;
flex-direction:column;
}
a{
color:hsl(260, 97%, 75%);
}
a:link{
text-decoration:none;
transition: 0.4s;
}
a:hover{
color: hsl(36, 93%, 43%);
}
#navigation-bar {
width: 70%;
padding: 20px;
margin: auto;
height: 60px;
}
#logo{
border-radius: 10%;
display: inline-block;
vertical-align: top;
}
#reload-btn{
font-size: xx-large;
color: hsl(0, 0%, 100%);
float: right;
border: none;
width: 48pt;
height: 48pt;
border-radius: 50%;
background: hsl(0, 1%, 37%);
transition: 0.4s;
}
#reload-btn:hover{
background: hsl(36, 93%, 43%);
}
main{
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
-moz-box-align: center;
-ms-flex-align: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
-moz-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
flex-flow: column nowrap;
text-align:center;
flex: 1 0 auto;
min-height:auto;
}
#quote,#author{
padding:10px 10px;
background-color: hsla(0, 0%, 100%, 0.7);
color: hsl(0, 0%, 0%);
border-radius: 10px;
}
#quote{
max-width: 80%;
font: 500 xx-large 'Aladin', sans-serif !important;
}
#author{
font: 400 x-large 'Grand Hotel', sans-serif !important;
}
footer{
text-align:center;
padding:18px;
color: hsl(0, 0%, 100%);
background: hsl(0, 0%, 0%);
height: 14px;
}
</style>
</head>
<body>
<nav id="navigation-bar">
<img id="logo" alt="Logo of Inspirofy" src="apple-touch-icon-60x60.png">
<button id="reload-btn" aria-label="Refresh Quote" onclick="location.reload(true);" class="fas fa-redo"></button>
</nav>
<main>
<h2 aria-label="Quote" id="quote">Please Be Patient! Your Random Quote will be placed here.</h2>
<h3 aria-label="Author" id="author">- And the Author</h3>
</main>
<footer>
Crafted with <span aria-label="love" class="fas fa-heart" style="color:hsl(0, 100%, 50%);"></span> by <a aria-label="Link to Developer's Site" href="https://pagalprogrammer.dev">pagalprogrammer</a>
</footer>
<script defer>
var quote = document.getElementById("quote"),
author = document.getElementById("author"),
body = document.getElementsByTagName("BODY")[0];
body.style.background = "hsl(0,0%,0%) url(https://picsum.photos/"+screen.width+"/"+screen.height+".webp)";
fetch("https://quotable-quotes.p.rapidapi.com/randomQuotes", {
"method": "GET",
"headers": {
"x-rapidapi-host": "quotable-quotes.p.rapidapi.com",
"x-rapidapi-key": "ad508caadamsh7b2e033bfbea7f7p192242jsn833332cbd75e"
}
})
.then(response => {
return response.json()
})
.then(data => {
quote.innerHTML = data.quote;
author.innerHTML = "- "+data.author;
})
.catch(err => {
})
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('sw.js');
}
</script>
</body>
</html>