-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
192 lines (155 loc) · 5.69 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- <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=Lobster&display=swap" rel="stylesheet"> -->
<!-- CDN link for emojis -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"
integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- Google fonts link -->
<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=Satisfy&display=swap" rel="stylesheet">
<!-- AOS animation link -->
<link href="https://unpkg.com/[email protected]/dist/aos.css" rel="stylesheet">
<title>Weather App</title>
<style>
:root {
--main-height: 500px;
--main-height2: 350px;
--main-margin-top: 40px;
/* font-family: 'Lobster', 'cursive'; */
--main-font-family: 'Satisfy', 'cursive';
}
.container {
height: var(--main-height);
width: 600px;
border: 2px solid blue;
box-shadow: 10px 10px 5px rgb(34, 164, 250);
border-radius: 5px;
display: flex;
justify-content: center;
align-items: center;
margin: auto;
margin-top: var(--main-margin-top);
background-color: rgba(48, 166, 245, 0.842);
}
.quote-section {
height: var(--main-height2);
width: var(--main-height2);
border: 2px solid rgba(48, 166, 245, 0.842);
background-color: white;
box-sizing: border-box;
position: relative;
box-shadow: 10px 10px 5px rgba(8, 156, 255, 0.842);
border-radius: 8px;
}
.twitter {
position: absolute;
/* height: 20px;
width: 20px; */
right: 1px;
top: 2px;
display: inline;
border: 0px solid white;
}
#dc-icon {
display: flex;
position: absolute;
top: 58px;
left: 25px;
}
#quotebox {
height: 150px;
width: 300px;
background-color: rgb(223, 233, 232);
position: absolute;
box-sizing: border-box;
overflow: auto;
top: 90px;
bottom: 50px;
left: 25px;
font-family: var(--main-font-family);
font-size: 20px;
padding-top: 20px;
padding-left: 18px;
}
#author-box {
position: absolute;
box-sizing: border-box;
height: 40px;
width: 170px;
background-color: rgb(223, 233, 232);
top: 250px;
right: 25px;
font-family: var(--main-font-family);
padding-top: 10px;
padding-left: 10px;
overflow: auto;
}
#new-quote {
position: absolute;
bottom: 0px;
padding: 11px 143px;
/* bottom:( var(--main-margin-top) + (var(--main-height)/2) ) ; */
/* box-sizing: border-box; */
background-color: blue;
/* font-family: 'Lobster', 'cursive'; */
font-family: var(--main-font-family);
font-size: 13px;
border: 3.3px solid blue;
}
/* .warning{
visibility: hidden;
} */
</style>
</head>
<body>
<div class="container" data-aos="zoom-in">
<!-- <h1 class="warning">
This page is designed for PC , Kindly switch to PC
</h1> -->
<div class="quote-section"data-aos="zoom-in">
<i id="dc-icon" class="fas fa-quote-left"></i>
<div id="quotebox" data-aos="zoom-in"></div>
<div id="author-box"></div>
<a class="twitter" href="https://twitter.com/login?lang=en" target="__Blank">
<img src="Twitter-img.webp" title="TweetMe">
</a>
<button id="new-quote" title="New Quote">New Quote</button>
</div>
</div>
</body>
<script src="https://unpkg.com/[email protected]/dist/aos.js"></script>
<script>
AOS.init();
let realdata = "";
const quote = document.getElementById("quotebox");
const auther = document.getElementById("author-box");
const getNewQuotes = () => {
let rendomNO = Math.floor(Math.random() * 1000);
quote.innerText = `${realdata[rendomNO].text}`;
auther.innerText = "- " + `${realdata[rendomNO].author}`;
if (realdata[rendomNO].author == null) {
auther.innerText = "UnKnown";
}
};
const getApi = async () => {
const api = "https://type.fit/api/quotes";
try {
let data = await fetch(api);
realdata = await data.json();
getNewQuotes();
}
catch (error) { }
};
getApi();
// On click event for new quote button
document.getElementById("new-quote").addEventListener('click',getNewQuotes)
</script>
</html>