project-name-here / style.css
barry254K's picture
Create an original endless runner game inspired by Temple Run mechanics,
17e4968 verified
Raw History Blame Contribute Delete
3.11 kB
/* AfriRun - Main Stylesheet */
:root {
--color-primary: #FF8C00;
--color-secondary: #8B4513;
--color-accent: #FFD700;
--color-ground: #D2691E;
--color-sky-top: #87CEEB;
--color-sky-bottom: #FFE4B5;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Open Sans', sans-serif;
background: linear-gradient(to bottom, var(--color-sky-top), var(--color-sky-bottom));
user-select: none;
-webkit-user-select: none;
overflow: hidden;
}
/* Canvas styling */
canvas {
display: block;
touch-action: none;
}
/* African pattern overlay for UI elements */
.african-pattern {
background-image: repeating-linear-gradient(
45deg,
transparent,
transparent 10px,
rgba(139, 69, 19, 0.1) 10px,
rgba(139, 69, 19, 0.1) 20px
);
border: 2px solid var(--color-secondary);
box-shadow:
inset 0 0 20px rgba(0,0,0,0.2),
0 4px 6px rgba(0,0,0,0.3);
}
/* Animations */
@keyframes pulse-glow {
0%, 100% {
box-shadow: 0 0 10px var(--color-primary);
transform: scale(1);
}
50% {
box-shadow: 0 0 25px var(--color-primary), 0 0 15px var(--color-accent);
transform: scale(1.02);
}
}
@keyframes slide-in {
from {
transform: translateY(-20px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
@keyframes drum-beat {
0% { transform: scale(1); }
10% { transform: scale(1.1); }
20% { transform: scale(1); }
100% { transform: scale(1); }
}
.animate-pulse-glow {
animation: pulse-glow 2s infinite;
}
.animate-slide-in {
animation: slide-in 0.5s ease-out;
}
.animate-drum {
animation: drum-beat 0.5s ease-in-out;
}
/* Custom scrollbar for any overflow content */
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
background: #3D2914;
}
::-webkit-scrollbar-thumb {
background: #8B4513;
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: #D2691E;
}
/* Touch feedback for mobile */
.touch-active {
background-color: rgba(255, 140, 0, 0.2) !important;
}
/* Loading overlay */
#loading {
position: fixed;
inset: 0;
background: #3D2914;
display: flex;
align-items: center;
justify-content: center;
z-index: 9999;
transition: opacity 0.5s;
}
.loader {
width: 48px;
height: 48px;
border: 5px solid #FFF;
border-bottom-color: #FF8C00;
border-radius: 50%;
display: inline-block;
animation: rotation 1s linear infinite;
}
@keyframes rotation {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* Responsive adjustments */
@media (max-width: 768px) {
.font-display {
font-size: 0.9em;
}
#controls-hint {
display: none !important;
}
}
/* Accessibility - reduced motion */
@media (prefers-reduced-motion: reduce) {
* {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}