ntphuc149 commited on
Commit
cc6bf68
·
verified ·
1 Parent(s): 4e0b876

Update src/App.js

Browse files
Files changed (1) hide show
  1. src/App.js +102 -10
src/App.js CHANGED
@@ -1,5 +1,79 @@
1
  import React, { useState } from "react";
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  const HoroscopeApp = () => {
4
  const [selectedSign, setSelectedSign] = useState("taurus");
5
  const [selectedGender, setSelectedGender] = useState("female");
@@ -123,7 +197,7 @@ const HoroscopeApp = () => {
123
  {
124
  id: "relationship",
125
  name: "Relationship",
126
- icon: <i class="ri-team-line"></i>,
127
  },
128
  {
129
  id: "finance",
@@ -367,10 +441,16 @@ const HoroscopeApp = () => {
367
  e.target.nextSibling.style.display = "block";
368
  }}
369
  />
370
- ) : null}
 
 
 
 
 
 
371
  <span
372
  style={{
373
- display: getImagePath(sign) ? "none" : "block",
374
  }}
375
  >
376
  {sign.emoji}
@@ -379,7 +459,11 @@ const HoroscopeApp = () => {
379
  </div>
380
  </div>
381
  <p className="text-xs font-medium mt-3 text-center flex items-center justify-center gap-1">
382
- <span className="text-sm">{sign.symbol}</span>
 
 
 
 
383
  {sign.name}
384
  </p>
385
  </div>
@@ -468,12 +552,16 @@ const HoroscopeApp = () => {
468
  e.target.nextSibling.style.display = "block";
469
  }}
470
  />
471
- ) : null}
 
 
 
 
 
 
472
  <span
473
  style={{
474
- display: getImagePath(getCurrentSign())
475
- ? "none"
476
- : "block",
477
  }}
478
  >
479
  {getCurrentSign()?.emoji}
@@ -487,7 +575,11 @@ const HoroscopeApp = () => {
487
  <i className="ri-pulse-line text-xl"></i>
488
  </h2>
489
  <div className="flex items-center gap-2">
490
- <span className="text-xl">{getCurrentSign()?.symbol}</span>
 
 
 
 
491
  <span className="font-semibold">{getCurrentSign()?.name}</span>
492
  </div>
493
  </div>
@@ -577,4 +669,4 @@ const HoroscopeApp = () => {
577
  );
578
  };
579
 
580
- export default HoroscopeApp;
 
1
  import React, { useState } from "react";
2
 
