Skip to content

Commit 2ef8c40

Browse files
committed
added animation
Signed-off-by: Vedansh Saini <[email protected]>
1 parent a9ad934 commit 2ef8c40

File tree

3 files changed

+47
-2
lines changed

3 files changed

+47
-2
lines changed

src/index.css

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,4 +338,30 @@ body,input,div,h3,h4,p,label,hr, #scrumReport{
338338

339339
.dark-mode .tooltip-container.tooltip-right .tooltip-bubble::after {
340340
border-color: transparent #374151 transparent transparent;
341+
}
342+
#toggleTokenVisibility {
343+
background: none;
344+
border: none;
345+
cursor: pointer;
346+
margin-left: 8px;
347+
padding: 0;
348+
line-height: 1;
349+
}
350+
#tokenEyeIcon {
351+
font-size: 18px;
352+
vertical-align: middle;
353+
}
354+
@keyframes eye-rotate {
355+
0% { transform: rotate(0deg);}
356+
60% { transform: rotate(180deg);}
357+
100% { transform: rotate(180deg);}
358+
}
359+
.eye-animating {
360+
animation: eye-rotate 0.4s cubic-bezier(0.4,0,0.2,1);
361+
}
362+
.token-animating {
363+
transition: box-shadow 0.3s, background 0.3s, color 0.3s, opacity 0.3s, transform 0.3s;
364+
box-shadow: 0 0 0 2px #3b82f6;
365+
opacity: 0.7;
366+
transform: translateX(8px) scale(1.03);
341367
}

src/popup.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,13 @@ <h6 class="text-base font-semibold">Scrum Report</h6>
112112
<div id="settingsSection" class="tab-content hidden">
113113

114114
<div class="">
115-
<div>
115+
<div class="flex items-center justify-between">
116116
<h4>Your Github Token</h4>
117-
<input id="githubToken" type="text" class="w-full border-2 border-gray-200 bg-gray-200 rounded-xl text-gray-800 p-2 my-2" placeholder="Required for making authenticated requests">
117+
<button id="toggleTokenVisibility" type="button" class="focus:outline-none">
118+
<i id="tokenEyeIcon" class="fa fa-eye text-gray-600"></i>
119+
</button>
118120
</div>
121+
<input id="githubToken" type="password" class="w-full border-2 border-gray-200 bg-gray-200 rounded-xl text-gray-800 p-2 my-2 pr-10" placeholder="Required for making authenticated requests">
119122
<p class="text-sm font-medium">Enter cache TTL <span class="text-sm text-gray-800 font-normal">(in minutes)</span>
120123
<span class="tooltip-container">
121124
<i class="fa fa-question-circle question-icon"></i>

src/scripts/popup.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ document.addEventListener('DOMContentLoaded', function() {
4747
const darkModeToggle = document.querySelector('img[alt="Night Mode"]');
4848
const settingsIcon = document.getElementById('settingsIcon');
4949
const body = document.body;
50+
const githubTokenInput = document.getElementById('githubToken');
51+
const toggleTokenBtn = document.getElementById('toggleTokenVisibility');
52+
const tokenEyeIcon = document.getElementById('tokenEyeIcon');
53+
let tokenVisible = false;
5054

5155
chrome.storage.local.get(['darkMode'], function(result) {
5256
if(result.darkMode) {
@@ -58,6 +62,18 @@ document.addEventListener('DOMContentLoaded', function() {
5862
}
5963
});
6064

65+
toggleTokenBtn.addEventListener('click', function() {
66+
tokenVisible = !tokenVisible;
67+
githubTokenInput.type = tokenVisible ? 'text' : 'password';
68+
69+
tokenEyeIcon.classList.add('eye-animating');
70+
setTimeout(() => tokenEyeIcon.classList.remove('eye-animating'), 400);
71+
tokenEyeIcon.className = tokenVisible ? 'fa fa-eye-slash text-gray-600' : 'fa fa-eye text-gray-600';
72+
73+
githubTokenInput.classList.add('token-animating');
74+
setTimeout(() => githubTokenInput.classList.remove('token-animating'), 300);
75+
});
76+
6177
darkModeToggle.addEventListener('click', function() {
6278
body.classList.toggle('dark-mode');
6379
const isDarkMode = body.classList.contains('dark-mode');

0 commit comments

Comments
 (0)