<template>
  <div v-if="isLoading" class="loading-spinner">
    <div class="spinner-container">
      <div class="logo-container">
        <div class="logo-circle"></div>
        <div class="logo-text">VAVA</div>
      </div>
      <div class="loading-dots">
        <span class="dot"></span>
        <span class="dot"></span>
        <span class="dot"></span>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const isLoading = ref(true)
</script>

<style scoped>
.loading-spinner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.logo-container {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-circle {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.logo-text {
  color: #fff;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 2px;
  animation: pulse 2s ease-in-out infinite;
}

.loading-dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  background-color: #fff;
  border-radius: 50%;
  opacity: 0.6;
  animation: fade 1.4s infinite;
}

.dot:nth-child(2) {
  animation-delay: 0.2s;
}

.dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(0.95);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

@keyframes fade {
  0%,
  100% {
    opacity: 0.2;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
  .logo-container {
    width: 60px;
    height: 60px;
  }

  .logo-text {
    font-size: 20px;
  }

  .dot {
    width: 6px;
    height: 6px;
  }
}

/* 防止iOS橡皮筋效果 */
.loading-spinner {
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}
</style> 