DmitrMakeev commited on
Commit
508376f
·
verified ·
1 Parent(s): 8d20045

Update spoller.html

Browse files
Files changed (1) hide show
  1. spoller.html +55 -22
spoller.html CHANGED
@@ -1,9 +1,9 @@
1
 
2
  <style>
3
-
4
  /* УНИВЕРСАЛЬНЫЕ СТИЛИ */
5
  .spoiler1-button,
6
- .spoiler2-button {
 
7
  display: flex;
8
  align-items: center;
9
  justify-content: center;
@@ -20,14 +20,14 @@
20
  margin: 10px 0;
21
  gap: 8px;
22
  }
23
-
24
  .spoiler1-button:hover,
25
- .spoiler2-button:hover {
 
26
  background-color: #e0e0e0;
27
  }
28
-
29
  .spoiler1-content,
30
- .spoiler2-content {
 
31
  padding: 16px;
32
  border: 1px solid #ddd;
33
  border-top: none;
@@ -35,48 +35,52 @@
35
  display: none;
36
  margin-top: -4px;
37
  }
38
-
39
  .arrow {
40
  flex-shrink: 0;
41
  transition: transform 0.3s;
42
  }
 
 
 
 
 
43
 
44
  /* 📱 Телефон (до 767px) */
45
  @media (max-width: 767px) {
46
  .spoiler1-button,
47
- .spoiler2-button {
 
48
  font-size: 18px; /* крупнее текст */
49
  padding: 16px 20px; /* больше зона клика */
50
  gap: 10px;
51
  }
52
  .spoiler1-content,
53
- .spoiler2-content {
 
54
  font-size: 16px;
55
  padding: 14px;
56
  }
57
  }
58
-
59
  /* 📱📲 Планшет (768px – 1024px) */
60
  @media (min-width: 768px) and (max-width: 1024px) {
61
  .spoiler1-button,
62
- .spoiler2-button {
 
63
  font-size: 17px;
64
  padding: 14px 18px;
65
  gap: 9px;
66
  }
67
  .spoiler1-content,
68
- .spoiler2-content {
 
69
  font-size: 15px;
70
  padding: 14px;
71
  }
72
  }
73
-
74
-
75
  </style>
76
 
77
 
78
- <!-- Первый блок HTML сдесь класс и ИД боков с номером 1 -->
79
-
80
  <div class="spoiler-divider"></div> <!-- верхняя линия -->
81
 
82
  <div class="spoiler-wrapper">
@@ -94,8 +98,6 @@
94
  <div class="spoiler-divider"></div> <!-- нижняя линия -->
95
 
96
 
97
-
98
- <!-- Скрипт для первого блока, работает с классом и ИД с номером 1 -->
99
  <script>
