-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsidebar.html
More file actions
230 lines (205 loc) · 5.29 KB
/
sidebar.html
File metadata and controls
230 lines (205 loc) · 5.29 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
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>チャットサイドパネル</title>
<style>
body {
width: auto;
height: 100%;
background: #f5f5f5;
display: flex;
flex-direction: column;
font-family: Arial, sans-serif;
font-size: 16px;
-ms-overflow-style: none; /* IE, Edge用 */
}
/* webkit-scrollbarでスクロールバーを非表示にする */
body::-webkit-scrollbar {
display: none;
}
/* チャットエリア */
#chat-box {
flex: 1;
padding: 10px;
width: 100%;
display: flex;
flex-direction: column;
overflow-y: auto;
box-sizing: border-box;
max-height: calc(100vh - 56px);
-ms-overflow-style: none;
}
#chat-box::-webkit-scrollbar {
display: none;
}
.message {
background: #e0e0e0;
margin-top: 10px;
border-radius: 5px;
text-align: left;
width: fit-content;
word-wrap: break-word;
max-width: 100%;
white-space: pre-wrap;
}
.my-message {
background: #4caf50;
color: white;
text-align: right;
margin-left: auto;
padding: 8px;
}
/* 入力エリア */
#input-container {
position: fixed;
bottom: 0;
left: 0;
width: 100vw;
padding: 10px;
display: flex;
gap: 5px;
box-sizing: border-box;
}
#message-input {
flex: 1;
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
#send-btn {
padding: 8px 12px;
background: #007bff;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
#send-btn:hover {
background: #0056b3;
}
.text-message {
background: #4caf50;
color: white;
padding: 8px;
border-radius: 5px;
text-align: left;
margin-left: auto;
}
.image-message {
background: none;
padding: 0;
margin-left: auto;
}
.chat-image {
max-width: 100%;
max-height: auto;
}
/* メッセージ全体を包むラッパー */
.message-wrapper {
position: relative;
display: inline-block;
margin-top: 20px;
max-width: 90%;
word-wrap: break-word;
overflow-wrap: break-word;
word-break: break-word;
white-space: pre-wrap;
}
/* 削除・拡大ボタンのコンテナ */
.button-container {
position: absolute;
top: -4px;
right: -6px;
display: flex;
gap: 12px; /* ボタン間のスペースを確保 */
opacity: 0;
transition: opacity 0.2s ease-in-out;
}
/* メッセージをホバーしたときにボタンを表示 */
.message-wrapper:hover .button-container {
opacity: 1;
}
/* 削除ボタン(×)と拡大ボタン(🔍) */
.button-container {
position: absolute;
top: -4px;
right: -6px;
display: flex;
gap: 12px; /* ボタン間のスペースを確保 */
opacity: 0;
transition: opacity 0.2s ease-in-out;
}
/* メッセージをホバーしたときにボタンを表示 */
.message-wrapper:hover .button-container {
opacity: 1;
}
/* 削除・拡大ボタンのコンテナ */
.button-container {
position: absolute;
top: 0px;
right: -6px;
display: flex;
gap: 12px; /* ボタン間のスペースを確保 */
opacity: 0;
transition: opacity 0.2s ease-in-out;
}
/* メッセージをホバーしたときにボタンを表示 */
.message-wrapper:hover .button-container {
opacity: 1;
}
/* 削除ボタン(×)と拡大ボタン(🔍) */ /* 削除ボタン(×)と拡大ボタン(🔍) */
.delete-btn,
.expand-btn {
width: 22px;
height: 22px;
background-color: #d3d3d3; /* 初期の背景色 */
border: none;
border-radius: 50%;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
background-size: 60%;
background-repeat: no-repeat;
background-position: center;
transition: background-color 0.2s ease-in-out, filter 0.2s ease-in-out;
}
/* 削除ボタン(×)のスタイル */
.delete-btn {
background-image: url("assets/images/delete-icon.png"); /* 削除アイコン画像 */
background-blend-mode: multiply; /* アイコンを保持しつつ背景色を変更 */
}
/* 拡大ボタン(🔍)のスタイル */
.expand-btn {
background-image: url("assets/images/expand-icon.png"); /* 拡大アイコン画像 */
background-blend-mode: multiply; /* アイコンを保持しつつ背景色を変更 */
}
/* 🟡 ホバー時に背景色を少し濃くし、アイコンを維持 */
.delete-btn:hover,
.expand-btn:hover {
background-color: #b0b0b0; /* ホバー時に少し濃く */
filter: brightness(95%); /* 全体の明るさを少し下げる(アイコンも自然に馴染む) */
}
/* 日時を右下に配置 */
.timestamp {
position: absolute;
bottom: -15px;
right: 0;
font-size: 12px;
color: rgba(0, 0, 0, 0.6);
white-space: nowrap;
}
</style>
</head>
<body>
<div id="chat-box"></div>
<div id="input-container">
<input type="text" id="message-input" placeholder="メモを入力..." />
<button id="send-btn">保存</button>
</div>
<script src="sidebar.js"></script>
</body>
</html>