Skip to content

Commit

Permalink
fix: navbar button styles
Browse files Browse the repository at this point in the history
  • Loading branch information
0xHericles committed Jan 5, 2024
1 parent 7faaf83 commit aeb7a31
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 135 deletions.
6 changes: 3 additions & 3 deletions islands/NRF/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default function Editor({ features }: Props) {

animate(
`#feature-title-${index}`,
{ color: colorValue, transform: scaleValue },
{ color: colorValue },
{ duration: 0.3 }
);

Expand Down Expand Up @@ -135,9 +135,9 @@ export default function Editor({ features }: Props) {
<div class="relative w-full right-container ml-auto flex gap-20">
<div class="hidden sticky h-screen top-0 lg:flex items-center justify-center">
<ul class="text-[#52525B] whitespace-nowrap space-y-2">
<li class="text-[#02F67C] ">How it Works</li>
<li class="text-[#02F67C] text-[24px]">How it Works</li>
{features.map(({ key: section }, idx) => (
<li id={`feature-title-${idx}`} key={idx}>
<li class="text-sm" id={`feature-title-${idx}`} key={idx}>
{section}
</li>
))}
Expand Down
2 changes: 1 addition & 1 deletion islands/NRF/Features.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default function Features({ title, cards }: Props) {
}, []);

return (
<section class="relative bg-black text-white py-20">
<section class="relative bg-black text-white py-20 max-w-screen overflow-hidden">
<div class="mx-6 lg:container lg:mx-auto flex justify-center items-center flex-col gap-20">
<h2 class="font-medium text-[36px] lg:text-[72px] leading-[100%] text-center max-w-4xl">
{title}
Expand Down
140 changes: 15 additions & 125 deletions islands/NRF/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { IS_BROWSER } from "https://deno.land/x/[email protected]/src/runtime/utils.ts";
import Slider from "deco-sites/starting/components/ui/Slider2.tsx";
import SliderJS from "deco-sites/starting/islands/SliderJS.tsx";
import { useSignal } from "@preact/signals";
import { useState } from "preact/hooks";
import { useId } from "deco-sites/starting/sdk/useId.ts";
Expand Down Expand Up @@ -29,6 +27,7 @@ export interface Props {
pageInitial: string;
mkt?: { label: string; url: string; selected?: boolean };
dev?: { label: string; url: string; selected?: boolean };
demo: { label: string; url: string };
login: { label: string; url: string };
sign: { label: string; url: string };
linkedinUrl: string;
Expand Down Expand Up @@ -169,7 +168,7 @@ export default function Header(props: Props) {

return (
<section class="lg:container rounded-full bg-white/5 backdrop-blur-xl fixed top-6 z-50 w-[calc(100vw-64px)] lg:w-full left-1/2 transform -translate-x-1/2 shadow-[0px_4px_16px_0px_rgba(0,0,0,0.10)]">
<nav class="flex flex-row justify-between items-center h-[63px] pb-[2px] max-w-screen-2xl m-auto relative">
<nav class="flex flex-row items-center h-[63px] pb-[2px] max-w-screen-2xl m-auto relative">
<ul class="h-full flex items-center">
<li class="h-full">
<a
Expand All @@ -194,123 +193,6 @@ export default function Header(props: Props) {
</svg>
</a>
</li>
<li class="group cursor-pointer relative min-w-[150px]">
{showSwitcher.value && (
<>
<div
class={`select-none flex gap-2 items-center ${
openSwitcher.value ? "md:border-[#06E474] md:border" : ""
} border-[transparent] rounded-full border md:hover:border-[#2FD180] md:hover:border md:hover:rounded-full focus:outline-none md:transition md:ease-in-out md:duration-300`}
>
<div
onClick={handleMenu}
class="z-10 font-normal text-[16px] md:px-3 md:py-1 text-[#fff] flex items-center justify-center gap-[5px]"
>
{props.pageInitial}
<svg
width="9"
height="5"
viewBox="0 0 9 5"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M1 1.5L3.84921 3.94218C4.2237 4.26317 4.7763 4.26317 5.15079 3.94218L8 1.5"
class="group-hover:border-[#55D695]"
stroke="#fff"
stroke-width="1.5"
stroke-linecap="round"
/>
</svg>
</div>
<div
onClick={handleMenu}
class={`${
openSwitcher.value
? "block cursor-default w-[110vw] h-[110vh] absolute left-[-100px] top-[-20px]"
: "hidden"
}`}
></div>
<div
class={`${
openSwitcher.value ? "block" : "hidden"
} absolute top-[35px] left-0 mt-5 rounded border border-[#ffffff10]`}
>
<div class="flex flex-col w-[212px] bg-[#0A2121;] p-2 rounded">
<div class="flex flex-row items-center justify-between">
<a
href="#"
onClick={(e) => {
e.preventDefault();
window.history.pushState(
{},
"",
urlMarketers.value
);
location.reload();
}}
class="flex flex-row items-center justify-between flex-grow p-2 hover:bg-mytheme-10 rounded"
>
<p class="font-sans not-italic font-normal text-[15px] text-[#2FD180] flex-grow">
{props?.mkt?.label}
</p>
<svg
width="15"
height="10"
viewBox="0 0 15 10"
fill="none"
xmlns="http://www.w3.org/2000/svg"
class={props?.mkt?.selected ? "" : "hidden"}
>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M14.2558 0.244078C14.5813 0.569515 14.5813 1.09715 14.2558 1.42259L5.92251 9.75592C5.59707 10.0814 5.06943 10.0814 4.744 9.75592L0.57733 5.58926C0.251893 5.26382 0.251893 4.73618 0.57733 4.41074C0.902767 4.08531 1.4304 4.08531 1.75584 4.41074L5.33325 7.98816L13.0773 0.244078C13.4028 -0.0813592 13.9304 -0.0813592 14.2558 0.244078Z"
fill="#2FD180"
/>
</svg>
</a>
</div>
<div class="flex flex-row items-center justify-between">
<a
href="#"
onClick={(e) => {
e.preventDefault();
window.history.pushState(
{},
"",
urlDevelopers.value
);
location.reload();
}}
class="flex flex-row items-center justify-between flex-grow p-2 hover:bg-mytheme-10 rounded"
>
<p class="font-sans not-italic font-normal text-[15px] text-[#06E474] flex-grow">
{props?.dev?.label}
</p>
<svg
width="15"
height="10"
viewBox="0 0 15 10"
fill="none"
xmlns="http://www.w3.org/2000/svg"
class={props?.dev?.selected ? "" : "hidden"}
>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M14.2558 0.244078C14.5813 0.569515 14.5813 1.09715 14.2558 1.42259L5.92251 9.75592C5.59707 10.0814 5.06943 10.0814 4.744 9.75592L0.57733 5.58926C0.251893 5.26382 0.251893 4.73618 0.57733 4.41074C0.902767 4.08531 1.4304 4.08531 1.75584 4.41074L5.33325 7.98816L13.0773 0.244078C13.4028 -0.0813592 13.9304 -0.0813592 14.2558 0.244078Z"
fill="#2FD180"
/>
</svg>
</a>
</div>
</div>
</div>
</div>
</>
)}
</li>
</ul>
<ul class="hidden lg:flex lg:flex-row h-full group">
{props.menuLinks.map((link, index) => {
Expand Down Expand Up @@ -374,7 +256,7 @@ export default function Header(props: Props) {
<div
class={
open
? "flex flex-col justify-between w-screen h-screen gap-[40px] fixed bg-[#0A2121] left-0 top-[107px] pt-[24px] pb-[100px] z-50 px-3 md:hidden"
? "flex flex-col w-screen h-screen gap-[40px] fixed bg-[#0A2121] left-0 top-[107px] pt-[24px] pb-[100px] z-50 px-3 md:hidden"
: "hidden"
}
>
Expand Down Expand Up @@ -422,7 +304,7 @@ export default function Header(props: Props) {
<a
href={props.linkedinUrl}
target="_blank"
class="block px-3 font-normal text-[16px] leading-[19.36px] text-[#2FD180]"
class="block px-3 font-normal text-[16px] leading-[19.36px] text-[#2FD180]"
>
<svg
width="18"
Expand Down Expand Up @@ -487,19 +369,27 @@ export default function Header(props: Props) {
</ul>
</div>
</ul>
<ul class="hidden lg:flex lg:flex-row lg:gap-4 px-3">
<ul class="ml-auto hidden lg:flex lg:flex-row lg:gap-4 px-3">
<li>
<a
href={props.login.url}
href={props.demo?.url}
class="block md:hover:border-[#02F67C] md:hover:border md:hover:text-[#fff] border-[transparent] border font-normal text-[16px] text-[#06E474] px-3 md:py-1 rounded-full md:transition md:ease-in-out md:duration-300"
>
{props.demo?.label}
</a>
</li>
<li>
<a
href={props.login.url}
class="block text-white bg-[#113032] md:hover:text-[#fff] border-[#113032] border hover:bg-transparent font-normal text-[16px] px-3 md:py-1 rounded-full md:transition md:ease-in-out md:duration-300"
>
{props.login.label}
</a>
</li>
<li>
<a
href={props.sign.url}
class="block md:hover:bg-[#0A2121] md:hover:border md:hover:text-[#fff] border-[#02F67C] border bg-[#02F67C] font-normal text-[16px] text-[#0A2121] px-3 md:py-1 rounded-full md:transition md:ease-in-out md:duration-300"
class="block hover:bg-transparent md:hover:border md:hover:text-[#fff] border-[#02F67C] border bg-[#02F67C] font-normal text-[16px] text-[#0A2121] px-3 md:py-1 rounded-full md:transition md:ease-in-out md:duration-300"
>
{props.sign.label}
</a>
Expand Down
2 changes: 2 additions & 0 deletions sections/NRF/CallToAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export default function CallToAction({ text, cta }: Props) {
<div class="flex flex-col lg:flex-row gap-4">
{cta?.map((item) => (
<a
href={item?.href}
target={item?.href?.includes("http") ? "_blank" : "_self"}
class={`border-none rounded-full text-lg py-4 px-8 transition-colors duration-200 cursor-pointer ${
item?.variant === "Reverse"
? "border bg-[#113032] text-[#FFF]"
Expand Down
39 changes: 35 additions & 4 deletions sections/NRF/Hero.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,59 @@
import { HeroEditorTabbed } from "deco-sites/starting/islands/NRF/HeroEditorTabbed.tsx";

interface CTA {
href: string;
text: string;
variant: "Normal" | "Reverse";
}
export interface Props {
/**
* @format html
*/
title: string;
cta?: CTA[];
alert?: {
image?: string;
text?: string;
href?: string;
}
}

export default function Hero({ title }: Props) {
export default function Hero({ title, cta, alert }: Props) {
return (
<div id="hero" class="relative bg-black min-h-screen space-y-10">
<div class="max-w-fit mx-auto flex flex-col items-center gap-8">
{
alert?.text && (
<div class="rounded-[56px] border border-white/15 bg-white/5 py-2 px-4">
{alert.text}
</div>
)
}
<div
class="mt-48 inline-block text-[48px] lg:text-[104px] text-left leading-[100%] font-medium text-white"
dangerouslySetInnerHTML={{
__html: title,
}}
></div>
{cta &&
cta?.map((item) => (
<a
href={item?.href}
target={item?.href.startsWith("http") ? "_blank" : "_self"}
class={`border-none rounded-full text-[28px] py-3 px-8 transition-colors duration-200 cursor-pointer ${
item?.variant === "Reverse"
? "border bg-[#113032] text-[#FFF]"
: "border bg-[#02F67C] text-[#113032]"
}`}
>
{item?.text}
</a>
))}
</div>
<div class="mx-auto flex flex-col items-center">
<HeroEditorTabbed />
</div>
<div class="ellipse-1"/>
<div class="ellipse-2"/>
<div class="ellipse-1" />
<div class="ellipse-2" />
</div>
);
}
2 changes: 1 addition & 1 deletion static/tailwind.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
}

.feature-card {
@apply w-[380px] max-w-[380px] h-[350px] bg-[#060A0A] rounded-3xl;
@apply w-[380px] max-w-[380px] h-[350px] bg-[#000D0D] rounded-3xl;
@apply flex flex-col items-center justify-start gap-12;
}

Expand Down

0 comments on commit aeb7a31

Please sign in to comment.