style: clean up and reorganize lootbox component styles

This commit is contained in:
Jan K9f 2025-04-23 13:47:36 +02:00
parent e9d2f6e0ca
commit 45c5b19e41
Signed by: jank
GPG key ID: 22BEAC760B3333D6
3 changed files with 286 additions and 166 deletions

View file

@ -2,88 +2,28 @@ body {
background: linear-gradient(to bottom, #181c2a, #232c43);
}
.case-strip-outer {
position: relative;
width: 900px;
max-width: 100vw;
height: 120px;
margin: 0 auto;
overflow: hidden;
background: #232c43;
border-radius: 16px;
border: 2px solid #2d3748;
box-shadow: 0 4px 32px 0 #000a;
}
.case-strip-inner {
display: flex;
align-items: center;
height: 100%;
will-change: transform;
}
.case-strip-reward {
width: 120px;
height: 100px;
margin: 0 6px;
background: #1a2233;
border-radius: 10px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 1.25rem;
font-weight: 600;
box-shadow: 0 2px 8px rgba(0,0,0,0.18);
border: 2px solid transparent;
transition: border-color 0.2s, color 0.2s;
}
/* Color classes */
.text-yellow-400 {
border-color: #facc15;
color: #facc15;
}
.text-purple-400 {
border-color: #a78bfa;
color: #a78bfa;
}
.text-blue-400 {
border-color: #60a5fa;
color: #60a5fa;
}
.case-strip-marker {
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
width: 6px;
height: 100%;
background: linear-gradient(to bottom, #facc15 60%, #fff0 100%);
z-index: 2;
border-radius: 3px;
box-shadow: 0 0 16px #facc15, 0 0 2px #fff;
pointer-events: none;
}
.open-btn {
background: linear-gradient(90deg, #facc15 0%, #a78bfa 100%);
color: #232c43;
font-size: 1.5rem;
font-weight: bold;
padding: 0.75rem 2.5rem;
border-radius: 999px;
border: none;
box-shadow: 0 2px 12px #0005;
transition: background 0.2s, color 0.2s, transform 0.1s;
cursor: pointer;
}
.open-btn:hover {
background: linear-gradient(90deg, #ffe066 0%, #c4b5fd 100%);
color: #181c2a;
transform: translateY(-2px) scale(1.04);
.border-yellow-400 {
border-color: #facc15;
}
.border-purple-400 {
border-color: #a78bfa;
}
.border-blue-400 {
border-color: #60a5fa;
}
/* Loader animation */
.loader {
border: 4px solid rgba(255, 255, 255, 0.2);
border-radius: 50%;
@ -95,4 +35,142 @@ body {
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* Open button styling */
.open-btn {
background: linear-gradient(90deg, #4338ca 0%, #8b5cf6 100%);
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
transition: all 0.2s ease;
}
.open-btn:hover {
background: linear-gradient(90deg, #4f46e5 0%, #a78bfa 100%);
transform: translateY(-2px);
box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}
/* CSGO-style case opening display */
.case-container {
position: relative;
width: 100%;
background: rgba(26, 31, 48, 0.6);
border-radius: 8px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
overflow: hidden;
margin-bottom: 20px;
display: flex;
justify-content: center;
}
.case-indicator {
position: absolute;
top: 50%;
left: 50%;
transform: translateY(-50%);
width: 6px;
height: 100%;
background: #facc15;
box-shadow: 0 0 10px #facc15, 0 0 15px rgba(255, 255, 255, 0.5);
z-index: 3;
animation: indicator-pulse 1.5s ease-in-out 3s infinite alternate;
}
@keyframes indicator-pulse {
0% {
opacity: 0.6;
box-shadow: 0 0 10px #facc15, 0 0 15px rgba(255, 255, 255, 0.3);
}
100% {
opacity: 1;
box-shadow: 0 0 15px #facc15, 0 0 20px rgba(255, 255, 255, 0.7);
}
}
.case-items-container {
position: relative;
z-index: 1;
padding: 10px 5px;
margin: 0 auto;
width: 100%;
height: 150px; /* Fixed height for the horizontal row */
overflow: hidden; /* Hide scrollbar */
}
.case-items {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap: 8px;
padding: 5px;
height: 100%;
width: 100%;
animation: slide-in 3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
transform: translateX(120%); /* Initial position far to the right */
}
@keyframes slide-in {
0% {
transform: translateX(120%);
}
90% {
transform: translateX(-5%); /* Slight overshoot */
}
100% {
transform: translateX(0%); /* Final centered position */
}
}
.case-item {
transition: all 0.2s ease;
padding: 2px;
}
.case-item-inner {
background: #232c43;
border: 2px solid #2d3748;
border-radius: 8px;
padding: 12px 8px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100px;
height: 100%;
}
.case-item-won {
z-index: 2;
animation: highlight-winner 0.5s ease-out 3s forwards;
}
.case-item-won .case-item-inner {
box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
background: linear-gradient(to right, #232c43, #2a3354, #232c43);
}
@keyframes highlight-winner {
0% {
transform: scale(1);
}
50% {
transform: scale(1.15);
}
75% {
transform: scale(1.1);
}
100% {
transform: scale(1.05);
}
}
.amount {
font-size: 1.2rem;
font-weight: bold;
margin-bottom: 4px;
}
.rarity {
font-size: 0.75rem;
opacity: 0.7;
}