-
Notifications
You must be signed in to change notification settings - Fork 0
/
magicgrid_differentsize.html
93 lines (93 loc) · 2.23 KB
/
magicgrid_differentsize.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
<!DOCTYPE html>
<html lang="ja" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<title>cards</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" lang="ja" xml:lang="ja" content="">
<meta name="keywords" lang="ja" xml:lang="ja" content="">
<link href="https://necolas.github.io/normalize.css/3.0.2/normalize.css" rel="stylesheet">
<script src="https://unpkg.com/magic-grid/dist/magic-grid.min.js"></script>
<style>
body{
width:100%;
margin:0;
padding:0;
}
main{
padding:10px 0;
color:#111;
}
.box1{
width:120px;
height: 150px;
background-color:#d3a1cf;
opacity: 0.5;
text-align: center;
}
.box2{
width:120px;
height: 180px;
background-color:#a0c1d3;
opacity: 0.5;
text-align: center;
}
.box3{
width:120px;
height: 130px;
background-color:#d3cfa0;
opacity: 0.5;
text-align: center;
}
.box4{
width:120px;
height: 190px;
background-color:#d5a69f;
opacity: 0.5;
text-align: center;
}
.box5{
width:120px;
height: 140px;
background-color:#a09dd7;
opacity: 0.5;
text-align: center;
}
.box6{
width:120px;
height: 120px;
background-color:#9ed6b5;
opacity: 0.5;
text-align: center;
}
</style>
</head>
<body>
<main>
<div class="container">
<div class="box1">one</div>
<div class="box2">two</div>
<div class="box3">three</div>
<div class="box4">four</div>
<div class="box5">five</div>
<div class="box6">six</div>
<div class="box1">seven</div>
<div class="box2">eight</div>
<div class="box3">nine</div>
<div class="box4">ten</div>
<div class="box5">eleven</div>
<div class="box6">twelve</div>
</div>
<main>
<script>
let magicGrid = new MagicGrid({
container: '.container',
animate: true, //配置する前にアニメーション優先
gutter: 20, //カードのマージン
static: true,
useMin: true //小さい画像優先
});
magicGrid.listen();
</script>
<body>
</html>