mizzzuno commited on
Commit
7c30752
·
verified ·
1 Parent(s): 492e20b

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +219 -322
templates/index.html CHANGED
@@ -1,322 +1,219 @@
1
- <!DOCTYPE html>
2
- <html lang="ja">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>JustTalk - Voice Analysis</title>
7
- <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
8
- <script src="https://cdn.tailwindcss.com"></script>
9
- <link
10
- rel="stylesheet"
11
- href="https://use.fontawesome.com/releases/v5.10.0/css/all.css"
12
- />
13
- <style>
14
- /* Custom Chart.js Styles */
15
- #speechChart {
16
- background-color: rgba(255, 255, 255, 0.05);
17
- border-radius: 10px;
18
- padding: 10px;
19
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
20
- }
21
-
22
- /* Record Button Styles */
23
- .record-button {
24
- width: 90px;
25
- height: 90px;
26
- background-color: transparent;
27
- border-radius: 50%;
28
- border: 5px solid white;
29
- display: flex;
30
- justify-content: center;
31
- align-items: center;
32
- cursor: pointer;
33
- box-shadow: 0 6px 10px rgba(0, 0, 0, 0.5);
34
- transition: all 0.2s ease;
35
- }
36
-
37
- .record-icon {
38
- width: 70px;
39
- height: 70px;
40
- background-color: #e53e3e;
41
- border-radius: 50%;
42
- transition: all 0.2s ease;
43
- }
44
-
45
- .recording .record-icon {
46
- width: 50px;
47
- height: 50px;
48
- border-radius: 15%;
49
- background-color: #c53030;
50
- }
51
-
52
- .icon i {
53
- font-size: 24px;
54
- }
55
-
56
- /* Hamburger Menu Styles */
57
- #menu {
58
- position: absolute;
59
- top: 0;
60
- left: 0;
61
- z-index: 10;
62
- transform: translateX(-100%);
63
- visibility: hidden;
64
- opacity: 0;
65
- background-color: rgb(31, 41, 55);
66
- transition: transform 0.3s ease-in-out, visibility 0s 0.3s,
67
- opacity 0.3s ease-in-out;
68
- backdrop-filter: blur(10px);
69
- border-right: 1px solid rgba(255, 255, 255, 0.2);
70
- }
71
-
72
- #menu.open {
73
- transform: translateX(0);
74
- visibility: visible;
75
- opacity: 1;
76
- transition: transform 0.3s ease-in-out, visibility 0s 0s,
77
- opacity 0.3s ease-in-out;
78
- }
79
-
80
- #menu button {
81
- transition: background-color 0.2s ease;
82
- background-color: rgba(0, 0, 0, 0.1); /* 変更点: 透明度を 10% に変更 */
83
- margin: 2px;
84
- border-radius: 5px;
85
- display: flex;
86
- align-items: center;
87
- justify-content: flex-start;
88
- gap: 10px;
89
- padding: 0.75rem 1rem;
90
- width: 100%;
91
- text-align: left;
92
- border: none;
93
- color: #fff;
94
- font-size: 1rem;
95
- cursor: pointer;
96
- }
97
-
98
- #menu button:hover {
99
- background-color: rgba(55, 65, 81, 0.7);
100
- }
101
-
102
- /* Responsive Design */
103
- @media (max-width: 640px) {
104
- .w-72 {
105
- width: 95%;
106
- }
107
- .h-72 {
108
- height: 350px;
109
- }
110
- }
111
- /* Main Container */
112
- body {
113
- background: linear-gradient(135deg, #2c3e50, #1f2937);
114
- display: flex;
115
- align-items: center;
116
- justify-content: center;
117
- min-height: 100vh;
118
- font-family: "Arial", sans-serif;
119
- }
120
-
121
- /* Main Content Wrapper */
122
- .main-content {
123
- border: 5px solid rgba(255, 255, 255, 0.2);
124
- padding: 2rem;
125
- border-radius: 1rem;
126
- width: 90%;
127
- max-width: 500px;
128
- background-color: rgba(0, 0, 0, 0.3);
129
- box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
130
- text-align: center;
131
- }
132
-
133
- /* Title */
134
- .main-title {
135
- font-size: 2.5rem;
136
- font-weight: bold;
137
- margin-bottom: 1.5rem;
138
- color: #fff;
139
- text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
140
- }
141
-
142
- /* Hamburger Menu Button */
143
- #menuButton {
144
- background-color: rgba(255, 255, 255, 0.1);
145
- border: none;
146
- border-radius: 50%;
147
- padding: 0.5rem;
148
- cursor: pointer;
149
- transition: background-color 0.2s ease;
150
- }
151
-
152
- #menuButton:hover {
153
- background-color: rgba(255, 255, 255, 0.2);
154
- }
155
-
156
- /* Member Chips Style */
157
- .member-chips {
158
- display: flex;
159
- flex-wrap: wrap;
160
- justify-content: center;
161
- gap: 0.5rem;
162
- margin-bottom: 1.5rem;
163
- }
164
-
165
- .member-chip {
166
- background: rgba(255, 255, 255, 0.2);
167
- border-radius: 999px;
168
- padding: 0.4rem 0.8rem;
169
- font-size: 0.8rem;
170
- color: white;
171
- display: inline-flex;
172
- align-items: center;
173
- gap: 0.5rem;
174
- }
175
-
176
- .member-avatar {
177
- width: 1.5rem;
178
- height: 1.5rem;
179
- background: rgba(255, 255, 255, 0.3);
180
- border-radius: 50%;
181
- display: flex;
182
- align-items: center;
183
- justify-content: center;
184
- font-size: 0.75rem;
185
- }
186
- </style>
187
- </head>
188
- <body onclick="closeMenu(event)">
189
- <!-- Main Content Wrapper -->
190
- <div class="main-content relative">
191
- <!-- Title -->
192
- <div class="main-title">JustTalk</div>
193
-
194
- <!-- Hamburger Menu -->
195
- <div class="absolute top-4 left-4">
196
- <button
197
- id="menuButton"
198
- class="text-white text-2xl focus:outline-none"
199
- onclick="toggleMenu(event)"
200
- >
201
- <i class="fas fa-bars"></i>
202
- </button>
203
-
204
- <!-- Menu Content -->
205
- <div
206
- id="menu"
207
- class="absolute top-0 left-0 h-full w-64 bg-gray-800 text-white transform -translate-x-full transition-transform duration-300 ease-in-out opacity-0 visibility-hidden"
208
- >
209
- <div class="px-4 py-2 text-lg font-semibold">メニュー</div>
210
- <button onclick="showUserRegister()">
211
- <i class="fas fa-user-plus"></i> メンバーを追加
212
- </button>
213
- <button onclick="showUserSelect()">
214
- <i class="fas fa-users"></i> メンバーを選択
215
- </button>
216
- <button onclick="showRecorder()">
217
- <i class="fas fa-microphone"></i> 録音画面を表示
218
- </button>
219
- <button onclick="showResults()">
220
- <i class="fas fa-chart-bar"></i> フィードバックを表示
221
- </button>
222
- <button onclick="showTalkDetail()">
223
- <i class="fas fa-comments"></i> 会話詳細を表示
224
- </button>
225
- <button onclick="resetAction()">
226
- <i class="fas fa-redo"></i> リセット
227
- </button>
228
- <button onclick="toggleMenu(event)">
229
- <i class="fas fa-times"></i> 閉じる
230
- </button>
231
- </div>
232
- </div>
233
-
234
- <!-- Selected Member Chips -->
235
- <div class="member-chips" id="memberChips">
236
- <!-- Member chips will be dynamically added here -->
237
- </div>
238
-
239
- <!-- Chart Display -->
240
- <div class="chart w-72 h-72 mb-5 mx-auto">
241
- <canvas id="speechChart"></canvas>
242
- </div>
243
-
244
- <!-- Record Form -->
245
- <form
246
- id="recordForm"
247
- action="/submit"
248
- method="POST"
249
- class="flex items-center justify-center space-x-2 w-full sm:w-auto"
250
- onsubmit="event.preventDefault();"
251
- >
252
- <!-- Record Button -->
253
- <button
254
- type="button"
255
- class="record-button"
256
- id="recordButton"
257
- onclick="toggleRecording()"
258
- >
259
- <div class="record-icon" id="recordIcon"></div>
260
- </button>
261
- </form>
262
- </div>
263
-
264
- <script src="{{ url_for('static', filename='process.js') }}"></script>
265
- <script src="{{ url_for('static', filename='menu.js') }}"></script>
266
- <script>
267
-
268
-
269
- // 選択されたメンバーの表示を更新する関数
270
- function updateSelectedMembers() {
271
- // ローカルストレージから選択されたメンバーを取得
272
- let selectedUsers = [];
273
- try {
274
- const stored = localStorage.getItem('selectedUsers');
275
- if (stored) {
276
- selectedUsers = JSON.parse(stored);
277
- }
278
- } catch (e) {
279
- console.error('選択メンバーの読み込みエラー:', e);
280
- }
281
-
282
- // メンバーチップを表示
283
- const memberChipsContainer = document.getElementById('memberChips');
284
- memberChipsContainer.innerHTML = '';
285
-
286
- if (selectedUsers.length === 0) {
287
- // メンバーがいない場合の表示
288
- const noMembers = document.createElement('div');
289
- noMembers.className = 'text-white opacity-50 text-sm';
290
- noMembers.textContent = 'メンバーが選択されていません';
291
- memberChipsContainer.appendChild(noMembers);
292
- return;
293
- }
294
-
295
- // 現在選択されているメンバー数を表示
296
- const countChip = document.createElement('div');
297
- countChip.className = 'member-chip';
298
- countChip.style.backgroundColor = 'rgba(66, 153, 225, 0.5)'; // 青っぽい背景
299
- countChip.innerHTML = `<i class="fas fa-users"></i> ${selectedUsers.length}人のメンバーを選択中`;
300
- memberChipsContainer.appendChild(countChip);
301
-
302
- // 各メンバーをチップとして表示
303
- selectedUsers.forEach(member => {
304
- const chip = document.createElement('div');
305
- chip.className = 'member-chip';
306
-
307
- const avatar = document.createElement('div');
308
- avatar.className = 'member-avatar';
309
- avatar.textContent = member.substr(0, 1).toUpperCase();
310
-
311
- chip.appendChild(avatar);
312
- chip.appendChild(document.createTextNode(member));
313
-
314
- memberChipsContainer.appendChild(chip);
315
- });
316
- }
317
-
318
- // ページ読み込み時にメンバー表示を更新
319
- document.addEventListener('DOMContentLoaded', updateSelectedMembers);
320
- </script>
321
- </body>
322
- </html>
 
