<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Premium Gladiator Flip Card</title>
  <link rel="stylesheet" href="styles.css">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
</head>
<body>

  <div class="card-container">
    <div class="gladiator-card">
      <div class="card-border-animation"></div>
      <div class="card-inner">
        
        <!-- Front of the Card -->
        <div class="card-front">
          <div class="gladiator-image">
            <img src="https://via.placeholder.com/150" alt="Gladiator Image">
          </div>
          <h2>Spartacus</h2>
          <p class="rarity">Legendary Gladiator</p>
          <div class="stats">
            <span><i class="fas fa-fist-raised"></i> Attack: 85</span>
            <span><i class="fas fa-shield-alt"></i> Defense: 70</span>
            <span><i class="fas fa-heart"></i> Health: 100</span>
          </div>

        </div>
        
        <!-- Back of the Card -->
        <div class="card-back">
          <h2>More about Spartacus</h2>
          <p>Spartacus was a legendary gladiator who led a major slave uprising against the Roman Republic. His strength, skill, and leadership made him one of the most feared and respected figures of his time.</p>
          <ul class="back-stats">
            <li><strong>Special Move:</strong> Thunderous Strike</li>
            <li><strong>Legacy:</strong> Inspiring fear and respect in the arena</li>
            <li><strong>Years Active:</strong> 73 - 71 BC</li>
          </ul>
        </div>
      </div>
    </div>
  </div>

  <script src="script.js"></script>
</body>
</html>
/* Background setup */
body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(circle at center, #1b1b2f, #353545, #121212);
  margin: 0;
  font-family: Arial, sans-serif;
  overflow: hidden;
}

/* Card container styling */
.card-container {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Gladiator card styling */
.gladiator-card {
  position: relative;
  width: 300px;
  height: 400px;
  perspective: 1000px;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
  cursor: pointer;
}

.gladiator-card:hover .card-inner {
  transform: rotateY(180deg);
}

/* Card border animation */
.card-border-animation {
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 15px;
  background: linear-gradient(90deg, #ff00cc, #3333ff, #00ffcc, #ff00cc);
  background-size: 200% 200%;
  filter: blur(10px);
  opacity: 0.8;
  z-index: -1;
  animation: cardGlowAnimation 6s ease-in-out infinite;
}

/* Front and Back of the card */
.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0px 15px 30px rgba(0, 0, 0, 0.8);
  background: linear-gradient(145deg, rgba(34, 34, 34, 0.95), rgba(51, 51, 51, 0.95));
  color: #ffffff;
}

/* Styling for the front */
.card-front .gladiator-image {
  text-align: center;
  margin-bottom: 10px;
}

.card-front .gladiator-image img {
  border-radius: 10px;
  box-shadow: 0px 4px 15px rgba(0, 255, 255, 0.7);
  width: 80%;
}

.card-front h2, .card-back h2 {
  font-size: 26px;
  margin: 0 0 5px;
  text-transform: uppercase;
  background: linear-gradient(45deg, #ff00cc, #3333ff);
  -webkit-background-clip: text;
  color: transparent;
  font-weight: bold;
}

.card-front .rarity {
  font-size: 14px;
  opacity: 0.8;
  background: linear-gradient(45deg, #ff4081, #1de9b6);
  -webkit-background-clip: text;
  color: transparent;
  margin-bottom: 15px;
}

.card-front .stats, .card-back .back-stats {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-top: 15px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0px 0px 10px rgba(255, 255, 255, 0.2);
  flex-direction: column;
}

.card-front .stats span, .card-back .back-stats li {
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-back .back-stats {
  list-style: none;
  padding: 0;
}

/* Abilities section */
.abilities h3 {
  margin: 0 0 5px;
  font-size: 16px;
  background: linear-gradient(45deg, #ff00cc, #3333ff);
  -webkit-background-clip: text;
  color: transparent;
  font-weight: bold;
}

.abilities ul {
  list-style: none;
  padding: 0;
}

.abilities li {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 5px;
  border-radius: 5px;
  margin-bottom: 5px;
  transition: transform 0.2s, background 0.2s;
}

.abilities li:hover {
  transform: scale(1.1);
  background: rgba(255, 64, 129, 0.15);
}

/* Back of the card */
.card-back {
  transform: rotateY(180deg);
}

/* Glow animation */
@keyframes cardGlowAnimation {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
// JavaScript to add a tilt effect to the card on mouse movement
document.querySelectorAll('.gladiator-card').forEach(card => {
  card.addEventListener('mousemove', (e) => {
    const rect = card.getBoundingClientRect();
    const x = e.clientX - rect.left;
    const y = e.clientY - rect.top;
    const centerX = rect.width / 2;
    const centerY = rect.height / 2;

    const rotateX = (y - centerY) / 15;
    const rotateY = (x - centerX) / 15;

    card.querySelector('.card-inner').style.transform = `rotateX(${rotateX}deg) rotateY(${rotateY}deg) scale(1.05)`;
  });

  card.addEventListener('mouseleave', () => {
    card.querySelector('.card-inner').style.transform = 'rotateX(0) rotateY(0) scale(1)';
  });
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.