Skip to content

Commit 59eb079

Browse files
lenis2000claude
andcommitted
Fix search bar layout and add icon rotation animation
- Move search icon to the right of the text field using input-group - Add smooth rotation animation when toggling between sun/moon icons - Style search input for both light and dark modes - Ensure search button aligns properly with input field Co-authored-by: Claude <noreply@anthropic.com> 🤖 Generated with Claude Code
1 parent d4f4aa3 commit 59eb079

File tree

3 files changed

+66
-10
lines changed

3 files changed

+66
-10
lines changed

_includes/footer.html

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,23 @@
8787

8888
icons.forEach(icon => {
8989
if (icon) {
90-
if (theme === 'dark') {
91-
icon.classList.remove('fa-sun');
92-
icon.classList.add('fa-moon');
93-
} else {
94-
icon.classList.remove('fa-moon');
95-
icon.classList.add('fa-sun');
96-
}
90+
// Add rotation animation
91+
icon.style.transform = 'rotate(180deg)';
92+
93+
setTimeout(() => {
94+
if (theme === 'dark') {
95+
icon.classList.remove('fa-sun');
96+
icon.classList.add('fa-moon');
97+
} else {
98+
icon.classList.remove('fa-moon');
99+
icon.classList.add('fa-sun');
100+
}
101+
102+
// Reset rotation after icon change
103+
setTimeout(() => {
104+
icon.style.transform = '';
105+
}, 10);
106+
}, 150);
97107
}
98108
});
99109
}

_includes/top_brand.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@
2121
<div class="navbar-nav me-auto">
2222
</div>
2323

24-
<form class="form-inline mt-2 mt-md-0 d-none d-md-block" id="search_form" name="q">
25-
<input class="form-control input-lg me-sm-2" type="text" id="q" placeholder="UVA Search">
26-
<button class="bg-inverse my-2 my-sm-0" style="border:none;" type="submit" value=""><img src="{{site.url}}/img/brand/search.png" style="width:30px" alt="UVA Search" title="UVA Search"></button>
24+
<form class="form-inline mt-2 mt-md-0 d-none d-md-block d-flex align-items-center" id="search_form" name="q">
25+
<div class="input-group">
26+
<input class="form-control" type="text" id="q" placeholder="UVA Search">
27+
<button class="btn bg-inverse" style="border:none;" type="submit" value="">
28+
<img src="{{site.url}}/img/brand/search.png" style="width:24px" alt="UVA Search" title="UVA Search">
29+
</button>
30+
</div>
2731
</form>
2832
</div>
2933
</div>

css/main.css

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,15 @@ footer {
624624
z-index: 1000;
625625
}
626626

627+
/* Icon animation */
628+
.theme-toggle-single i {
629+
transition: transform 0.3s ease;
630+
}
631+
632+
.theme-toggle-single:active i {
633+
transform: rotate(180deg) scale(0.9);
634+
}
635+
627636
/* In light navbar */
628637
.navbar-light .theme-toggle-single {
629638
background-color: rgba(0, 47, 108, 0.1);
@@ -685,6 +694,39 @@ footer {
685694
align-items: center;
686695
}
687696

697+
/* Search form styling */
698+
#search_form .input-group {
699+
max-width: 300px;
700+
}
701+
702+
#search_form .input-group .form-control {
703+
border-right: none;
704+
border-top-right-radius: 0;
705+
border-bottom-right-radius: 0;
706+
}
707+
708+
#search_form .input-group .btn {
709+
border-left: 1px solid #ced4da;
710+
border-top-left-radius: 0;
711+
border-bottom-left-radius: 0;
712+
padding: 0.375rem 0.75rem;
713+
}
714+
715+
/* Dark mode search form */
716+
[data-theme="dark"] #search_form .input-group .form-control {
717+
background-color: rgba(255, 255, 255, 0.1);
718+
border-color: rgba(255, 255, 255, 0.2);
719+
color: #e8e8e8;
720+
}
721+
722+
[data-theme="dark"] #search_form .input-group .form-control::placeholder {
723+
color: rgba(255, 255, 255, 0.5);
724+
}
725+
726+
[data-theme="dark"] #search_form .input-group .btn {
727+
border-left-color: rgba(255, 255, 255, 0.2);
728+
}
729+
688730
/* Orange items in dark mode */
689731
[data-theme="dark"] .orange-item {
690732
background-color: #d14900; /* Darker orange for dark mode */

0 commit comments

Comments
 (0)