feat: Implement view transitions for smoother navigation
- Added `useViewTransitions` hook to enable view transitions in the app. - Created `useNavigateWithTransition` for navigation with transitions. - Integrated view transitions in `ClientRoot`, `HomeTab`, `InboxTab`, and `SettingsTab`. - Introduced `AnimatedOutlet` and `RouteTransition` components for route-based animations. - Enhanced CSS for transitions and added a new `twilightTheme`. - Updated Vite configuration to serve sound and font assets. - Added support for reaction notifications in the room utility. - Created `DirectList` and related components for direct messaging functionality.
This commit is contained in:
160
src/index.css
160
src/index.css
@@ -48,7 +48,8 @@
|
||||
.dark-theme,
|
||||
.butter-theme,
|
||||
.discord-theme,
|
||||
.discord-darker-theme {
|
||||
.discord-darker-theme,
|
||||
.twilight-theme {
|
||||
--tc-link: hsl(213deg 100% 80%);
|
||||
|
||||
--mx-uc-1: hsl(208, 100%, 75%);
|
||||
@@ -111,6 +112,9 @@ body.discord-theme {
|
||||
body.discord-darker-theme {
|
||||
background-color: #1E1F22;
|
||||
}
|
||||
body.twilight-theme {
|
||||
background: linear-gradient(135deg, #14121F 0%, #1C1A2E 50%, #24223D 100%);
|
||||
}
|
||||
#root {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
@@ -119,6 +123,160 @@ body.discord-darker-theme {
|
||||
background-color: #262626;
|
||||
}
|
||||
|
||||
.twilight-theme #root {
|
||||
background: linear-gradient(180deg, rgba(28, 26, 46, 0.5) 0%, rgba(36, 34, 61, 0.3) 100%);
|
||||
}
|
||||
|
||||
/* Twilight theme gradient overlays */
|
||||
.twilight-theme [role="navigation"],
|
||||
.twilight-theme aside {
|
||||
background: linear-gradient(180deg, rgba(20, 18, 31, 0.8) 0%, rgba(28, 26, 46, 0.9) 100%);
|
||||
backdrop-filter: blur(8px);
|
||||
}
|
||||
|
||||
.twilight-theme main {
|
||||
background: linear-gradient(135deg, rgba(24, 22, 45, 0.4) 0%, rgba(36, 34, 61, 0.3) 100%);
|
||||
}
|
||||
|
||||
.twilight-theme header {
|
||||
background: linear-gradient(90deg, rgba(20, 18, 31, 0.9) 0%, rgba(28, 26, 46, 0.8) 100%);
|
||||
}
|
||||
|
||||
/* CSS animations for route transitions */
|
||||
@keyframes fadeSlideIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateX(20px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Apply transition to route changes - works on ALL themes */
|
||||
[data-route-transition="true"] {
|
||||
animation: fadeSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
/* Twilight theme enhanced transitions */
|
||||
.twilight-theme [data-route-transition="true"] {
|
||||
animation: fadeSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
/* Also apply to main content areas for double coverage */
|
||||
.twilight-theme [data-room-view],
|
||||
.twilight-theme [data-space-view],
|
||||
.twilight-theme [data-inbox-view],
|
||||
.twilight-theme [data-explore-view] {
|
||||
animation: fadeSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
/* Smooth transitions for interactive elements */
|
||||
.twilight-theme button,
|
||||
.twilight-theme [role="button"],
|
||||
.twilight-theme a,
|
||||
.twilight-theme input,
|
||||
.twilight-theme textarea {
|
||||
transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
|
||||
}
|
||||
|
||||
.twilight-theme button:hover,
|
||||
.twilight-theme [role="button"]:hover {
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.twilight-theme button:active,
|
||||
.twilight-theme [role="button"]:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
/* Message transitions */
|
||||
.twilight-theme [data-message-item] {
|
||||
transition: background-color 0.2s ease, transform 0.2s ease;
|
||||
}
|
||||
|
||||
.twilight-theme [data-message-item]:hover {
|
||||
background: linear-gradient(90deg, rgba(62, 58, 106, 0.15) 0%, rgba(86, 80, 150, 0.1) 100%);
|
||||
transform: translateX(2px);
|
||||
}
|
||||
|
||||
/* Selected item indicator */
|
||||
.twilight-theme [data-selected="true"],
|
||||
.twilight-theme [aria-selected="true"],
|
||||
.twilight-theme [aria-current="true"] {
|
||||
position: relative;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.twilight-theme [data-selected="true"]::before,
|
||||
.twilight-theme [aria-selected="true"]::before,
|
||||
.twilight-theme [aria-current="true"]::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 3px;
|
||||
background: linear-gradient(180deg, #8B7FFF 0%, #6E62E8 100%);
|
||||
transition: width 0.2s ease;
|
||||
}
|
||||
|
||||
/* Scrollbar styling */
|
||||
.twilight-theme ::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
.twilight-theme ::-webkit-scrollbar-track {
|
||||
background: rgba(20, 18, 31, 0.5);
|
||||
}
|
||||
|
||||
.twilight-theme ::-webkit-scrollbar-thumb {
|
||||
background: linear-gradient(180deg, #3E3A6A 0%, #565096 100%);
|
||||
border-radius: 5px;
|
||||
border: 2px solid rgba(20, 18, 31, 0.5);
|
||||
transition: background 0.2s ease;
|
||||
}
|
||||
|
||||
.twilight-theme ::-webkit-scrollbar-thumb:hover {
|
||||
background: linear-gradient(180deg, #4A4580 0%, #625BAC 100%);
|
||||
}
|
||||
|
||||
/* Subtle dot pattern overlay */
|
||||
.twilight-theme::after {
|
||||
content: '';
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background-image: radial-gradient(rgba(139, 127, 255, 0.03) 1px, transparent 1px);
|
||||
background-size: 24px 24px;
|
||||
pointer-events: none;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.twilight-theme #root {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* Focus states */
|
||||
.twilight-theme input:focus,
|
||||
.twilight-theme textarea:focus,
|
||||
.twilight-theme button:focus-visible {
|
||||
outline: 2px solid rgba(139, 127, 255, 0.5);
|
||||
outline-offset: 2px;
|
||||
transition: outline 0.2s ease;
|
||||
}
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
|
||||
Reference in New Issue
Block a user