-
Notifications
You must be signed in to change notification settings - Fork 0
/
dh.html
194 lines (192 loc) · 5.04 KB
/
dh.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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Dropdown Interaction</title>
</head>
<body>
<div
style="
width: 256px;
background: #1d1d1d;
border-radius: 4px;
padding: 12px;
"
>
<div style="margin-left: 4px; margin-right: 4px; margin-bottom: 12px">
<div
style="
color: #8e8e8e;
font-size: 12px;
display: flex;
justify-content: space-between;
"
>
<div>베이커리</div>
<div style="display: flex">더보기<img src="/svg/seeMore.svg" /></div>
</div>
<div
style="
color: white;
font-size: 16px;
width: 127px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
"
>
맛있는 빵집
</div>
</div>
<!-- 드롭다운 열리기 전 -->
<div
style="
padding: 8px;
background-color: #2d2d2d;
display: flex;
justify-content: space-evenly;
align-items: center;
gap: 12px;
"
>
<div
style="
background-color: #f73a2c;
width: 41px;
height: 24px;
border-radius: 2px;
display: flex;
justify-content: center;
align-items: center;
"
>
<img src="/svg/people.svg" />
3
</div>
<div
class="names-short"
style="
width: 127px;
font-size: 12px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: white;
opacity: 1; /* 시작할 때 보이기 */
"
>
이어령이어령, 이어령이어령, 김규리, 김규리, 김규리
</div>
<img
src="/svg/dropdown.svg"
style="transform: rotate(180deg); cursor: pointer"
onclick="toggleDropdown()"
/>
</div>
<!-- 드롭다운 열린 후 -->
<div
id="dropdownExtended"
style="padding: 8px; background-color: #2d2d2d; display: none"
>
<div
style="
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-top: 8px;
font-size: 14px;
width: 216px;
margin-left: 8px;
margin-bottom: 8px;
margin-right: 8px;
"
>
<div
style="
background-color: #1d1d1d;
padding-left: 8px;
padding-right: 8px;
padding-top: 2px;
padding-bottom: 2px;
color: white;
border-radius: 2px;
"
>
이어령이어령
</div>
<div
style="
background-color: #1d1d1d;
padding-left: 8px;
padding-right: 8px;
padding-top: 2px;
padding-bottom: 2px;
color: white;
border-radius: 2px;
"
>
이어령이어령
</div>
<div
style="
background-color: #1d1d1d;
padding-left: 8px;
padding-right: 8px;
padding-top: 2px;
padding-bottom: 2px;
color: white;
border-radius: 2px;
"
>
김규리
</div>
<div
style="
background-color: #1d1d1d;
padding-left: 8px;
padding-right: 8px;
padding-top: 2px;
padding-bottom: 2px;
color: white;
border-radius: 2px;
"
>
김규리
</div>
<div
style="
background-color: #1d1d1d;
padding-left: 8px;
padding-right: 8px;
padding-top: 2px;
padding-bottom: 2px;
color: white;
border-radius: 2px;
"
>
김규리
</div>
</div>
</div>
</div>
<script>
function toggleDropdown() {
var dropdown = document.getElementById("dropdownExtended");
var dropdownIcon = document.querySelector(
'img[src="/svg/dropdown.svg"]'
);
var namesShort = document.querySelector(".names-short");
if (dropdown.style.display === "none") {
dropdown.style.display = "block";
dropdownIcon.style.transform = "rotate(0deg)";
namesShort.style.opacity = 0; // 이름 목록 투명하게
} else {
dropdown.style.display = "none";
dropdownIcon.style.transform = "rotate(180deg)";
namesShort.style.opacity = 1; // 이름 목록 보이게
}
}
</script>
</body>
</html>