-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathposition-visibility.html
More file actions
160 lines (147 loc) · 3.91 KB
/
Copy pathposition-visibility.html
File metadata and controls
160 lines (147 loc) · 3.91 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
154
155
156
157
158
159
160
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>position-visibilityでツールチップを非表示にする</title>
<style>
*, *::before, *::after {
box-sizing: border-box;
}
html {
height: 300px;
}
body {
margin: 0;
height: 300px;
overflow: hidden;
font-family: sans-serif;
background-color: #f0f4f8;
display: flex;
align-items: flex-start;
padding: 16px;
}
/* スクロールリスト */
.list-panel {
width: 200px;
background: #fff;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.list-header {
padding: 8px 14px;
font-size: 11px;
font-weight: bold;
color: #888;
letter-spacing: 0.5px;
border-bottom: 1px solid #f0f0f0;
background: #fafafa;
}
.list {
/* 300px(html) - 32px(body padding) - 32px(list-header) = 236px */
height: 236px;
overflow-y: auto;
}
.item {
display: flex;
align-items: center;
padding: 10px 14px;
gap: 10px;
border-bottom: 1px solid #f5f5f5;
}
.item--active {
anchor-name: --tooltip-anchor;
background-color: #eff6ff;
}
.avatar {
width: 34px;
height: 34px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-size: 14px;
font-weight: bold;
flex-shrink: 0;
}
.item:nth-child(1) .avatar { background: #1a73e8; }
.item:nth-child(2) .avatar { background: #34a853; }
.item:nth-child(3) .avatar { background: #ea4335; }
.item:nth-child(4) .avatar { background: #f59e0b; }
.item:nth-child(5) .avatar { background: #8b5cf6; }
.item:nth-child(6) .avatar { background: #0d9488; }
.item:nth-child(7) .avatar { background: #e11d48; }
.item:nth-child(8) .avatar { background: #f97316; }
.name {
font-size: 13px;
color: #333;
}
.tooltip {
position: fixed;
position-anchor: --tooltip-anchor;
position-area: center right;
margin: 0 0 0 8px;
padding: 5px 10px;
background: #1e293b;
color: #fff;
border-radius: 6px;
font-size: 11px;
white-space: nowrap;
position-visibility: anchors-visible;
}
.tooltip::before {
content: '';
position: absolute;
left: -5px;
top: 50%;
translate: 0 -50%;
border: 5px solid transparent;
border-left: none;
border-right-color: #1e293b;
}
</style>
</head>
<body>
<div class="list-panel">
<div class="list-header">ユーザー一覧(スクロールできます)</div>
<div class="list">
<div class="item">
<span class="avatar">田</span>
<span class="name">田中 一郎</span>
</div>
<div class="item">
<span class="avatar">鈴</span>
<span class="name">鈴木 花子</span>
</div>
<div class="item item--active">
<span class="avatar">佐</span>
<span class="name">佐藤 次郎</span>
</div>
<div class="item">
<span class="avatar">山</span>
<span class="name">山田 三恵</span>
</div>
<div class="item">
<span class="avatar">高</span>
<span class="name">高橋 四郎</span>
</div>
<div class="item">
<span class="avatar">渡</span>
<span class="name">渡辺 五月</span>
</div>
<div class="item">
<span class="avatar">伊</span>
<span class="name">伊藤 六美</span>
</div>
<div class="item">
<span class="avatar">中</span>
<span class="name">中村 七海</span>
</div>
</div>
</div>
<div class="tooltip">バックエンドエンジニア</div>
</body>
</html>