Merge version_1 into main #2
@@ -49,7 +49,7 @@ export default function LandingPage() {
|
||||
]}
|
||||
slides={[
|
||||
{ imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AlmqOsNGOoll8KiKNsPHmJmSny/a-vibrant-nature-photography-app-interfa-1773175801668-d64174d7.png", imageAlt: "PlantSnap species identification interface" },
|
||||
{ imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AlmqOsNGOoll8KiKNsPHmJmSny/an-exciting-outdoor-scene-showing-kids-a-1773175801736-2d61982a.png?_wi=1", imageAlt: "Kids exploring nature with PlantSnap" },
|
||||
{ imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AlmqOsNGOoll8KiKNsPHmJmSny/an-exciting-outdoor-scene-showing-kids-a-1773175801736-2d61982a.png", imageAlt: "Kids exploring nature with PlantSnap" },
|
||||
{ imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AlmqOsNGOoll8KiKNsPHmJmSny/a-digital-leaderboard-display-showing-pl-1773175802145-3e654607.png", imageAlt: "PlantSnap gamification leaderboard" }
|
||||
]}
|
||||
autoplayDelay={5000}
|
||||
@@ -189,8 +189,8 @@ export default function LandingPage() {
|
||||
description="Download PlantSnap"
|
||||
subdescription="Available on iOS & Android"
|
||||
icon={MapPin}
|
||||
imageSrc="https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AlmqOsNGOoll8KiKNsPHmJmSny/an-exciting-outdoor-scene-showing-kids-a-1773175801736-2d61982a.png?_wi=2"
|
||||
imageAlt="Child discovering nature with PlantSnap"
|
||||
imageSrc="https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3AlmqOsNGOoll8KiKNsPHmJmSny/an-exciting-outdoor-scene-showing-kids-a-1773175801736-2d61982a.png"
|
||||
useInvertedBackground={false}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -1,51 +1,58 @@
|
||||
"use client";
|
||||
|
||||
import { memo } from "react";
|
||||
import useSvgTextLogo from "./useSvgTextLogo";
|
||||
import { cls } from "@/lib/utils";
|
||||
import React, { CSSProperties } from 'react';
|
||||
|
||||
interface SvgTextLogoProps {
|
||||
logoText: string;
|
||||
adjustHeightFactor?: number;
|
||||
verticalAlign?: "top" | "center";
|
||||
text: string;
|
||||
className?: string;
|
||||
textClassName?: string;
|
||||
fontSize?: number;
|
||||
fontWeight?: number | string;
|
||||
fontFamily?: string;
|
||||
fill?: string;
|
||||
letterSpacing?: number;
|
||||
width?: number | string;
|
||||
height?: number | string;
|
||||
}
|
||||
|
||||
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 = '',
|
||||
textClassName = '',
|
||||
fontSize = 48,
|
||||
fontWeight = 700,
|
||||
fontFamily = 'system-ui, -apple-system, sans-serif',
|
||||
fill = 'currentColor',
|
||||
letterSpacing = 0,
|
||||
width = '100%',
|
||||
height = 'auto',
|
||||
}) => {
|
||||
const textStyle: CSSProperties = {
|
||||
fontFamily,
|
||||
fontSize,
|
||||
fontWeight,
|
||||
fill,
|
||||
letterSpacing,
|
||||
};
|
||||
|
||||
return (
|
||||
<svg
|
||||
ref={svgRef}
|
||||
viewBox={viewBox}
|
||||
className={cls("w-full", className)}
|
||||
style={{ aspectRatio: aspectRatio }}
|
||||
preserveAspectRatio="none"
|
||||
role="img"
|
||||
aria-label={`${logoText} logo`}
|
||||
width={width}
|
||||
height={height}
|
||||
viewBox={`0 0 ${text.length * (fontSize as number) * 0.6} ${fontSize}`}
|
||||
preserveAspectRatio="xMidYMid meet"
|
||||
className={className}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<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"
|
||||
}}
|
||||
y={fontSize as number}
|
||||
style={textStyle}
|
||||
dominantBaseline="middle"
|
||||
className={textClassName}
|
||||
>
|
||||
{logoText}
|
||||
{text}
|
||||
</text>
|
||||
</svg>
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
SvgTextLogo.displayName = "SvgTextLogo";
|
||||
|
||||
export default SvgTextLogo;
|
||||
export default SvgTextLogo;
|
||||
Reference in New Issue
Block a user