-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvisualizer.html
More file actions
210 lines (184 loc) · 9.74 KB
/
visualizer.html
File metadata and controls
210 lines (184 loc) · 9.74 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cognify - Data Visualization</title>
<link rel="stylesheet" href="css/visualizer.css">
<link rel="stylesheet" href="css/custom-waveform.css">
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path d='M50 15L45 35 25 40 37 52 32 72 50 62 68 72 63 52 75 40 55 35z' fill='%231db954'/></svg>">
</head>
<body>
<!-- Sidebar Navigation -->
<div id="sidebar" class="sidebar">
<div class="sidebar-header">
<div class="logo-container">
<svg width="30" height="30" viewBox="0 0 24 24">
<path d="M12 3v9.28c-.47-.17-.97-.28-1.5-.28C8.01 12 6 14.01 6 16.5S8.01 21 10.5 21c2.31 0 4.2-1.75 4.45-4H15V6h4V3h-7z" fill="#1db954" />
</svg>
<span>Cognify</span>
</div>
<button id="close-sidebar" class="close-btn">
<svg width="24" height="24" viewBox="0 0 24 24">
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" fill="currentColor"/>
</svg>
</button>
</div>
<div class="sidebar-content">
<h3>Datasets</h3>
<div id="sidebar-albums" class="sidebar-albums">
<!-- Will be populated dynamically -->
</div>
</div>
</div>
<!-- MAIN APP CONTAINER -->
<div class="app-container">
<!-- Toggle sidebar button -->
<button id="toggle-sidebar" class="toggle-sidebar-btn">
<svg width="24" height="24" viewBox="0 0 24 24">
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" fill="currentColor"/>
</svg>
</button>
<!-- Header section -->
<div class="header-info">
<div class="header-nav">
<button id="back-to-albums" class="back-button" onclick="window.location.href='albums.html'">
<svg width="16" height="16" viewBox="0 0 24 24">
<path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z" fill="currentColor"/>
</svg>
Back to Datasets
</button>
</div>
<h1 id="current-dataset" class="current-selection">Dataset</h1>
<div id="current-subject" class="subtitle">Subject</div>
</div>
<!-- Subject and Metric selection (dropdowns) -->
<div class="selection-panel">
<div id="subjects-dropdown-container" class="dropdown-container">
<!-- Subject dropdown will be populated dynamically -->
</div>
<div id="metrics-dropdown-container" class="dropdown-container">
<!-- Metrics dropdown will be populated dynamically -->
</div>
</div>
<!-- Visualization container -->
<div class="visualization-container">
<!-- Line chart -->
<div id="chart-container" class="chart-container"></div>
<div class="waveform-and-pulse-container">
<!-- Waveform visualization -->
<div id="waveform-container" class="waveform-container">
<div id="waveform-bars" class="waveform-bars"></div>
<div id="metric-display" class="metric-display">Value: 0</div>
</div>
<!-- Circular pulse visualization -->
<div id="pulse-container" class="pulse-container">
<div id="pulse-circle" class="pulse-circle"></div>
<div id="circular-wave" class="circular-wave"></div>
</div>
</div>
<!-- Player controls -->
<div class="player-controls">
<div id="timeline" class="timeline">
<div id="timeline-progress" class="timeline-progress"></div>
<!-- Timeline handle added via JavaScript -->
</div>
<div class="time-display">
<span id="current-time">0:00</span>
<span id="total-time">0:00</span>
</div>
<div class="control-buttons">
<button id="skip-back-btn" class="control-btn">
<svg id="skip-back-icon" width="24" height="24" viewBox="0 0 24 24">
<path d="M6 6h2v12H6zm3.5 6l8.5 6V6z" fill="currentColor"/>
</svg>
</button>
<button id="play-btn" class="play-btn">
<svg id="play-icon" width="24" height="24" viewBox="0 0 24 24">
<path d="M8 5v14l11-7z" fill="currentColor"/>
</svg>
<svg id="pause-icon" class="hidden" width="24" height="24" viewBox="0 0 24 24">
<path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z" fill="currentColor"/>
</svg>
</button>
<button id="skip-forward-btn" class="control-btn">
<svg id="skip-forward-icon" width="24" height="24" viewBox="0 0 24 24">
<path d="M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z" fill="currentColor"/>
</svg>
</button>
</div>
</div>
<div class="playback-options">
<div class="volume-control">
<span class="volume-icon">
<svg width="16" height="16" viewBox="0 0 24 24">
<path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z" fill="currentColor"/>
</svg>
</span>
<input type="range" id="volume-slider" class="volume-slider" min="0" max="100" value="20">
</div>
<div class="playback-control">
<span class="speed-label">Playback Speed:</span>
<input type="range" id="speed-slider" class="speed-slider" min="0.25" max="3" step="0.25" value="1">
<span id="speed-value" class="speed-value">1.0x</span>
</div>
<div id="pitch-range-container" class="pitch-range-container"></div>
<div id="sound-profile-container" class="sound-profile-container">
<!-- Sound profile dropdown will be added here -->
</div>
<div id="sound-upload-section" class="sound-upload-section" style="display: none;">
<!-- Heading -->
<h3 class="sound-upload-header">Upload Custom Sound</h3>
<!-- Description text -->
<p class="sound-upload-description">
Upload an audio file that will loop and change pitch based on data values.
</p>
<!-- Hidden file input that the label will trigger -->
<input
type="file"
id="sound-file-input"
class="sound-file-input"
accept="audio/*"
style="display: none;"
>
<!-- Label that opens the file dialog when clicked, targeting the file input above -->
<label for="sound-file-input" class="sound-upload-btn">
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
<path d="M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z"/>
</svg>
Upload Sound File
</label>
<!-- Preview section; stays hidden until a file is chosen -->
<div id="sound-preview" class="sound-preview" style="display: none;"></div>
</div>
</div>
</div>
</div>
<!-- Animated wave at bottom -->
<div id="bottom-wave-container" class="bottom-wave-container">
<svg id="bottom-wave" class="bottom-wave" preserveAspectRatio="none" viewBox="0 0 1200 120" xmlns="http://www.w3.org/2000/svg">
<path id="wave-path" d="M0,0 C150,40 350,0 500,30 C650,60 750,0 900,20 C1050,40 1150,10 1200,0 V120 H0 Z"></path>
</svg>
</div>
<!-- Chart tooltip -->
<div id="chart-tooltip" class="chart-tooltip hidden"></div>
<!-- D3.js -->
<script src="https://d3js.org/d3.v7.min.js"></script>
<!-- Application Scripts - Split into modules -->
<script src="js/app-state.js"></script>
<script src="js/audio-integration-helper.js"></script>
<script src="js/audio-processor.js"></script>
<script src="js/chart-visualizer.js"></script>
<script src="js/waveform-visualizer.js"></script>
<script src="js/circular-wave.js"></script>
<script src="js/bottom-wave.js"></script>
<script src="js/playback-controls.js"></script>
<script src="js/data-manager.js"></script>
<script src="js/sound-upload.js"></script>
<script src="js/custom-audio-connector.js"></script>
<script src="js/loading-manager.js"></script>
<script src="js/logo-redirect.js"></script>
<script src="js/simplified-waveform.js"></script>
<script src="js/main.js"></script>
</body>
</html>