Skip to content

Commit c08a241

Browse files
Fix www mobile (supabase#29640)
* fix ent quotes logos * mobile hp product cards * mobile customers section * mobile examples * update sitemap * mobile customers slider * remove autoplay
1 parent 9686f90 commit c08a241

24 files changed

+492
-262
lines changed

apps/www/components/BuiltWithSupabase.tsx

Lines changed: 0 additions & 49 deletions
This file was deleted.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import 'swiper/css'
2+
3+
import React, { FC } from 'react'
4+
import { useRouter } from 'next/router'
5+
import { Swiper, SwiperSlide } from 'swiper/react'
6+
import ExampleCard from '../ExampleCard'
7+
8+
import content from '~/data/home/content'
9+
import type { Example } from 'data/Examples'
10+
11+
interface Props {
12+
examples: Example[]
13+
className?: string
14+
}
15+
16+
const ExamplesMobile: FC<Props> = ({ examples, className }: any) => {
17+
const { basePath } = useRouter()
18+
19+
return (
20+
<div className={className}>
21+
<Swiper
22+
style={{ zIndex: 0, marginRight: '1px' }}
23+
initialSlide={0}
24+
spaceBetween={12}
25+
slidesPerView={1.1}
26+
speed={300}
27+
watchOverflow
28+
threshold={2}
29+
updateOnWindowResize
30+
className="!px-6 w-full overflow-visible"
31+
breakpoints={{
32+
320: {
33+
slidesPerView: 1.1,
34+
},
35+
540: {
36+
slidesPerView: 1.6,
37+
},
38+
720: {
39+
slidesPerView: 2.5,
40+
},
41+
}}
42+
>
43+
{examples.map((example: Example, i: number) => (
44+
<SwiperSlide key={`${content}-${i}`}>
45+
<ExampleCard {...example} showProducts />
46+
</SwiperSlide>
47+
))}
48+
</Swiper>
49+
</div>
50+
)
51+
}
52+
53+
export default ExamplesMobile
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import { Button, cn, IconGitHubSolid } from 'ui'
2+
import Link from 'next/link'
3+
4+
import SectionContainer from '~/components/Layouts/SectionContainer'
5+
import ExampleCard from '../ExampleCard'
6+
7+
import Examples from 'data/Examples'
8+
import ExamplesMobile from './ExamplesMobile'
9+
10+
const BuiltWithSupabase = () => {
11+
return (
12+
<>
13+
<SectionContainer id="examples" className="xl:pt-32 !pb-0">
14+
<div className="text-center flex flex-col items-center">
15+
<h3 className="h2">Start building in seconds</h3>
16+
<p className="p max-w-[300px] md:max-w-none">
17+
Kickstart your next project with templates built by us and our community.
18+
</p>
19+
<div className="flex justify-center gap-2 py-4">
20+
<Button asChild type="default" size="small" className="h-full">
21+
<Link href="/docs/guides/examples">View all examples</Link>
22+
</Button>
23+
<Button
24+
asChild
25+
type="default"
26+
icon={<IconGitHubSolid size="tiny" className="!w-full !h-full" />}
27+
size="small"
28+
>
29+
<Link href="https://github.com/supabase/supabase/tree/master/examples">
30+
Official GitHub library
31+
</Link>
32+
</Button>
33+
</div>
34+
</div>
35+
</SectionContainer>
36+
<SectionContainer className="relative w-full !px-0 lg:!px-16 xl:!px-20 !pb-0 mb-16 md:mb-12 lg:mb-12 !pt-6 max-w-[1400px]">
37+
<ExamplesMobile examples={Examples.slice(0, 6)} className="lg:hidden" />
38+
<div className="hidden lg:grid grid-cols-12 gap-5 mt-4">
39+
{Examples.slice(0, 6).map((example, i) => {
40+
return (
41+
<div
42+
className={cn(
43+
'col-span-12 h-full lg:col-span-6 xl:col-span-4',
44+
'flex items-stretch'
45+
)}
46+
key={i}
47+
>
48+
<ExampleCard {...example} showProducts />
49+
</div>
50+
)
51+
})}
52+
</div>
53+
</SectionContainer>
54+
</>
55+
)
56+
}
57+
58+
export default BuiltWithSupabase
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import 'swiper/css'
2+
import React from 'react'
3+
import { Swiper, SwiperSlide } from 'swiper/react'
4+
5+
import { cn } from 'ui'
6+
import { CompositionCol } from '.'
7+
import type { CompositionColType } from '.'
8+
9+
interface Props {
10+
className?: string
11+
columns: CompositionColType[]
12+
}
13+
14+
const CustomersSliderMobile: React.FC<Props> = ({ columns, className }) => (
15+
<div className={className}>
16+
<Swiper
17+
initialSlide={0}
18+
spaceBetween={12}
19+
slidesPerView="auto"
20+
speed={400}
21+
watchOverflow
22+
threshold={2}
23+
updateOnWindowResize
24+
allowTouchMove
25+
className="!px-6 w-full h-full overflow-visible"
26+
>
27+
{columns.map((column: CompositionColType, i: number) => (
28+
<SwiperSlide
29+
className={cn(
30+
'flex w-full !h-full',
31+
column.type === 'expanded' ? 'w-full max-w-[450px]' : '!w-[250px]'
32+
)}
33+
key={`${column.cards[0].organization}-mobile-customer-${i}`}
34+
>
35+
<CompositionCol
36+
className={cn(
37+
'flex flex-col w-full !h-full gap-3',
38+
column.type === 'expanded' ? 'w-full' : 'w-[250px]'
39+
)}
40+
column={column}
41+
/>
42+
</SwiperSlide>
43+
))}
44+
</Swiper>
45+
</div>
46+
)
47+
48+
export default CustomersSliderMobile
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import React from 'react'
2+
import { range } from 'lodash'
3+
import { cn } from 'ui'
4+
5+
import { CompositionCol } from '.'
6+
import type { CompositionColType } from '.'
7+
8+
interface Props {
9+
className?: string
10+
columns: CompositionColType[]
11+
}
12+
13+
const compositionGap = 'gap-4'
14+
15+
const CutomsersSliderDesktop: React.FC<Props> = ({ columns, className }) => (
16+
<div
17+
className={cn(
18+
'group/tw-marquee w-full items-stretch h-[300px] min-w-[300px] nowrap mb-16 md:mb-24 lg:mb-24',
19+
compositionGap,
20+
className
21+
)}
22+
>
23+
{range(0, 2).map((_, idx1: number) => (
24+
<div
25+
key={`row-${idx1}`}
26+
className={cn(
27+
'relative',
28+
'left-0 z-10',
29+
'w-auto h-full',
30+
'flex gap-4 items-end',
31+
'motion-safe:run motion-safe:animate-[marquee_50000ms_linear_both_infinite] group-hover/tw-marquee:pause',
32+
'will-change-transform transition-transform',
33+
compositionGap
34+
)}
35+
>
36+
{columns.map((column, idx2) => (
37+
<CompositionCol
38+
key={`customers-col-${idx1}-${idx2}`}
39+
className={cn(
40+
'flex flex-col !h-full',
41+
compositionGap,
42+
column.type === 'expanded' ? 'w-[450px]' : 'w-[250px]'
43+
)}
44+
column={column}
45+
/>
46+
))}
47+
</div>
48+
))}
49+
</div>
50+
)
51+
52+
export default CutomsersSliderDesktop

0 commit comments

Comments
 (0)