ntphuc149 commited on
Commit
2e65e68
Β·
verified Β·
1 Parent(s): 8a697d5

Update src/App.js

Browse files
Files changed (1) hide show
  1. src/App.js +70 -38
src/App.js CHANGED
@@ -13,6 +13,7 @@ const HoroscopeApp = () => {
13
  name: "Taurus",
14
  dates: "April 20 - May 20",
15
  emoji: "πŸ‚",
 
16
  imageFile: "TAURUS.png",
17
  },
18
  {
@@ -20,6 +21,7 @@ const HoroscopeApp = () => {
20
  name: "Sagittarius",
21
  dates: "Nov 22 - Dec 21",
22
  emoji: "🏹",
 
23
  imageFile: "SAGITTARIUS.png",
24
  },
25
  {
@@ -27,6 +29,7 @@ const HoroscopeApp = () => {
27
  name: "Pisces",
28
  dates: "Feb 19 - Mar 20",
29
  emoji: "🐠",
 
30
  imageFile: "PISCES.png",
31
  },
32
  {
@@ -34,6 +37,7 @@ const HoroscopeApp = () => {
34
  name: "Libra",
35
  dates: "Sep 23 - Oct 22",
36
  emoji: "βš–οΈ",
 
37
  imageFile: "LIBRA.png",
38
  },
39
  {
@@ -41,6 +45,7 @@ const HoroscopeApp = () => {
41
  name: "Gemini",
42
  dates: "May 21 - Jun 20",
43
  emoji: "πŸ‘―",
 
44
  imageFile: "GEMINI.png",
45
  },
46
  {
@@ -48,6 +53,7 @@ const HoroscopeApp = () => {
48
  name: "Leo",
49
  dates: "Jul 23 - Aug 22",
50
  emoji: "🦁",
 
51
  imageFile: "LEO.png",
52
  },
53
  {
@@ -55,6 +61,7 @@ const HoroscopeApp = () => {
55
  name: "Virgo",
56
  dates: "Aug 23 - Sep 22",
57
  emoji: "πŸ‘Έ",
 
58
  imageFile: "VIRGO.png",
59
  },
60
  {
@@ -62,6 +69,7 @@ const HoroscopeApp = () => {
62
  name: "Aquarius",
63
  dates: "Jan 20 - Feb 18",
64
  emoji: "🏺",
 
65
  imageFile: "AQUARIUS.png",
66
  },
67
  {
@@ -69,6 +77,7 @@ const HoroscopeApp = () => {
69
  name: "Aries",
70
  dates: "Mar 21 - Apr 19",
71
  emoji: "🐏",
 
72
  imageFile: "ARIES.png",
73
  },
74
  {
@@ -76,6 +85,7 @@ const HoroscopeApp = () => {
76
  name: "Cancer",
77
  dates: "Jun 21 - Jul 22",
78
  emoji: "πŸ¦€",
 
79
  imageFile: "CANCER.png",
80
  },
81
  {
@@ -83,6 +93,7 @@ const HoroscopeApp = () => {
83
  name: "Scorpio",
84
  dates: "Oct 23 - Nov 21",
85
  emoji: "πŸ¦‚",
 
86
  imageFile: "SCORPIO.png",
87
  },
88
  {
@@ -90,6 +101,7 @@ const HoroscopeApp = () => {
90
  name: "Capricorn",
91
  dates: "Dec 22 - Jan 19",
92
  emoji: "🐐",
 
93
  imageFile: "CAPRICORN.png",
94
  },
95
  ];
@@ -189,6 +201,7 @@ const HoroscopeApp = () => {
189
  ],
190
  };
191
 
 
192
  const getImagePath = (sign) => {
193
  if (!sign.imageFile) return null;
194
  return `/img/${selectedGender}/${sign.imageFile}`;
@@ -317,30 +330,40 @@ const HoroscopeApp = () => {
317
  : "linear-gradient(135deg, #07090A 0%, #979999 100%)",
318
  }}
319
  >
 
320
  <div
321
- className={`w-full h-full rounded-full flex items-center justify-center text-xl overflow-hidden ${
322
- isDarkMode ? "bg-gray-800" : "bg-gray-100"
323
  }`}
324
  >
325
- {getImagePath(sign) ? (
326
- <img
327
- src={getImagePath(sign)}
328
- alt={sign.name}
329
- className="w-full h-full object-cover rounded-full"
330
- onError={(e) => {
331
- e.target.style.display = "none";
332
- e.target.nextSibling.style.display = "block";
333
- }}
334
- />
335
- ) : null}
336
- <span
337
- style={{ display: getImagePath(sign) ? "none" : "block" }}
338
  >
339
- {sign.emoji}
340
- </span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
341
  </div>
342
  </div>
343
- <p className="text-xs font-medium mt-3 text-center">
 
344
  {sign.name}
345
  </p>
346
  </div>
@@ -408,29 +431,38 @@ const HoroscopeApp = () => {
408
  background: "linear-gradient(135deg, #1D3249 0%, #96D1E2 100%)",
409
  }}
410
  >
 
411
  <div
412
- className={`w-full h-full rounded-full flex items-center justify-center text-2xl overflow-hidden ${
413
- isDarkMode ? "bg-gray-800" : "bg-gray-100"
414
  }`}
415
  >
416
- {getImagePath(getCurrentSign()) ? (
417
- <img
418
- src={getImagePath(getCurrentSign())}
419
- alt={getCurrentSign()?.name}
420
- className="w-full h-full object-cover rounded-full"
421
- onError={(e) => {
422
- e.target.style.display = "none";
423
- e.target.nextSibling.style.display = "block";
424
- }}
425
- />
426
- ) : null}
427
- <span
428
- style={{
429
- display: getImagePath(getCurrentSign()) ? "none" : "block",
430
- }}
431
  >
432
- {getCurrentSign()?.emoji}
433
- </span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
434
  </div>
435
  </div>
436
  <div className="flex-1">
@@ -439,7 +471,7 @@ const HoroscopeApp = () => {
439
  <span className="text-xl">πŸ“ˆ</span>
440
  </h2>
441
  <div className="flex items-center gap-2">
442
- <span className="text-xl">{getCurrentSign()?.emoji}</span>
443
  <span className="font-semibold">{getCurrentSign()?.name}</span>
444
  </div>
445
  </div>
 
13
  name: "Taurus",
14
  dates: "April 20 - May 20",
15
  emoji: "πŸ‚",
16
+ symbol: "♉",
17
  imageFile: "TAURUS.png",
18
  },
19
  {
 
21
  name: "Sagittarius",
22
  dates: "Nov 22 - Dec 21",
23
  emoji: "🏹",
24
+ symbol: "♐",
25
  imageFile: "SAGITTARIUS.png",
26
  },
27
  {
 
29
  name: "Pisces",
30
  dates: "Feb 19 - Mar 20",
31
  emoji: "🐠",
32
+ symbol: "β™“",
33
  imageFile: "PISCES.png",
34
  },
35
  {
 
37
  name: "Libra",
38
  dates: "Sep 23 - Oct 22",
39
  emoji: "βš–οΈ",
40
+ symbol: "β™Ž",
41
  imageFile: "LIBRA.png",
42
  },
43
  {
 
45
  name: "Gemini",
46
  dates: "May 21 - Jun 20",
47
  emoji: "πŸ‘―",
48
+ symbol: "β™Š",
49
  imageFile: "GEMINI.png",
50
  },
51
  {
 
53
  name: "Leo",
54
  dates: "Jul 23 - Aug 22",
55
  emoji: "🦁",
56
+ symbol: "β™Œ",
57
  imageFile: "LEO.png",
58
  },
59
  {
 
61
  name: "Virgo",
62
  dates: "Aug 23 - Sep 22",
63
  emoji: "πŸ‘Έ",
64
+ symbol: "♍",
65
  imageFile: "VIRGO.png",
66
  },
67
  {
 
69
  name: "Aquarius",
70
  dates: "Jan 20 - Feb 18",
71
  emoji: "🏺",
72
+ symbol: "β™’",
73
  imageFile: "AQUARIUS.png",
74
  },
75
  {
 
77
  name: "Aries",
78
  dates: "Mar 21 - Apr 19",
79
  emoji: "🐏",
80
+ symbol: "β™ˆ",
81
  imageFile: "ARIES.png",
82
  },
83
  {
 
85
  name: "Cancer",
86
  dates: "Jun 21 - Jul 22",
87
  emoji: "πŸ¦€",
88
+ symbol: "β™‹",
89
  imageFile: "CANCER.png",
90
  },
91
  {
 
93
  name: "Scorpio",
94
  dates: "Oct 23 - Nov 21",
95
  emoji: "πŸ¦‚",
96
+ symbol: "♏",
97
  imageFile: "SCORPIO.png",
98
  },
99
  {
 
101
  name: "Capricorn",
102
  dates: "Dec 22 - Jan 19",
103
  emoji: "🐐",
104
+ symbol: "β™‘",
105
  imageFile: "CAPRICORN.png",
106
  },
107
  ];
 
201
  ],
202
  };
203
 
204
+ // Function to get image path based on gender
205
  const getImagePath = (sign) => {
206
  if (!sign.imageFile) return null;
207
  return `/img/${selectedGender}/${sign.imageFile}`;
 
330
  : "linear-gradient(135deg, #07090A 0%, #979999 100%)",
331
  }}
332
  >
333
+ {/* Background layer for separation */}
334
  <div
335
+ className={`w-full h-full rounded-full p-0.5 ${
336
+ isDarkMode ? "bg-gray-900" : "bg-gray-50"
337
  }`}
338
  >
339
+ <div
340
+ className={`w-full h-full rounded-full flex items-center justify-center text-xl overflow-hidden ${
341
+ isDarkMode ? "bg-gray-800" : "bg-gray-100"
342
+ }`}
 
 
 
 
 
 
 
 
 
343
  >
344
+ {getImagePath(sign) ? (
345
+ <img
346
+ src={getImagePath(sign)}
347
+ alt={sign.name}
348
+ className="w-full h-full object-cover rounded-full"
349
+ onError={(e) => {
350
+ e.target.style.display = "none";
351
+ e.target.nextSibling.style.display = "block";
352
+ }}
353
+ />
354
+ ) : null}
355
+ <span
356
+ style={{
357
+ display: getImagePath(sign) ? "none" : "block",
358
+ }}
359
+ >
360
+ {sign.emoji}
361
+ </span>
362
+ </div>
363
  </div>
364
  </div>
365
+ <p className="text-xs font-medium mt-3 text-center flex items-center justify-center gap-1">
366
+ <span className="text-sm">{sign.symbol}</span>
367
  {sign.name}
368
  </p>
369
  </div>
 
431
  background: "linear-gradient(135deg, #1D3249 0%, #96D1E2 100%)",
432
  }}
433
  >
434
+ {/* Background layer for separation */}
435
  <div
436
+ className={`w-full h-full rounded-full p-0.5 ${
437
+ isDarkMode ? "bg-gray-900" : "bg-gray-50"
438
  }`}
439
  >
440
+ <div
441
+ className={`w-full h-full rounded-full flex items-center justify-center text-2xl overflow-hidden ${
442
+ isDarkMode ? "bg-gray-800" : "bg-gray-100"
443
+ }`}
 
 
 
 
 
 
 
 
 
 
 
444
  >
445
+ {getImagePath(getCurrentSign()) ? (
446
+ <img
447
+ src={getImagePath(getCurrentSign())}
448
+ alt={getCurrentSign()?.name}
449
+ className="w-full h-full object-cover rounded-full"
450
+ onError={(e) => {
451
+ e.target.style.display = "none";
452
+ e.target.nextSibling.style.display = "block";
453
+ }}
454
+ />
455
+ ) : null}
456
+ <span
457
+ style={{
458
+ display: getImagePath(getCurrentSign())
459
+ ? "none"
460
+ : "block",
461
+ }}
462
+ >
463
+ {getCurrentSign()?.emoji}
464
+ </span>
465
+ </div>
466
  </div>
467
  </div>
468
  <div className="flex-1">
 
471
  <span className="text-xl">πŸ“ˆ</span>
472
  </h2>
473
  <div className="flex items-center gap-2">
474
+ <span className="text-xl">{getCurrentSign()?.symbol}</span>
475
  <span className="font-semibold">{getCurrentSign()?.name}</span>
476
  </div>
477
  </div>