100
  function toggleSpoiler1() {
101
  const button = document.getElementById('spoiler1Button');
@@ -112,8 +114,7 @@
112
  </script>
113
 
114
 
115
-
116
- <!-- Второй блок HTML сдесь класс и ИД боков с номером 2 -->
117
  <div class="spoiler-divider"></div> <!-- верхняя линия -->
118
 
119
  <div class="spoiler-wrapper">
@@ -131,8 +132,6 @@
131
  <div class="spoiler-divider"></div> <!-- нижняя линия -->
132
 
133
 
134
-
135
- <!-- Скрипт для второго блока, работает с классом и ИД с номером 2 -->
136
  <script>
137
  function toggleSpoiler2() {
138
  const button = document.getElementById('spoiler2Button');
@@ -149,6 +148,40 @@
149
  </script>
150
 
151
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  <!-- Для третьего -->
153
 
154
  <!-- 1) Добавляем через запятую в стили класс .spoiler3-button -->
 
1
 
2
  <style>
 
3
  /* УНИВЕРСАЛЬНЫЕ СТИЛИ */
4
  .spoiler1-button,
5
+ .spoiler2-button,
6
+ .spoiler3-button {
7
  display: flex;
8
  align-items: center;
9
  justify-content: center;
 
20
  margin: 10px 0;
21
  gap: 8px;
22
  }
 
23
  .spoiler1-button:hover,
24
+ .spoiler2-button:hover,
25
+ .spoiler3-button:hover {
26
  background-color: #e0e0e0;
27
  }
 
28
  .spoiler1-content,
29
+ .spoiler2-content,
30
+ .spoiler3-content {
31
  padding: 16px;
32
  border: 1px solid #ddd;
33
  border-top: none;
 
35
  display: none;
36
  margin-top: -4px;
37
  }
 
38
  .arrow {
39
  flex-shrink: 0;
40
  transition: transform 0.3s;
41
  }
42
+ /* серые линии сверху и снизу */
43
+ .spoiler-divider {
44
+ border-bottom: 1px solid #ccc;
45
+ margin: 10px 0;
46
+ }
47
 
48
  /* 📱 Телефон (до 767px) */
49
  @media (max-width: 767px) {
50
  .spoiler1-button,
51
+ .spoiler2-button,
52
+ .spoiler3-button {
53
  font-size: 18px; /* крупнее текст */
54
  padding: 16px 20px; /* больше зона клика */
55
  gap: 10px;
56
  }
57
  .spoiler1-content,
58
+ .spoiler2-content,
59
+ .spoiler3-content {
60
  font-size: 16px;
61
  padding: 14px;
62
  }
63
  }
 
64
  /* 📱📲 Планшет (768px – 1024px) */
65
  @media (min-width: 768px) and (max-width: 1024px) {
66
  .spoiler1-button,
67
+ .spoiler2-button,
68
+ .spoiler3-button {
69
  font-size: 17px;
70
  padding: 14px 18px;
71
  gap: 9px;
72
  }
73
  .spoiler1-content,
74
+ .spoiler2-content,
75
+ .spoiler3-content {
76
  font-size: 15px;
77
  padding: 14px;
78
  }
79
  }
 
 
80
  </style>
81
 
82
 
83
+ <!-- Первый блок -->
 
84
  <div class="spoiler-divider"></div> <!-- верхняя линия -->
85
 
86
  <div class="spoiler-wrapper">
 
98
  <div class="spoiler-divider"></div> <!-- нижняя линия -->
99
 
100
 
 
 
101
  <script>
102
  function toggleSpoiler1() {
103
  const button = document.getElementById('spoiler1Button');
 
114
  </script>
115
 
116
 
117
+ <!-- Второй блок -->
 
118
  <div class="spoiler-divider"></div> <!-- верхняя линия -->
119
 
120
  <div class="spoiler-wrapper">
 
132
  <div class="spoiler-divider"></div> <!-- нижняя линия -->
133
 
134
 
 
 
135
  <script>
136
  function toggleSpoiler2() {
137
  const button = document.getElementById('spoiler2Button');
 
148
  </script>
149
 
150
 
151
+ <!-- Третий блок (пример) -->
152
+ <div class="spoiler-divider"></div> <!-- верхняя линия -->
153
+
154
+ <div class="spoiler-wrapper">
155
+ <button class="spoiler3-button" onclick="toggleSpoiler3()" id="spoiler3Button">
156
+ <span class="spoiler-text">ТРЕТИЙ СПОЙЛЕР</span>
157
+ <svg class="arrow" width="17" height="17" viewBox="0 0 17 17">
158
+ <path fill="none" stroke="#000" stroke-width="1.7" d="M3.6 10.6L8.3 16l4.7-5.4M8.3 15.2V1.2"/>
159
+ </svg>
160
+ </button>
161
+ <div class="spoiler3-content" id="spoiler3Content">
162
+ <p>Контент третьего спойлера</p>
163
+ </div>
164
+ </div>
165
+
166
+ <div class="spoiler-divider"></div> <!-- нижняя линия -->
167
+
168
+
169
+ <script>
170
+ function toggleSpoiler3() {
171
+ const button = document.getElementById('spoiler3Button');
172
+ const content = document.getElementById('spoiler3Content');
173
+ const arrow = button.querySelector('.arrow');
174
+
175
+ const isExpanded = content.style.display === 'block';
176
+ content.style.display = isExpanded ? 'none' : 'block';
177
+ arrow.style.transform = isExpanded ? 'rotate(0)' : 'rotate(180deg)';
178
+ button.querySelector('.spoiler-text').textContent = isExpanded
179
+ ? 'ТРЕТИЙ СПОЙЛЕР'
180
+ : 'СВЕРНУТЬ';
181
+ }
182
+ </script>
183
+
184
+
185
  <!-- Для третьего -->
186
 
187
  <!-- 1) Добавляем через запятую в стили класс .spoiler3-button -->