-
Notifications
You must be signed in to change notification settings - Fork 0
/
Template.html
151 lines (136 loc) · 3.79 KB
/
Template.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<!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">
<title>网页模板</title>
<link rel="stylesheet" href="./css/nav.css">
<link rel="stylesheet" href="./css/all.css">
<link rel="shortcut icon" href="./image/logo.png" type="image/x-icon"/>
<style>
body .shell-main-nav ul .nav-box {
left: 480px;
}
body .shell-main {
margin-bottom: 0;
}
body .shell-main-nav{
margin-bottom: 0;
}
.images {
width: 90%;
column-count: 4;
column-gap: 20px;
margin-top: 100px;
position: relative;
}
.images::before{
content: '';
position: absolute;
left: 50%;
transform: translate(-50%);
height: 100%;
width: 500px;
background-image: linear-gradient(to bottom, #a1e6ff, #a8ffe2, #a1e6ff);
z-index: -9;
}
.images div {
margin-bottom: 15px;
overflow: hidden;
border: #000 solid 2px;
}
.images img {
width: 100%;
transition: .3s;
opacity: 0.8;
}
.images img:hover {
transform: scale(1.1);
opacity: 1;
}
@media (max-width:1200px) {
.images {
column-count: 4;
}
}
@media (max-width:850px) {
.images {
column-count: 3;
}
}
@media (max-width:600px) {
.images {
column-count: 2;
}
}
.image {
width: 100vw;
height: 100vh;
position: sticky;
z-index: 999;
background-color: rgba(0, 0, 0, 0.4);
justify-content: center;
align-items: center;
top: 0;
display: none;
}
.image img {
height: 90%;
}
</style>
</head>
<body>
<div class="shell">
<div class="shell-main">
<!-- 顶部导航栏-->
<div class="shell-main-nav">
<div class="logo">
<img src="./image/logo.png" alt="">
<span>Ace魔术社</span>
</div>
<ul>
<li><a href="./index.html">关于我们</a></li>
<li><a href="details.html">社团章程</a></li>
<li><a href="./timeline.html">魔幻之夜</a></li>
<li><a href="record.html">社员档案</a></li>
<li><a href="./Template.html">社员风采</a></li>
<li>登录</li>
<div class="nav-box"></div>
</ul>
</div>
</div>
<div class="image">
</div>
<div class="images">
</div>
<div class="shell-main-footer">
<span>magic-Ace<br>如有侵权,请联系作者删除</span>
</div>
</div>
<script>
let images = document.querySelector('.images')
let image = document.querySelector('.image')
for (let i = 1; i < 44; i++) {
var lis = document.createElement('div')
lis.innerHTML = `<img class="img" src='./image/img/img(` + i + `).jpg'>`
images.appendChild(lis)
}
let img = document.querySelectorAll('.img')
for (let i = 0; i < img.length; i++) {
img[i].addEventListener("click", () => {
image.style.display = "flex"
let index = i + 1
image.innerHTML = "<img src='./image/img/img(" + index + ").jpg'>"
document.body.style.overflow = 'hidden'; //禁止页面滑动
})
}
image.addEventListener('click', () => {
image.style.display = "none"
document.body.style.overflow = 'auto'; //出现滚动条
})
</script>
<audio id="audio" src="./music/music.mp3" autoplay loop style="display: none;" ></audio>
<script src="./js/audio.js"></script>
</body>
</html>