menu
This commit is contained in:
@@ -10,7 +10,6 @@ import react from "@astrojs/react";
|
|||||||
import mdx from "@astrojs/mdx";
|
import mdx from "@astrojs/mdx";
|
||||||
import pagefind from "astro-pagefind";
|
import pagefind from "astro-pagefind";
|
||||||
|
|
||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
site: "https://eduseg.com.br",
|
site: "https://eduseg.com.br",
|
||||||
|
|||||||
@@ -7,12 +7,15 @@ const courses = await getCollection(
|
|||||||
"courses",
|
"courses",
|
||||||
({ data }) => data.draft != true,
|
({ data }) => data.draft != true,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const { title } = Astro.props;
|
||||||
---
|
---
|
||||||
|
|
||||||
<nav
|
<nav
|
||||||
class="bg-lime-400 sticky top-0 z-10 py-3 drop-shadow shadow-sm"
|
class="bg-lime-400 sticky top-0 z-10 py-3 drop-shadow shadow-sm"
|
||||||
x-data="{ open: false }"
|
x-data="{ open: false }"
|
||||||
x-on:keydown.esc.prevent.stop="open = false"
|
x-on:keydown.esc.prevent.stop="open = false"
|
||||||
|
x-effect="document.documentElement.classList.toggle('overflow-hidden', open)"
|
||||||
>
|
>
|
||||||
<Container class="flex items-center">
|
<Container class="flex items-center">
|
||||||
<button
|
<button
|
||||||
@@ -22,7 +25,7 @@ const courses = await getCollection(
|
|||||||
aria-haspopup="true"
|
aria-haspopup="true"
|
||||||
>
|
>
|
||||||
<div class="truncate max-w-36 sm:max-w-72 md:max-w-124">
|
<div class="truncate max-w-36 sm:max-w-72 md:max-w-124">
|
||||||
NR-18 PEMT Plataforma Elevatória Móvel de Trabalho
|
{title}
|
||||||
</div>
|
</div>
|
||||||
<Icon name="chevron-down" aria-hidden="true" class="size-4" />
|
<Icon name="chevron-down" aria-hidden="true" class="size-4" />
|
||||||
</button>
|
</button>
|
||||||
@@ -38,15 +41,8 @@ const courses = await getCollection(
|
|||||||
<div
|
<div
|
||||||
x-cloak
|
x-cloak
|
||||||
x-show="open"
|
x-show="open"
|
||||||
x-on:click.outside="open = false"
|
|
||||||
x-transition:enter="transition ease-linear duration-50"
|
|
||||||
x-transition:enter-start="opacity-0"
|
|
||||||
x-transition:enter-end="opacity-100 "
|
|
||||||
x-transition:leave="transition ease-in duration-50"
|
|
||||||
x-transition:leave-start="opacity-100"
|
|
||||||
x-transition:leave-end="opacity-0"
|
|
||||||
role="menu"
|
role="menu"
|
||||||
class="absolute top-0 bg-lime-400 w-full py-6 2xl:py-24 rounded-b-2xl drop-shadow shadow-sm"
|
class="absolute top-0 bg-lime-400 w-full py-6 2xl:py-24 rounded-b-2xl drop-shadow shadow-sm max-h-screen overflow-auto"
|
||||||
style="display: none;"
|
style="display: none;"
|
||||||
>
|
>
|
||||||
<Container class="text-black relative xl:w-10/12 2xl:w-5xl">
|
<Container class="text-black relative xl:w-10/12 2xl:w-5xl">
|
||||||
@@ -61,7 +57,7 @@ const courses = await getCollection(
|
|||||||
<div class="border-b border-black pb-6 lg:pb-12 mb-6 lg:mb-12">
|
<div class="border-b border-black pb-6 lg:pb-12 mb-6 lg:mb-12">
|
||||||
<span>Curso de formação</span>
|
<span>Curso de formação</span>
|
||||||
<h1 class="text-xl lg:text-2xl">
|
<h1 class="text-xl lg:text-2xl">
|
||||||
NR-18 PEMT Plataforma Elevatória Móvel de Trabalho
|
{title}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -107,21 +103,46 @@ const courses = await getCollection(
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul
|
<div x-data="{ expanded: false }">
|
||||||
class="list-disc list-inside max-lg:[&_li]:truncate font-medium"
|
<div class="relative">
|
||||||
>
|
<div
|
||||||
{
|
x-show="! expanded"
|
||||||
courses.map(({ data: { title, slug } }) => {
|
class="absolute bottom-0 h-16 w-full bg-gradient-to-t from-lime-400 to-lime-400/30"
|
||||||
return (
|
>
|
||||||
<li>
|
</div>
|
||||||
<a href={`/${slug}`} class="hover:underline">
|
<ul
|
||||||
{title}
|
class="list-disc list-inside max-lg:[&_li]:truncate font-medium overflow-hidden"
|
||||||
</a>
|
:class="expanded ? 'h-none' : 'h-36'"
|
||||||
</li>
|
>
|
||||||
);
|
{
|
||||||
})
|
courses.map(({ data: { title, slug } }) => {
|
||||||
}
|
return (
|
||||||
</ul>
|
<li>
|
||||||
|
<a
|
||||||
|
href={`/${slug}`}
|
||||||
|
class=" hover:underline p-0.5"
|
||||||
|
>
|
||||||
|
{title}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
:aria-expanded="expanded"
|
||||||
|
x-on:click="expanded = ! expanded"
|
||||||
|
class="border border-black rounded-full px-5 py-1 cursor-pointer mt-2.5"
|
||||||
|
aria-expanded="false"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
x-text="expanded ? 'Ocultar' : 'Exibir todos os cursos'"
|
||||||
|
>
|
||||||
|
Exibir todos os cursos
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</Container>
|
</Container>
|
||||||
</div>
|
</div>
|
||||||
<!-- Dropdown Menu End -->
|
<!-- Dropdown Menu End -->
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ const { Content } = await render(course);
|
|||||||
</Fragment>
|
</Fragment>
|
||||||
|
|
||||||
<Fragment slot="nav">
|
<Fragment slot="nav">
|
||||||
<HeaderNav />
|
<HeaderNav {...data} />
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
|
||||||
<section class="space-y-6 lg:space-y-24">
|
<section class="space-y-6 lg:space-y-24">
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ import { Picture } from "astro:assets";
|
|||||||
import { Icon } from "astro-icon/components";
|
import { Icon } from "astro-icon/components";
|
||||||
import Layout from "~/layouts/Layout.astro";
|
import Layout from "~/layouts/Layout.astro";
|
||||||
import Container from "~/components/Container.astro";
|
import Container from "~/components/Container.astro";
|
||||||
import { Clients } from "~/components/Course";
|
|
||||||
import Search from "./_components/Search.astro";
|
import Search from "./_components/Search.astro";
|
||||||
|
import { Clients } from "~/components/Course";
|
||||||
|
|
||||||
import mulhercomepi from "~/assets/mulher-com-epi.png";
|
import mulhercomepi from "~/assets/mulher-com-epi.png";
|
||||||
const treands = [
|
const trends = [
|
||||||
{
|
{
|
||||||
label: "NR-18 PEMT Plataforma Móvel de Trabalho Aéreo",
|
label: "NR-18 PEMT Plataforma Móvel de Trabalho Aéreo",
|
||||||
href: "nr-18-plataforma-de-trabalho-aereo",
|
href: "nr-18-plataforma-de-trabalho-aereo",
|
||||||
@@ -48,7 +48,7 @@ const treands = [
|
|||||||
</h2>
|
</h2>
|
||||||
<ul class="list-disc list-inside font-medium">
|
<ul class="list-disc list-inside font-medium">
|
||||||
{
|
{
|
||||||
treands.map(({ label, href }) => (
|
trends.map(({ label, href }) => (
|
||||||
<li>
|
<li>
|
||||||
<a href={href}>{label}</a>
|
<a href={href}>{label}</a>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
import { QueryClient } from "@tanstack/react-query";
|
|
||||||
|
|
||||||
export const queryClient = new QueryClient();
|
|
||||||
Reference in New Issue
Block a user