mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-15 02:05:37 +02:00
This adds the following pages: The landing page (/) The pricing page (/pricing) The contact page (/contact) The changelog page (/changelog) Terms Of Service page (/terms) Privacy Policy (/privacy)
24 lines
766 B
TypeScript
24 lines
766 B
TypeScript
import { component$, Slot } from "@builder.io/qwik"
|
|
import { cn } from "./design";
|
|
|
|
type Props = {
|
|
position: "bottom" | "top" | "left" | "right",
|
|
text: string;
|
|
}
|
|
|
|
const textPosition = {
|
|
top: "bottom-[125%] left-1/2 -ml-[60px] after:absolute after:left-1/2 after:top-[100%] after:-ml-[5px] after:border-[5px] after:border-[#000_transparent_transparent_transparent]"
|
|
}
|
|
|
|
export const Tooltip = component$(({ position, text }: Props) => {
|
|
|
|
return (
|
|
<>
|
|
<Slot />
|
|
{/**@ts-ignore */}
|
|
<span class={cn("invisible absolute w-[120px] group-hover:visible group-hover:opacity-100 text-white bg-black text-center py-1 rounded-md", textPosition[position])} >
|
|
{text}
|
|
</span>
|
|
</>
|
|
)
|
|
}) |