File size: 6,927 Bytes
93243e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108bcb4
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
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>TimeWizard ⏳✨</title>
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
  <script src="https://cdn.tailwindcss.com"></script>
  <link rel="stylesheet" href="popup.css">
</head>
<body>
  <!-- Login Screen -->
  <div id="loginScreen" class="screen">
    <div class="header">
      <h1 class="text-3xl font-bold text-gradient bg-gradient-to-r from-purple-600 to-blue-500">
        <i class="fas fa-hat-wizard mr-2"></i>TimeWizard
      </h1>
      <p class="text-sm text-gray-400 mt-1">Track time like magic!</p>
    </div>
<div class="content">
      <div class="form-group space-y-2">
        <label class="text-sm font-medium text-gray-600">API Endpoint <i class="fas fa-info-circle text-blue-400 ml-1" title="Your timesheet API URL"></i></label>
        <div class="relative">
          <input type="text" id="apiUrl" class="input-field" placeholder="http://localhost:3000" value="http://localhost:3000">
          <i class="fas fa-link absolute right-3 top-3 text-gray-400"></i>
        </div>
      </div>
      <div class="form-group space-y-2">
        <label class="text-sm font-medium text-gray-600">Email</label>
        <div class="relative">
          <input type="email" id="email" class="input-field" placeholder="your@email.com">
          <i class="fas fa-envelope absolute right-3 top-3 text-gray-400"></i>
        </div>
      </div>
      <div class="form-group space-y-2">
        <label class="text-sm font-medium text-gray-600">Password</label>
        <div class="relative">
          <input type="password" id="password" class="input-field" placeholder="••••••••">
          <i class="fas fa-lock absolute right-3 top-3 text-gray-400"></i>
        </div>
      </div>
      <button id="loginBtn" class="btn btn-primary w-full py-3 mt-4">
        <i class="fas fa-sign-in-alt mr-2"></i>Login
      </button>
<div id="loginError" class="error-message"></div>
    </div>
  </div>

  <!-- Main Timer Screen -->
  <div id="timerScreen" class="screen" style="display: none;">
    <div class="header flex justify-between items-center">
      <div class="user-info flex items-center">
        <div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center mr-2">
          <i class="fas fa-user text-blue-500"></i>
        </div>
        <span id="userName" class="font-medium"></span>
      </div>
      <button id="logoutBtn" class="btn-icon" title="Logout">
        <i class="fas fa-sign-out-alt text-gray-500 hover:text-red-500 transition"></i>
      </button>
    </div>
<div class="content">
      <!-- Project Selection -->
      <div class="form-group space-y-2">
        <label class="text-sm font-medium text-gray-600">Project <span class="text-red-500">*</span></label>
        <div class="relative">
          <select id="projectSelect" class="select-input">
            <option value="">Select a project...</option>
          </select>
          <i class="fas fa-chevron-down absolute right-3 top-3 pointer-events-none text-gray-400"></i>
        </div>
      </div>

      <!-- Task Type Selection -->
      <div class="form-group space-y-2" id="taskTypeGroup" style="display: none;">
        <label class="text-sm font-medium text-gray-600">Task Type</label>
        <div class="relative">
          <select id="taskTypeSelect" class="select-input">
            <option value="">Select task type...</option>
          </select>
          <i class="fas fa-chevron-down absolute right-3 top-3 pointer-events-none text-gray-400"></i>
        </div>
      </div>
      <!-- Circular Timer -->
      <div class="timer-container relative w-48 h-48 mx-auto my-6">
        <svg class="timer-circle w-full h-full" viewBox="0 0 200 200">
          <circle class="timer-bg" cx="100" cy="100" r="85" stroke-width="8" stroke="#E5E7EB"></circle>
          <circle class="timer-progress" cx="100" cy="100" r="85" stroke-width="8" stroke="#3B82F6" stroke-linecap="round" transform="rotate(-90 100 100)"></circle>
        </svg>
        <div class="timer-content absolute inset-0 flex flex-col items-center justify-center">
          <div class="timer-display text-2xl font-bold tracking-tighter" id="timerDisplay">00:00:00</div>
          <div class="timer-project text-sm text-gray-500 mt-1 max-w-full px-4 truncate" id="currentProject">No project selected</div>
        </div>
      </div>
      <!-- Control Buttons -->
      <div class="controls flex justify-center space-x-4">
        <button id="startBtn" class="btn-action bg-green-500 hover:bg-green-600">
          <i class="fas fa-play mr-2"></i>
          <span>Start</span>
        </button>
        <button id="pauseBtn" class="btn-action bg-yellow-500 hover:bg-yellow-600" style="display: none;">
          <i class="fas fa-pause mr-2"></i>
          <span>Pause</span>
        </button>
        <button id="stopBtn" class="btn-action bg-red-500 hover:bg-red-600" style="display: none;">
          <i class="fas fa-stop mr-2"></i>
          <span>Save</span>
        </button>
      </div>
      <!-- Session History -->
      <div class="session-history mt-6 border-t border-gray-200 pt-4">
        <h3 class="text-lg font-semibold mb-3 flex items-center">
          <i class="fas fa-history mr-2 text-blue-500"></i>Today's Sessions
        </h3>
        <div id="sessionList" class="session-list space-y-2 max-h-40 overflow-y-auto pr-2"></div>
        <div class="total-time flex justify-between items-center mt-3 pt-3 border-t border-gray-100">
          <span class="font-medium">Total Today:</span>
          <span id="totalTime" class="font-bold text-blue-600">0h 0m</span>
        </div>
      </div>
      <!-- Settings Button -->
      <button id="settingsBtn" class="btn-text mt-4 text-gray-500 hover:text-blue-500 transition flex items-center justify-center">
        <i class="fas fa-cog mr-2"></i>Settings
      </button>
</div>
  </div>

  <!-- Settings Screen -->
  <div id="settingsScreen" class="screen" style="display: none;">
    <div class="header">
      <button id="backBtn" class="btn-icon">←</button>
      <h2>Settings</h2>
    </div>
    <div class="content">
      <div class="form-group">
        <label>API URL</label>
        <input type="text" id="settingsApiUrl" placeholder="http://localhost:3000">
      </div>
      <button id="saveSettingsBtn" class="btn btn-primary">Save Settings</button>
      <button id="clearDataBtn" class="btn btn-danger">Clear All Data</button>
    </div>
  </div>
  <script src="popup.js"></script>
  <script>
    document.addEventListener('DOMContentLoaded', () => {
      feather.replace();
    });
  </script>
</body>
</html>