A-yum1 commited on
Commit
1db25b3
·
2 Parent(s): 34cbda6 0245f6e

Merge branch 'main' of https://huggingface.co/spaces/Justtalk/Justalk

Browse files
__pycache__/transcription.cpython-310.pyc CHANGED
Binary files a/__pycache__/transcription.cpython-310.pyc and b/__pycache__/transcription.cpython-310.pyc differ
 
app.py CHANGED
@@ -196,8 +196,9 @@ def upload_audio():
196
  @app.route('/reset', methods=['GET'])
197
  def reset():
198
  global users
199
- users=[]
200
- return 200
 
201
 
202
  @app.route('/upload_base_audio', methods=['POST'])
203
  def upload_base_audio():
 
196
  @app.route('/reset', methods=['GET'])
197
  def reset():
198
  global users
199
+ users = []
200
+ return jsonify({"status": "success", "message": "Users reset"}), 200
201
+
202
 
203
  @app.route('/upload_base_audio', methods=['POST'])
204
  def upload_base_audio():
static/feedback.js CHANGED
@@ -16,6 +16,7 @@ async function getAnalysis() {
16
  loader.style.display = "block";
17
  try {
18
  const response = await fetch("/analyze");
 
19
  if (!response.ok) {
20
  throw new Error(`HTTP error! status: ${response.status}`);
21
  }
@@ -32,6 +33,16 @@ async function getAnalysis() {
32
  const pleasantConversation = analysis.pleasantConversation;
33
  const blameOrHarassment = analysis.blameOrHarassment;
34
 
 
 
 
 
 
 
 
 
 
 
35
  loader.style.display = "none";
36
  // DOMに表示
37
  document.getElementById(
 
16
  loader.style.display = "block";
17
  try {
18
  const response = await fetch("/analyze");
19
+
20
  if (!response.ok) {
21
  throw new Error(`HTTP error! status: ${response.status}`);
22
  }
 
33
  const pleasantConversation = analysis.pleasantConversation;
34
  const blameOrHarassment = analysis.blameOrHarassment;
35
 
36
+ if (harassmentPresent) {
37
+ harassmentPresent = "あり";
38
+ } else {
39
+ harassmentPresent = "なし";
40
+ }
41
+
42
+ if (harassmentType == null) {
43
+ harassmentType = "該当なし";
44
+ }
45
+
46
  loader.style.display = "none";
47
  // DOMに表示
48
  document.getElementById(
static/register_record.js CHANGED
@@ -1,150 +1,150 @@
1
- let mediaRecorder;
2
- let audioChunks = [];
3
- let userCount = 0; // 追加されたメンバー数を保持
4
- let isRecording = false; // 録音中かどうかを判定するフラグ
5
- let currentRecordingButton = null; // 現在録音中のボタンを保持
6
- let userNames = [];
7
-
8
- function toggleRecording(button) {
9
- button.classList.toggle("recording");
10
- }
11
-
12
- async function startRecording(button) {
13
- if (isRecording && currentRecordingButton !== button) return; // 他の人が録音中なら何もしない
14
- isRecording = true; // 録音中に設定
15
- currentRecordingButton = button; // 録音中のボタンを記録
16
-
17
- try {
18
- const stream = await navigator.mediaDevices.getUserMedia({
19
- audio: true,
20
- });
21
- mediaRecorder = new MediaRecorder(stream, { mimeType: "audio/webm" });
22
- audioChunks = [];
23
- mediaRecorder.ondataavailable = (e) => audioChunks.push(e.data);
24
- mediaRecorder.onstop = () => {
25
- sendAudioChunks(audioChunks, button); // ボタン情報を渡す
26
- audioChunks = [];
27
- isRecording = false; // 録音停止後はフラグを戻す
28
- currentRecordingButton = null; // 録音ボタンを解除
29
- };
30
- mediaRecorder.start();
31
- toggleRecording(button);
32
- } catch (err) {
33
- console.error("マイクアクセスに失敗しました:", err);
34
- isRecording = false; // エラー発生時もフラグを戻す
35
- currentRecordingButton = null;
36
- }
37
- }
38
-
39
- function stopRecording(button) {
40
- if (!isRecording) return; // 録音中でない場合は停止しない
41
- mediaRecorder.stop();
42
- toggleRecording(button);
43
- }
44
-
45
- function handleRecording(e) {
46
- const button = e.target.closest(".record-button");
47
- if (button) {
48
- if (isRecording && currentRecordingButton !== button) {
49
- // 他の人が録音中なら反応しない
50
- return;
51
- }
52
- if (mediaRecorder && mediaRecorder.state === "recording") {
53
- stopRecording(button);
54
- } else {
55
- startRecording(button);
56
- }
57
- }
58
- }
59
-
60
- function sendAudioChunks(chunks, button) {
61
- // 引数に button を追加
62
- const audioBlob = new Blob(chunks, { type: "audio/wav" });
63
- const reader = new FileReader();
64
- reader.onloadend = () => {
65
- const base64String = reader.result.split(",")[1]; // Base64エンコードされた音声データ
66
- // フォームの取得方法を変更
67
- const form = button.closest(".user-item")?.querySelector("form")
68
- const nameInput = form?.querySelector('input[name="name"]');
69
- const name = nameInput ? nameInput.value : "unknown"; // 名前がない
70
- fetch("/upload_base_audio", {
71
- method: "POST",
72
- headers: {
73
- "Content-Type": "application/json",
74
- },
75
- body: JSON.stringify({ audio_data: base64String, name: name }),
76
- })
77
- .then((response) => response.json())
78
- .then((data) => {
79
- // エラー処理のみ残す
80
- if (data.error) {
81
- alert("エラー: " + data.error);
82
- console.error(data.details);
83
- }
84
- // 成功時の処理(ボタンの有効化など)
85
- else {
86
- console.log("音声データ送信成功:", data);
87
- userNames.push(name);
88
- // 必要に応じて、ここでUIの変更(ボタンの有効化など)を行う
89
- // 例: button.disabled = true; // 送信ボタンを無効化
90
- // 例: button.classList.remove("recording"); //録音中のスタイルを解除
91
- }
92
- })
93
- .catch((error) => {
94
- console.error("エラー:", error);
95
- });
96
- };
97
- reader.readAsDataURL(audioBlob);
98
- }
99
-
100
- // 前の画面に戻る
101
- function goBack() {
102
- window.location.href = "index";
103
- }
104
-
105
- // Add user function
106
- function addUser() {
107
- const userName = prompt("ユーザー名を入力してください");
108
- if (userName) {
109
- const userList = document.getElementById("people-list");
110
- const userDiv = document.createElement("div");
111
- userDiv.classList.add(
112
- "user-item", // 追加
113
- "bg-gray-700",
114
- "p-4",
115
- "rounded-lg",
116
- "text-white",
117
- "flex",
118
- "justify-between",
119
- "items-center",
120
- "flex-wrap", // 追加
121
- "gap-3" // 追加
122
- );
123
- userDiv.innerHTML = `
124
- <form
125
- action="/submit"
126
- method="POST"
127
- class="flex items-center space-x-2 w-full sm:w-auto"
128
- onsubmit="event.preventDefault();"
129
- >
130
- <input
131
- type="text"
132
- name="name"
133
- placeholder="名前を入力"
134
- value="${userName}"
135
- class="flex-1 px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 bg-gray-700 text-white"
136
- />
137
- <button type="button" class="record-button" aria-label="音声録音開始">
138
- <div class="record-icon"></div>
139
- </button>
140
- </form>
141
- `;
142
- userDiv
143
- .querySelector(".record-button")
144
- .addEventListener("click", handleRecording);
145
- userList.appendChild(userDiv);
146
- userCount++;
147
- }
148
- }
149
-
150
- document.getElementById("add-btn").addEventListener("click", addUser);
 
1
+ let mediaRecorder;
2
+ let audioChunks = [];
3
+ let userCount = 0; // 追加されたメンバー数を保持
4
+ let isRecording = false; // 録音中かどうかを判定するフラグ
5
+ let currentRecordingButton = null; // 現在録音中のボタンを保持
6
+ let userNames = [];
7
+
8
+ function toggleRecording(button) {
9
+ button.classList.toggle("recording");
10
+ }
11
+
12
+ async function startRecording(button) {
13
+ if (isRecording && currentRecordingButton !== button) return; // 他の人が録音中なら何もしない
14
+ isRecording = true; // 録音中に設定
15
+ currentRecordingButton = button; // 録音中のボタンを記録
16
+
17
+ try {
18
+ const stream = await navigator.mediaDevices.getUserMedia({
19
+ audio: true,
20
+ });
21
+ mediaRecorder = new MediaRecorder(stream, { mimeType: "audio/webm" });
22
+ audioChunks = [];
23
+ mediaRecorder.ondataavailable = (e) => audioChunks.push(e.data);
24
+ mediaRecorder.onstop = () => {
25
+ sendAudioChunks(audioChunks, button); // ボタン情報を渡す
26
+ audioChunks = [];
27
+ isRecording = false; // 録音停止後はフラグを戻す
28
+ currentRecordingButton = null; // 録音ボタンを解除
29
+ };
30
+ mediaRecorder.start();
31
+ toggleRecording(button);
32
+ } catch (err) {
33
+ console.error("マイクアクセスに失敗しました:", err);
34
+ isRecording = false; // エラー発生時もフラグを戻す
35
+ currentRecordingButton = null;
36
+ }
37
+ }
38
+
39
+ function stopRecording(button) {
40
+ if (!isRecording) return; // 録音中でない場合は停止しない
41
+ mediaRecorder.stop();
42
+ toggleRecording(button);
43
+ }
44
+
45
+ function handleRecording(e) {
46
+ const button = e.target.closest(".record-button");
47
+ if (button) {
48
+ if (isRecording && currentRecordingButton !== button) {
49
+ // 他の人が録音中なら反応しない
50
+ return;
51
+ }
52
+ if (mediaRecorder && mediaRecorder.state === "recording") {
53
+ stopRecording(button);
54
+ } else {
55
+ startRecording(button);
56
+ }
57
+ }
58
+ }
59
+
60
+ function sendAudioChunks(chunks, button) {
61
+ // 引数に button を追加
62
+ const audioBlob = new Blob(chunks, { type: "audio/wav" });
63
+ const reader = new FileReader();
64
+ reader.onloadend = () => {
65
+ const base64String = reader.result.split(",")[1]; // Base64エンコードされた音声データ
66
+ // フォームの取得方法を変更
67
+ const form = button.closest(".user-item")?.querySelector("form")
68
+ const nameInput = form?.querySelector('input[name="name"]');
69
+ const name = nameInput ? nameInput.value : "unknown"; // 名前がない
70
+ fetch("/upload_base_audio", {
71
+ method: "POST",
72
+ headers: {
73
+ "Content-Type": "application/json",
74
+ },
75
+ body: JSON.stringify({ audio_data: base64String, name: name }),
76
+ })
77
+ .then((response) => response.json())
78
+ .then((data) => {
79
+ // エラー処理のみ残す
80
+ if (data.error) {
81
+ alert("エラー: " + data.error);
82
+ console.error(data.details);
83
+ }
84
+ // 成功時の処理(ボタンの有効化など)
85
+ else {
86
+ console.log("音声データ送信成功:", data);
87
+ userNames.push(name);
88
+ // 必要に応じて、ここでUIの変更(ボタンの有効化など)を行う
89
+ // 例: button.disabled = true; // 送信ボタンを無効化
90
+ // 例: button.classList.remove("recording"); //録音中のスタイルを解除
91
+ }
92
+ })
93
+ .catch((error) => {
94
+ console.error("エラー:", error);
95
+ });
96
+ };
97
+ reader.readAsDataURL(audioBlob);
98
+ }
99
+
100
+ // 録音画面に移動
101
+ function showRecorder() {
102
+ window.location.href = "index";
103
+ }
104
+
105
+ // Add user function
106
+ function addUser() {
107
+ const userName = prompt("ユーザー名を入力してください");
108
+ if (userName) {
109
+ const userList = document.getElementById("people-list");
110
+ const userDiv = document.createElement("div");
111
+ userDiv.classList.add(
112
+ "user-item", // 追加
113
+ "bg-gray-700",
114
+ "p-4",
115
+ "rounded-lg",
116
+ "text-white",
117
+ "flex",
118
+ "justify-between",
119
+ "items-center",
120
+ "flex-wrap", // 追加
121
+ "gap-3" // 追加
122
+ );
123
+ userDiv.innerHTML = `
124
+ <form
125
+ action="/submit"
126
+ method="POST"
127
+ class="flex items-center space-x-2 w-full sm:w-auto"
128
+ onsubmit="event.preventDefault();"
129
+ >
130
+ <input
131
+ type="text"
132
+ name="name"
133
+ placeholder="名前を入力"
134
+ value="${userName}"
135
+ class="flex-1 px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 bg-gray-700 text-white"
136
+ />
137
+ <button type="button" class="record-button" aria-label="音声録音開始">
138
+ <div class="record-icon"></div>
139
+ </button>
140
+ </form>
141
+ `;
142
+ userDiv
143
+ .querySelector(".record-button")
144
+ .addEventListener("click", handleRecording);
145
+ userList.appendChild(userDiv);
146
+ userCount++;
147
+ }
148
+ }
149
+
150
+ document.getElementById("add-btn").addEventListener("click", addUser);
templates/feedback.html CHANGED
@@ -1,170 +1,174 @@
1
- <!DOCTYPE html>
2
- <html lang="ja" class="dark">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>会話フィードバック画面</title>
7
- <script src="https://cdn.tailwindcss.com"></script>
8
- <script>
9
- tailwind.config = {
10
- darkMode: "class",
11
- };
12
- </script>
13
- <script src="https://use.fontawesome.com/releases/v5.10.0/js/all.js"></script>
14
- <style>
15
- /* Main Container */
16
- body {
17
- background: linear-gradient(135deg, #2c3e50, #1f2937);
18
- display: flex;
19
- align-items: center;
20
- justify-content: center;
21
- min-height: 100vh;
22
- font-family: "Arial", sans-serif;
23
- color: #fff;
24
- }
25
-
26
- /* Main Content Wrapper */
27
- .main-content {
28
- border: 5px solid rgba(255, 255, 255, 0.2);
29
- padding: 2rem;
30
- border-radius: 1rem;
31
- width: 90%;
32
- max-width: 500px;
33
- background-color: rgba(0, 0, 0, 0.3);
34
- box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
35
- text-align: center;
36
- }
37
-
38
- /* Title */
39
- .main-title {
40
- font-size: 2.5rem;
41
- font-weight: bold;
42
- margin-bottom: 1.5rem;
43
- color: #fff;
44
- text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
45
- }
46
-
47
- /* Hamburger Menu Button */
48
- #menuButton {
49
- background-color: rgba(255, 255, 255, 0.1);
50
- border: none;
51
- border-radius: 50%;
52
- padding: 0.5rem;
53
- cursor: pointer;
54
- transition: background-color 0.2s ease;
55
- }
56
-
57
- #menuButton:hover {
58
- background-color: rgba(255, 255, 255, 0.2);
59
- }
60
-
61
- /* Hamburger Menu Styles */
62
- #menu {
63
- position: absolute;
64
- top: 0;
65
- left: 0;
66
- z-index: 10;
67
- transform: translateX(-100%);
68
- visibility: hidden;
69
- opacity: 0;
70
- background-color: rgb(31, 41, 55);
71
- transition: transform 0.3s ease-in-out, visibility 0s 0.3s,
72
- opacity 0.3s ease-in-out;
73
- backdrop-filter: blur(10px);
74
- border-right: 1px solid rgba(255, 255, 255, 0.2);
75
- }
76
-
77
- #menu.open {
78
- transform: translateX(0);
79
- visibility: visible;
80
- opacity: 1;
81
- transition: transform 0.3s ease-in-out, visibility 0s 0s,
82
- opacity 0.3s ease-in-out;
83
- }
84
-
85
- #menu button {
86
- transition: background-color 0.2s ease;
87
- background-color: rgba(0, 0, 0, 0.1);
88
- margin: 2px;
89
- border-radius: 5px;
90
- display: flex;
91
- align-items: center;
92
- justify-content: flex-start;
93
- gap: 10px;
94
- padding: 0.75rem 1rem;
95
- width: 100%;
96
- text-align: left;
97
- border: none;
98
- color: #fff;
99
- font-size: 1rem;
100
- cursor: pointer;
101
- }
102
-
103
- #menu button:hover {
104
- background-color: rgba(55, 65, 81, 0.7);
105
- }
106
- </style>
107
- </head>
108
- <body>
109
- <div class="loader" id="loader">
110
- <div class="one"></div>
111
- <div class="two"></div>
112
- <div class="three"></div>
113
- <div class="four"></div>
114
- </div>
115
- <div class="main-content relative">
116
- <!-- Title -->
117
- <div class="main-title">会話フィードバック</div>
118
-
119
- <!-- Hamburger Menu -->
120
- <div class="absolute top-4 left-4">
121
- <button
122
- id="menuButton"
123
- class="text-white text-2xl focus:outline-none"
124
- onclick="toggleMenu(event)"
125
- >
126
- <i class="fas fa-bars"></i>
127
- </button>
128
-
129
- <!-- Menu Content -->
130
- <div
131
- id="menu"
132
- 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"
133
- >
134
- <div class="px-4 py-2 text-lg font-semibold">メニュー</div>
135
- <button onclick="showUserRegister()">
136
- <i class="fas fa-user-plus"></i> メンバーを追加
137
- </button>
138
- <button onclick="showRecorder()">
139
- <i class="fas fa-microphone"></i> 録音画面を表示
140
- </button>
141
- <button onclick="showResults()">
142
- <i class="fas fa-chart-bar"></i> フィードバックを表示
143
- </button>
144
- <button onclick="showTalkDetail()">
145
- <i class="fas fa-comments"></i> 会話詳細を表示
146
- </button>
147
- <button onclick="resetAction()">
148
- <i class="fas fa-redo"></i> リセット
149
- </button>
150
- <button onclick="toggleMenu(event)">
151
- <i class="fas fa-times"></i> 閉じる
152
- </button>
153
- </div>
154
- </div>
155
-
156
- <!-- Feedback Details -->
157
- <div class="text-xl font-semibold mb-6" id="level">会話レベル:</div>
158
- <div class="text-lg mb-2" id="Harassment_bool">ハラスメントの有無:</div>
159
- <div class="text-lg mb-2" id="Harassment_type">ハラスメントの種類:</div>
160
- <div class="text-lg mb-2" id="Harassment_loop">繰り返しの程度:</div>
161
- <div class="text-lg mb-2" id="Harassment_comfort">会話の心地よさ:</div>
162
- <div class="text-lg mb-2" id="Harassment_volume">
163
- 非難またはハラスメントの程度:
164
- </div>
165
- </div>
166
-
167
- <script src="{{ url_for('static', filename='menu.js') }}"></script>
168
- <script src="{{ url_for('static', filename='feedback.js') }}"></script>
169
- </body>
170
- </html>
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="ja" class="dark">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>会話フィードバック画面</title>
7
+ <link
8
+ rel="stylesheet"
9
+ href="{{ url_for('static', filename='loading.css') }}"
10
+ />
11
+ <script src="https://cdn.tailwindcss.com"></script>
12
+ <script>
13
+ tailwind.config = {
14
+ darkMode: "class",
15
+ };
16
+ </script>
17
+ <script src="https://use.fontawesome.com/releases/v5.10.0/js/all.js"></script>
18
+ <style>
19
+ /* Main Container */
20
+ body {
21
+ background: linear-gradient(135deg, #2c3e50, #1f2937);
22
+ display: flex;
23
+ align-items: center;
24
+ justify-content: center;
25
+ min-height: 100vh;
26
+ font-family: "Arial", sans-serif;
27
+ color: #fff;
28
+ }
29
+
30
+ /* Main Content Wrapper */
31
+ .main-content {
32
+ border: 5px solid rgba(255, 255, 255, 0.2);
33
+ padding: 2rem;
34
+ border-radius: 1rem;
35
+ width: 90%;
36
+ max-width: 500px;
37
+ background-color: rgba(0, 0, 0, 0.3);
38
+ box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
39
+ text-align: center;
40
+ }
41
+
42
+ /* Title */
43
+ .main-title {
44
+ font-size: 2.5rem;
45
+ font-weight: bold;
46
+ margin-bottom: 1.5rem;
47
+ color: #fff;
48
+ text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
49
+ }
50
+
51
+ /* Hamburger Menu Button */
52
+ #menuButton {
53
+ background-color: rgba(255, 255, 255, 0.1);
54
+ border: none;
55
+ border-radius: 50%;
56
+ padding: 0.5rem;
57
+ cursor: pointer;
58
+ transition: background-color 0.2s ease;
59
+ }
60
+
61
+ #menuButton:hover {
62
+ background-color: rgba(255, 255, 255, 0.2);
63
+ }
64
+
65
+ /* Hamburger Menu Styles */
66
+ #menu {
67
+ position: absolute;
68
+ top: 0;
69
+ left: 0;
70
+ z-index: 10;
71
+ transform: translateX(-100%);
72
+ visibility: hidden;
73
+ opacity: 0;
74
+ background-color: rgb(31, 41, 55);
75
+ transition: transform 0.3s ease-in-out, visibility 0s 0.3s,
76
+ opacity 0.3s ease-in-out;
77
+ backdrop-filter: blur(10px);
78
+ border-right: 1px solid rgba(255, 255, 255, 0.2);
79
+ }
80
+
81
+ #menu.open {
82
+ transform: translateX(0);
83
+ visibility: visible;
84
+ opacity: 1;
85
+ transition: transform 0.3s ease-in-out, visibility 0s 0s,
86
+ opacity 0.3s ease-in-out;
87
+ }
88
+
89
+ #menu button {
90
+ transition: background-color 0.2s ease;
91
+ background-color: rgba(0, 0, 0, 0.1);
92
+ margin: 2px;
93
+ border-radius: 5px;
94
+ display: flex;
95
+ align-items: center;
96
+ justify-content: flex-start;
97
+ gap: 10px;
98
+ padding: 0.75rem 1rem;
99
+ width: 100%;
100
+ text-align: left;
101
+ border: none;
102
+ color: #fff;
103
+ font-size: 1rem;
104
+ cursor: pointer;
105
+ }
106
+
107
+ #menu button:hover {
108
+ background-color: rgba(55, 65, 81, 0.7);
109
+ }
110
+ </style>
111
+ </head>
112
+ <body>
113
+ <div class="loader" id="loader">
114
+ <div class="one"></div>
115
+ <div class="two"></div>
116
+ <div class="three"></div>
117
+ <div class="four"></div>
118
+ </div>
119
+ <div class="main-content relative">
120
+ <!-- Title -->
121
+ <div class="main-title">会話フィードバック</div>
122
+
123
+ <!-- Hamburger Menu -->
124
+ <div class="absolute top-4 left-4">
125
+ <button
126
+ id="menuButton"
127
+ class="text-white text-2xl focus:outline-none"
128
+ onclick="toggleMenu(event)"
129
+ >
130
+ <i class="fas fa-bars"></i>
131
+ </button>
132
+
133
+ <!-- Menu Content -->
134
+ <div
135
+ id="menu"
136
+ 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"
137
+ >
138
+ <div class="px-4 py-2 text-lg font-semibold">メニュー</div>
139
+ <button onclick="showUserRegister()">
140
+ <i class="fas fa-user-plus"></i> メンバーを追加
141
+ </button>
142
+ <button onclick="showRecorder()">
143
+ <i class="fas fa-microphone"></i> 録音画面を表示
144
+ </button>
145
+ <button onclick="showResults()">
146
+ <i class="fas fa-chart-bar"></i> フィードバックを表示
147
+ </button>
148
+ <button onclick="showTalkDetail()">
149
+ <i class="fas fa-comments"></i> 会話詳細を表���
150
+ </button>
151
+ <button onclick="resetAction()">
152
+ <i class="fas fa-redo"></i> リセット
153
+ </button>
154
+ <button onclick="toggleMenu(event)">
155
+ <i class="fas fa-times"></i> 閉じる
156
+ </button>
157
+ </div>
158
+ </div>
159
+
160
+ <!-- Feedback Details -->
161
+ <div class="text-xl font-semibold mb-6" id="level">会話レベル:</div>
162
+ <div class="text-lg mb-2" id="Harassment_bool">ハラスメントの有無:</div>
163
+ <div class="text-lg mb-2" id="Harassment_type">ハラスメントの種類:</div>
164
+ <div class="text-lg mb-2" id="Harassment_loop">繰り返しの程度:</div>
165
+ <div class="text-lg mb-2" id="Harassment_comfort">会話の心地よさ:</div>
166
+ <div class="text-lg mb-2" id="Harassment_volume">
167
+ 非難またはハラスメントの程度:
168
+ </div>
169
+ </div>
170
+
171
+ <script src="{{ url_for('static', filename='menu.js') }}"></script>
172
+ <script src="{{ url_for('static', filename='feedback.js') }}"></script>
173
+ </body>
174
+ </html>
templates/talkDetail.html CHANGED
@@ -1,49 +1,151 @@
1
- <!DOCTYPE html>
2
- <html lang="ja" class="dark">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>会話詳細画面</title>
7
- <script src="https://cdn.tailwindcss.com"></script>
8
- <link
9
- rel="stylesheet"
10
- href="{{ url_for('static', filename='loading.css') }}"
11
- />
12
- </head>
13
- <body
14
- class="bg-gray-100 dark:bg-gray-900 text-gray-900 dark:text-gray-100 min-h-screen flex items-center justify-center"
15
- >
16
- <div class="loader" id="loader">
17
- <div class="one"></div>
18
- <div class="two"></div>
19
- <div class="three"></div>
20
- <div class="four"></div>
21
- </div>
22
- <div
23
- class="container mx-auto p-6 bg-white dark:bg-gray-800 shadow-lg rounded-2xl"
24
- >
25
- <h2 class="text-2xl font-semibold mb-4">会話の文字起こし表示</h2>
26
- <div
27
- id="transcription"
28
- class="p-4 bg-gray-200 dark:bg-gray-700 rounded-lg mb-4 max-h-96 overflow-y-auto"
29
- >
30
- ここに会話内容が表示されます。
31
- </div>
32
- <div class="flex justify-center gap-4">
33
- <button
34
- class="px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors"
35
- onclick="showRecorder()"
36
- >
37
- 録音画面を表示
38
- </button>
39
- <button
40
- class="px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors"
41
- onclick="showFeedback()"
42
- >
43
- フィードバック画面を表示
44
- </button>
45
- </div>
46
- </div>
47
- <script src="{{ url_for('static', filename='talk_detail.js') }}"></script>
48
- </body>
49
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="ja" class="dark">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>会話詳細画面</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <script src="https://use.fontawesome.com/releases/v5.10.0/js/all.js"></script>
9
+ <link
10
+ rel="stylesheet"
11
+ href="{{ url_for('static', filename='loading.css') }}"
12
+ />
13
+ <style>
14
+ .main-content {
15
+ border: 5px solid rgba(255, 255, 255, 0.2);
16
+ border-radius: 1rem;
17
+ margin: 1rem; /* 外側の余白 */
18
+ width: 90%;
19
+ max-width: 500px;
20
+ /*width: 100%; */ /* 枠線全体を広げる */
21
+ /*max-width: 90%;*/ /* 最大幅を画面の90%に設定 */
22
+ }
23
+
24
+ /* Hamburger Menu Button */
25
+ #menuButton {
26
+ background-color: rgba(255, 255, 255, 0.1);
27
+ border: none;
28
+ border-radius: 50%;
29
+ padding: 0.5rem;
30
+ cursor: pointer;
31
+ transition: background-color 0.2s ease;
32
+ }
33
+
34
+ #menuButton:hover {
35
+ background-color: rgba(255, 255, 255, 0.2);
36
+ }
37
+
38
+ /* Hamburger Menu Styles */
39
+ #menu {
40
+ position: absolute;
41
+ top: 0;
42
+ left: 0;
43
+ z-index: 10;
44
+ transform: translateX(-100%);
45
+ visibility: hidden;
46
+ opacity: 0;
47
+ background-color: rgb(31, 41, 55);
48
+ transition: transform 0.3s ease-in-out, visibility 0s 0.3s,
49
+ opacity 0.3s ease-in-out;
50
+ backdrop-filter: blur(10px);
51
+ border-right: 1px solid rgba(255, 255, 255, 0.2);
52
+ }
53
+
54
+ #menu.open {
55
+ transform: translateX(0);
56
+ visibility: visible;
57
+ opacity: 1;
58
+ transition: transform 0.3s ease-in-out, visibility 0s 0s,
59
+ opacity 0.3s ease-in-out;
60
+ }
61
+
62
+ #menu button {
63
+ transition: background-color 0.2s ease;
64
+ background-color: rgba(0, 0, 0, 0.1);
65
+ margin: 2px;
66
+ border-radius: 5px;
67
+ display: flex;
68
+ align-items: center;
69
+ justify-content: flex-start;
70
+ gap: 10px;
71
+ padding: 0.75rem 1rem;
72
+ width: 100%;
73
+ text-align: left;
74
+ border: none;
75
+ color: #fff;
76
+ font-size: 1rem;
77
+ cursor: pointer;
78
+ }
79
+
80
+ #menu button:hover {
81
+ background-color: rgba(55, 65, 81, 0.7);
82
+ }
83
+ </style>
84
+ </head>
85
+ <body
86
+ class="bg-gray-100 dark:bg-gray-900 text-gray-900 dark:text-gray-100 min-h-screen flex items-center justify-center"
87
+ >
88
+ <div class="main-content relative">
89
+ <div class="loader" id="loader">
90
+ <div class="one"></div>
91
+ <div class="two"></div>
92
+ <div class="three"></div>
93
+ <div class="four"></div>
94
+ </div>
95
+ <div
96
+ class="container mx-auto p-6 bg-white dark:bg-gray-800 shadow-lg rounded-2xl w-full max-w-none"
97
+ >
98
+ <h2 class="text-2xl font-semibold mb-4 text-center">
99
+ 会話の文字起こし表示
100
+ </h2>
101
+
102
+ <!-- Hamburger Menu -->
103
+ <div class="absolute top-4 left-4">
104
+ <button
105
+ id="menuButton"
106
+ class="text-white text-2xl focus:outline-none"
107
+ onclick="toggleMenu(event)"
108
+ >
109
+ <i class="fas fa-bars"></i>
110
+ </button>
111
+
112
+ <!-- Menu Content -->
113
+ <div
114
+ id="menu"
115
+ 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"
116
+ >
117
+ <div class="px-4 py-2 text-lg font-semibold">メニュー</div>
118
+ <button onclick="showUserRegister()">
119
+ <i class="fas fa-user-plus"></i> メンバーを追加
120
+ </button>
121
+ <button onclick="showRecorder()">
122
+ <i class="fas fa-microphone"></i> 録音画面を表示
123
+ </button>
124
+ <button onclick="showResults()">
125
+ <i class="fas fa-chart-bar"></i> フィードバックを表示
126
+ </button>
127
+ <button onclick="showTalkDetail()">
128
+ <i class="fas fa-comments"></i> 会話詳細を表示
129
+ </button>
130
+ <button onclick="resetAction()">
131
+ <i class="fas fa-redo"></i> リセット
132
+ </button>
133
+ <button onclick="toggleMenu(event)">
134
+ <i class="fas fa-times"></i> 閉じる
135
+ </button>
136
+ </div>
137
+ </div>
138
+ <!-- Hamburger Menu End -->
139
+
140
+ <div
141
+ id="transcription"
142
+ class="p-4 bg-gray-200 dark:bg-gray-700 rounded-lg mb-4 max-h-96 overflow-y-auto"
143
+ >
144
+ ここに会話内容が表示されます。
145
+ </div>
146
+ </div>
147
+ <script src="{{ url_for('static', filename='talk_detail.js') }}"></script>
148
+ <script src="{{ url_for('static', filename='menu.js') }}"></script>
149
+ </div>
150
+ </body>
151
+ </html>
templates/userRegister.html CHANGED
@@ -1,151 +1,151 @@
1
- <!DOCTYPE html>
2
- <html lang="ja">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <title>ユーザー音声登録</title>
6
- <script src="https://cdn.tailwindcss.com"></script>
7
- <script src="https://use.fontawesome.com/releases/v5.10.0/js/all.js"></script>
8
- <style>
9
- @keyframes pulse-scale {
10
- 0%,
11
- 100% {
12
- transform: scale(1);
13
- }
14
- 50% {
15
- transform: scale(1.1);
16
- }
17
- }
18
- .animate-pulse-scale {
19
- animation: pulse-scale 1s infinite;
20
- }
21
-
22
- /* Record Button Styles */
23
- .record-button {
24
- width: 50px;
25
- height: 50px;
26
- background-color: transparent;
27
- border-radius: 50%;
28
- border: 2px solid white;
29
- display: flex;
30
- justify-content: center;
31
- align-items: center;
32
- cursor: pointer;
33
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
34
- transition: all 0.3s ease;
35
- }
36
- .record-icon {
37
- width: 35px;
38
- height: 35px;
39
- background-color: #d32f2f;
40
- border-radius: 50%;
41
- transition: all 0.3s ease;
42
- }
43
- .record-button.recording .record-icon {
44
- background-color: #f44336; /* 録音中は赤色 */
45
- border-radius: 4px; /* 録音時に赤い部分だけ四角にする */
46
- }
47
- .recording .record-icon {
48
- width: 20px;
49
- height: 20px;
50
- border-radius: 50%;
51
- }
52
-
53
- /* Main Container */
54
- body {
55
- background: linear-gradient(135deg, #2c3e50, #1f2937);
56
- display: flex;
57
- align-items: center;
58
- justify-content: center;
59
- min-height: 100vh;
60
- font-family: "Arial", sans-serif;
61
- }
62
-
63
- /* Main Content Wrapper */
64
- .main-content {
65
- border: 5px solid rgba(255, 255, 255, 0.2);
66
- padding: 2rem;
67
- border-radius: 1rem;
68
- width: 90%;
69
- max-width: 500px;
70
- background-color: rgba(0, 0, 0, 0.3);
71
- box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
72
- text-align: center;
73
- }
74
-
75
- /* Title */
76
- .main-title {
77
- font-size: 2.5rem;
78
- font-weight: bold;
79
- margin-bottom: 1.5rem;
80
- color: #fff;
81
- text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
82
- }
83
-
84
- /* Buttons */
85
- .action-button {
86
- margin-top: 1rem;
87
- padding: 0.75rem 1.5rem;
88
- border-radius: 0.5rem;
89
- cursor: pointer;
90
- transition: background-color 0.2s ease;
91
- width: 100%;
92
- }
93
-
94
- .action-button:hover {
95
- background-color: rgba(55, 65, 81, 0.7);
96
- }
97
-
98
- .back-button {
99
- background-color: #607d8b; /* 落ち着いたグレー */
100
- color: white;
101
- }
102
-
103
- .add-button {
104
- background-color: #4caf50; /* 落ち着いた緑色 */
105
- color: white;
106
- }
107
-
108
- /* Disabled State */
109
- .disabled {
110
- opacity: 0.5;
111
- pointer-events: none;
112
- }
113
-
114
- /* Responsive Design */
115
- @media (max-width: 640px) {
116
- .main-content {
117
- padding: 1.5rem;
118
- }
119
- }
120
- </style>
121
- </head>
122
- <body>
123
- <!-- Main Content Wrapper -->
124
- <div class="main-content relative">
125
- <!-- Title -->
126
- <div class="main-title">ユーザー音声登録</div>
127
-
128
- <!-- User List -->
129
- <div id="people-list" class="space-y-4"></div>
130
-
131
- <!-- Add Button -->
132
- <button id="add-btn" class="action-button add-button">
133
- <i class="fas fa-user-plus"></i> メンバーを追加
134
- </button>
135
-
136
- <!-- Back Button -->
137
- <button
138
- id="backButton"
139
- onclick="goBack()"
140
- class="action-button back-button"
141
- >
142
- 戻る
143
- </button>
144
- </div>
145
-
146
- <script src="{{ url_for('static', filename='register_record.js') }}"></script>
147
-
148
-
149
-
150
- </body>
151
- </html>
 
1
+ <!DOCTYPE html>
2
+ <html lang="ja">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <title>ユーザー音声登録</title>
6
+ <script src="https://cdn.tailwindcss.com"></script>
7
+ <script src="https://use.fontawesome.com/releases/v5.10.0/js/all.js"></script>
8
+ <style>
9
+ @keyframes pulse-scale {
10
+ 0%,
11
+ 100% {
12
+ transform: scale(1);
13
+ }
14
+ 50% {
15
+ transform: scale(1.1);
16
+ }
17
+ }
18
+ .animate-pulse-scale {
19
+ animation: pulse-scale 1s infinite;
20
+ }
21
+
22
+ /* Record Button Styles */
23
+ .record-button {
24
+ width: 50px;
25
+ height: 50px;
26
+ background-color: transparent;
27
+ border-radius: 50%;
28
+ border: 2px solid white;
29
+ display: flex;
30
+ justify-content: center;
31
+ align-items: center;
32
+ cursor: pointer;
33
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
34
+ transition: all 0.3s ease;
35
+ }
36
+ .record-icon {
37
+ width: 35px;
38
+ height: 35px;
39
+ background-color: #d32f2f;
40
+ border-radius: 50%;
41
+ transition: all 0.3s ease;
42
+ }
43
+ .record-button.recording .record-icon {
44
+ background-color: #f44336; /* 録音中は赤色 */
45
+ border-radius: 4px; /* 録音時に赤い部分だけ四角にする */
46
+ }
47
+ .recording .record-icon {
48
+ width: 20px;
49
+ height: 20px;
50
+ border-radius: 50%;
51
+ }
52
+
53
+ /* Main Container */
54
+ body {
55
+ background: linear-gradient(135deg, #2c3e50, #1f2937);
56
+ display: flex;
57
+ align-items: center;
58
+ justify-content: center;
59
+ min-height: 100vh;
60
+ font-family: "Arial", sans-serif;
61
+ }
62
+
63
+ /* Main Content Wrapper */
64
+ .main-content {
65
+ border: 5px solid rgba(255, 255, 255, 0.2);
66
+ padding: 2rem;
67
+ border-radius: 1rem;
68
+ width: 90%;
69
+ max-width: 500px;
70
+ background-color: rgba(0, 0, 0, 0.3);
71
+ box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
72
+ text-align: center;
73
+ }
74
+
75
+ /* Title */
76
+ .main-title {
77
+ font-size: 2.5rem;
78
+ font-weight: bold;
79
+ margin-bottom: 1.5rem;
80
+ color: #fff;
81
+ text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
82
+ }
83
+
84
+ /* Buttons */
85
+ .action-button {
86
+ margin-top: 1rem;
87
+ padding: 0.75rem 1.5rem;
88
+ border-radius: 0.5rem;
89
+ cursor: pointer;
90
+ transition: background-color 0.2s ease;
91
+ width: 100%;
92
+ }
93
+
94
+ .action-button:hover {
95
+ background-color: rgba(55, 65, 81, 0.7);
96
+ }
97
+
98
+ .back-button {
99
+ background-color: #607d8b; /* 落ち着いたグレー */
100
+ color: white;
101
+ }
102
+
103
+ .add-button {
104
+ background-color: #4caf50; /* 落ち着いた緑色 */
105
+ color: white;
106
+ }
107
+
108
+ /* Disabled State */
109
+ .disabled {
110
+ opacity: 0.5;
111
+ pointer-events: none;
112
+ }
113
+
114
+ /* Responsive Design */
115
+ @media (max-width: 640px) {
116
+ .main-content {
117
+ padding: 1.5rem;
118
+ }
119
+ }
120
+ </style>
121
+ </head>
122
+ <body>
123
+ <!-- Main Content Wrapper -->
124
+ <div class="main-content relative">
125
+ <!-- Title -->
126
+ <div class="main-title">ユーザー音声登録</div>
127
+
128
+ <!-- User List -->
129
+ <div id="people-list" class="space-y-4"></div>
130
+
131
+ <!-- Add Button -->
132
+ <button id="add-btn" class="action-button add-button">
133
+ <i class="fas fa-user-plus"></i> メンバーを追加
134
+ </button>
135
+
136
+ <!-- 録音画面へ移動ボタン(Back Buttonから変更) -->
137
+ <button
138
+ id="backButton"
139
+ onclick="showRecorder()"
140
+ class="action-button back-button"
141
+ >
142
+ <i class="fas fa-microphone"></i> 録音画面を表示
143
+ </button>
144
+ </div>
145
+
146
+ <script src="{{ url_for('static', filename='register_record.js') }}"></script>
147
+
148
+
149
+
150
+ </body>
151
+ </html>