Spaces:
Build error

Hamkytech commited on
Commit
f22fa55
·
verified ·
1 Parent(s): c894d16

Upload components/PlanetView.jsx with huggingface_hub

Browse files
Files changed (1) hide show
  1. components/PlanetView.jsx +28 -0
components/PlanetView.jsx ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { motion } from 'framer-motion';
2
+
3
+ export default function PlanetView({ planet, onClick }) {
4
+ return (
5
+ <motion.div
6
+ whileHover={{ scale: 1.05 }}
7
+ whileTap={{ scale: 0.95 }}
8
+ onClick={onClick}
9
+ className="relative cursor-pointer"
10
+ >
11
+ <div className="w-32 h-32 md:w-48 md:h-48 bg-gradient-to-b from-space-blue to-space-purple rounded-full flex items-center justify-center border-4 border-space-gold/20 shadow-lg shadow-space-blue/20">
12
+ <div className="text-center">
13
+ <div className="text-2xl font-bold text-space-gold">{planet.name}</div>
14
+ <div className="text-xs text-space-blue/70 mt-1">Level {planet.level}</div>
15
+ </div>
16
+ </div>
17
+ {planet.unlocked && (
18
+ <motion.div
19
+ animate={{ scale: [1, 1.2, 1] }}
20
+ transition={{ duration: 2, repeat: Infinity }}
21
+ className="absolute -top-2 -right-2 w-6 h-6 bg-space-gold rounded-full flex items-center justify-center text-xs font-bold text-space-dark"
22
+ >
23
+ {planet.level}
24
+ </motion.div>
25
+ )}
26
+ </motion.div>
27
+ );
28
+ }