1
+ <!DOCTYPE html>
2
+ <html lang="ja">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>JustTalk - Voice Analysis</title>
7
+ <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ <link rel="stylesheet" type="text/css" href="menu.css" />
10
+ <link rel="stylesheet" type="text/css" href="main.css" />
11
+ <script src="https://use.fontawesome.com/releases/v5.10.0/js/all.js"></script>
12
+ <style>
13
+ /* Custom Chart.js Styles */
14
+ #speechChart {
15
+ background-color: rgba(255, 255, 255, 0.05);
16
+ border-radius: 10px;
17
+ padding: 10px;
18
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
19
+ }
20
+
21
+ /* Record Button Styles */
22
+ .record-button {
23
+ width: 90px;
24
+ height: 90px;
25
+ background-color: transparent;
26
+ border-radius: 50%;
27
+ border: 5px solid white;
28
+ display: flex;
29
+ justify-content: center;
30
+ align-items: center;
31
+ cursor: pointer;
32
+ box-shadow: 0 6px 10px rgba(0, 0, 0, 0.5);
33
+ transition: all 0.2s ease;
34
+ }
35
+
36
+ .record-icon {
37
+ width: 70px;
38
+ height: 70px;
39
+ background-color: #e53e3e;
40
+ border-radius: 50%;
41
+ transition: all 0.2s ease;
42
+ }
43
+
44
+ .recording .record-icon {
45
+ width: 50px;
46
+ height: 50px;
47
+ border-radius: 15%;
48
+ background-color: #c53030;
49
+ }
50
+
51
+ .icon i {
52
+ font-size: 24px;
53
+ }
54
+
55
+ /* Member Chips Style */
56
+ .member-chips {
57
+ display: flex;
58
+ flex-wrap: wrap;
59
+ justify-content: center;
60
+ gap: 0.5rem;
61
+ margin-bottom: 1.5rem;
62
+ }
63
+
64
+ .member-chip {
65
+ background: rgba(255, 255, 255, 0.2);
66
+ border-radius: 999px;
67
+ padding: 0.4rem 0.8rem;
68
+ font-size: 0.8rem;
69
+ color: white;
70
+ display: inline-flex;
71
+ align-items: center;
72
+ gap: 0.5rem;
73
+ }
74
+
75
+ .member-avatar {
76
+ width: 1.5rem;
77
+ height: 1.5rem;
78
+ background: rgba(255, 255, 255, 0.3);
79
+ border-radius: 50%;
80
+ display: flex;
81
+ align-items: center;
82
+ justify-content: center;
83
+ font-size: 0.75rem;
84
+ }
85
+ </style>
86
+ </head>
87
+ <body onclick="closeMenu(event)">
88
+ <!-- Main Content Wrapper -->
89
+ <div class="main-content relative">
90
+ <!-- Title -->
91
+ <div class="main-title">JustTalk</div>
92
+
93
+ <!-- Hamburger Menu -->
94
+ <div class="absolute top-4 left-4">
95
+ <button
96
+ id="menuButton"
97
+ class="text-white text-2xl focus:outline-none"
98
+ onclick="toggleMenu(event)"
99
+ >
100
+ <i class="fas fa-bars"></i>
101
+ </button>
102
+
103
+ <!-- Menu Content -->
104
+ <div
105
+ id="menu"
106
+ class="absolute top-0 left-0 h-full w-64 bg-gray-800 text-white transform -translate-x-full transition-transform duration-300 ease-in-out opacity-0 visibility-hidden"
107
+ >
108
+ <div class="px-4 py-2 text-lg font-semibold">メニュー</div>
109
+ <button onclick="showUserRegister()">
110
+ <i class="fas fa-user-plus"></i> メンバーを追加
111
+ </button>
112
+ <button onclick="showUserSelect()">
113
+ <i class="fas fa-users"></i> メンバーを選択
114
+ </button>
115
+ <button onclick="showRecorder()">
116
+ <i class="fas fa-microphone"></i> 録音画面を表示
117
+ </button>
118
+ <button onclick="showResults()">
119
+ <i class="fas fa-chart-bar"></i> フィードバックを表示
120
+ </button>
121
+ <button onclick="showTalkDetail()">
122
+ <i class="fas fa-comments"></i> 会話詳細を表示
123
+ </button>
124
+ <button onclick="resetAction()">
125
+ <i class="fas fa-redo"></i> リセット
126
+ </button>
127
+ <button onclick="toggleMenu(event)">
128
+ <i class="fas fa-times"></i> 閉じる
129
+ </button>
130
+ </div>
131
+ </div>
132
+
133
+ <!-- Selected Member Chips -->
134
+ <div class="member-chips" id="memberChips">
135
+ <!-- Member chips will be dynamically added here -->
136
+ </div>
137
+
138
+ <!-- Chart Display -->
139
+ <div class="chart w-72 h-72 mb-5 mx-auto">
140
+ <canvas id="speechChart"></canvas>
141
+ </div>
142
+
143
+ <!-- Record Form -->
144
+ <form
145
+ id="recordForm"
146
+ action="/submit"
147
+ method="POST"
148
+ class="flex items-center justify-center space-x-2 w-full sm:w-auto"
149
+ onsubmit="event.preventDefault();"
150
+ >
151
+ <!-- Record Button -->
152
+ <button
153
+ type="button"
154
+ class="record-button"
155
+ id="recordButton"
156
+ onclick="toggleRecording()"
157
+ >
158
+ <div class="record-icon" id="recordIcon"></div>
159
+ </button>
160
+ </form>
161
+ </div>
162
+
163
+ <script src="{{ url_for('static', filename='process.js') }}"></script>
164
+ <script src="{{ url_for('static', filename='menu.js') }}"></script>
165
+ <script>
166
+ // 選択されたメンバーの表示を更新する関数
167
+ function updateSelectedMembers() {
168
+ // ローカルストレージから選択されたメンバーを取得
169
+ let selectedUsers = [];
170
+ try {
171
+ const stored = localStorage.getItem("selectedUsers");
172
+ if (stored) {
173
+ selectedUsers = JSON.parse(stored);
174
+ }
175
+ } catch (e) {
176
+ console.error("選択メンバーの読み込みエラー:", e);
177
+ }
178
+
179
+ // メンバーチップを表示
180
+ const memberChipsContainer = document.getElementById("memberChips");
181
+ memberChipsContainer.innerHTML = "";
182
+
183
+ if (selectedUsers.length === 0) {
184
+ // メンバーがいない場合の表示
185
+ const noMembers = document.createElement("div");
186
+ noMembers.className = "text-white opacity-50 text-sm";
187
+ noMembers.textContent = "メンバーが選択されていません";
188
+ memberChipsContainer.appendChild(noMembers);
189
+ return;
190
+ }
191
+
192
+ // 現在選択されているメンバー数を表示
193
+ const countChip = document.createElement("div");
194
+ countChip.className = "member-chip";
195
+ countChip.style.backgroundColor = "rgba(66, 153, 225, 0.5)"; // 青っぽい背景
196
+ countChip.innerHTML = `<i class="fas fa-users"></i> ${selectedUsers.length}人のメンバーを選択中`;
197
+ memberChipsContainer.appendChild(countChip);
198
+
199
+ // 各メンバーをチップとして表示
200
+ selectedUsers.forEach((member) => {
201
+ const chip = document.createElement("div");
202
+ chip.className = "member-chip";
203
+
204
+ const avatar = document.createElement("div");
205
+ avatar.className = "member-avatar";
206
+ avatar.textContent = member.substr(0, 1).toUpperCase();
207
+
208
+ chip.appendChild(avatar);
209
+ chip.appendChild(document.createTextNode(member));
210
+
211
+ memberChipsContainer.appendChild(chip);
212
+ });
213
+ }
214
+
215
+ // ページ読み込み時にメンバー表示を更新
216
+ document.addEventListener("DOMContentLoaded", updateSelectedMembers);
217
+ </script>
218
+ </body>
219
+ </html>