-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.html
126 lines (111 loc) · 3.58 KB
/
home.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
<!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 href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<title>Feeling Bored</title>
<style>
body {
background: #1D1F20;
}
#ct {
height: auto;
width: 50%;
border: 1px solid #f1c40f;
margin: 100px auto;
text-align: center;
position: relative;
color: #fff;
padding: 10px;
}
span {
background: #1D1F20;
color: #f1c40f;
padding: 0 10px;
font-size: 20px;
position: relative;
top: -28px;
}
.corner {
height: 30px;
width: 30px;
border-radius: 50%;
border: 1px solid #fff;
transform: rotate(-45deg);
position: absolute;
background: #1D1F20;
}
#left_top {
top: -16px;
left: -16px;
border-color: transparent transparent #f1c40f transparent;
}
#right_top {
top: -16px;
right: -16px;
border-color: transparent transparent transparent #f1c40f;
}
#left_bottom {
bottom: -16px;
left: -16px;
border-color: transparent #f1c40f transparent transparent;
}
#right_bottom {
bottom: -16px;
right: -16px;
border-color: #f1c40f transparent transparent transparent;
}
p {
padding-top: 13px;
font-size: 18px
}
.center{
text-align: center;
margin: 0 auto;
margin-top: -70px;
}
.btn{
border-radius: 10px;
}
</style>
</head>
<body>
<div class="center" style="font-size: 2em; text-transform: capitalize; text-decoration: underline; color: yellow; margin-top: 60px;">
feeling bored ??
</div>
<div class="center" style="font-size: 1.2em; margin-top: 15px; color: yellow;">
Do some random activities
</div>
<div id="ct">
<div class="corner " id="left_top"></div>
<div class="corner" id="left_bottom"></div>
<div class="corner" id="right_top"></div>
<div class="corner" id="right_bottom"></div>
<span style="font-size: 1.5em; font-weight: 600; color: rgb(180, 189, 96);">RANDOM ACTIVITY</span>
<blockquote>
<p class="pt-4"><i>
<span id="data">“Catch up with a friend over a lunch date“</span>
</i></p>
</blockquote>
</div>
<div class="center">
<button class="btn btn-warning px-5" id="clicked">Next</button>
</div>
<script>
const text = document.getElementById("data");
const clicked = document.getElementById("clicked");
const url = "https://www.boredapi.com/api/activity";
const getdata = async () => {
text.innerHTML = "loading ......";
const data = await fetch(url);
const ndata = await data.json();
console.log(ndata);
text.innerHTML = `“${ndata.activity}“`;
}
clicked.addEventListener("click", getdata);
// getdata();
</script>
</body>
</html>