Kexin-251202 commited on
Commit
fda4324
·
verified ·
1 Parent(s): 83fc68f

Upload 3 files

Browse files
Files changed (3) hide show
  1. static/index.html +65 -0
  2. static/script.js +44 -0
  3. static/styles.css +191 -0
static/index.html ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>Focus Guard</title>
6
+ <link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap" rel="stylesheet">
7
+ <link rel="stylesheet" href="styles.css">
8
+ </head>
9
+ <body>
10
+ <!-- Top Menu -->
11
+ <nav id="top-menu">
12
+ <button id="menu-start" class="menu-btn">Start Focus</button>
13
+ <div class="separator"></div>
14
+ <button id="menu-achievement" class="menu-btn">My Achievement</button>
15
+ <div class="separator"></div>
16
+ <button id="menu-records" class="menu-btn">My Records</button>
17
+ <div class="separator"></div>
18
+ <button id="menu-customise" class="menu-btn">Customise</button>
19
+ <div class="separator"></div>
20
+ <button id="menu-help" class="menu-btn">Help</button>
21
+ </nav>
22
+ <!-- Page A -->
23
+ <main id="page-a" class="page">
24
+ <h1>Focus Guard</h1>
25
+ <p>Your productivity monitor assistant.</p>
26
+ <button id="start-button" class="btn-main">Start</button>
27
+ </main>
28
+ <!-- Page B -->
29
+ <main id="page-b" class="page hidden">
30
+ <!-- 1. Camera / Display Area -->
31
+ <section id="display-area">
32
+ <p id="display-placeholder">Nothing</p>
33
+ </section>
34
+
35
+ <!-- 2. Timeline Area -->
36
+ <section id="timeline-area">
37
+ <div class="timeline-label">Timeline</div>
38
+ <div id="timeline-visuals"></div>
39
+ <div id="timeline-line"></div>
40
+ </section>
41
+
42
+ <!-- 3. Control Buttons -->
43
+ <section id="control-panel">
44
+ <button id="btn-cam-start" class="action-btn green">Start</button>
45
+ <button id="btn-floating" class="action-btn yellow">Floating Window</button>
46
+ <button id="btn-models" class="action-btn blue">Models</button>
47
+ <button id="btn-cam-stop" class="action-btn red">Stop</button>
48
+ </section>
49
+
50
+ <!-- 4. Frame Control -->
51
+ <section id="frame-control">
52
+ <label for="frame-slider">Frame</label>
53
+ <input type="range" id="frame-slider" min="1" max="60" value="30">
54
+ <input type="number" id="frame-input" value="30">
55
+ </section>
56
+ </main>
57
+
58
+ <main id="page-c" class="page hidden"><h1>My Achievement</h1><p>Coming Soon</p></main>
59
+ <main id="page-d" class="page hidden"><h1>My Records</h1><p>Coming Soon</p></main>
60
+ <main id="page-e" class="page hidden"><h1>Customise</h1><p>Coming Soon</p></main>
61
+ <main id="page-f" class="page hidden"><h1>Help</h1><p>Coming Soon</p></main>
62
+
63
+ <script src="script.js"></script>
64
+ </body>
65
+ </html>
static/script.js ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Get all pages
2
+ const pages = {
3
+ 'page-a': document.getElementById('page-a'),
4
+ 'page-b': document.getElementById('page-b'),
5
+ 'page-c': document.getElementById('page-c'), // Achievement
6
+ 'page-d': document.getElementById('page-d'), // Records
7
+ 'page-e': document.getElementById('page-e'), // Customise
8
+ 'page-f': document.getElementById('page-f') // Help
9
+ };
10
+
11
+ // Function to hide all pages and show the target one
12
+ function showPage(pageId) {
13
+ // Hide all
14
+ for (const key in pages) {
15
+ pages[key].classList.add('hidden');
16
+ }
17
+ // Show target
18
+ if(pages[pageId]) {
19
+ pages[pageId].classList.remove('hidden');
20
+ }
21
+ }
22
+
23
+ // Event Listeners for Menu
24
+ document.getElementById('menu-start').addEventListener('click', () => showPage('page-b'));
25
+ document.getElementById('menu-achievement').addEventListener('click', () => showPage('page-c'));
26
+ document.getElementById('menu-records').addEventListener('click', () => showPage('page-d'));
27
+ document.getElementById('menu-customise').addEventListener('click', () => showPage('page-e'));
28
+ document.getElementById('menu-help').addEventListener('click', () => showPage('page-f'));
29
+
30
+ // Event Listener for Page A Start Button
31
+ document.getElementById('start-button').addEventListener('click', () => showPage('page-b'));
32
+
33
+ // Frame Control Logic (Sync slider and input)
34
+ const frameSlider = document.getElementById('frame-slider');
35
+ const frameInput = document.getElementById('frame-input');
36
+
37
+ frameSlider.addEventListener('input', (e) => {
38
+ frameInput.value = e.target.value;
39
+ // Here you would add logic to debounce and update actual frame rate
40
+ });
41
+
42
+ frameInput.addEventListener('input', (e) => {
43
+ frameSlider.value = e.target.value;
44
+ });
static/styles.css ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* GLOBAL STYLES */
2
+ body {
3
+ margin: 0;
4
+ font-family: 'Nunito', sans-serif; /* Rounded font */
5
+ background-color: #f9f9f9;
6
+ height: 100vh;
7
+ overflow: hidden; /* Prevents scrolling */
8
+ }
9
+
10
+ .hidden {
11
+ display: none !important;
12
+ }
13
+
14
+ /* TOP MENU */
15
+ #top-menu {
16
+ height: 60px;
17
+ background-color: white;
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: center; /* Center buttons horizontally */
21
+ box-shadow: 0 2px 5px rgba(0,0,0,0.05);
22
+ position: fixed;
23
+ top: 0;
24
+ width: 100%;
25
+ z-index: 1000;
26
+ }
27
+
28
+ .menu-btn {
29
+ background: none;
30
+ border: none;
31
+ font-family: 'Nunito', sans-serif;
32
+ font-size: 16px;
33
+ color: #333;
34
+ padding: 10px 20px;
35
+ cursor: pointer;
36
+ transition: background-color 0.2s;
37
+ }
38
+
39
+ .menu-btn:hover {
40
+ background-color: #f0f0f0;
41
+ border-radius: 4px;
42
+ }
43
+
44
+ .separator {
45
+ width: 1px;
46
+ height: 20px;
47
+ background-color: #555; /* Dark gray separator */
48
+ margin: 0 5px;
49
+ }
50
+
51
+ /* PAGE CONTAINER */
52
+ .page {
53
+ height: 100vh;
54
+ padding-top: 60px; /* Space for fixed menu */
55
+ box-sizing: border-box;
56
+ display: flex;
57
+ flex-direction: column;
58
+ align-items: center;
59
+ }
60
+
61
+ /* PAGE A SPECIFIC */
62
+ #page-a {
63
+ justify-content: center; /* Center vertically */
64
+ margin-top: -40px; /* Slight offset to look optical centered */
65
+ }
66
+
67
+ #page-a h1 {
68
+ font-size: 80px;
69
+ margin: 0 0 10px 0;
70
+ color: #000;
71
+ }
72
+
73
+ #page-a p {
74
+ color: #666;
75
+ font-size: 20px;
76
+ margin-bottom: 40px;
77
+ }
78
+
79
+ .btn-main {
80
+ background-color: #007BFF; /* Blue */
81
+ color: white;
82
+ border: none;
83
+ padding: 15px 50px;
84
+ font-size: 20px;
85
+ font-family: 'Nunito', sans-serif;
86
+ border-radius: 30px; /* Fully rounded corners */
87
+ cursor: pointer;
88
+ transition: transform 0.2s ease;
89
+ }
90
+
91
+ .btn-main:hover {
92
+ transform: scale(1.1); /* Zoom effect */
93
+ }
94
+
95
+ /* PAGE B SPECIFIC */
96
+ #page-b {
97
+ justify-content: space-evenly; /* Distribute vertical space */
98
+ padding-bottom: 20px;
99
+ }
100
+
101
+ /* 1. Display Area */
102
+ #display-area {
103
+ width: 60%;
104
+ height: 50%; /* Takes up half the page height */
105
+ border: 2px solid #ddd;
106
+ border-radius: 12px;
107
+ background-color: #fff;
108
+ display: flex;
109
+ align-items: center;
110
+ justify-content: center;
111
+ color: #555;
112
+ font-size: 24px;
113
+ position: relative;
114
+ }
115
+
116
+ /* 2. Timeline Area */
117
+ #timeline-area {
118
+ width: 60%;
119
+ height: 80px;
120
+ position: relative;
121
+ display: flex;
122
+ flex-direction: column;
123
+ justify-content: flex-end;
124
+ }
125
+
126
+ .timeline-label {
127
+ position: absolute;
128
+ top: 0;
129
+ left: 0;
130
+ color: #888;
131
+ font-size: 14px;
132
+ }
133
+
134
+ #timeline-line {
135
+ width: 100%;
136
+ height: 2px;
137
+ background-color: #87CEEB; /* Light blue */
138
+ }
139
+
140
+ /* 3. Control Panel */
141
+ #control-panel {
142
+ display: flex;
143
+ gap: 20px;
144
+ width: 60%;
145
+ justify-content: space-between;
146
+ }
147
+
148
+ .action-btn {
149
+ flex: 1; /* Evenly distributed width */
150
+ padding: 12px 0;
151
+ border: none;
152
+ border-radius: 12px;
153
+ font-size: 16px;
154
+ font-family: 'Nunito', sans-serif;
155
+ font-weight: 700;
156
+ cursor: pointer;
157
+ color: white;
158
+ transition: opacity 0.2s;
159
+ }
160
+
161
+ .action-btn:hover {
162
+ opacity: 0.9;
163
+ }
164
+
165
+ .action-btn.green { background-color: #28a745; }
166
+ .action-btn.yellow { background-color: #ffc107; color: #333; }
167
+ .action-btn.blue { background-color: #17a2b8; }
168
+ .action-btn.red { background-color: #dc3545; }
169
+
170
+ /* 4. Frame Control */
171
+ #frame-control {
172
+ display: flex;
173
+ align-items: center;
174
+ gap: 15px;
175
+ color: #333;
176
+ font-weight: bold;
177
+ }
178
+
179
+ #frame-slider {
180
+ width: 200px;
181
+ cursor: pointer;
182
+ }
183
+
184
+ #frame-input {
185
+ width: 50px;
186
+ padding: 5px;
187
+ border: 1px solid #ccc;
188
+ border-radius: 5px;
189
+ text-align: center;
190
+ font-family: 'Nunito', sans-serif;
191
+ }