ai-time-machine / static /css /tte_reference.css
manikandanj's picture
Prepare AI Time Machine hackathon Space
5862322 verified
Raw
History Blame Contribute Delete
15.8 kB
/* =============================================================================
TRANS-TEMPORAL EXPRESS β€” CSS Reference Stylesheet
This is a REFERENCE stylesheet showing the developer how to implement
the visual design system. It covers:
- Design tokens / CSS variables
- Cockpit frame layout
- Era sign styling
- Animation keyframes for all sequences
- State-driven transitions
- Overlay compositing
The developer should integrate these patterns into the existing
cockpit.css, adapting to the current DOM structure.
============================================================================= */
/* ─── DESIGN TOKENS ─── */
:root {
/* Colors */
--tte-brass: #C4943D;
--tte-amber: #D4A843;
--tte-burgundy: #6B2D3E;
--tte-copper: #B87333;
--tte-cyan: #8ED8D1;
--tte-cream: #F5E6C8;
--tte-dark: #1A0F08;
--tte-darker: #0A0605;
--tte-mahogany: #2A1810;
/* Glows */
--tte-glow-amber: rgba(212, 168, 67, 0.4);
--tte-glow-cyan: rgba(142, 216, 209, 0.4);
--tte-glow-brass: 0 0 20px rgba(196, 148, 61, 0.3);
/* Typography */
--tte-font-heading: 'Playfair Display', Georgia, serif;
--tte-font-body: 'Outfit', system-ui, sans-serif;
--tte-font-mono: 'JetBrains Mono', monospace;
/* Timing */
--tte-fast: 0.3s ease;
--tte-medium: 0.8s ease;
--tte-slow: 2s ease-in-out;
--tte-travel-progress: 0;
}
/* ─── COCKPIT LAYOUT ─── */
/* The main cockpit container fills the viewport */
.tte-cockpit {
position: relative;
width: 100vw;
height: 100vh;
overflow: hidden;
background: var(--tte-darker);
}
/* Viewport β€” the windshield area where world/travel content displays */
.tte-viewport {
position: absolute;
inset: 0;
z-index: 10;
overflow: hidden;
}
.tte-viewport-content {
width: 100%;
height: 100%;
object-fit: cover;
transition: opacity var(--tte-slow);
}
/* Cockpit frame overlay β€” positioned OVER the viewport */
/* This is the window arch, dashboard, and cab interior border */
.tte-cockpit-frame {
position: absolute;
inset: 0;
z-index: 100;
pointer-events: none; /* Click-through so viewport is interactive */
/*
* OPTION A: Use the generated cockpit_frame.png
* background: url('/file=static/img/cockpit/cockpit_frame.png') center/cover no-repeat;
*
* OPTION B (RECOMMENDED): Build with CSS for flexibility
*/
}
/* CSS-built cockpit frame (recommended approach) */
.tte-cockpit-frame::before {
content: '';
position: absolute;
inset: 0;
/* Create the window arch shape with gradients */
background:
/* Top arch shadow */
radial-gradient(ellipse 120% 30% at 50% 0%, var(--tte-mahogany) 0%, transparent 70%),
/* Left panel */
linear-gradient(90deg, var(--tte-mahogany) 0%, transparent 12%),
/* Right panel */
linear-gradient(270deg, var(--tte-mahogany) 0%, transparent 12%),
/* Bottom dashboard */
linear-gradient(0deg, var(--tte-dark) 0%, var(--tte-mahogany) 15%, transparent 35%);
z-index: 100;
pointer-events: none;
}
/* Brass trim on the window arch */
.tte-cockpit-frame::after {
content: '';
position: absolute;
inset: 5% 8%;
border: 3px solid var(--tte-brass);
border-radius: 50% 50% 5% 5% / 30% 30% 5% 5%;
box-shadow:
inset 0 0 30px rgba(196, 148, 61, 0.15),
0 0 15px rgba(196, 148, 61, 0.1);
z-index: 101;
pointer-events: none;
}
/* ─── CHRONO-THROTTLE ─── */
.tte-throttle {
position: absolute;
bottom: 5%;
left: 50%;
transform: translateX(-50%);
z-index: 120;
width: 120px;
height: 200px;
cursor: pointer;
transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tte-throttle img {
width: 100%;
height: 100%;
object-fit: contain;
filter: drop-shadow(0 0 10px var(--tte-glow-amber));
}
/* Throttle states */
.tte-throttle[data-direction="future"] {
transform: translateX(-50%) rotate(-25deg);
}
.tte-throttle[data-direction="neutral"] {
transform: translateX(-50%) rotate(0deg);
}
.tte-throttle[data-direction="past"] {
transform: translateX(-50%) rotate(25deg);
}
/* Sparks on throttle activation */
.tte-throttle.active::after {
content: '';
position: absolute;
inset: -20px;
background: url('/file=static/img/overlays/spark_particles.png') center/contain no-repeat;
mix-blend-mode: screen;
animation: tte-spark-burst 0.8s ease-out forwards;
pointer-events: none;
}
/* ─── COMM SCREEN ─── */
.tte-comm-screen {
position: absolute;
bottom: 8%;
right: 10%;
width: 140px;
height: 100px;
z-index: 120;
}
.tte-comm-screen img {
width: 100%;
height: 100%;
object-fit: contain;
}
/* Pulse when character is speaking */
.tte-comm-screen.speaking {
animation: tte-comm-pulse 0.5s ease-in-out infinite alternate;
}
/* ─── GAUGE CLUSTER ─── */
.tte-gauges {
position: absolute;
bottom: 8%;
left: 10%;
width: 180px;
height: 80px;
z-index: 120;
}
/* Haywire during travel */
.tte-state-traveling .tte-gauges {
animation: tte-gauge-shake 0.15s ease-in-out infinite;
}
/* ─── YEAR COUNTER ─── */
.tte-year-counter {
position: absolute;
top: 8%;
left: 50%;
transform: translateX(-50%);
z-index: 130;
font-family: var(--tte-font-heading);
font-size: 2.5rem;
font-weight: 700;
color: var(--tte-cream);
text-shadow: 0 0 20px var(--tte-glow-amber);
letter-spacing: 6px;
text-align: center;
}
.tte-year-counter .tte-year-label {
font-size: 0.7rem;
font-family: var(--tte-font-body);
text-transform: uppercase;
letter-spacing: 4px;
color: var(--tte-brass);
margin-bottom: 4px;
}
/* ─── ERA STATION SIGNS ─── */
/* These are dynamically created HTML elements, NOT images */
.tte-era-sign {
position: absolute;
top: 35%;
z-index: 60;
padding: 10px 28px;
background: linear-gradient(135deg, #1a2a1a 0%, #0d1f0d 100%);
border: 2px solid var(--tte-brass);
border-radius: 3px;
font-family: var(--tte-font-heading);
font-size: 1.1rem;
font-weight: 600;
color: var(--tte-cream);
text-transform: uppercase;
letter-spacing: 2px;
white-space: nowrap;
box-shadow: var(--tte-glow-brass), inset 0 0 15px rgba(0,0,0,0.5);
text-shadow: 0 0 8px rgba(196, 148, 61, 0.5);
pointer-events: none;
/* Initial position off-screen */
transform: translateX(120vw);
}
/* Alternate sign position (some signs higher, some lower for depth) */
.tte-era-sign:nth-child(even) {
top: 55%;
font-size: 0.9rem;
opacity: 0.7;
filter: blur(1px);
}
/* Brass post under the sign */
.tte-era-sign::after {
content: '';
position: absolute;
bottom: -40px;
left: 50%;
width: 4px;
height: 40px;
background: linear-gradient(to bottom, var(--tte-brass), var(--tte-copper));
transform: translateX(-50%);
}
/* Flying animation β€” FUTURE direction (signs move right-to-left) */
@keyframes tte-sign-fly-future {
from { transform: translateX(120vw) scale(0.8); opacity: 0; }
10% { opacity: 1; }
90% { opacity: 1; }
to { transform: translateX(-120vw) scale(1.2); opacity: 0; }
}
/* Flying animation β€” PAST direction (signs move left-to-right) */
@keyframes tte-sign-fly-past {
from { transform: translateX(-120vw) scale(0.8); opacity: 0; }
10% { opacity: 1; }
90% { opacity: 1; }
to { transform: translateX(120vw) scale(1.2); opacity: 0; }
}
.tte-era-sign.future {
animation: tte-sign-fly-future var(--sign-speed, 1.5s) linear forwards;
}
.tte-era-sign.past {
animation: tte-sign-fly-past var(--sign-speed, 1.5s) linear forwards;
}
/* Current era sign (idle state β€” stationary, near tracks) */
.tte-current-era-sign {
position: absolute;
bottom: 38%;
right: 15%;
z-index: 30;
padding: 8px 20px;
background: linear-gradient(135deg, #1a2a1a 0%, #0d1f0d 100%);
border: 2px solid var(--tte-brass);
border-radius: 3px;
font-family: var(--tte-font-heading);
font-size: 0.9rem;
color: var(--tte-cream);
text-transform: uppercase;
letter-spacing: 2px;
box-shadow: var(--tte-glow-brass);
opacity: 0.8;
}
/* ─── OVERLAYS ─── */
.tte-overlay {
position: absolute;
inset: 0;
pointer-events: none;
transition: opacity var(--tte-slow);
}
/* Speed lines β€” during travel */
.tte-speed-lines {
z-index: 50;
background: url('/file=static/img/overlays/speed_lines.png') center/cover no-repeat;
mix-blend-mode: screen;
opacity: 0;
animation: none;
}
.tte-state-traveling .tte-speed-lines {
opacity: 0.7;
animation: tte-speed-rotate 30s linear infinite;
}
/* Energy lines β€” during intro materialization */
.tte-energy-lines {
z-index: 80;
background: url('/file=static/img/overlays/energy_lines.png') center/cover no-repeat;
mix-blend-mode: screen;
opacity: 0;
transform: scale(0.5);
}
.tte-energy-lines.active {
opacity: 1;
animation: tte-shockwave 1.5s ease-out forwards;
}
/* Steam cloud β€” during landing reveal */
.tte-steam-cloud {
z-index: 90;
background: url('/file=static/img/overlays/steam_cloud.png') center/cover no-repeat;
opacity: 0;
}
.tte-steam-cloud.active {
opacity: 1;
animation: tte-steam-drift 4s ease-in-out;
}
/* Film grain overlay (pure CSS, no image needed) */
.tte-film-grain {
z-index: 200;
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
opacity: 0.035;
mix-blend-mode: overlay;
}
/* Vignette overlay (pure CSS) */
.tte-vignette {
z-index: 150;
background: radial-gradient(ellipse at center, transparent 50%, rgba(10, 6, 5, 0.6) 100%);
}
/* ─── ANIMATION KEYFRAMES ─── */
/* Screen shake β€” used during braking and impacts */
@keyframes tte-screen-shake {
0%, 100% { transform: translate(0, 0); }
10% { transform: translate(-4px, 3px); }
20% { transform: translate(4px, -2px); }
30% { transform: translate(-3px, 4px); }
40% { transform: translate(3px, -4px); }
50% { transform: translate(-2px, 2px); }
60% { transform: translate(4px, -1px); }
70% { transform: translate(-4px, 3px); }
80% { transform: translate(2px, -3px); }
90% { transform: translate(-1px, 2px); }
}
/* Violent shake β€” for braking sequence */
@keyframes tte-violent-shake {
0%, 100% { transform: translate(0, 0) rotate(0deg); }
10% { transform: translate(-8px, 5px) rotate(-0.5deg); }
20% { transform: translate(7px, -6px) rotate(0.5deg); }
30% { transform: translate(-6px, 8px) rotate(-0.3deg); }
40% { transform: translate(8px, -4px) rotate(0.4deg); }
50% { transform: translate(-5px, 6px) rotate(-0.4deg); }
60% { transform: translate(6px, -8px) rotate(0.3deg); }
70% { transform: translate(-7px, 4px) rotate(-0.5deg); }
80% { transform: translate(4px, -5px) rotate(0.2deg); }
90% { transform: translate(-3px, 3px) rotate(-0.1deg); }
}
/* Speed lines rotation */
@keyframes tte-speed-rotate {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
/* Shockwave β€” energy lines expanding */
@keyframes tte-shockwave {
0% { transform: scale(0.3); opacity: 0; }
30% { opacity: 1; }
100% { transform: scale(2.5); opacity: 0; }
}
/* Comm screen pulse */
@keyframes tte-comm-pulse {
from { filter: brightness(1) drop-shadow(0 0 5px var(--tte-glow-cyan)); }
to { filter: brightness(1.3) drop-shadow(0 0 15px var(--tte-glow-cyan)); }
}
/* Spark burst from throttle */
@keyframes tte-spark-burst {
0% { transform: scale(0.5); opacity: 1; }
100% { transform: scale(2); opacity: 0; }
}
/* Gauge shake during travel */
@keyframes tte-gauge-shake {
0%, 100% { transform: translateX(0); }
25% { transform: translateX(-2px); }
75% { transform: translateX(2px); }
}
/* Steam drift */
@keyframes tte-steam-drift {
0% { opacity: 0; transform: translateY(5%); }
20% { opacity: 1; transform: translateY(0); }
80% { opacity: 1; transform: translateY(-3%); }
100% { opacity: 0; transform: translateY(-5%); }
}
/* Idle viewport parallax drift */
@keyframes tte-idle-drift {
0% { transform: scale(1.05) translate(0, 0); }
33% { transform: scale(1.05) translate(-1%, 0.5%); }
66% { transform: scale(1.05) translate(0.5%, -0.5%); }
100% { transform: scale(1.05) translate(0, 0); }
}
/* Travel zoom β€” future (pushing forward) */
@keyframes tte-travel-zoom-future {
from { transform: scale(1.0); }
to { transform: scale(1.25); }
}
/* Travel zoom β€” past (pulling backward) */
@keyframes tte-travel-zoom-past {
from { transform: scale(1.25); }
to { transform: scale(1.0); }
}
/* Character breathing β€” subtle life */
@keyframes tte-character-breathe {
0%, 100% { transform: scale(1.0); }
50% { transform: scale(1.008); }
}
/* Gentle golden particle float */
@keyframes tte-particle-float {
0% { transform: translateY(0) translateX(0); opacity: 0; }
20% { opacity: 0.8; }
80% { opacity: 0.8; }
100% { transform: translateY(-100px) translateX(30px); opacity: 0; }
}
/* Intro ticket float */
@keyframes tte-ticket-float {
0% { transform: scale(0.8) rotate(-5deg); opacity: 0; }
30% { transform: scale(1) rotate(0deg); opacity: 1; }
70% { transform: scale(1) rotate(2deg) translateY(0); }
100% { transform: scale(0.7) rotate(0deg) translateY(200px); opacity: 0; }
}
/* Launch button pulse (dormant state) */
@keyframes tte-launch-pulse {
0%, 100% {
box-shadow: 0 0 10px var(--tte-glow-amber), inset 0 0 10px rgba(212, 168, 67, 0.1);
}
50% {
box-shadow: 0 0 25px var(--tte-glow-amber), inset 0 0 20px rgba(212, 168, 67, 0.2);
}
}
/* ─── STATE-DRIVEN TRANSITIONS ─── */
/* Dormant β€” cockpit idle, waiting for launch */
.tte-state-dormant .tte-idle-viewport {
opacity: 1;
animation: tte-idle-drift 20s ease-in-out infinite;
}
.tte-state-dormant .tte-launch-btn {
animation: tte-launch-pulse 2s ease-in-out infinite;
}
/* Traveling β€” high-speed time travel */
.tte-state-traveling {
animation: tte-screen-shake 0.3s ease-in-out infinite;
}
.tte-state-traveling .tte-idle-viewport {
opacity: 0;
}
.tte-state-traveling .tte-travel-bg {
opacity: 1;
}
/* Braking β€” violent stop */
.tte-state-braking {
animation: tte-violent-shake 0.15s ease-in-out infinite;
}
/* Conversation β€” calm, world visible */
.tte-state-conversation .tte-cockpit-frame {
filter: brightness(0.8); /* Dim frame to emphasize viewport */
}
.tte-state-conversation .tte-character {
animation: tte-character-breathe 4s ease-in-out infinite;
}
/* ─── RESPONSIVE ─── */
@media (max-width: 860px) {
.tte-year-counter {
font-size: 1.8rem;
}
.tte-throttle {
width: 80px;
height: 140px;
}
.tte-era-sign {
font-size: 0.9rem;
padding: 8px 20px;
}
}
@media (max-width: 520px) {
.tte-year-counter {
font-size: 1.4rem;
}
.tte-gauges,
.tte-comm-screen {
display: none; /* Hide on very small screens */
}
}
/* ─── ACCESSIBILITY ─── */
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.001ms !important;
transition-duration: 0.001ms !important;
}
}