Skip to content

Commit

Permalink
Merge branch 'mateus/correcoes-button' of https://github.com/deco-sit…
Browse files Browse the repository at this point in the history
  • Loading branch information
omattaeus committed Jan 13, 2025
2 parents 09b7a26 + 4b36db0 commit f3c43d3
Showing 66 changed files with 1,888 additions and 1,608 deletions.
17 changes: 16 additions & 1 deletion .deco/blocks/Abertura%20Home.json
Original file line number Diff line number Diff line change
@@ -2,5 +2,20 @@
"__resolveType": "site/sections/Final/Headers/Openning.tsx",
"title": "Gestão inteligente para sonhar mais",
"highlight": "sonhar mais",
"subtitleDescription": "A Linked entende as dores do seu negócio e pode te ajudar a economizar e lucrar"
"subtitleDescription": "A Linked entende as dores do seu negócio e pode te ajudar a economizar e lucrar",
"open": [
{
"title": "Gestão inteligente para sonhar mais",
"highlight": "sonhar mais",
"subtitleDescription": "A Linked entende as dores do seu negócio e pode te ajudar a economizar e lucrar"
},
{
"title": "Gestão inteligente para sonhar mais",
"highlight": "sonhar mais"
},
{
"title": "Gestão inteligente para sonhar mais",
"highlight": "sonhar mais"
}
]
}
16 changes: 9 additions & 7 deletions .deco/blocks/pages-My%2520New%2520Page-461078.json
Original file line number Diff line number Diff line change
@@ -29,7 +29,8 @@
"section": {
"__resolveType": "site/sections/Final/Form/InputText.tsx",
"title": "Por favor, diga o seu nome.",
"placeholder": "Por favor, diga o seu nome."
"placeholder": "Por favor, diga o seu nome.",
"name": "name"
},
"title": "Por favor, diga o seu nome.",
"text": "Por favor, diga o seu nome.",
@@ -73,12 +74,13 @@
{
"section": {
"__resolveType": "site/sections/Final/Form/InputText.tsx",
"title": "Por favor, diga o seu nome.",
"placeholder": "Por favor, diga o seu nome."
"title": "Por favor, diga o seu sobrenome.",
"placeholder": "Por favor, diga o seu sobrenome.",
"name": "lastname"
},
"title": "Por favor, diga o seu nome.",
"text": "Por favor, diga o seu nome.",
"description": "Por favor, diga o seu nome."
"title": "Por favor, diga o seu sobrenome.",
"text": "Por favor, diga o seu sobrenome.",
"description": "Por favor, diga o seu sobrenome."
},
{
"section": {
@@ -127,7 +129,7 @@
}
],
"text": "Teste",
"name": "Teste"
"name": "radio"
},
"title": "Teste",
"text": "Teste",
2 changes: 1 addition & 1 deletion components/ui/Content/Benefits/index.tsx
Original file line number Diff line number Diff line change
@@ -228,4 +228,4 @@ function Benefits({ benefits, collapse, colorTheme }: Props) {
}
}

export default Benefits;
export default Benefits;
6 changes: 0 additions & 6 deletions components/ui/Content/BigNumber/index.tsx
Original file line number Diff line number Diff line change
@@ -29,12 +29,6 @@ function setClass(value: string) {
}
}

/* Descrição do component
*asdasd
*asd
*asd
*/

function BigNumber(
{ number, description, colorTheme }: JSX.IntrinsicElements["div"] & Props,
) {
2 changes: 1 addition & 1 deletion components/ui/Content/ComparisonBody/index.tsx
Original file line number Diff line number Diff line change
@@ -96,4 +96,4 @@ function ExampleComponent({ body }: JSX.IntrinsicElements["div"] & Props) {
);
}

