Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions packages/web/src/assets/svg/loading-circle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from "react";

export const LoadingCircleIcon = (props: React.SVGProps<SVGSVGElement>) => {
return (
<svg
width="16"
height="16"
viewBox="0 0 16 16"
fill="none"
{...props}
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8 16C6.92031 16 5.87188 15.7891 4.88594 15.3719C3.93281 14.9687 3.07813 14.3906 2.34375 13.6562C1.60938 12.9219 1.03125 12.0672 0.628125 11.1141C0.210938 10.1281 0 9.07969 0 8C0 7.68906 0.251563 7.4375 0.5625 7.4375C0.873438 7.4375 1.125 7.68906 1.125 8C1.125 8.92813 1.30625 9.82812 1.66563 10.6766C2.0125 11.4953 2.50781 12.2313 3.13906 12.8625C3.77031 13.4938 4.50625 13.9906 5.325 14.3359C6.17188 14.6937 7.07188 14.875 8 14.875C8.92813 14.875 9.82813 14.6938 10.6766 14.3344C11.4953 13.9875 12.2313 13.4922 12.8625 12.8609C13.4938 12.2297 13.9906 11.4938 14.3359 10.675C14.6938 9.82813 14.875 8.92813 14.875 8C14.875 7.07187 14.6938 6.17188 14.3344 5.32344C13.9887 4.50665 13.4884 3.76439 12.8609 3.1375C12.2347 2.50925 11.4923 2.0088 10.675 1.66406C9.82813 1.30625 8.92813 1.125 8 1.125C7.68906 1.125 7.4375 0.873437 7.4375 0.5625C7.4375 0.251563 7.68906 0 8 0C9.07969 0 10.1281 0.210938 11.1141 0.628125C12.0672 1.03125 12.9219 1.60938 13.6563 2.34375C14.3906 3.07812 14.9672 3.93438 15.3703 4.88594C15.7875 5.87188 15.9984 6.92031 15.9984 8C15.9984 9.07969 15.7875 10.1281 15.3703 11.1141C14.9688 12.0672 14.3906 12.9219 13.6563 13.6562C12.9219 14.3906 12.0656 14.9672 11.1141 15.3703C10.1281 15.7891 9.07969 16 8 16V16Z"
fill="url(#paint0_linear_3177_3624)"
/>
<defs>
<linearGradient
id="paint0_linear_3177_3624"
x1="0"
y1="8"
x2="15.9984"
y2="8"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#AE00FF" />
<stop offset="1" stopColor="#FF1100" />
</linearGradient>
</defs>
</svg>
);
};
4 changes: 2 additions & 2 deletions packages/web/src/components/Badge/Badge.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { HTMLAttributes } from "react";
function Badge(props: HTMLAttributes<HTMLDivElement>) {
return (
<div
className={`rounded-full bg-white py-[5px] px-4 absolute bottom-6 right-6 w-fit ${props.className}`}
className={`rounded-full font-extrabold bg-white py-[5px] text-purple px-4 absolute bottom-6 right-6 w-fit tracking-tight ${props.className}`}
>
<p className="text-3.5 font-extrabold leading-3.5 tracking-tight text-purple">
<p className="text-3.5 leading-3.5">
{props.children || <Skeleton width="120px" />}
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
type GradientBorderProps = {
className?: string;
stroke?: number;
width?: number;
height?: number;
radius?: number;
colors: string[];
direction:
| "to-top"
| "to-top-left"
| "to-top-right"
| "to-right"
| "to-bottom"
| "to-bottom-left"
| "to-bottom-right"
| "to-left";
};

function GradientBorder(props: GradientBorderProps) {
const box = document.getElementById("gradient-border");
const width = props.width
? props.width
: box?.clientWidth
? box?.clientWidth
: 1;
const height = props.height
? props.height
: box?.clientHeight
? box?.clientHeight
: 1;

const stroke = props.stroke || 1;
const radius = props.radius || 20;

let direction = { x1: 0, y1: 0, x2: 0, y2: 0 };
switch (props.direction) {
case "to-top":
direction = { x1: width / 2, y1: height, x2: width / 2, y2: 0 };
break;
case "to-top-left":
direction = { x1: width, y1: height, x2: 0, y2: 0 };
break;
case "to-top-right":
direction = { x1: 0, y1: height, x2: width, y2: 0 };
break;
case "to-right":
direction = { x1: 0, y1: height / 2, x2: width, y2: height / 2 };
break;
case "to-bottom":
direction = { x1: width / 2, y1: 0, x2: width / 2, y2: height };
break;
case "to-bottom-left":
direction = { x1: width, y1: 0, x2: 0, y2: height };
break;
case "to-bottom-right":
direction = { x1: 0, y1: 0, x2: width, y2: height };
break;
case "to-left":
direction = { x1: width, y1: height / 2, x2: 0, y2: height / 2 };
break;
}

function renderStopColor(color: string, key: number) {
return <stop key={key} offset={key ? key : undefined} stopColor={color} />;
}

return (
<svg
id="gradient-border"
className={`absolute inset-0 pointer-events-none w-full h-full ${
props.className || ""
}`}
width="100%"
height="100%"
viewBox={`0 0 ${width} ${height}`}
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<rect
x="1"
y="1"
width={width - stroke}
height={height - stroke}
rx={radius}
stroke="url(#paint)"
strokeWidth={stroke}
/>
<defs>
<linearGradient
id="paint"
x1={direction.x1}
y1={direction.y1}
x2={direction.x2}
y2={direction.y2}
gradientUnits="userSpaceOnUse"
>
{props.colors.map(renderStopColor)}
</linearGradient>
</defs>
</svg>
);
}

export default GradientBorder;
3 changes: 3 additions & 0 deletions packages/web/src/components/GradientBorder/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import GradientBorder from "./GradientBorder.component";

export default GradientBorder;
Loading