Skip to content

Commit 00a07c0

Browse files
author
paullyy8
committed
update : adaptive button for smaller screen size
1 parent 65c15c6 commit 00a07c0

2 files changed

Lines changed: 67 additions & 1 deletion

File tree

index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ <h1><span class="material-icons-round">check_circle</span> Taskify</h1>
1919
<span class="material-icons-round light-icon">light_mode</span>
2020
</button>
2121
<button id="newTaskBtn" class="new-task-btn">
22-
<span class="material-icons-round">add</span> New Task
22+
<span class="material-icons-round icon-add">add</span>
23+
<span class="btn-text">New Task</span>
2324
</button>
2425
</div>
2526
</div>

styles.css

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,4 +659,69 @@ body {
659659
.filter-group {
660660
flex: 1 1 40%;
661661
}
662+
}
663+
/* New Task Button */
664+
.new-task-btn {
665+
background: var(--primary);
666+
color: var(--text);
667+
padding: 10px 16px;
668+
border: none;
669+
border-radius: 8px;
670+
cursor: pointer;
671+
font-weight: 500;
672+
font-size: 0.95rem;
673+
display: flex;
674+
align-items: center;
675+
gap: 6px;
676+
transition: var(--transition);
677+
position: relative;
678+
overflow: hidden;
679+
}
680+
681+
.new-task-btn:hover {
682+
background: var(--primary-dark);
683+
}
684+
685+
.new-task-btn .icon-add {
686+
display: flex;
687+
}
688+
689+
.new-task-btn .btn-text {
690+
transition: opacity 0.2s ease;
691+
}
692+
693+
/* Mobile adaptation */
694+
@media (max-width: 480px) {
695+
.new-task-btn {
696+
padding: 10px;
697+
width: 40px;
698+
justify-content: center;
699+
}
700+
701+
.new-task-btn .btn-text {
702+
position: absolute;
703+
opacity: 0;
704+
width: 0;
705+
}
706+
707+
.new-task-btn::after {
708+
content: attr(aria-label);
709+
position: absolute;
710+
background: rgba(0,0,0,0.8);
711+
color: white;
712+
padding: 4px 8px;
713+
border-radius: 4px;
714+
font-size: 0.8rem;
715+
bottom: -30px;
716+
left: 50%;
717+
transform: translateX(-50%);
718+
opacity: 0;
719+
transition: opacity 0.2s;
720+
pointer-events: none;
721+
white-space: nowrap;
722+
}
723+
724+
.new-task-btn:hover::after {
725+
opacity: 1;
726+
}
662727
}

0 commit comments

Comments
 (0)