-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
44 lines (40 loc) · 1.42 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<link rel="stylesheet" href="quote.css">
<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=Barlow:wght@800&family=Dancing+Script:wght@700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Mooli&family=Poppins&display=swap" rel="stylesheet">
<body>
<div class="container">
<div class="box">
<h1>Motivational quote</h1>
<blockquote id="quote"> loading...</blockquote>
<h3 id="author">loading...</h3>
<button id="btn", onclick="Quote(api_url)">Next Quote</button>
</div>
</div>
<div class="foot" style="
background-color: black;
color: white;
"><h><center>Copyright © Prabhat Yadav⭐|2023|</center></h></div>
<script>
let quote=document.getElementById("quote");
let author=document.getElementById("author");
const api_url="https://api.quotable.io/random";
async function Quote(url){
const response=await fetch(url);
var data= await response.json();
console.log(data);
quote.innerHTML=data.content;
author.innerHTML=data.author;
}
Quote("https://api.quotable.io/random");
</script>
</body>
</html>