diff --git a/components/community.css b/components/community.css index 571d6ef6..e99ffae6 100644 --- a/components/community.css +++ b/components/community.css @@ -15,3 +15,40 @@ margin: calc(-100px / 2); width: 250px; } +.social-cloud { + display: flex; + justify-content: center; + align-items: center; + padding: 2em 0; +} + +@media (max-width: 768px) { + .link-1, + .link-2, + .link-3, + .link-4, + .link-5 { + height: 60px; + width: 60px; + margin-left: 10px; + } + .social-link { + display: flex; + justify-content: center; + align-items: center; + width: 60px; + height: 60px; + margin-left: 10px; + border-radius: 50%; + background-color: #fff; + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); + transition: transform 0.3s ease; + position: relative; + } + .social-link p { + display: none; + } + .social-link:hover { + transform: scale(1.2); + } +} diff --git a/components/community.tsx b/components/community.tsx index 051f2ea5..78b96222 100644 --- a/components/community.tsx +++ b/components/community.tsx @@ -1,4 +1,6 @@ -import React from "react"; +'use client'; + +import React, { useState } from "react"; import "./community.css"; import Image from "next/image"; import CommunityBunny from "@/public/images/community-bunny.png"; @@ -38,9 +40,7 @@ const createCircleStyles = ( const dangle = 360 / totalCircles; const currentAngle = angle + dangle * index; return { - transform: `rotate(${currentAngle}deg) translate(${ - containerWidth / 2 - }px) rotate(-${currentAngle}deg)`, + transform: `rotate(${currentAngle}deg) translate(${containerWidth / 2}px) rotate(-${currentAngle}deg)`, }; }; @@ -77,6 +77,7 @@ function SocialLinkCard({ } export default function Community() { + const [value, setValue] = useState("Where Code Meets Community!"); const cardsData: CardData[] = [ { link: "https://twitter.com/Keployio", @@ -110,10 +111,7 @@ export default function Community() { }, ]; - // Define the number of circles you want to render const totalCircles = cardsData.length; - - // You can adjust this width as per your requirement or dynamically based on the parent component's state const containerWidth = 600; const cardsSurround = Array.from({ length: totalCircles }, (_, index) => ( @@ -128,18 +126,8 @@ export default function Community() { /> )); - const cardsList = Array.from({ length: totalCircles }, (_, index) => ( - - )); - return ( -
+

🐰 Join the Keploy community ✨ @@ -157,7 +145,23 @@ export default function Community() {

Image - {cardsList} +
+ {cardsData.map((link, index) => ( + setValue(link.description)} + onMouseLeave={() => setValue("Where Code Meets Community!")} + > + {link.platformName} + + ))} +
+

{value}

diff --git a/package-lock.json b/package-lock.json index 31ff6423..03c35fa1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11742,6 +11742,7 @@ } }, "node_modules/tailwindcss": { + "version": "3.4.14", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.14.tgz", "integrity": "sha512-IcSvOcTRcUtQQ7ILQL5quRDg7Xs93PdJEk1ZLbhhvJc7uj/OAhYOnruEiwnGgBvUtaUAJ8/mhSw1o8L2jCiENA==",