Skip to content

Commit cb9dee4

Browse files
Merge PR #888 - refine modal close buttons
2 parents ed83798 + 6c05613 commit cb9dee4

3 files changed

Lines changed: 69 additions & 53 deletions

File tree

‎frontend/css/style.css‎

Lines changed: 67 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2077,19 +2077,45 @@ main {
20772077
}
20782078

20792079
.close-genre-modal {
2080-
background: none;
2081-
border: none;
2080+
width: 44px;
2081+
height: 44px;
2082+
background: transparent;
2083+
border: 1px solid transparent;
20822084
font-size: 1.5rem;
2083-
color: var(--text-main);
2085+
color: var(--text-muted, rgba(0, 0, 0, 0.6));
20842086
cursor: pointer;
2085-
padding: 0.5rem;
2087+
padding: 0;
2088+
line-height: 1;
20862089
border-radius: 50%;
2087-
transition: all 0.2s ease;
2090+
flex-shrink: 0;
2091+
aspect-ratio: 1 / 1;
2092+
display: flex;
2093+
align-items: center;
2094+
justify-content: center;
2095+
transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
20882096
}
20892097

20902098
.close-genre-modal:hover {
2091-
background: rgba(0, 0, 0, 0.1);
2092-
transform: rotate(90deg);
2099+
background-color: rgba(220, 53, 69, 0.08);
2100+
color: #c9302c;
2101+
transform: scale(1.04);
2102+
}
2103+
2104+
.close-genre-modal:active {
2105+
transform: scale(0.96);
2106+
}
2107+
2108+
[data-theme="night"] .close-genre-modal {
2109+
background-color: transparent;
2110+
border: 1px solid transparent;
2111+
color: rgba(255, 255, 255, 0.7);
2112+
}
2113+
2114+
[data-theme="night"] .close-genre-modal:hover {
2115+
background-color: rgba(255, 99, 104, 0.12);
2116+
border-color: rgba(255, 99, 104, 0.25);
2117+
color: #ffb3b3;
2118+
transform: scale(1.04);
20932119
}
20942120

20952121
.genre-modal-body {
@@ -2659,28 +2685,48 @@ main {
26592685

26602686
.modal-close-btn {
26612687
position: absolute;
2662-
top: 10px;
2663-
right: 10px;
2688+
top: 15px;
2689+
right: 15px;
26642690
width: 36px;
26652691
height: 36px;
2666-
font-size: 1rem;
26672692
border-radius: 50%;
2668-
background: var(--glass-bg);
2669-
border: 1px solid var(--glass-border);
2670-
cursor: pointer;
2693+
flex-shrink: 0;
2694+
aspect-ratio: 1 / 1;
26712695
display: flex;
26722696
align-items: center;
26732697
justify-content: center;
2674-
font-size: 1.5rem;
2675-
color: var(--text-muted);
2676-
transition: all 0.3s ease;
2677-
z-index: 10;
2698+
padding: 0;
2699+
font-size: 1.25rem;
2700+
line-height: 1;
2701+
cursor: pointer;
2702+
z-index: 100;
2703+
transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
2704+
background-color: transparent;
2705+
border: 1px solid transparent;
2706+
color: var(--text-muted, rgba(0, 0, 0, 0.6));
26782707
}
26792708

26802709
.modal-close-btn:hover {
2681-
background: var(--accent-gold);
2682-
color: white;
2683-
transform: rotate(90deg);
2710+
background-color: rgba(220, 53, 69, 0.08);
2711+
color: #c9302c;
2712+
transform: scale(1.04);
2713+
}
2714+
2715+
.modal-close-btn:active {
2716+
transform: scale(0.96);
2717+
}
2718+
2719+
[data-theme="night"] .modal-close-btn {
2720+
background-color: transparent;
2721+
border: 1px solid transparent;
2722+
color: rgba(255, 255, 255, 0.7);
2723+
}
2724+
2725+
[data-theme="night"] .modal-close-btn:hover {
2726+
background-color: rgba(255, 99, 104, 0.12);
2727+
border-color: rgba(255, 99, 104, 0.25);
2728+
color: #ffb3b3;
2729+
transform: scale(1.04);
26842730
}
26852731

26862732
.book-detail-grid {
@@ -3820,30 +3866,7 @@ main {
38203866
pointer-events: auto;
38213867
}
38223868

3823-
#modal-close-btn {
3824-
position: absolute;
3825-
top: 10px;
3826-
right: 10px;
3827-
background: rgba(255, 255, 255, 0.1);
3828-
border: 1px solid rgba(255, 255, 255, 0.2);
3829-
color: #fff;
3830-
width: 32px;
3831-
height: 32px;
3832-
border-radius: 50%;
3833-
font-size: 0.9rem;
3834-
cursor: pointer;
3835-
z-index: 2005;
3836-
transition: all 0.3s ease;
3837-
pointer-events: auto;
3838-
display: flex;
3839-
align-items: center;
3840-
justify-content: center;
3841-
}
38423869

3843-
#modal-close-btn:hover {
3844-
background: rgba(255, 255, 255, 0.25);
3845-
transform: rotate(90deg);
3846-
}
38473870

38483871
.book-expanded-layout {
38493872
display: flex;
@@ -4320,14 +4343,7 @@ main {
43204343
max-height: 300px;
43214344
}
43224345

4323-
#modal-close-btn {
4324-
top: 15px;
4325-
right: 15px;
4326-
background: rgba(0, 0, 0, 0.5);
4327-
/* Contrast on white if scrolled */
4328-
position: fixed;
4329-
/* Keep it visible */
4330-
}
4346+
43314347
}
43324348

43334349
/* 404 Page Styles */

‎frontend/css/style_main.css‎

-3.22 KB
Binary file not shown.

‎frontend/pages/library.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ <h1 id="selected-collection-name" style="font-family: 'Playfair Display', serif;
330330

331331
<!-- Book Detail Modal -->
332332
<div class="book-detail-modal" id="book-detail-modal">
333-
<button class="modal-close-btn" id="modal-close-btn" title="Close details">
334-
<i class="fa-solid fa-times"></i>
333+
<button class="modal-close-btn" id="modal-close-btn" aria-label="Close details" title="Close details">
334+
<i class="fa-solid fa-xmark"></i>
335335
</button>
336336
<div class="book-detail-content">
337337
<div class="book-expanded-layout">

0 commit comments

Comments
 (0)