Newer
Older
import {
Button,
Card,
Carousel,
Search,
} from "@onegeo-suite/gatsby-theme-onegeo"
import { twMerge } from "tailwind-merge"
name: string
description: string
image: string
url: string
title?: string
subtitle?: string
content?: string
action?: Action
services?: Array<Service>
bgImage?: Array<Bg>
}
const Hero = (props: Props) => {
title = "Onegeo Suite Portal",
content = "Solution Open Source sur-mesure pour communiquer et valoriser les données disponibles sur votre territoire ou vos infrastructures.",
action = {},
services = [],
src: "https://picsum.photos/1920/600?random=1",
src: "https://picsum.photos/1920/600?random=2",
src: "https://picsum.photos/1920/600?random=3",
const options = props.options ?? {}
imageFondList = bgImage
imageFond = [
imageFondList.map((image: any) => {
const layoutClass = {
xs: {
main: "h-xl",
image: "h-xl",
services: "-bottom-12",
},
base: {
main: "h-2xl",
image: "h-2xl",
services: "-bottom-12",
},
xl: {
main: "h-3xl",
image: "h-3xl",
services: "bottom-12",
},
}
const lClass = layoutClass[options.size || "base"] || layoutClass["base"]
const layout = options.layout || "card"
className={twMerge(
"relative z-0 mb-20 flex flex-col",
lClass.main,
oClass.main
)}
{options.search !== false && (
<Search
options={merge(
{
class: {
main: "z-50 absolute w-full md:mt-8 ",
combobox:
"md:rounded-md md:shadow-2xl max-w-3xl md:p-2",
input: "md:text-xl md:pl-14",
icon: "md:w-6 md:h-6",
},
},
options?.search
)}
height={lClass.main}
<Image
image={bgImage[0].src}
className={twMerge("w-full", lClass.image, oClass.main)}
"absolute top-0 z-10 h-full w-full bg-gradient-to-r from-slate-500 opacity-80",
{layout === "card" ? (
<div
className={twMerge(
"absolute top-0 z-20 mb-5 w-full text-center",
oClass.body
)}
>
<div
className={twMerge(
oClass.bodydiv
)}
>
<h1
className={twMerge(
"text-primary-content mb-5 text-3xl font-extrabold tracking-tight lg:text-6xl",
oClass.title
)}
>
oClass.subtitle
)}
>
{subtitle}
</div>
<p className={twMerge("mb-5", oClass.content)}>
{content}
</p>
{action && action.name !== "" ? (
<Button
"btn-primary text-primary-content ",
{...action}
/>
) : null}
</div>
) : (
<></>
)}
{layout === "card" ? (
<div
className={twMerge(
"absolute z-10 flex w-full flex-row flex-wrap justify-center gap-6",
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
)}
>
{services &&
services.map((service, idx) => {
return (
<Card
key={idx}
layout="left"
size="xs"
{...service}
options={merge(
{
class: {
main: "w-96",
body: "place-content-center",
figure: "basis-20",
image: "m-auto h-16",
imageComponent:
"object-scale-down",
},
},
merge(options?.card, service?.options)
)}
/>
)
})}
</div>
) : (
<div
className={twMerge(
"absolute z-10 grid h-full w-full grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",
oClass.services
)}
>
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
{services &&
services.map((service, idx) => {
return (
<Card
key={idx}
layout="top"
size="full"
anime={false}
{...service}
options={merge(
{
class: {
main: "card-side sm:flex-col shadow-none bg-transparent opacity-90 sm:pt-10 lg:pt-40 group/card transition duration-200 ease-out hover:bg-base-100 ",
body: "self-center text-base-100 group-hover/card:text-base-content lg:transition lg:duration-200 ease-in-out lg:group-hover/card:-translate-y-6",
figure: "lg:transition lg:duration-200 ease-in-out lg:group-hover/card:-translate-y-6",
image: "m-auto w-40 h-24 md:h-32 lg:h-40 ",
imageComponent:
"object-scale-down",
title: "sm:justify-center text-xl lg:text-2xl",
description:
" hidden lg:block text-xl text-center opacity-0 lg:transition lg:duration-200 ease-out lg:group-hover/card:opacity-100",
__for_inline_svg:
"h-full w-full fill-slate-50 group-hover/card:fill-sky-700",
},
},
merge(options?.card, service?.options)
)}
/>
)
})}
</div>
)}