diff --git a/src/pages/ecosystem/Header/index.tsx b/src/pages/ecosystem/Header/index.tsx index 33fce10fd..cc5148c3d 100644 --- a/src/pages/ecosystem/Header/index.tsx +++ b/src/pages/ecosystem/Header/index.tsx @@ -48,7 +48,8 @@ const Header = () => { - Scroll Ecosystem + An Ecosystem
+ Forever in Motion
diff --git a/src/pages/ecosystem/Highlights/HighlightList/Card.tsx b/src/pages/ecosystem/Highlights/HighlightList/Card.tsx new file mode 100644 index 000000000..6900ee26c --- /dev/null +++ b/src/pages/ecosystem/Highlights/HighlightList/Card.tsx @@ -0,0 +1,80 @@ +import { useNavigate } from "react-router-dom" + +import { Box, Button, SvgIcon, Typography } from "@mui/material" +import { styled } from "@mui/system" + +import { ReactComponent as ArrowSvg } from "@/assets/svgs/ecosystem/arrow.svg" +import WebpImage from "@/components/WebpImage" + +const Card = styled(Box)(({ theme }) => ({ + backgroundColor: "#FFF8F3", + borderRadius: "2rem", + display: "flex", + flexDirection: "column", + gap: "2rem", + padding: "16px 16px 24px 16px", + cursor: "pointer", + color: theme.palette.text.primary, + [theme.breakpoints.down("lg")]: { + gap: "2rem", + }, +})) + +const BlogTitle = styled(Typography)(({ theme }) => ({ + fontWeight: 600, + fontSize: "2.4rem", + lineHeight: "3.6rem", + textAlign: "center", + verticalAlign: "bottom", + marginBottom: "0.6rem", +})) + +const BlogPoster = styled(WebpImage)(({ theme }) => ({ + width: "100%", + maxHeight: "23rem", + borderRadius: "1rem", + overflow: "hidden", + [theme.breakpoints.down("md")]: { + gridRow: 1, + borderRadius: "1.5rem", + }, +})) + +const ReadButton = styled(Button)(({ theme }) => ({ + gridArea: "action", + alignSelf: "center", + borderRadius: "0.8rem", + padding: "0.8rem 2.4rem", + fontSize: "1.8rem", + height: "4rem", + width: "10.6rem", + fontWeight: 600, + [theme.breakpoints.down("sm")]: { + justifySelf: "flex-start", + fontSize: "1.6rem", + width: "9.6rem", + }, +})) + +const BlogCard = ({ blog, small = false }) => { + const navigate = useNavigate() + const handleClick = () => { + if (blog.externalLink) { + window.location.href = blog.externalLink + } else { + navigate("/blog/" + blog.id) + } + } + + return ( + + + {blog.title} + }> + Read + + + ) +} + +export default BlogCard diff --git a/src/pages/ecosystem/Highlights/HighlightList/index.tsx b/src/pages/ecosystem/Highlights/HighlightList/index.tsx new file mode 100644 index 000000000..d81302884 --- /dev/null +++ b/src/pages/ecosystem/Highlights/HighlightList/index.tsx @@ -0,0 +1,78 @@ +import { Pagination } from "swiper/modules" +import { Swiper, SwiperSlide } from "swiper/react" + +import { styled } from "@mui/system" + +import useCheckViewport from "@/hooks/useCheckViewport" + +import BlogCard from "./Card" + +const StyledSwiper = styled(Swiper)(({ theme }) => ({ + marginTop: "2.4rem", + "&.swiper": { + paddingBottom: "5rem", + }, + "& .swiper-pagination-bullet": { + backgroundColor: "transparent", + border: "1px solid #fff", + width: "1.2rem", + height: "1.2rem", + opacity: 1, + margin: "0 1rem !important", + }, + "& .swiper-pagination-bullet-active": { + backgroundColor: "#fff", + }, +})) + +const data = [ + { + title: "Scaling DeFi: Announcing The First zkEVM Market On Aave", + posterImg: "https://scroll.ghost.io/content/images/2024/08/Hero-page_Darwin-Mainnet-Upgrade-_1280-_721--1-.png", + link: "https://baidu.com", + }, + { + title: "Scaling DeFi: Announcing The First zkEVM Market On Aave", + posterImg: "https://scroll.ghost.io/content/images/2024/08/Hero-page_Darwin-Mainnet-Upgrade-_1280-_721--1-.png", + link: "https://baidu.com", + }, + { + title: "Scaling DeFi: Announcing The First zkEVM Market On Aave", + posterImg: "https://scroll.ghost.io/content/images/2024/08/Hero-page_Darwin-Mainnet-Upgrade-_1280-_721--1-.png", + link: "https://baidu.com", + }, + { + title: "Scaling DeFi: Announcing The First zkEVM Market On Aave", + posterImg: "https://scroll.ghost.io/content/images/2024/08/Hero-page_Darwin-Mainnet-Upgrade-_1280-_721--1-.png", + link: "https://baidu.com", + }, +] + +const Carousel = props => { + const { isPortrait, isTabletLandscape } = useCheckViewport() + let slidesPerView = 3 + if (isTabletLandscape) { + slidesPerView = 2 + } else if (isPortrait) { + slidesPerView = 1 + } + return ( + + {data.map(blog => ( + + + + ))} + + ) +} + +export default Carousel diff --git a/src/pages/ecosystem/Highlights/index.tsx b/src/pages/ecosystem/Highlights/index.tsx new file mode 100644 index 000000000..a6f7289b5 --- /dev/null +++ b/src/pages/ecosystem/Highlights/index.tsx @@ -0,0 +1,73 @@ +import { useEffect } from "react" +import { useLocation, useNavigate } from "react-router-dom" + +import { Stack, Typography } from "@mui/material" + +import Button from "@/components/Button" +import SectionWrapper from "@/components/SectionWrapper" +import { ECOSYSTEM_PAGE_SYMBOL } from "@/constants" +import useCheckViewport from "@/hooks/useCheckViewport" + +// import useCanvasStore from "@/stores/canvasStore" +import HighlightList from "./HighlightList" + +const data = [ + { + title: "Scaling DeFi: Announcing The First zkEVM Market On Aave", + cover: "Discover Badges on Scroll Canvas", + link: "https://baidu.com", + }, + { + title: "Scaling DeFi: Announcing The First zkEVM Market On Aave", + cover: "Discover Badges on Scroll Canvas", + link: "https://baidu.com", + }, + { + title: "Scaling DeFi: Announcing The First zkEVM Market On Aave", + cover: "Discover Badges on Scroll Canvas", + link: "https://baidu.com", + }, + { + title: "Scaling DeFi: Announcing The First zkEVM Market On Aave", + cover: "Discover Badges on Scroll Canvas", + link: "https://baidu.com", + }, +] + +const Highlights = () => { + const { isMobile, isTablet } = useCheckViewport() + const { hash } = useLocation() + // const { badgeList } = useCanvasStore() + const navigate = useNavigate() + + useEffect(() => { + if (hash) { + const targetEl = document.getElementById(`${ECOSYSTEM_PAGE_SYMBOL}-${hash.slice(1)}`) + if (targetEl) { + targetEl.scrollIntoView({ + behavior: "smooth", + }) + } + } + }, [hash]) + + return ( + + + + Ecosystem highlights + + + + + + ) +} +export default Highlights diff --git a/src/pages/ecosystem/index.tsx b/src/pages/ecosystem/index.tsx index 3be864abc..b45b0896d 100644 --- a/src/pages/ecosystem/index.tsx +++ b/src/pages/ecosystem/index.tsx @@ -1,11 +1,13 @@ import Contribute from "./Contribute" import Header from "./Header" +import Highlights from "./Highlights" import Protocols from "./Protocols" const Ecosystem = () => { return ( <>
+