From 231d8bbc22c2646b0c972cc072884b7bc21a559c Mon Sep 17 00:00:00 2001
From: Joshen Lim
Date: Wed, 17 Aug 2022 18:25:39 +0800
Subject: [PATCH 01/79] Midway starting on realtime landing page
---
apps/www/data/Solutions.json | 8 +
.../data/products/realtime/api-examples.js | 83 +++++++++
.../data/products/realtime/app-examples.js | 62 +++++++
apps/www/pages/realtime/Realtime.module.css | 7 +
apps/www/pages/realtime/Realtime.tsx | 175 ++++++++++++++++++
apps/www/pages/realtime/index.tsx | 3 +
6 files changed, 338 insertions(+)
create mode 100644 apps/www/data/products/realtime/api-examples.js
create mode 100644 apps/www/data/products/realtime/app-examples.js
create mode 100644 apps/www/pages/realtime/Realtime.module.css
create mode 100644 apps/www/pages/realtime/Realtime.tsx
create mode 100644 apps/www/pages/realtime/index.tsx
diff --git a/apps/www/data/Solutions.json b/apps/www/data/Solutions.json
index 7e9131da046..e6abd655e13 100644
--- a/apps/www/data/Solutions.json
+++ b/apps/www/data/Solutions.json
@@ -30,5 +30,13 @@
"description_short": "",
"label": "",
"url": "/edge-functions"
+ },
+ "realtime": {
+ "name": "Realtime",
+ "icon": "M13 10V3L4 14h7v7l9-11h-7z",
+ "description": "Listen to changes in a Postgres Database and broadcast them over web sockets",
+ "description_short": "",
+ "label": "",
+ "url": "/realtime"
}
}
diff --git a/apps/www/data/products/realtime/api-examples.js b/apps/www/data/products/realtime/api-examples.js
new file mode 100644
index 00000000000..3519bdba82e
--- /dev/null
+++ b/apps/www/data/products/realtime/api-examples.js
@@ -0,0 +1,83 @@
+export default [
+ {
+ lang: 'js',
+ title: 'Subscribing to events',
+ description: '',
+ code: `
+import { RealtimeClient } from '@supabase/realtime-js'
+const client = new RealtimeClient(process.env.REALTIME_URL)
+
+// Listen to events on the entire database.
+const databaseChanges = client.channel('realtime:*')
+databaseChanges.on('*', (e) => console.log(e))
+databaseChanges.subscribe()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `,
+ },
+ {
+ lang: 'js',
+ title: 'Presence',
+ description: '',
+ code: `
+import { RealtimeClient } from '@supabase/realtime-js'
+const client = new RealtimeClient(process.env.REALTIME_URL)
+
+const channel = client.channel('room:*')
+channel.on('presence', { event: 'SYNC' }, () => {
+ console.log('Presence synced')
+})
+channel.subscribe().receive('ok', () => console.log('Subscribed!))
+
+
+
+
+
+
+
+
+
+
+
+
+ `,
+ },
+ {
+ lang: 'js',
+ title: 'Broadcast',
+ description: '',
+ code: `
+ // Sign in with magic links
+ const { user, error } = await supabase.auth.signIn({
+ email: 'example@email.com'
+ })
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `,
+ },
+]
diff --git a/apps/www/data/products/realtime/app-examples.js b/apps/www/data/products/realtime/app-examples.js
new file mode 100644
index 00000000000..c9b7bcc93b5
--- /dev/null
+++ b/apps/www/data/products/realtime/app-examples.js
@@ -0,0 +1,62 @@
+export default [
+ {
+ image: '',
+ title: 'Leaderboard',
+ description:
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ',
+ },
+ {
+ image: '',
+ title: 'Shared code editor',
+ description:
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ',
+ },
+ {
+ image: '',
+ title: 'Shared text editor',
+ description:
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ',
+ },
+ {
+ image: '',
+ title: 'Stock market',
+ description:
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ',
+ },
+ {
+ image: '',
+ title: 'Share whiteboard',
+ description:
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ',
+ },
+ {
+ image: '',
+ title: 'Multiplayer',
+ description:
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ',
+ },
+ {
+ image: '',
+ title: 'Charts',
+ description:
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ',
+ },
+ {
+ image: '',
+ title: 'Location',
+ description:
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ',
+ },
+ {
+ image: '',
+ title: 'Notifications',
+ description:
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ',
+ },
+ {
+ image: '',
+ title: 'In app chat',
+ description:
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ',
+ },
+]
diff --git a/apps/www/pages/realtime/Realtime.module.css b/apps/www/pages/realtime/Realtime.module.css
new file mode 100644
index 00000000000..3dd7008e1bd
--- /dev/null
+++ b/apps/www/pages/realtime/Realtime.module.css
@@ -0,0 +1,7 @@
+/* .github-icon svg {
+ fill: currentColor;
+} */
+
+.github-icon {
+ @apply text-white;
+}
diff --git a/apps/www/pages/realtime/Realtime.tsx b/apps/www/pages/realtime/Realtime.tsx
new file mode 100644
index 00000000000..0cfd3b81ca3
--- /dev/null
+++ b/apps/www/pages/realtime/Realtime.tsx
@@ -0,0 +1,175 @@
+import {
+ Button,
+ IconArrowUpRight,
+ IconBriefcase,
+ IconEye,
+ IconLink,
+ IconShield,
+} from '@supabase/ui'
+
+// [TODO] These need to be relooked - I'm using multiplayer.dev as a "docs"
+import ApiExamples from 'data/products/realtime/api-examples'
+import AppExamples from 'data/products/realtime/app-examples'
+
+import AuthSqlRulesExamples from 'data/products/auth/auth-sql-rules-examples'
+import Solutions from 'data/Solutions.json'
+import { NextSeo } from 'next-seo'
+import Image from 'next/image'
+import Link from 'next/link'
+import { useRouter } from 'next/router'
+import SplitCodeBlockCarousel from '~/components/Carousels/SplitCodeBlockCarousel'
+import CTABanner from '~/components/CTABanner'
+import FeatureColumn from '~/components/FeatureColumn'
+import FloatingIcons from '~/components/FloatingIcons'
+import DefaultLayout from '~/components/Layouts/Default'
+import SectionContainer from '~/components/Layouts/SectionContainer'
+import APISection from '~/components/Sections/APISection'
+import GithubExamples from '~/components/Sections/GithubExamples'
+import ProductHeader from '~/components/Sections/ProductHeader'
+import AuthProviders from '~/data/auth.json'
+
+const Cursor = (color: string = 'none') => {
+ return (
+
+ )
+}
+
+function AuthPage() {
+ // base path for images
+ const { basePath } = useRouter()
+ const meta_title = 'Realtime | Sync your data in real time'
+ const meta_description =
+ 'Listens to changes in a PostgreSQL Database and broadcasts them over WebSockets'
+
+ return (
+ <>
+
+
+ Build reactive web and mobile applications]}
+ subheader={[
+ 'Sync data across clients by listening to changes in your Database and broadcasting them over web sockets',
+ ]}
+ image={[
+
+
+
,
+ //
+ //
+ //
,
+ //
+ //
+ //
,
+ ]}
+ // [TODO] Point to the correct docs URL
+ documentation_url={'/docs/guides/auth'}
+ />
+
+
+
+ {/* [TODO] Update copy */}
+
+ APIs that you can understand. With powerful libraries that work on client and
+ server-side applications.
+
+
,
+ ]}
+ // [TODO] Point to the correct docs URL
+ documentation_link={'/docs/guides/auth'}
+ />
+
+
+
+
+
+
+
+
What you can build with Realtime
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
+ incididunt ut labore et dolore magna aliqua.
+
+
+ {AppExamples.map((example) => {
+ return (
+
+
+
{example.title}
+
{example.description}
+
+ )
+ })}
+
+
+
+
+
+
+
+ >
+ )
+}
+
+export default AuthPage
diff --git a/apps/www/pages/realtime/index.tsx b/apps/www/pages/realtime/index.tsx
new file mode 100644
index 00000000000..a8eea95247e
--- /dev/null
+++ b/apps/www/pages/realtime/index.tsx
@@ -0,0 +1,3 @@
+import Realtime from './Realtime'
+
+export default Realtime
From 7612f6725c300384b613c4f937b8309cf132b3cc Mon Sep 17 00:00:00 2001
From: Joshen Lim
Date: Wed, 17 Aug 2022 20:18:26 +0800
Subject: [PATCH 02/79] Playing around with hero image
---
apps/www/pages/realtime/Realtime.module.css | 100 +++++++++++++++++++-
apps/www/pages/realtime/Realtime.tsx | 34 ++++++-
2 files changed, 125 insertions(+), 9 deletions(-)
diff --git a/apps/www/pages/realtime/Realtime.module.css b/apps/www/pages/realtime/Realtime.module.css
index 3dd7008e1bd..dab399b724c 100644
--- a/apps/www/pages/realtime/Realtime.module.css
+++ b/apps/www/pages/realtime/Realtime.module.css
@@ -1,7 +1,97 @@
-/* .github-icon svg {
- fill: currentColor;
-} */
+.element {
+ animation: element 8s infinite;
+}
-.github-icon {
- @apply text-white;
+@keyframes element {
+ 39% {
+ border-color: hsla(153, 60%, 28%, 1)
+ }
+ 40% {
+ border-color: #FFF;
+ }
+ 75% {
+ border-color: #FFF;
+ }
+ 80% {
+ border-color: hsla(153, 60%, 28%, 1)
+ }
+}
+
+.cursor-1 {
+ transform-origin: left;
+ animation: cursor-1 8s cubic-bezier(0, 0, 0.2, 1) infinite;
+}
+
+@keyframes cursor-1 {
+ 20%{
+ transform: scale(1) translate(0)
+ }
+ 25% {
+ transform: scale(1) translate(-50px, -20px)
+ }
+ 39% {
+ transform: scale(1) translate(-50px, -20px)
+ }
+ 40% {
+ transform: scale(0.9) translate(-50px, -20px)
+ }
+ 41% {
+ transform: scale(1) translate(-50px, -20px)
+ }
+ 75% {
+ transform: scale(1) translate(-50px, -20px)
+ }
+ 80% {
+ transform: scale(1) translate(0)
+ }
+}
+
+.cursor-2 {
+ animation: cursor-2 6s cubic-bezier(0, 0, 0.2, 1) infinite;
+}
+
+@keyframes cursor-2 {
+ 15% {
+ transform: translate(0px, 0px)
+ }
+ 20% {
+ transform: translate(70px, -40px)
+ }
+ 70% {
+ transform: translate(70px, -40px)
+ }
+ 75% {
+ transform: translate(0px, 0px)
+ }
+}
+
+.comment-bubble {
+ animation: chat 6s cubic-bezier(0, 0, 0.2, 1) infinite;
+}
+
+@keyframes chat {
+ 0% {
+ opacity: 0;
+ transform: translateY(5px);
+ }
+ 25% {
+ opacity: 0;
+ transform: translateY(5px);
+ }
+ 30% {
+ opacity: 1;
+ transform: translateY(0);
+ }
+ 65% {
+ opacity: 1;
+ transform: translateY(0);
+ }
+ 70% {
+ opacity: 0;
+ transform: translateY(5px);
+ }
+ 100% {
+ opacity: 0;
+ transform: translateY(5px);
+ }
}
diff --git a/apps/www/pages/realtime/Realtime.tsx b/apps/www/pages/realtime/Realtime.tsx
index 0cfd3b81ca3..b464526d617 100644
--- a/apps/www/pages/realtime/Realtime.tsx
+++ b/apps/www/pages/realtime/Realtime.tsx
@@ -10,6 +10,7 @@ import {
// [TODO] These need to be relooked - I'm using multiplayer.dev as a "docs"
import ApiExamples from 'data/products/realtime/api-examples'
import AppExamples from 'data/products/realtime/app-examples'
+import RealtimeStyles from './Realtime.module.css'
import AuthSqlRulesExamples from 'data/products/auth/auth-sql-rules-examples'
import Solutions from 'data/Solutions.json'
@@ -28,14 +29,14 @@ import GithubExamples from '~/components/Sections/GithubExamples'
import ProductHeader from '~/components/Sections/ProductHeader'
import AuthProviders from '~/data/auth.json'
-const Cursor = (color: string = 'none') => {
+const Cursor = ({ className = '', color = 'none' }) => {
return (