File size: 9,979 Bytes
3b517e3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5730461
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3b517e3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5730461
 
 
3b517e3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5730461
 
 
 
 
3b517e3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5730461
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3b517e3
5730461
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
<!DOCTYPE html>
<html lang="ja">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>JustTalk - Voice Analysis</title>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <script src="https://cdn.tailwindcss.com"></script>
    <link

      rel="stylesheet"

      href="https://use.fontawesome.com/releases/v5.10.0/css/all.css"

    />
    <style>

      /* Custom Chart.js Styles */

      #speechChart {

        background-color: rgba(255, 255, 255, 0.05);

        border-radius: 10px;

        padding: 10px;

        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);

      }



      /* Record Button Styles */

      .record-button {

        width: 90px;

        height: 90px;

        background-color: transparent;

        border-radius: 50%;

        border: 5px solid white;

        display: flex;

        justify-content: center;

        align-items: center;

        cursor: pointer;

        box-shadow: 0 6px 10px rgba(0, 0, 0, 0.5);

        transition: all 0.2s ease;

      }



      .record-icon {

        width: 70px;

        height: 70px;

        background-color: #e53e3e;

        border-radius: 50%;

        transition: all 0.2s ease;

      }



      .recording .record-icon {

        width: 50px;

        height: 50px;

        border-radius: 15%;

        background-color: #c53030;

      }



      .icon i {

        font-size: 24px;

      }



      /* Hamburger Menu Styles */

      #menu {

        position: absolute;

        top: 0;

        left: 0;

        z-index: 10;

        transform: translateX(-100%);

        visibility: hidden;

        opacity: 0;

        background-color: rgb(31, 41, 55);

        transition: transform 0.3s ease-in-out, visibility 0s 0.3s,

          opacity 0.3s ease-in-out;

        backdrop-filter: blur(10px);

        border-right: 1px solid rgba(255, 255, 255, 0.2);

      }



      #menu.open {

        transform: translateX(0);

        visibility: visible;

        opacity: 1;

        transition: transform 0.3s ease-in-out, visibility 0s 0s,

          opacity 0.3s ease-in-out;

      }



      #menu button {

        transition: background-color 0.2s ease;

        background-color: rgba(0, 0, 0, 0.1); /* 変更点: 透明度を 10% に変更 */

        margin: 2px;

        border-radius: 5px;

        display: flex;

        align-items: center;

        justify-content: flex-start;

        gap: 10px;

        padding: 0.75rem 1rem;

        width: 100%;

        text-align: left;

        border: none;

        color: #fff;

        font-size: 1rem;

        cursor: pointer;

      }



      #menu button:hover {

        background-color: rgba(55, 65, 81, 0.7);

      }



      /* Responsive Design */

      @media (max-width: 640px) {

        .w-72 {

          width: 95%;

        }

        .h-72 {

          height: 350px;

        }

      }

      /* Main Container */

      body {

        background: linear-gradient(135deg, #2c3e50, #1f2937);

        display: flex;

        align-items: center;

        justify-content: center;

        min-height: 100vh;

        font-family: "Arial", sans-serif;

      }



      /* Main Content Wrapper */

      .main-content {

        border: 5px solid rgba(255, 255, 255, 0.2);

        padding: 2rem;

        border-radius: 1rem;

        width: 90%;

        max-width: 500px;

        background-color: rgba(0, 0, 0, 0.3);

        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);

        text-align: center;

      }



      /* Title */

      .main-title {

        font-size: 2.5rem;

        font-weight: bold;

        margin-bottom: 1.5rem;

        color: #fff;

        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);

      }



      /* Hamburger Menu Button */

      #menuButton {

        background-color: rgba(255, 255, 255, 0.1);

        border: none;

        border-radius: 50%;

        padding: 0.5rem;

        cursor: pointer;

        transition: background-color 0.2s ease;

      }



      #menuButton:hover {

        background-color: rgba(255, 255, 255, 0.2);

      }



      /* Member Chips Style */

      .member-chips {

        display: flex;

        flex-wrap: wrap;

        justify-content: center;

        gap: 0.5rem;

        margin-bottom: 1.5rem;

      }



      .member-chip {

        background: rgba(255, 255, 255, 0.2);

        border-radius: 999px;

        padding: 0.4rem 0.8rem;

        font-size: 0.8rem;

        color: white;

        display: inline-flex;

        align-items: center;

        gap: 0.5rem;

      }



      .member-avatar {

        width: 1.5rem;

        height: 1.5rem;

        background: rgba(255, 255, 255, 0.3);

        border-radius: 50%;

        display: flex;

        align-items: center;

        justify-content: center;

        font-size: 0.75rem;

      }

    </style>
  </head>
  <body onclick="closeMenu(event)">
    <!-- Main Content Wrapper -->
    <div class="main-content relative">
      <!-- Title -->
      <div class="main-title">JustTalk</div>

      <!-- Hamburger Menu -->
      <div class="absolute top-4 left-4">
        <button

          id="menuButton"

          class="text-white text-2xl focus:outline-none"

          onclick="toggleMenu(event)"

        >
          <i class="fas fa-bars"></i>
        </button>

        <!-- Menu Content -->
        <div

          id="menu"

          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"

        >
          <div class="px-4 py-2 text-lg font-semibold">メニュー</div>
          <button onclick="showUserRegister()">
            <i class="fas fa-user-plus"></i> メンバーを追加
          </button>
          <button onclick="showUserSelect()">
            <i class="fas fa-users"></i> メンバーを選択
          </button>
          <button onclick="showRecorder()">
            <i class="fas fa-microphone"></i> 録音画面を表示
          </button>
          <button onclick="showResults()">
            <i class="fas fa-chart-bar"></i> フィードバックを表示
          </button>
          <button onclick="showTalkDetail()">
            <i class="fas fa-comments"></i> 会話詳細を表示
          </button>
          <button onclick="resetAction()">
            <i class="fas fa-redo"></i> リセット
          </button>
          <button onclick="toggleMenu(event)">
            <i class="fas fa-times"></i> 閉じる
          </button>
        </div>
      </div>

      <!-- Selected Member Chips -->
      <div class="member-chips" id="memberChips">
        <!-- Member chips will be dynamically added here -->
      </div>

      <!-- Chart Display -->
      <div class="chart w-72 h-72 mb-5 mx-auto">
        <canvas id="speechChart"></canvas>
      </div>

      <!-- Record Form -->
      <form

        id="recordForm"

        action="/submit"

        method="POST"

        class="flex items-center justify-center space-x-2 w-full sm:w-auto"

        onsubmit="event.preventDefault();"

      >
        <!-- Record Button -->
        <button

          type="button"

          class="record-button"

          id="recordButton"

          onclick="toggleRecording()"

        >
          <div class="record-icon" id="recordIcon"></div>
        </button>
      </form>
    </div>

    <script src="{{ url_for('static', filename='process.js') }}"></script>
    <script src="{{ url_for('static', filename='menu.js') }}"></script>
    <script>

      



      // 選択されたメンバーの表示を更新する関数

      function updateSelectedMembers() {

        // ローカルストレージから選択されたメンバーを取得

        let selectedUsers = [];

        try {

          const stored = localStorage.getItem('selectedUsers');

          if (stored) {

            selectedUsers = JSON.parse(stored);

          }

        } catch (e) {

          console.error('選択メンバーの読み込みエラー:', e);

        }



        // メンバーチップを表示

        const memberChipsContainer = document.getElementById('memberChips');

        memberChipsContainer.innerHTML = '';



        if (selectedUsers.length === 0) {

          // メンバーがいない場合の表示

          const noMembers = document.createElement('div');

          noMembers.className = 'text-white opacity-50 text-sm';

          noMembers.textContent = 'メンバーが選択されていません';

          memberChipsContainer.appendChild(noMembers);

          return;

        }



        // 現在選択されているメンバー数を表示

        const countChip = document.createElement('div');

        countChip.className = 'member-chip';

        countChip.style.backgroundColor = 'rgba(66, 153, 225, 0.5)'; // 青っぽい背景

        countChip.innerHTML = `<i class="fas fa-users"></i> ${selectedUsers.length}人のメンバーを選択中`;

        memberChipsContainer.appendChild(countChip);



        // 各メンバーをチップとして表示

        selectedUsers.forEach(member => {

          const chip = document.createElement('div');

          chip.className = 'member-chip';

          

          const avatar = document.createElement('div');

          avatar.className = 'member-avatar';

          avatar.textContent = member.substr(0, 1).toUpperCase();

          

          chip.appendChild(avatar);

          chip.appendChild(document.createTextNode(member));

          

          memberChipsContainer.appendChild(chip);

        });

      }



      // ページ読み込み時にメンバー表示を更新

      document.addEventListener('DOMContentLoaded', updateSelectedMembers);

    </script>
  </body>
</html>