-
Notifications
You must be signed in to change notification settings - Fork 1
/
59-load-moreClass.html
115 lines (102 loc) Β· 2.72 KB
/
59-load-moreClass.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
<!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="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css"
integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2"
crossorigin="anonymous"
/>
<style>
*,
*::before,
*::after {
box-sizing: border-box;
}
body {
font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
Ubuntu, Cantarell, sans-serif;
line-height: 1.5;
color: #2a2a2a;
}
img {
display: block;
max-width: 100%;
height: auto;
}
.search-form {
display: flex;
justify-content: center;
padding: 8px;
margin-bottom: 24px;
}
.button {
display: block;
margin-left: auto;
margin-right: auto;
}
.button.is-hidden {
display: none;
}
.button > .spinner.is-hidden {
display: none;
}
/* Article List */
.articles {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
grid-gap: 20px;
padding: 0;
margin: 0;
list-style: none;
max-width: calc(100vw - 80px);
margin-left: auto;
margin-right: auto;
margin-bottom: 30px;
}
.articles li {
height: 450px;
overflow: hidden;
}
.articles img {
display: block;
width: 100%;
height: 200px;
object-fit: cover;
}
.articles a {
text-decoration: none;
color: #2a2a2a;
}
</style>
</head>
<body>
<form class="form-inline search-form js-search-form">
<div class="form-group mx-sm-3 mb-2">
<label for="searchQuery" class="sr-only">Search</label>
<input
type="text"
class="form-control"
name="query"
id="searchQuery"
placeholder="Search articles..."
autocomplete="off"
/>
</div>
<button type="submit" class="btn btn-primary mb-2">Search</button>
</form>
<ul class="articles js-articles-container"></ul>
<button type="button" class="btn btn-primary button" data-action="load-more">
<span
class="spinner-border spinner-border-sm spinner is-hidden"
role="status"
aria-hidden="true"
></span>
<span class="label">Load more</span>
</button>
<script src="./app/59-load-moreClass.js" type="module"></script>
</body>
</html>