Merge version_1 into main #3
@@ -19,7 +19,7 @@ export default function LandingPage() {
|
||||
borderRadius="rounded"
|
||||
contentWidth="compact"
|
||||
sizing="largeSmallSizeLargeTitles"
|
||||
background="floatingGradient"
|
||||
background="circleGradient"
|
||||
cardStyle="solid"
|
||||
primaryButtonStyle="flat"
|
||||
secondaryButtonStyle="layered"
|
||||
@@ -45,7 +45,7 @@ export default function LandingPage() {
|
||||
<HeroCentered
|
||||
title="Nútímaleg Leið til Lífsstíls"
|
||||
description="Uppgötvaðu gæðavörur og bæklega hönnun frá NODA. Við teljum að gæði, fagurfræði og ábyrg framleiðsla geta farið saman."
|
||||
background={{ variant: "floatingGradient" }}
|
||||
background={{ variant: "plain" }}
|
||||
avatars={[
|
||||
{ src: "http://img.b2bpic.net/free-photo/young-pretty-woman-outdoors_624325-2662.jpg", alt: "Viðskiptavinir" },
|
||||
{ src: "http://img.b2bpic.net/free-photo/portrait-bearded-black-man-with-crossed-arms-wearing-wool-suit_613910-1866.jpg", alt: "Samfélag" },
|
||||
@@ -149,7 +149,7 @@ export default function LandingPage() {
|
||||
]}
|
||||
cardTitle="Þúsundir ánægðir viðskiptavinir treysta NODA fyrir gæði og hönnun"
|
||||
cardTag="Endurspeglunarviðskiptavinir"
|
||||
cardAnimation="entrance-slide"
|
||||
cardAnimation="blur-reveal"
|
||||
useInvertedBackground={true}
|
||||
/>
|
||||
</div>
|
||||
@@ -159,7 +159,7 @@ export default function LandingPage() {
|
||||
tag="Fréttabréf"
|
||||
title="Vertu með okkar"
|
||||
description="Skráðu þig í okkar fréttabréf til að fá eksklusíva tilboð, nýjar útgáfur og sögur um bak við tjöldin NODA."
|
||||
background={{ variant: "floatingGradient" }}
|
||||
background={{ variant: "plain" }}
|
||||
useInvertedBackground={false}
|
||||
imageSrc="http://img.b2bpic.net/free-photo/top-view-different-items-desk_23-2148750500.jpg"
|
||||
imageAlt="NODA samfélag"
|
||||
|
||||
@@ -1,51 +1,66 @@
|
||||
"use client";
|
||||
|
||||
import { memo } from "react";
|
||||
import useSvgTextLogo from "./useSvgTextLogo";
|
||||
import { cls } from "@/lib/utils";
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
|
||||
interface SvgTextLogoProps {
|
||||
logoText: string;
|
||||
adjustHeightFactor?: number;
|
||||
verticalAlign?: "top" | "center";
|
||||
text: string;
|
||||
className?: string;
|
||||
animationDuration?: number;
|
||||
animationDelay?: number;
|
||||
}
|
||||
|
||||
const SvgTextLogo = memo<SvgTextLogoProps>(function SvgTextLogo({
|
||||
logoText,
|
||||
adjustHeightFactor,
|
||||
verticalAlign = "top",
|
||||
className = "",
|
||||
}) {
|
||||
const { svgRef, textRef, viewBox, aspectRatio } = useSvgTextLogo(logoText, false, adjustHeightFactor);
|
||||
const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
|
||||
text,
|
||||
className = '',
|
||||
animationDuration = 2,
|
||||
animationDelay = 0,
|
||||
}) => {
|
||||
const svgRef = useRef<SVGSVGElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (!svgRef.current) return;
|
||||
|
||||
const textElements = svgRef.current.querySelectorAll('tspan');
|
||||
textElements.forEach((el, index) => {
|
||||
(el as SVGTSpanElement).style.animation = `fadeIn ${animationDuration}s ease-in-out ${animationDelay + index * 0.1}s forwards`;
|
||||
(el as SVGTSpanElement).style.opacity = '0';
|
||||
});
|
||||
}, [animationDuration, animationDelay]);
|
||||
|
||||
return (
|
||||
<svg
|
||||
ref={svgRef}
|
||||
viewBox={viewBox}
|
||||
className={cls("w-full", className)}
|
||||
style={{ aspectRatio: aspectRatio }}
|
||||
preserveAspectRatio="none"
|
||||
role="img"
|
||||
aria-label={`${logoText} logo`}
|
||||
>
|
||||
<text
|
||||
ref={textRef}
|
||||
x="0"
|
||||
y={verticalAlign === "center" ? "50%" : "0"}
|
||||
className="font-bold fill-current"
|
||||
style={{
|
||||
fontSize: "20px",
|
||||
letterSpacing: "-0.02em",
|
||||
dominantBaseline: verticalAlign === "center" ? "middle" : "text-before-edge"
|
||||
}}
|
||||
<>
|
||||
<style>{`
|
||||
@keyframes fadeIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
`}</style>
|
||||
<svg
|
||||
ref={svgRef}
|
||||
viewBox="0 0 200 50"
|
||||
className={className}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
{logoText}
|
||||
</text>
|
||||
</svg>
|
||||
<text
|
||||
x="50%"
|
||||
y="50%"
|
||||
dominantBaseline="middle"
|
||||
textAnchor="middle"
|
||||
fontSize="24"
|
||||
fontWeight="bold"
|
||||
fill="currentColor"
|
||||
>
|
||||
{text.split('').map((char, index) => (
|
||||
<tspan key={index} x={30 + index * 12}>
|
||||
{char}
|
||||
</tspan>
|
||||
))}
|
||||
</text>
|
||||
</svg>
|
||||
</>
|
||||
);
|
||||
});
|
||||
|
||||
SvgTextLogo.displayName = "SvgTextLogo";
|
||||
};
|
||||
|
||||
export default SvgTextLogo;
|
||||
|
||||
Reference in New Issue
Block a user