Skip to content

Commit e517660

Browse files
authored
Merge pull request #247 from prabhakar-dessai/social-links
social-links files
2 parents 32e6cce + de268b9 commit e517660

File tree

2 files changed

+114
-0
lines changed

2 files changed

+114
-0
lines changed

social-links/social-links.js

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
import React, { useState } from "react";
2+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
3+
import {
4+
faGithub,
5+
faLinkedinIn,
6+
faDiscord,
7+
} from "@fortawesome/free-brands-svg-icons";
8+
import { faLink } from "@fortawesome/free-solid-svg-icons";
9+
10+
function sociallinks() {
11+
//saves state of the clicked component
12+
let [isOpen, setIsOpen] = useState(false);
13+
const handleClick = () => {
14+
setIsOpen(!isOpen);
15+
};
16+
// var className = isOpen ? 'click-state' : 'base-state';
17+
return (
18+
//holds the whole component
19+
<div className="relative w-96 h-96 flex items-center justify-center ml-40 bg-black z-0">
20+
{/* github arm and icon */}
21+
<span
22+
className={
23+
(!isOpen
24+
? "transition-transform ease duration-[1000ms] scale-100 rotate-[15deg] delay-0 "
25+
: "transition-transform ease duration-[1000ms] scale-[0.45] delay-0 ") +
26+
"text-white text-xl absolute w-10 h-96 top-0 flex justify-center origin-bottom-center after:absolute after:w-px after:h-12 after:bg-white after:top-10 after:content-'' "
27+
}
28+
>
29+
<FontAwesomeIcon
30+
className={
31+
(!isOpen
32+
? "transition-transform ease duration-[1000ms] -rotate-[15deg] delay-0 "
33+
: "") +
34+
"absolute -rotate-10 border-solid border-2 rounded-[50%] p-1.5"
35+
}
36+
icon={faGithub}
37+
/>
38+
</span>
39+
{/* linkedin arm and icon */}
40+
<span
41+
className={
42+
(!isOpen
43+
? "transition-transform ease duration-[1000ms] scale-100 rotate-[45deg] delay-0 "
44+
: "transition-transform ease duration-[1000ms] scale-[0.45] delay-0 ") +
45+
"text-white text-xl absolute w-10 h-96 top-0 flex justify-center origin-bottom-center after:absolute after:w-px after:h-12 after:bg-white after:top-10 after:content-''"
46+
}
47+
>
48+
<FontAwesomeIcon
49+
className={
50+
(!isOpen
51+
? "transition-transform ease duration-[1000ms] -rotate-[45deg] delay-0 "
52+
: " ") +
53+
"absolute -rotate-50 border-solid border-2 rounded-[50%] p-1.5"
54+
}
55+
icon={faLinkedinIn}
56+
/>
57+
</span>
58+
{/* discord arm and icon */}
59+
<span
60+
className={
61+
(!isOpen
62+
? "transition-transform ease duration-[1000ms] scale-100 rotate-[75deg] delay-0 "
63+
: "transition-transform ease duration-[1000ms] scale-[0.45] delay-0 ") +
64+
"text-white text-xl absolute w-10 h-96 top-0 flex justify-center origin-bottom-center after:absolute after:w-px after:h-12 after:bg-white after:top-10 after:content-'' "
65+
}
66+
>
67+
<FontAwesomeIcon
68+
className={
69+
(!isOpen
70+
? "transition-transform ease duration-[1000ms] -rotate-[75deg] delay-0 "
71+
: " ") +
72+
"absolute -rotate-80 border-solid border-2 rounded-[50%] p-1.5"
73+
}
74+
icon={faDiscord}
75+
/>
76+
</span>
77+
{/* central icon */}
78+
<div
79+
onClick={handleClick}
80+
className="w-48 h-48 text-[7.5rem] relative bg-black rounded-[50%] flex items-center justify-center cursor-pointer after:absolute after:bg-gradient-to-r from-emerald-300 via-green-400 via-indigo-500 to-pink-400 after:-top-0.5 after:-bottom-0.5 after:-left-0.5 after:-right-0.5 after:rounded-[50%] after:content-'' after:z-negetive"
81+
>
82+
<FontAwesomeIcon className="text-white text-8xl" icon={faLink} />
83+
</div>
84+
</div>
85+
);
86+
}
87+
88+
export default sociallinks;

social-links/tailwind.config.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
module.exports = {
2+
content: [
3+
"./pages/**/*.{js,ts,jsx,tsx}",
4+
"./components/**/*.{js,ts,jsx,tsx}",
5+
],
6+
theme: {
7+
extend: {
8+
transitionProperty: {
9+
height: "height",
10+
},
11+
zIndex: {
12+
negetive: "-1",
13+
1: "1",
14+
},
15+
rotate: {
16+
20: "20deg",
17+
50: "50deg",
18+
80: "80deg",
19+
},
20+
transitionTimingFunction: {
21+
ease: "cubic-bezier(0.25, 0.1, 0.16, 1)",
22+
},
23+
plugins: [],
24+
},
25+
},
26+
};

0 commit comments

Comments
 (0)