-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgrid.html
More file actions
138 lines (129 loc) · 3.73 KB
/
Copy pathgrid.html
File metadata and controls
138 lines (129 loc) · 3.73 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>grid muuri</title>
<style>
.grid {
position: relative;
opacity: 0;
transition: opacity 0.8s linear 1s;
}
.images-loaded .grid {
opacity: 1;
}
.item {
position: absolute;
margin: 5px;
z-index: 1;
}
.item.muuri-item-hidden {
z-index: 0;
}
.item.muuri-item-releasing {
z-index: 2;
}
.item.muuri-item-dragging {
z-index: 3;
}
.item-content {
position: relative;
cursor: pointer;
}
.item-content > img {
display: block;
border-radius: 6px;
}
.loading {
display: flex;
justify-content: center;
align-items: center;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
text-transform: uppercase;
transition: opacity 0.6s linear 0.4s;
}
.images-loaded .loading {
opacity: 0;
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/web-animations/2.3.2/web-animations.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/muuri@0.9.3/dist/muuri.min.js"></script>
</head>
<body><div class="loading">
Loading images...
</div>
<div class="grid">
<div class="item">
<div class="item-content">
<img src="https://images.weserv.nl/?url=www.dramabeans.com/wp-content/uploads/2020/09/MTF0102_8A.jpg" alt="Drama image" height ="300"/>
</div>
</div>
<div class="item">
<div class="item-content">
<img src="https://6.soompi.io/wp-content/uploads/image/a975e552d1fd478796492062be4e481e.jpeg?s=900x600&e=t" width="400" />
</div>
</div>
<div class="item">
<div class="item-content">
<img src="https://i2.wp.com/www.cdramalove.com/wp-content/uploads/2020/04/2-The-Love-Equations-Review.jpg?ssl=1" width="400" />
</div>
</div>
<div class="item">
<div class="item-content">
<img src="https://m.media-amazon.com/images/S/pv-target-images/5c85e8901c2d2727697c15eb71312022e4ee54b7201412db63124290d11ce898.jpg" width="400" />
</div>
</div>
<div class="item">
<div class="item-content">
<img src="https://th-i.thgim.com/public/life-and-style/oayzmc/article68928800.ece/alternates/FREE_1200/family-by-choice-5-1.jpg" width="400" />
</div>
</div>
<div class="item">
<div class="item-content">
<img src="https://i.pinimg.com/474x/16/1d/5f/161d5f59011ac0de83e4408d920de83c.jpg" height="300" />
</div>
</div>
<div class="item">
<div class="item-content">
<img src="https://occ-0-8407-116.1.nflxso.net/dnm/api/v6/9pS1daC2n6UGc3dUogvWIPMR_OU/AAAABZVg1svfP2o4-NDlJJneY_FO4sKqbp4jflryZJuaimI9kRQ4DDhN9Q8vXPYoNFLy-3Vl_PNfkH4uua7C4MS1GPLnLQShKX4nWl4y.jpg?r=7bf" width="400" />
</div>
</div>
<div class="item">
<div class="item-content">
<img src="https://media.butwhytho.net/wp-content/uploads/2024/01/My-Demon-Episodes-15-16-But-Why-Tho.jpg" height="300" />
</div>
</div>
<div class="item">
<div class="item-content">
<img src="https://dramadelight.com/wp-content/uploads/2019/03/whats-wrong-with-secretary-kim-english-translation-live-recap-7-1-1.jpg?w=640" width="400" />
</div>
</div>
<div class="item">
<div class="item-content">
<img src="https://newpic.wetvinfo.com/vpic_cover/m0033cznkgz/m0033cznkgz_hz.jpg/496" height="200"/>
</div>
</div>
</div>
<script >
var grid = new Muuri('.grid', {
dragEnabled: true,
layout: {
fillGaps: true
}
});
// When all items have loaded refresh their
// dimensions and layout the grid.
window.addEventListener('load', function () {
grid.refreshItems().layout();
// For a little finishing touch, let's fade in
// the images after all them have loaded and
// they are corrertly positioned.
document.body.classList.add('images-loaded');
});
</script></body>
</html>