Added Events Hub in navbar with ripple effect#290
Added Events Hub in navbar with ripple effect#290DevanshSharma351 wants to merge 3 commits intoIEEE-NITK:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds an "Events Hub" link as the first item in the Events dropdown menu in the navbar. The link includes a visually distinctive wave animation effect where each letter animates independently, intended to draw user attention to the main events page.
Key Changes:
- Added a new navigation link labeled "Events Hub" that redirects to the newsletter home page
- Implemented a wave animation effect using character-by-character span elements with CSS custom properties
- Added inline CSS styles for the animation directly in the template
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| .wave-text span { | ||
| display: inline-block; | ||
| animation: wave 4s ease-in-out infinite; | ||
| animation-delay: calc(.1s * var(--i)); | ||
| font-weight: 800; | ||
| } | ||
| .events-hub-link:hover .wave-text span { | ||
| animation: wave 2.5s ease-in-out infinite; | ||
| animation-delay: calc(.08s * var(--i)); | ||
| } | ||
| @keyframes wave { | ||
| 0%, 30%, 100% { transform: translateY(0); } | ||
| 15% { transform: translateY(-12px); } | ||
| } |
There was a problem hiding this comment.
The wave animation runs continuously (infinite) for all users, which can be distracting and problematic for users with vestibular disorders or motion sensitivity. Consider respecting the user's motion preferences by adding a CSS media query to disable animations when users have prefers-reduced-motion enabled. Additionally, the animation should ideally only trigger on hover or focus rather than running infinitely by default.
| <span class="wave-text"> | ||
| <span style="--i:0">E</span><span style="--i:1">v</span><span style="--i:2">e</span><span style="--i:3">n</span><span style="--i:4">t</span><span style="--i:5">s</span><span style="--i:6"> </span><span style="--i:7">H</span><span style="--i:8">u</span><span style="--i:9">b</span> |
There was a problem hiding this comment.
Splitting each character into individual span elements with inline styles creates significant HTML bloat and reduces maintainability. The text "Events Hub" is hard-coded character by character with CSS custom properties, making it difficult to update the text or reuse this pattern. Consider using a JavaScript solution or CSS that applies to the text as a whole, or at minimum, generate these spans dynamically if this pattern needs to be reused.
| animation: wave 4s ease-in-out infinite; | ||
| animation-delay: calc(.1s * var(--i)); | ||
| font-weight: 800; | ||
| } | ||
| .events-hub-link:hover .wave-text span { |
There was a problem hiding this comment.
The continuously running animation on multiple DOM elements causes unnecessary repaints and reflows, impacting page performance. This is especially noticeable on lower-end devices or when multiple dropdown menus are open. Consider removing the default infinite animation and only applying the wave effect on user interaction (hover/focus).
| animation: wave 4s ease-in-out infinite; | |
| animation-delay: calc(.1s * var(--i)); | |
| font-weight: 800; | |
| } | |
| .events-hub-link:hover .wave-text span { | |
| font-weight: 800; | |
| } | |
| .events-hub-link:hover .wave-text span, | |
| .events-hub-link:focus-visible .wave-text span { |
| <style> | ||
| .wave-text { display: inline-flex; font-weight: bold; } | ||
| .wave-text span { | ||
| display: inline-block; | ||
| animation: wave 4s ease-in-out infinite; | ||
| animation-delay: calc(.1s * var(--i)); | ||
| font-weight: 800; | ||
| } | ||
| .events-hub-link:hover .wave-text span { | ||
| animation: wave 2.5s ease-in-out infinite; | ||
| animation-delay: calc(.08s * var(--i)); | ||
| } | ||
| @keyframes wave { | ||
| 0%, 30%, 100% { transform: translateY(0); } | ||
| 15% { transform: translateY(-12px); } | ||
| } | ||
| </style> | ||
|
|
There was a problem hiding this comment.
The CSS styles should be moved to the existing navbar.css file instead of being embedded in the template. This follows the project's existing pattern where navbar-related styles are centralized in corpus/templates/static/css/navbar.css, improving maintainability and separation of concerns.
| <style> | |
| .wave-text { display: inline-flex; font-weight: bold; } | |
| .wave-text span { | |
| display: inline-block; | |
| animation: wave 4s ease-in-out infinite; | |
| animation-delay: calc(.1s * var(--i)); | |
| font-weight: 800; | |
| } | |
| .events-hub-link:hover .wave-text span { | |
| animation: wave 2.5s ease-in-out infinite; | |
| animation-delay: calc(.08s * var(--i)); | |
| } | |
| @keyframes wave { | |
| 0%, 30%, 100% { transform: translateY(0); } | |
| 15% { transform: translateY(-12px); } | |
| } | |
| </style> |
|
The color fill when not hovered upon is blending with the bg, make it a darker shade so it is more visible |
|
Okay, now in the later commit I have increased the density of both the colour effects when duller in the unhovered state so it does not mix with their bg , also i removed the 2 colours switching when hovered as keeping it plain make it more professional. Screen.Recording.2025-12-31.at.10.45.52.AM.mov |
…palette to make it look more professional
Description
I added the Events hub access to the events dropdown from the nav bar. Also to make it eye-catching I added ripple effect to it, it would redirect to the what's new page of events. Resources -Google for ripple effect
Fixes # (issue)
Dependencies
N/A
List any dependencies that are required for this change.
N/A
Type of Change
What types of changes does your code introduce?
Put an
xin the boxes that applyHow Has This Been Tested?
Added the new list element and fixed up the broken CSS due to the ripple effect eventually after testing all CSS was working fine
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Screen.Recording.2025-12-24.at.10.50.20.PM.mov