TomatitoToho commited on
Commit
6f8bf09
·
verified ·
1 Parent(s): 472ffa5

Upload src/components/ui/Hotbar.tsx with huggingface_hub

Browse files
Files changed (1) hide show
  1. src/components/ui/Hotbar.tsx +8 -8
src/components/ui/Hotbar.tsx CHANGED
@@ -10,7 +10,7 @@ export function Hotbar() {
10
  const items = player?.inventory.hotbar || Array(9).fill(null)
11
 
12
  return (
13
- <div className="flex gap-0.5 p-0.5 bg-black/70 rounded-lg backdrop-blur-sm">
14
  {items.map((item, i) => {
15
  const def = item ? BLOCK_DEFS[item.id] : null
16
  const isSelected = i === hotbarSlot
@@ -19,11 +19,11 @@ export function Hotbar() {
19
  <div
20
  key={i}
21
  className={`
22
- w-8 h-8 sm:w-10 sm:h-10 flex items-center justify-center rounded cursor-pointer
23
  transition-all duration-75 relative
24
  ${isSelected
25
- ? 'bg-white/25 border-2 border-white/80'
26
- : 'bg-gray-800/50 border border-gray-600/40 hover:bg-gray-700/50'
27
  }
28
  `}
29
  onClick={() => setHotbarSlot(i)}
@@ -31,18 +31,18 @@ export function Hotbar() {
31
  {def && (
32
  <>
33
  <div
34
- className="w-5 h-5 sm:w-7 sm:h-7 rounded-sm border border-black/20"
35
- style={{ backgroundColor: def.color }}
36
  />
37
  {item!.count > 1 && (
38
  <span className="absolute bottom-0 right-0.5 text-[8px] sm:text-[10px] text-white font-bold"
39
- style={{ textShadow: '1px 1px 1px rgba(0,0,0,0.9)' }}>
40
  {item!.count}
41
  </span>
42
  )}
43
  </>
44
  )}
45
- <span className="absolute -bottom-3.5 text-[7px] sm:text-[9px] text-gray-500">
46
  {i + 1}
47
  </span>
48
  </div>
 
10
  const items = player?.inventory.hotbar || Array(9).fill(null)
11
 
12
  return (
13
+ <div className="flex gap-0.5 p-0.5 bg-black/60 rounded backdrop-blur-sm border border-gray-700/30">
14
  {items.map((item, i) => {
15
  const def = item ? BLOCK_DEFS[item.id] : null
16
  const isSelected = i === hotbarSlot
 
19
  <div
20
  key={i}
21
  className={`
22
+ w-8 h-8 sm:w-11 sm:h-11 flex items-center justify-center cursor-pointer
23
  transition-all duration-75 relative
24
  ${isSelected
25
+ ? 'bg-white/20 border-2 border-white/80 scale-105'
26
+ : 'bg-gray-900/50 border border-gray-700/40 hover:bg-gray-700/40'
27
  }
28
  `}
29
  onClick={() => setHotbarSlot(i)}
 
31
  {def && (
32
  <>
33
  <div
34
+ className="w-5 h-5 sm:w-7 sm:h-7 rounded-sm shadow-md"
35
+ style={{ backgroundColor: def.color, border: '1px solid rgba(0,0,0,0.2)' }}
36
  />
37
  {item!.count > 1 && (
38
  <span className="absolute bottom-0 right-0.5 text-[8px] sm:text-[10px] text-white font-bold"
39
+ style={{ textShadow: '1px 1px 2px rgba(0,0,0,0.9)' }}>
40
  {item!.count}
41
  </span>
42
  )}
43
  </>
44
  )}
45
+ <span className="absolute -bottom-4 text-[7px] sm:text-[9px] text-gray-500 font-mono">
46
  {i + 1}
47
  </span>
48
  </div>