-
Notifications
You must be signed in to change notification settings - Fork 208
/
FlexAlbum.html
118 lines (118 loc) · 2.83 KB
/
FlexAlbum.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>自适应相册</title>
<link href="https://cdn.bootcss.com/magnific-popup.js/1.1.0/magnific-popup.min.css" rel="stylesheet" />
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/magnific-popup.js/1.1.0/jquery.magnific-popup.min.js"></script>
<style>
* {
margin: 0;
padding: 0;
font-family: 'montserrat', sans-serif;
box-sizing: border-box;
}
.gallery-section {
width: 100%;
padding: 60px 0;
background: #f1f1f1;
}
.inner-width {
width: 100%;
max-width: 1200px;
margin: auto;
padding: 0 20px;
}
.gallery-section h1 {
text-align: center;
text-transform: uppercase;
color: #333;
}
.border {
width: 180px;
height: 4px;
background: #333;
margin: 60px auto;
}
.gallery-section .gallery {
display: flex;
flex-wrap: wrap-reverse;
justify-content: center;
}
.gallery-section .image {
flex: 25%;
overflow: hidden;
cursor: pointer;
}
.gallery-section .image img {
width: 100%;
height: 100%;
transition: 0.4s;
}
.gallery-section .image:hover img {
transform: scale(1.4) rotate(15deg);
}
@media screen and (max-width: 960px) {
.gallery-section .image {
flex: 33.33%;
}
}
@media screen and (max-width: 768px) {
.gallery-section .image {
flex: 50%;
}
}
@media screen and (max-width: 480px) {
.gallery-section .image {
flex: 100%;
}
}
</style>
</head>
<body>
<div class="gallery-section">
<div class="inner-width">
<h1>My Gallery</h1>
<div class="border"></div>
<div class="gallery">
<a href="../images/71.jpg" class="image">
<img src="../images/71.jpg" alt="" />
</a>
<a href="../images/93.jpg" class="image">
<img src="../images/93.jpg" alt="" />
</a>
<a href="../images/104.jpg" class="image">
<img src="../images/104.jpg" alt="" />
</a>
<a href="../images/114.jpg" class="image">
<img src="../images/114.jpg" alt="" />
</a>
<a href="../images/156.jpg" class="image">
<img src="../images/156.jpg" alt="" />
</a>
<a href="../images/171.jpg" class="image">
<img src="../images/171.jpg" alt="" />
</a>
<a href="../images/264.jpg" class="image">
<img src="../images/264.jpg" alt="" />
</a>
<a href="../images/265.jpg" class="image">
<img src="../images/265.jpg" alt="" />
</a>
</div>
</div>
</div>
<script>
$('.gallery').magnificPopup({
delegate: 'a',
type: 'image',
gallery: {
enabled: true
}
})
</script>
</body>
</html>