3
+ // Zodiac Icon Components using Tabler Icons SVGs
4
+ const ZodiacIcon = ({ sign, size = 24, className = "" }) => {
5
+ const iconPaths = {
6
+ taurus: [
7
+ "M6 3a6 6 0 0 0 12 0",
8
+ "M12 15m-6 0a6 6 0 1 0 12 0a6 6 0 1 0 -12 0",
9
+ ],
10
+ sagittarius: ["M4 20l16 -16", "M13 4h7v7", "M6.5 12.5l5 5"],
11
+ pisces: ["M5 3a21 21 0 0 1 0 18", "M19 3a21 21 0 0 0 0 18", "M5 12l14 0"],
12
+ libra: ["M5 20l14 0", "M5 17h5v-.3a7 7 0 1 1 4 0v.3h5"],
13
+ gemini: [
14
+ "M3 3a21 21 0 0 0 18 0",
15
+ "M3 21a21 21 0 0 1 18 0",
16
+ "M7 4.5l0 15",
17
+ "M17 4.5l0 15",
18
+ ],
19
+ leo: [
20
+ "M13 17a4 4 0 1 0 8 0",
21
+ "M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",
22
+ "M11 7m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",
23
+ "M7 7c0 3 2 5 2 9",
24
+ "M15 7c0 4 -2 6 -2 10",
25
+ ],
26
+ virgo: [
27
+ "M3 4a2 2 0 0 1 2 2v9",
28
+ "M5 6a2 2 0 0 1 4 0v9",
29
+ "M9 6a2 2 0 0 1 4 0v10a7 5 0 0 0 7 5",
30
+ "M12 21a7 5 0 0 0 7 -5v-2a3 3 0 0 0 -6 0",
31
+ ],
32
+ aquarius: [
33
+ "M3 10l3 -3l3 3l3 -3l3 3l3 -3l3 3",
34
+ "M3 17l3 -3l3 3l3 -3l3 3l3 -3l3 3",
35
+ ],
36
+ aries: ["M12 5a5 5 0 1 0 -4 8", "M16 13a5 5 0 1 0 -4 -8", "M12 21l0 -16"],
37
+ cancer: [
38
+ "M6 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",
39
+ "M18 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",
40
+ "M3 12a10 6.5 0 0 1 14 -6.5",
41
+ "M21 12a10 6.5 0 0 1 -14 6.5",
42
+ ],
43
+ scorpio: [
44
+ "M3 4a2 2 0 0 1 2 2v9",
45
+ "M5 6a2 2 0 0 1 4 0v9",
46
+ "M9 6a2 2 0 0 1 4 0v10a3 3 0 0 0 3 3h5l-3 -3m0 6l3 -3",
47
+ ],
48
+ capricorn: [
49
+ "M4 4a3 3 0 0 1 3 3v9",
50
+ "M7 7a3 3 0 0 1 6 0v11a3 3 0 0 1 -3 3",
51
+ "M16 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",
52
+ ],
53
+ };
54
+
55
+ const paths = iconPaths[sign] || [];
56
+
57
+ return (
58
+ <svg
59
+ width={size}
60
+ height={size}
61
+ viewBox="0 0 24 24"
62
+ fill="none"
63
+ stroke="currentColor"
64
+ strokeWidth="2"
65
+ strokeLinecap="round"
66
+ strokeLinejoin="round"
67
+ className={className}
68
+ >
69
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
70
+ {paths.map((path, index) => (
71
+ <path key={index} d={path} />
72
+ ))}
73
+ </svg>
74
+ );
75
+ };
76
+
77
  const HoroscopeApp = () => {
78
  const [selectedSign, setSelectedSign] = useState("taurus");
79
  const [selectedGender, setSelectedGender] = useState("female");
 
197
  {
198
  id: "relationship",
199
  name: "Relationship",
200
+ icon: <i className="ri-team-line"></i>,
201
  },
202
  {
203
  id: "finance",
 
441
  e.target.nextSibling.style.display = "block";
442
  }}
443
  />
444
+ ) : (
445
+ <ZodiacIcon
446
+ sign={sign.id}
447
+ size={28}
448
+ className="text-gray-600"
449
+ />
450
+ )}
451
  <span
452
  style={{
453
+ display: getImagePath(sign) ? "none" : "none",
454
  }}
455
  >
456
  {sign.emoji}
 
459
  </div>
460
  </div>
461
  <p className="text-xs font-medium mt-3 text-center flex items-center justify-center gap-1">
462
+ <ZodiacIcon
463
+ sign={sign.id}
464
+ size={16}
465
+ className="text-current"
466
+ />
467
  {sign.name}
468
  </p>
469
  </div>
 
552
  e.target.nextSibling.style.display = "block";
553
  }}
554
  />
555
+ ) : (
556
+ <ZodiacIcon
557
+ sign={getCurrentSign()?.id}
558
+ size={32}
559
+ className="text-gray-600"
560
+ />
561
+ )}
562
  <span
563
  style={{
564
+ display: getImagePath(getCurrentSign()) ? "none" : "none",
 
 
565
  }}
566
  >
567
  {getCurrentSign()?.emoji}
 
575
  <i className="ri-pulse-line text-xl"></i>
576
  </h2>
577
  <div className="flex items-center gap-2">
578
+ <ZodiacIcon
579
+ sign={getCurrentSign()?.id}
580
+ size={20}
581
+ className="text-current"
582
+ />
583
  <span className="font-semibold">{getCurrentSign()?.name}</span>
584
  </div>
585
  </div>
 
669
  );
670
  };
671
 
672
+ export default HoroscopeApp;