export default ExampleComponent;
export default ExampleComponent;
14 changes: 12 additions & 2 deletions components/ui/Content/ComparisonFooter/index.tsx
Original file line number Diff line number Diff line change
@@ -17,7 +17,12 @@ function ComparisonFooter(
</div>
)}
{left.button && (
<ButtonComponent text={left.button.text} link={left.button.link} icon={left.button.icon} buttonTheme={left.button.buttonTheme} />
<ButtonComponent
text={left.button.text}
link={left.button.link}
icon={left.button.icon}
buttonTheme={left.button.buttonTheme}
/>
)}
</div>
)}
@@ -31,7 +36,12 @@ function ComparisonFooter(
</div>
)}
{right.button && (
<ButtonComponent text={right.button.text} link={right.button.link} icon={right.button.icon} buttonTheme={right.button.buttonTheme} />
<ButtonComponent
text={right.button.text}
link={right.button.link}
icon={right.button.icon}
buttonTheme={right.button.buttonTheme}
/>
)}
</div>
)}
4 changes: 3 additions & 1 deletion components/ui/Content/Conection/index.tsx
Original file line number Diff line number Diff line change
@@ -38,7 +38,9 @@ function Conection({
</div>
<div class="absolute inset-0 flex justify-center items-center">
<div
class={`w-16 h-16 lg:w-[70px] lg:h-[70px] ${setClass("bg", circleBackground)} ${
class={`w-16 h-16 lg:w-[70px] lg:h-[70px] ${
setClass("bg", circleBackground)
} ${
setClass("text", colorText)
} flex justify-center items-center rounded-full font-sans text-[32px] lg:text-[48px] font-medium leading-tight-35 tracking-tight-0.64`}
>
2 changes: 1 addition & 1 deletion components/ui/Content/CustomDropdown/index.tsx
Original file line number Diff line number Diff line change
@@ -110,4 +110,4 @@ function CustomDropdown({
);
}

export default CustomDropdown;
export default CustomDropdown;
6 changes: 2 additions & 4 deletions components/ui/Content/Dropdown/index.tsx
Original file line number Diff line number Diff line change
@@ -109,12 +109,10 @@ function Dropdown({
</div>
))
)
: (
<p className=""></p>
)}
: <p className=""></p>}
</div>
</div>
);
}

export default Dropdown;
export default Dropdown;
42 changes: 27 additions & 15 deletions components/ui/Content/Lead/index.tsx
Original file line number Diff line number Diff line change
@@ -4,24 +4,36 @@ import type { JSX } from "preact";
import ButtonComponent from "../../Button/index.tsx";
import TitleComponent from "../Title/index.tsx";

function Lead({ title, button, placeholder }: JSX.IntrinsicElements["div"] & Props) {
function Lead(
{ title, button, placeholder }: JSX.IntrinsicElements["div"] & Props,
) {
return (
<>
<div className="flex justify-center">
<div className="w-full max-w-[706px] p-12 pb-24">
<TitleComponent content={title.content} color={title.colorTheme} alignment={title.textAlignment} />
<input
name="email"
// class="input input-bordered flex-grow"
class="w-full pb-2 border-b-2 border-sacramentoState bg-transparent text-lg font-normal text-sacramentoState placeholder:text-sacramentoState-40"
type="text"
placeholder={placeholder}
/>
<div className="pt-4">
<ButtonComponent text={button.text} link={button.link} icon={button.icon} buttonTheme={button.buttonTheme} tamanho={button.tamanho} />
</div>
</div>
<div className="flex justify-center">
<div className="w-full max-w-[706px] p-12 pb-24">
<TitleComponent
content={title.content}
color={title.colorTheme}
alignment={title.textAlignment}
/>
<input
name="email"
// class="input input-bordered flex-grow"
class="w-full pb-2 border-b-2 border-sacramentoState bg-transparent text-lg font-normal text-sacramentoState placeholder:text-sacramentoState-40"
type="text"
placeholder={placeholder}
/>
<div className="pt-4">
<ButtonComponent
text={button.text}
link={button.link}
icon={button.icon}
buttonTheme={button.buttonTheme}
tamanho={button.tamanho}
/>
</div>
</div>
</div>
</>
);
}
2 changes: 1 addition & 1 deletion components/ui/Content/List/index.tsx
Original file line number Diff line number Diff line change
@@ -50,4 +50,4 @@ function List({ items, colorTheme, isFirst, isLast }: Props) {
);
}

export default List;
export default List;
2 changes: 1 addition & 1 deletion components/ui/Content/LogoGroup/index.tsx
Original file line number Diff line number Diff line change
@@ -43,4 +43,4 @@ function LogoGroupComponent(
);
}

export default LogoGroupComponent;
export default LogoGroupComponent;
95 changes: 95 additions & 0 deletions components/ui/Content/Openning/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import Script, { type Props } from "./script.tsx";

export interface Open {
/**
* @title Título
* @description Escreva aqui o título da abertura
*/
title?: string;
/**
* @title Palavra ou Frase com Cor
* @description Escreva a palavra ou frase com cor
*/
highlight?: string;
/**
* @title Subtítulo
* @description Escreva aqui o subtítulo da abertura
*/
subtitleDescription?: string;
}

/**
* @title {{{title}}}
*/
export interface Props {
/**
* @title Título do Bloco
* @description Escreva aqui o título do bloco
*/
title?: string;
/**
* @title Títulos de Abertura
* @description Lista de títulos de abertura com suas propriedades
*/
open?: Open[];
}

export default function Section({
title = "",
open = [],
}: Props) {
const getHighlightedText = (text: string, highlight?: string) => {
if (!highlight) return text;

const parts = text.split(new RegExp(`(${highlight})`, "gi"));
return parts.map((part, index) =>
part.toLowerCase() === highlight.toLowerCase()
? (
<span key={index} className="text-accent">
{part}
</span>
)
: part
);
};

return (
<>
<div className="bg-sacramentoState h-[80vh] flex">
<div className="ml-4 md:ml-10 w-full flex flex-col items-start justify-center">
{open.map((item, index) => (
<div
key={index}
data-slide={String(index)}
className={`pt-[10px] md:pt-[21px] w-full
${
index === 0
? "block slide-in-left"
: "slide-in-left hidden"
}
transition-all duration-800 ease-out`}
>
<div className="grid gap-y-[14px]">
{item.title && (
<div className="max-w-[320px] md:max-w-[548px]">
<p className="font-sans text-white font-medium text-[32px] lg:text-[64px] leading-tight-35 lg:leading-tight-70 tracking-tight-2 fade-in-animation">
{getHighlightedText(item.title, item.highlight)}
</p>
</div>
)}
{item.subtitleDescription && (
<div className="pr-10 md:pr-0 w-full !max-w-none">
<p className="text-base md:text-lg font-sans font-normal leading-tight-18 md:leading-tight-25 text-white-80 fade-in-animation">
{item.subtitleDescription}
</p>
</div>
)}
</div>
</div>
))}
</div>
</div>
<Script />
</>
);
}
65 changes: 65 additions & 0 deletions components/ui/Content/Openning/script.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { useScript } from "@deco/deco/hooks";

export interface Props {}

const setup = () => {
let currentIndex = 0;
const slides = Array.from(document.querySelectorAll("[data-slide]"));
const totalSlides = slides.length;

console.log("TOTAL SLIDES: " + totalSlides);

const showSlide = (index: number) => {
slides.forEach((slide, idx) => {
if (idx === index) {
slide.classList.remove("translate-x-full", "opacity-0", "hidden");
slide.classList.add("translate-x-0", "opacity-100", "block");
} else {
slide.classList.remove("translate-x-0", "opacity-100", "block");
slide.classList.add("translate-x-full", "opacity-0", "hidden");
}
});
};

const nextSlide = () => {
currentIndex = (currentIndex + 1) % totalSlides;
console.log("INDEX ATUAL: " + currentIndex);
showSlide(currentIndex);
};

const prevSlide = () => {
currentIndex = (currentIndex - 1 + totalSlides) % totalSlides;
console.log("INDEX ATUAL: " + currentIndex);
showSlide(currentIndex);
};

document.addEventListener("DOMContentLoaded", () => {
if (slides.length === 0) return;

showSlide(currentIndex);

document.addEventListener("keydown", (event) => {
if (event.key === "ArrowRight") {
nextSlide();
}
if (event.key === "ArrowLeft") {
prevSlide();
}
});

setInterval(nextSlide, 5000);
});
};

function Open({}: Props) {
return (
<script
type="module"
dangerouslySetInnerHTML={{
__html: useScript(setup, {}),
}}
/>
);
}

export default Open;
2 changes: 1 addition & 1 deletion components/ui/Content/OptionalCollappse/index.tsx
Original file line number Diff line number Diff line change
@@ -153,4 +153,4 @@ function OptionalCollappseComponent({ optional, colorTheme }: Props) {
);
}

export default OptionalCollappseComponent;
export default OptionalCollappseComponent;
Loading

0 comments on commit f3c43d3

Please sign in to comment.