Skip to content

Commit e97e9ab

Browse files
committed
Minor UI updates.
Signed-off-by: James R. Perkins <jperkins@ibm.com>
1 parent 3ab26fd commit e97e9ab

3 files changed

Lines changed: 77 additions & 6 deletions

File tree

public/css/bootstrap-theme.css

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,18 @@ h4 {
8080
margin-top: 0 !important;
8181
}
8282

83+
/* ============================================
84+
LINKS - Modern hover behavior
85+
============================================ */
86+
a {
87+
text-decoration: none !important;
88+
transition: all 0.15s ease !important;
89+
}
90+
91+
a:hover {
92+
text-decoration: underline !important;
93+
}
94+
8395
/* Dark mode heading colors */
8496
[data-bs-theme="dark"] h1 {
8597
color: #e6edf3 !important;
@@ -1680,11 +1692,14 @@ table tbody tr:last-child td,
16801692
color: #e6edf3 !important;
16811693
}
16821694

1683-
[data-bs-theme="dark"] p,
1684-
[data-bs-theme="dark"] a {
1695+
[data-bs-theme="dark"] p {
16851696
color: #c9d1d9 !important;
16861697
}
16871698

1699+
[data-bs-theme="dark"] a {
1700+
color: var(--resteasy-accent) !important;
1701+
}
1702+
16881703
[data-bs-theme="dark"] a:hover {
16891704
color: var(--resteasy-accent-light) !important;
16901705
}
Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
/**
2-
* RESTEasy Theme Switcher
3-
* Toggles between light and dark modes using Bootstrap's data-bs-theme
2+
* RESTEasy Site JavaScript
3+
* Main JavaScript file containing theme switcher, navigation, and interactive features
44
*/
55

6+
/**
7+
* Theme Switcher
8+
* Toggles between light and dark modes using Bootstrap's data-bs-theme
9+
*/
610
(function() {
711
'use strict';
812

@@ -151,3 +155,55 @@
151155
});
152156
});
153157
})();
158+
159+
/**
160+
* Clickable News Cards
161+
* Makes entire news/blog cards clickable while maintaining link accessibility
162+
*/
163+
(function() {
164+
'use strict';
165+
166+
document.addEventListener('DOMContentLoaded', () => {
167+
// Select all news/blog cards
168+
const cards = document.querySelectorAll('.news-list-blocks .card, .blog-post-card');
169+
170+
cards.forEach(card => {
171+
// Find the main link (either in title or "Read More")
172+
const link = card.querySelector('.card-title a, .post-title a, a[href*="/posts/"]');
173+
174+
if (link) {
175+
// Make the card clickable
176+
card.style.cursor = 'pointer';
177+
178+
card.addEventListener('click', (e) => {
179+
// Don't trigger if clicking on an actual link (let the link handle it)
180+
if (e.target.tagName === 'A') {
181+
return;
182+
}
183+
184+
// Respect modifier keys (cmd/ctrl click for new tab, etc.)
185+
if (e.metaKey || e.ctrlKey) {
186+
window.open(link.href, '_blank');
187+
} else {
188+
window.location.href = link.href;
189+
}
190+
});
191+
192+
// Improve accessibility - make cards keyboard navigable
193+
card.setAttribute('tabindex', '0');
194+
card.setAttribute('role', 'article');
195+
196+
// Handle keyboard navigation (Enter key)
197+
card.addEventListener('keydown', (e) => {
198+
if (e.key === 'Enter') {
199+
if (e.metaKey || e.ctrlKey) {
200+
window.open(link.href, '_blank');
201+
} else {
202+
window.location.href = link.href;
203+
}
204+
}
205+
});
206+
}
207+
});
208+
});
209+
})();

templates/partials/head.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
3333
crossorigin="anonymous"></script>
3434

35-
<!-- Theme Toggle -->
36-
<script src="{site.url('/js/theme-toggle.js').absolute}"></script>
35+
<!-- Site JavaScript -->
36+
<script src="{site.url('/js/site.js').absolute}"></script>
3737
</head>

0 commit comments

Comments
 (0)