diff --git a/css/auth.css b/css/auth.css index 7fad6dd..3cc8fc7 100644 --- a/css/auth.css +++ b/css/auth.css @@ -38,7 +38,7 @@ body { padding: 10px; border: 1px solid #ccc; border-radius: 3px; - font-size: 16px; + font-size: 14px; } .input-field:focus { @@ -62,4 +62,34 @@ body { .error-message { border: 1px solid #ff1717 !important; +} + +.loader { + border: 4px solid #97064557; + border-top: 4px solid #970645d1; + border-radius: 50%; + width: 50px; + height: 50px; + animation: spin 1s linear infinite; + top: 48%; + left: 48%; + display: block; + overflow: hidden; + position: absolute; +} + +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +} + +.background { + position: absolute; + width: 100%; + height: 100%; + background: #fff5eaed; +} + +.disabled { + display: none !important; } \ No newline at end of file diff --git a/css/popup.css b/css/popup.css index 99d2878..23bf9aa 100644 --- a/css/popup.css +++ b/css/popup.css @@ -10,43 +10,60 @@ body { .container { border-radius: 5px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); - padding: 5px 20px 20px 20px; + padding: 5px 20px 45px 20px; width: 340px; - min-height: 340px; text-align: center; + overflow: hidden; } .select-container { - margin-bottom: 20px; + margin-bottom: 10px; +} + +.form-control { + overflow: hidden; } select { width: 100%; - padding: 10px; + padding: 6px 10px; border: 1px solid #ccc; border-radius: 3px; font-size: 14px; + background: #fff; } select option:first-child { color: #6d6d6d; } +.select-block { + width: 70%; + float: left; +} button { background-color: #970645d1; color: #fff; - padding: 10px 20px; + padding: 10px; border: none; border-radius: 3px; cursor: pointer; font-size: 16px; + position: relative; } button:hover { background-color: #970645; } +button svg { + fill: #FFF; + position: absolute; + top: 6px; + right: 4px; +} + #resume-button, #pause-button { margin-top: 10px; @@ -55,11 +72,29 @@ button:hover { padding: 5px 15px; } +#resume-button, +#stop-button, +#pause-button { + padding: 16px; +} + +#resume-button svg, +#stop-button svg, +#pause-button svg { + top: 4px; + right: 4px; +} + #resume-button:hover, #pause-button:hover { background-color: #c99d9d; } +#action-button { + margin-left: 15px; + margin-top: 18px; +} + h1 { float: left; } @@ -90,7 +125,7 @@ h1 img { float: left; max-width: 80px; padding: 5px; - margin-bottom: 15px; + margin-bottom: 10px; } .loader { @@ -101,6 +136,7 @@ h1 img { height: 50px; animation: spin 1s linear infinite; margin: 50px auto; + overflow: hidden; } @keyframes spin { @@ -111,7 +147,7 @@ h1 img { #running-info { background: #fff; padding: 15px; - border-radius: 0px; + border-radius: 5px; position: relative; font-size: 14px; } @@ -119,6 +155,7 @@ h1 img { #running-info .btn-action { max-width: 30%; overflow: hidden; + margin-top: -8px; } #task-project, @@ -150,8 +187,9 @@ h1 img { #counter { font-size: 14px; - margin-top: -20px; + margin-top: 20px; text-align: left; + width: 100%; } #billable { diff --git a/scripts/auth.js b/scripts/auth.js index 09101ce..c0b20a0 100644 --- a/scripts/auth.js +++ b/scripts/auth.js @@ -13,6 +13,12 @@ async function auth() { try { var apiKey = document.getElementById("apiKey").value + if (!apiKey) { + return false; + } + + document.getElementById('bg').classList.remove('disabled'); + const headers = { 'X-Api-Key': apiKey, 'Content-Type': 'application/json', @@ -21,14 +27,23 @@ async function auth() { const response = await fetch(`${baseUrl}/user`, { headers }); if (!response.ok) { + document.getElementById('bg').classList.add('disabled'); throw new Error(`Authentication failed with status ${response.status}`); } value = btoa(apiKey); chrome.storage.local.set({ 'noffort_Caeth3Haileeko1r': value }, function () { + console.log('saved'); if (chrome.runtime.lastError) { + document.getElementById('bg').classList.add('disabled'); console.error('Error saving to Chrome storage: ', chrome.runtime.lastError); } else { + chrome.tabs.query({url : 'https://*.kanbanize.com/*'}, tabs => { + tabs.forEach((tab) => { + chrome.tabs.reload(tab.id); + }) + }); + chrome.tabs.getCurrent(function(tab) { chrome.tabs.remove(tab.id, function() { }); }); diff --git a/view/authentication.html b/view/authentication.html index 278d692..f0832fa 100644 --- a/view/authentication.html +++ b/view/authentication.html @@ -4,20 +4,22 @@ -
Provide your API key below to access the service.
+Provide your Clockify API KEY below to access the service.