-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex3.html
More file actions
153 lines (137 loc) · 4.95 KB
/
Copy pathindex3.html
File metadata and controls
153 lines (137 loc) · 4.95 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Three.js Shader Slider</title>
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }
html, body {
width: 100%; height: 100%;
background: #0a0a0a;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
overflow: hidden;
}
#slider {
position: relative;
width: 100%; height: 100%;
user-select: none;
}
/* Three.js рендерит в canvas, который добавляем программно */
canvas {
position: absolute;
inset: 0;
display: block;
}
/* Скрытые img — источники текстур */
.slide-img { display: none }
/* Затемняющий градиент поверх */
#overlay {
position: absolute; inset: 0; pointer-events: none; z-index: 1;
background: linear-gradient(to top,
rgba(0,0,0,.68) 0%, rgba(0,0,0,.2) 40%, transparent 70%);
}
/* Текст слайда */
#slide-content {
position: absolute; left: 40px; bottom: 64px;
z-index: 2; color: #fff;
max-width: min(520px, calc(100% - 80px));
pointer-events: none;
transition: opacity .3s;
}
#slide-content.fade { opacity: 0 }
.slide-label {
font-size: 11px; font-weight: 600;
letter-spacing: .15em; text-transform: uppercase;
opacity: .5; margin-bottom: 8px;
}
.slide-title {
font-size: clamp(22px, 4vw, 40px);
font-weight: 700; line-height: 1.2;
text-shadow: 0 2px 16px rgba(0,0,0,.55);
}
.slide-sub {
margin-top: 6px; font-size: 13px;
opacity: .58; letter-spacing: .04em;
}
/* Кнопки навигации */
.nav {
position: absolute; top: 50%; transform: translateY(-50%);
z-index: 3; cursor: pointer;
width: 48px; height: 48px; border-radius: 50%;
border: 1px solid rgba(255,255,255,.18);
background: rgba(255,255,255,.1);
backdrop-filter: blur(8px);
display: flex; align-items: center; justify-content: center;
color: #fff; font-size: 18px;
transition: background .2s, transform .2s;
}
.nav:hover {
background: rgba(255,255,255,.22);
transform: translateY(-50%) scale(1.08);
}
#prev { left: 16px }
#next { right: 16px }
/* Пагинация */
#dots {
position: absolute; bottom: 24px; left: 50%;
transform: translateX(-50%);
z-index: 3; display: flex; gap: 8px;
}
.dot {
width: 8px; height: 8px; border-radius: 4px;
background: rgba(255,255,255,.38); cursor: pointer;
transition: width .3s, background .3s;
}
.dot.active { width: 24px; background: #fff }
/* Пикер шейдеров */
#picker {
position: absolute; top: 14px; right: 14px;
z-index: 3; display: flex; gap: 5px;
flex-wrap: wrap; justify-content: flex-end;
max-width: 340px;
}
#picker button {
font-size: 11px; font-family: inherit; font-weight: 500;
padding: 4px 10px; border-radius: 4px; cursor: pointer;
border: 1px solid rgba(255,255,255,.18);
background: rgba(15,15,15,.75);
color: rgba(255,255,255,.55);
backdrop-filter: blur(6px);
transition: color .15s, border-color .15s;
}
#picker button:hover { color: #fff; border-color: rgba(255,255,255,.5) }
#picker button.active { color: #60aaff; border-color: #60aaff }
</style>
<!-- Three.js через importmap — никакого npm -->
<script type="importmap">
{
"imports": {
"three": "https://cdn.jsdelivr.net/npm/three@0.167.1/build/three.module.js"
}
}
</script>
</head>
<body>
<div id="slider">
<!-- Текстурные источники -->
<img class="slide-img" src="img/1.jpg" data-title="Slide One" data-sub="2021 · Marvel Studios" crossorigin="anonymous">
<img class="slide-img" src="img/2.jpg" data-title="Slide Two" data-sub="2021 · Marvel Studios" crossorigin="anonymous">
<img class="slide-img" src="img/3.jpg" data-title="Slide Three" data-sub="2021 · Marvel Studios" crossorigin="anonymous">
<img class="slide-img" src="img/4.jpg" data-title="Slide Four" data-sub="2021 · Marvel Studios" crossorigin="anonymous">
<img class="slide-img" src="img/5.jpg" data-title="Slide Five" data-sub="2021 · Marvel Studios" crossorigin="anonymous">
<img class="slide-img" src="img/6.jpg" data-title="Slide Six" data-sub="2021 · Marvel Studios" crossorigin="anonymous">
<div id="overlay"></div>
<div id="slide-content">
<div class="slide-label" id="lbl"></div>
<div class="slide-title" id="ttl"></div>
<div class="slide-sub" id="sub"></div>
</div>
<div class="nav" id="prev">←</div>
<div class="nav" id="next">→</div>
<div id="dots"></div>
<div id="picker"></div>
</div>
<script type="module" src="slider3.js"></script>
</body>
</html>