style: Improve CSS formatting and animation adjustments

This commit is contained in:
Jan K9f 2025-04-23 14:16:03 +02:00 committed by Jan-Marlon Leibl
commit f44f5ed02b
Signed by: jleibl
GPG key ID: 300B2F906DC6F1D5
3 changed files with 124 additions and 33 deletions

View file

@ -94,8 +94,8 @@ export default class LootboxOpeningComponent {
generateCasePrizes(wonReward: Reward) {
if (!this.lootbox) return;
// Create a case opening display with fewer prizes to fit on screen without scrolling
const prizeCount = 9; // Total number of prizes to show (odd number to have center prize)
// Create a case opening display with an extremely large number of prizes for a massive scrolling animation
const prizeCount = 200; // Set to 200 for an extremely long scrolling animation
const winningPosition = Math.floor(prizeCount / 2); // Position of the winning prize (middle)
// Get possible rewards from the lootbox
@ -166,4 +166,14 @@ export default class LootboxOpeningComponent {
reward.value === this.wonReward.value &&
reward.probability === this.wonReward.probability;
}
// Calculate the center position for better alignment
getCenterOffset(): string {
return '0px'; // No additional offset - using animation transform instead
}
// Check if item is at center position (100th item)
isCenterItem(index: number): boolean {
return index === Math.floor(200 / 2); // Center item at index 100 (0-indexed)
}
}