|
1 | | -import React from "react"; |
| 1 | +import React, { useState } from "react"; |
2 | 2 | import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; |
3 | | -import { faArrowUpRightFromSquare } from "@fortawesome/free-solid-svg-icons"; |
| 3 | +import { |
| 4 | + faArrowUpRightFromSquare, |
| 5 | + faChevronDown, |
| 6 | + faChevronUp, |
| 7 | +} from "@fortawesome/free-solid-svg-icons"; |
4 | 8 |
|
5 | 9 | function Toplink() { |
| 10 | + const [isVisible, setIsVisible] = useState(true); |
| 11 | + |
6 | 12 | return ( |
7 | | - <div |
8 | | - style={{ |
9 | | - position: "fixed", |
10 | | - bottom: "30px", |
11 | | - left: "50%", |
12 | | - transform: "translateX(-50%)", |
13 | | - zIndex: "1000", |
14 | | - backgroundColor: "white", |
15 | | - padding: "10px", |
16 | | - borderRadius: "10px", |
17 | | - boxShadow: "0 0 10px rgba(0, 0, 0, 0.5)", |
18 | | - border: "3px solid #000000", // Initial border |
19 | | - animation: "borderAnimation 2s infinite", // Apply animation |
20 | | - }} |
21 | | - > |
22 | | - <div> |
23 | | - <a |
24 | | - href="https://konfhub.com/yuvarang-2025" |
25 | | - target="_blank" |
26 | | - rel="noopener noreferrer" |
27 | | - style={{ |
28 | | - color: "black", |
29 | | - fontWeight: "bold", |
30 | | - }} |
31 | | - onMouseEnter={(e) => (e.target.style.color = "blue")} |
32 | | - onMouseLeave={(e) => (e.target.style.color = "black")} |
33 | | - > |
34 | | - ✨ Register Now for Yuvarang 2025 ✨ |
35 | | - <FontAwesomeIcon icon={faArrowUpRightFromSquare} /> |
36 | | - </a> |
37 | | - </div> |
38 | | - <div |
| 13 | + <div> |
| 14 | + <button |
| 15 | + onClick={() => setIsVisible(!isVisible)} |
39 | 16 | style={{ |
40 | | - alignItems: "center", |
41 | | - justifyContent: "center", |
42 | | - display: "flex", |
43 | | - flexDirection: "column", |
| 17 | + position: "fixed", |
| 18 | + bottom: "10px", |
| 19 | + left: "50%", |
| 20 | + transform: "translateX(-50%)", |
| 21 | + zIndex: "1001", |
| 22 | + background: "none", |
| 23 | + border: "none", |
| 24 | + cursor: "pointer", |
44 | 25 | }} |
45 | 26 | > |
46 | | - <button className="rainbow-text2"> |
47 | | - <a |
48 | | - href="https://drive.google.com/file/d/1QWBCFOCWWI7yo0hUFoSM9n9c0WvorNDj/view?usp=sharing" |
49 | | - target="_blank" |
50 | | - rel="noreferrer" |
| 27 | + <FontAwesomeIcon |
| 28 | + icon={isVisible ? faChevronDown : faChevronUp} |
| 29 | + size="2x" |
| 30 | + color="white" |
| 31 | + /> |
| 32 | + </button> |
| 33 | + |
| 34 | + {isVisible && ( |
| 35 | + <div |
| 36 | + style={{ |
| 37 | + position: "fixed", |
| 38 | + bottom: "50px", |
| 39 | + left: "50%", |
| 40 | + transform: "translateX(-50%)", |
| 41 | + zIndex: "1000", |
| 42 | + backgroundColor: "white", |
| 43 | + padding: "10px", |
| 44 | + borderRadius: "10px", |
| 45 | + boxShadow: "0 0 10px rgba(0, 0, 0, 0.5)", |
| 46 | + border: "3px solid #000000", |
| 47 | + animation: "borderAnimation 2s infinite", |
| 48 | + }} |
| 49 | + > |
| 50 | + <div> |
| 51 | + <a |
| 52 | + href="https://konfhub.com/yuvarang-2025" |
| 53 | + target="_blank" |
| 54 | + rel="noopener noreferrer" |
| 55 | + style={{ |
| 56 | + color: "black", |
| 57 | + fontWeight: "bold", |
| 58 | + }} |
| 59 | + onMouseEnter={(e) => (e.target.style.color = "blue")} |
| 60 | + onMouseLeave={(e) => (e.target.style.color = "black")} |
| 61 | + > |
| 62 | + ✨ Register Now for Yuvarang 2025 ✨ |
| 63 | + <FontAwesomeIcon icon={faArrowUpRightFromSquare} /> |
| 64 | + </a> |
| 65 | + </div> |
| 66 | + <div |
| 67 | + style={{ |
| 68 | + alignItems: "center", |
| 69 | + justifyContent: "center", |
| 70 | + display: "flex", |
| 71 | + flexDirection: "column", |
| 72 | + }} |
51 | 73 | > |
52 | | - ✨View RuleBook✨{" "} |
53 | | - {/* <FontAwesomeIcon icon={faArrowUpRightFromSquare} /> */} |
54 | | - </a> |
55 | | - </button> |
56 | | - </div> |
| 74 | + <button className="rainbow-text2"> |
| 75 | + <a |
| 76 | + href="https://drive.google.com/file/d/1QWBCFOCWWI7yo0hUFoSM9n9c0WvorNDj/view?usp=sharing" |
| 77 | + target="_blank" |
| 78 | + rel="noreferrer" |
| 79 | + > |
| 80 | + ✨View RuleBook✨ |
| 81 | + </a> |
| 82 | + </button> |
| 83 | + </div> |
| 84 | + </div> |
| 85 | + )} |
57 | 86 | </div> |
58 | 87 | ); |
59 | 88 | } |
|
0 commit comments