Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

open source background grid

Francesco Sansalvadorec59cf7d10209
diff --git a/apps/www/components/OpenSource/OSSHero.tsx b/apps/www/components/OpenSource/OSSHero.tsx
new file mode 100644
index 00000000000..fef72852bef
--- /dev/null
+++ b/apps/www/components/OpenSource/OSSHero.tsx
@@ -0,0 +1,204 @@
+import React from 'react'
+import { useBreakpoint, useTheme } from 'common'
+import { motion } from 'framer-motion'
+
+import styles from './hero.module.css'
+import { useWindowSize } from 'react-use'
+
+const OSSHero = () => (
+ <>
+ <div
+ className={[
+ 'absolute z-[-4] flex flex-col top-0 left-0 w-screen h-[300px] lg:h-[500px] overflow-hidden pointer-events-none',
+ ].join(' ')}
+ >
+ <div className="absolute bottom-0 z-[1] w-full h-1/3 bg-gradient-to-t from-background to-transparent" />
+ <div className="absolute top-0 z-[1] w-full h-3/5 bg-gradient-to-b from-background to-transparent" />
+ </div>
+ <div
+ className={[
+ 'absolute inset-0 w-full h-[300px] lg:h-[500px] overflow-hidden pointer-events-none',
+ styles['hero-container'],
+ ].join(' ')}
+ >
+ <div className={['w-full h-full opacity-20 dark:opacity-60', styles['gradient']].join(' ')} />
+ <div className="absolute bottom-0 z-[-2] w-full h-full bg-gradient-to-t from-background to-transparent" />
+ <HeroGrid />
+ </div>
+ </>
+)
+
+const HeroGrid = () => {
+ const { isDarkMode } = useTheme()
+ const { width } = useWindowSize()
+ const isSm = useBreakpoint(640)
+
+ const svgGridOptions = {
+ color: isDarkMode ? '#00d4ad' : '#015a42',
+ boxWidth: width ? width * 7 : 7500,
+ boxHeight: width ? width * 5 : 6000,
+ xLines: isSm ? 20 : 49,
+ yLines: isSm ? 65 : 130,
+ strokeWidth: 1,
+ }
+
+ const GridSVG = () => (
+ <svg
+ preserveAspectRatio="none"
+ width="100%"
+ height="100%"
+ viewBox={`0 0 ${svgGridOptions.boxWidth} ${svgGridOptions.boxHeight}`}
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ {[...new Array(svgGridOptions.yLines)].map((_: any, i: number) => {
+ const y = (svgGridOptions.boxWidth * i) / svgGridOptions.yLines
+ return (
+ <line
+ key={`y-${i}`}
+ x1={svgGridOptions.boxHeight}
+ y1={y}
+ x2="0"
+ y2={y}
+ stroke={svgGridOptions.color}
+ strokeWidth={svgGridOptions.strokeWidth}
+ shapeRendering="crispEdges"
+ />
+ )
+ })}
+ {[...new Array(svgGridOptions.xLines)].map((_: any, i: number) => {
+ const x = (svgGridOptions.boxHeight * i) / svgGridOptions.xLines
+ return (
+ <>
+ <line
+ key={`x-${i}`}
+ x1={x}
+ y1={svgGridOptions.boxWidth}
+ x2={x}
+ y2="0"
+ stroke={svgGridOptions.color}
+ strokeWidth={svgGridOptions.strokeWidth}
+ shapeRendering="crispEdges"
+ />
+ {isSm
+ ? i === 9 && (
+ <line
+ x1={x}
+ y1={svgGridOptions.boxWidth}
+ x2={x}
+ y2="0"
+ stroke="url(#electric-pulse)"
+ strokeLinecap="round"
+ strokeWidth={4}
+ shapeRendering="crispEdges"
+ />
+ )
+ : i === 25 && (
+ <line
+ x1={x}
+ y1={svgGridOptions.boxWidth}
+ x2={x}
+ y2="0"
+ stroke="url(#electric-pulse)"
+ strokeLinecap="round"
+ strokeWidth={4}
+ shapeRendering="crispEdges"
+ />
+ )}
+ {isSm
+ ? i === 14 && (
+ <line
+ x1={x}
+ y1={svgGridOptions.boxWidth}
+ x2={x}
+ y2="0"
+ stroke="url(#electric-pulse-2)"
+ strokeLinecap="round"
+ strokeWidth={4}
+ shapeRendering="crispEdges"
+ />
+ )
+ : i === 33 && (
+ <line
+ x1={x}
+ y1={svgGridOptions.boxWidth}
+ x2={x}
+ y2="0"
+ stroke="url(#electric-pulse-2)"
+ strokeLinecap="round"
+ strokeWidth={4}
+ shapeRendering="crispEdges"
+ />
+ )}
+ </>
+ )
+ })}
+ <defs>
+ <motion.linearGradient
+ animate={{
+ x2: [svgGridOptions.boxWidth / 2, 0, svgGridOptions.boxWidth / 2],
+ x1: [svgGridOptions.boxWidth / 2, 0, svgGridOptions.boxWidth / 2],
+ y1: [svgGridOptions.boxHeight, svgGridOptions.boxHeight / 3, 0],
+ y2: [svgGridOptions.boxHeight, svgGridOptions.boxHeight / 2, 0],
+ }}
+ transition={{
+ duration: isSm ? 4 : 5,
+ repeat: Infinity,
+ ease: 'linear',
+ }}
+ id="electric-pulse"
+ gradientUnits="userSpaceOnUse"
+ >
+ <stop stopColor={svgGridOptions.color} stopOpacity="0" />
+ <stop stopColor={svgGridOptions.color} stopOpacity="0.8" />
+ <stop offset="1" stopColor="var(--colors-brand9)" stopOpacity="0" />
+ </motion.linearGradient>
+ <motion.linearGradient
+ animate={{
+ x2: [svgGridOptions.boxWidth / 2, 0, svgGridOptions.boxWidth / 2],
+ x1: [svgGridOptions.boxWidth / 2, 0, svgGridOptions.boxWidth / 2],
+ y1: [svgGridOptions.boxHeight, svgGridOptions.boxHeight / 3, 0],
+ y2: [svgGridOptions.boxHeight, svgGridOptions.boxHeight / 2, 0],
+ }}
+ transition={{
+ duration: isSm ? 4 : 5,
+ repeat: Infinity,
+ ease: 'linear',
+ delay: 2,
+ }}
+ id="electric-pulse-2"
+ gradientUnits="userSpaceOnUse"
+ >
+ <stop stopColor={svgGridOptions.color} stopOpacity="0" />
+ <stop stopColor={svgGridOptions.color} stopOpacity="0.8" />
+ <stop offset="1" stopColor="var(--colors-brand9)" stopOpacity="0" />
+ </motion.linearGradient>
+ </defs>
+ </svg>
+ )
+
+ return (
+ <div
+ className={[
+ 'relative -z-10 ![perspective:1200px] sm:![perspective:1200px] md:![perspective:1200px] lg:![perspective:1200px]',
+ ].join(' ')}
+ >
+ <div
+ style={{
+ transform: 'rotateX(85deg)',
+ position: 'absolute',
+ top: 0,
+ bottom: 0,
+ left: 0,
+ right: 0,
+ }}
+ >
+ <div className={[styles['hero-grid-lines']].join(' ')}>
+ <GridSVG />
+ </div>
+ </div>
+ </div>
+ )
+}
+
+export default OSSHero
diff --git a/apps/www/components/OpenSource/Repos.tsx b/apps/www/components/OpenSource/Repos.tsx
index 903b91e1b08..8c34f6fae46 100644
--- a/apps/www/components/OpenSource/Repos.tsx
+++ b/apps/www/components/OpenSource/Repos.tsx
@@ -95,13 +95,14 @@ const Repos = ({ tabs, repos }: Props) => {
</Link>
</div>
<div className="w-full gap-2 flex flex-col items-center">
- <div className="flex border justify-center max-w-full w-full md:w-auto overflow-hidden items-center rounded-full bg-surface-100 relative [&_.swiper-wrapper]:w-full [&_.swiper-slide]:w-fit">
+ <div className="relative flex border justify-center h-fit max-w-full w-full md:w-auto overflow-hidden items-center rounded-full bg-surface-100 [&_.swiper-wrapper]:w-full [&_.swiper-slide]:w-fit">
<Swiper
// @ts-ignore
onSwiper={setApiSwiper}
style={{ padding: 10 }}
initialSlide={0}
spaceBetween={10}
+ grabCursor
slidesPerView="auto"
onSlideChange={(slider) =>
setSwiperState(slider.isEnd ? 'END' : slider.isBeginning ? 'START' : 'MIDDLE')
diff --git a/apps/www/components/OpenSource/hero.module.css b/apps/www/components/OpenSource/hero.module.css
new file mode 100644
index 00000000000..366359aa567
--- /dev/null
+++ b/apps/www/components/OpenSource/hero.module.css
@@ -0,0 +1,49 @@
+.hero-container {
+ z-index: -6;
+ transition: perspective 3s ease 0s;
+}
+
+.hero-grid-lines {
+ position: absolute;
+ width: 120vw;
+ height: 120vh;
+ min-height: 800px;
+ margin-left: 0%;
+ transform: translateY(0);
+ overflow: hidden;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ inset: 0;
+ margin: 0 auto;
+ animation: animate-grid 30s linear infinite;
+ will-change: transform;
+}
+
+.gradient {
+ position: absolute;
+ user-select: none;
+ pointer-events: none;
+ inset: 0px;
+ z-index: -3;
+ filter: blur(140px);
+ transform: translateZ(0px);
+ background: radial-gradient(ellipse 50% 60% at 50% 70%, #3ecf8e, transparent),
+ radial-gradient(ellipse 70% 80% at 50% 50%, #1d7a50, transparent);
+}
+
+@media (min-width: 1024px) {
+ .hero-grid-lines {
+ animation-duration: 30s;
+ }
+}
+
+@keyframes animate-grid {
+ 0% {
+ transform: translateY(500px);
+ }
+
+ to {
+ transform: translateY(100px);
+ }
+}
diff --git a/apps/www/pages/open-source/index.tsx b/apps/www/pages/open-source/index.tsx
index 761bf6de1aa..a314c1611d5 100644
--- a/apps/www/pages/open-source/index.tsx
+++ b/apps/www/pages/open-source/index.tsx
@@ -3,11 +3,8 @@ import { useRouter } from 'next/router'
import { Octokit } from '@octokit/core'
import DefaultLayout from '~/components/Layouts/Default'
import SectionContainer from '~/components/Layouts/SectionContainer'
-import maintainers from '~/data/maintainers.json'
-import Image from 'next/image'
import { NextSeo } from 'next-seo'
import ProductHeaderCentered from '~/components/Sections/ProductHeaderCentered'
-import Sponsors from '~/components/Sponsors'
import Repos from '~/components/OpenSource/Repos'
import Sponsorships from '~/components/OpenSource/Sponsorships'
@@ -15,17 +12,12 @@ import pageData from '~/data/open-source'
// Import Swiper styles if swiper used on page
import 'swiper/swiper.min.css'
+import OSSHero from '../../components/OpenSource/OSSHero'
const OpenSource = () => {
const octokit = new Octokit()
const [repos, setRepos] = useState([{}])
- const maintainerTags = maintainers
- .reduce((acc: any, x: any) => acc.concat(x.tags), []) // get all tags
- .filter((v: any, i: any, a: any) => a.indexOf(v) === i) // remove duplicates
- .sort((a: any, b: any) => a.localeCompare(b)) // alphabetical
- const maintainerPills = ['All'].concat(maintainerTags)
-
useEffect(() => {
async function fetchOctoData() {
const res = await octokit.request('GET /orgs/{org}/repos', {
@@ -39,7 +31,6 @@ const OpenSource = () => {
fetchOctoData()
}, [])
- console.log(repos)
const router = useRouter()
const meta_title = pageData.metaTitle || 'Open Source | Supabase'
@@ -63,10 +54,11 @@ const OpenSource = () => {
],
}}
/>
- <DefaultLayout>
+ <DefaultLayout className="relative">
<SectionContainer className="overflow-hidden pt-8 pb-12 md:pt-12">
<ProductHeaderCentered className="-mb-14" {...pageData.heroSection} />
</SectionContainer>
+ <OSSHero />
<SectionContainer className="!pt-0">
<Repos repos={repos} tabs={pageData.repo_tabs} title="Yooo" paragraph="asfd" />
</SectionContainer>