-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhost.html
More file actions
171 lines (152 loc) · 7.46 KB
/
host.html
File metadata and controls
171 lines (152 loc) · 7.46 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Host Dashboard — ParetoChart</title>
<link rel="stylesheet" href="css/style.css" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
</head>
<body class="host-body">
<!-- Toast container -->
<div id="toast-container"></div>
<!-- Loading overlay -->
<div id="loading-overlay" class="loading-overlay">
<div class="spinner"></div>
<p>Loading session…</p>
</div>
<!-- Top bar -->
<header class="host-header">
<div class="host-header-left">
<a href="index.html" class="logo logo-sm">
<svg width="28" height="28" viewBox="0 0 36 36" fill="none">
<rect width="36" height="36" rx="10" fill="#6C5CE7"/>
<rect x="8" y="10" width="6" height="18" rx="2" fill="#fff" opacity="0.9"/>
<rect x="16" y="16" width="6" height="12" rx="2" fill="#fff" opacity="0.7"/>
<rect x="24" y="20" width="6" height="8" rx="2" fill="#fff" opacity="0.5"/>
<path d="M8 12 L16 18 L24 22 L30 25" stroke="#00E676" stroke-width="2" stroke-linecap="round" fill="none"/>
</svg>
<span>ParetoChart</span>
</a>
<span class="separator">|</span>
<span class="host-badge">HOST</span>
</div>
<div class="host-header-right">
<button class="btn-icon" id="darkModeToggle" title="Toggle dark mode">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79z"/></svg>
</button>
</div>
</header>
<div class="host-layout">
<!-- Main content -->
<main class="host-main">
<!-- Phase header -->
<div class="phase-header" id="phaseHeader">
<h2 id="phaseTitle">Root Causes</h2>
<div id="phaseActions"></div>
</div>
<!-- Add cause form (collecting phase) -->
<form class="add-cause-form" id="addCauseForm" autocomplete="off">
<input type="text" id="causeInput" placeholder="Enter a possible root cause…" maxlength="200" required />
<button type="submit" class="btn btn-primary">Add Cause</button>
</form>
<!-- Chart section (voting/results phase) -->
<div class="chart-section" id="chartSection" style="display:none;">
<div class="chart-container" id="chartContainer"></div>
</div>
<!-- Cause list -->
<div id="causeList" class="cause-list"></div>
<!-- Ranked table (results phase) -->
<div class="ranked-table-wrap" id="rankedTableWrap" style="display:none;"></div>
<!-- Empty state -->
<div id="emptyState" class="empty-state" style="display:none;">
<svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2" opacity="0.4"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>
<p>No root causes yet.</p>
<p class="empty-sub">Add possible root causes above to get started.</p>
</div>
</main>
<!-- Sidebar -->
<aside class="host-sidebar">
<div class="sidebar-section">
<h2 id="sessionTitle" class="session-title-display">Loading…</h2>
<div class="session-status">
<span class="status-dot collecting" id="statusDot"></span>
<span id="statusText">Collecting</span>
</div>
</div>
<!-- QR Code -->
<div class="sidebar-section qr-section">
<h3>Share with participants</h3>
<div id="qrCode" class="qr-placeholder"></div>
<div class="join-link-box">
<input type="text" id="joinLink" readonly />
<button class="btn-icon btn-copy" id="copyLink" title="Copy link">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>
</button>
</div>
<p class="session-code-label">Session Code</p>
<p class="session-code" id="sessionCode">—</p>
</div>
<!-- Stats -->
<div class="sidebar-section stats-section">
<div class="stat-card">
<span class="stat-number" id="causeCount">0</span>
<span class="stat-label">Causes</span>
</div>
<div class="stat-card">
<span class="stat-number" id="participantCount">0</span>
<span class="stat-label">Participants</span>
</div>
</div>
<!-- Controls -->
<div class="sidebar-section controls-section">
<div class="control-row" id="maxVotesRow">
<span>Max votes per user</span>
<input type="number" id="maxVotesInput" min="1" max="20" value="3" />
</div>
<button class="btn btn-success btn-full" id="advancePhaseBtn">
Start Voting
</button>
<button class="btn btn-outline btn-full" id="exportPNG" style="display:none;">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>
Export PNG
</button>
<button class="btn btn-outline btn-full" id="exportCSV" style="display:none;">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
Export CSV
</button>
<button class="btn btn-danger btn-full" id="resetVotes" style="display:none;">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/></svg>
Reset Votes
</button>
<button class="btn btn-outline btn-full" id="endSession">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2"/><line x1="9" y1="9" x2="15" y2="15"/><line x1="15" y1="9" x2="9" y2="15"/></svg>
End Session
</button>
</div>
</aside>
</div>
<!-- Confirm modal -->
<div class="modal-overlay" id="confirmModal" style="display:none;">
<div class="modal-card modal-sm">
<h3 id="confirmTitle">Are you sure?</h3>
<p id="confirmMessage"></p>
<div class="modal-actions">
<button class="btn btn-secondary" id="confirmCancel">Cancel</button>
<button class="btn btn-danger" id="confirmOk">Confirm</button>
</div>
</div>
</div>
<!-- QR code library -->
<script src="https://cdn.jsdelivr.net/npm/qrcode-generator@1.4.4/qrcode.min.js"></script>
<!-- Firebase SDKs -->
<script src="https://www.gstatic.com/firebasejs/10.12.0/firebase-app-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/10.12.0/firebase-auth-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/10.12.0/firebase-firestore-compat.js"></script>
<script src="js/firebase-config.js?v=1"></script>
<script src="js/utils.js?v=1"></script>
<script src="js/chart.js?v=1"></script>
<script src="js/host.js?v=1"></script>
</body>
</html>