Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UUID converter #13

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
186 changes: 97 additions & 89 deletions components/nav.ts
Original file line number Diff line number Diff line change
@@ -1,97 +1,105 @@
import { IconProp } from "@fortawesome/fontawesome-svg-core";
import {IconProp} from "@fortawesome/fontawesome-svg-core";
import {
faCommentDots,
faFileCode,
faFileCircleCheck,
faFilePen,
faPaste,
faFileCircleQuestion,
faHouseCircleCheck,
faComment,
faTurnUp,
faCommentDots,
faFileCode,
faFileCircleCheck,
faFilePen,
faPaste,
faFileCircleQuestion,
faHouseCircleCheck,
faComment,
faTurnUp,
faIdCard,
} from "@fortawesome/free-solid-svg-icons";

export const Tools: Record<
string,
ToolboxTool[] | Record<string, ToolboxTool[]>
> = {
Converters: {
ChatChat: [
{
name: "DeluxeChat Convert",
short: "DeluxeChat",
icon: faCommentDots,
description: "Convert DeluxeChat Configs to ChatChat Configs",
link: "/converters/chatchat/deluxechat",
},
{
name: "Essentials Convert",
short: "Essentials",
icon: faHouseCircleCheck,
description: "Convert EssentialsChat Configs to ChatChat Configs",
link: "/converters/chatchat/essentialschat",
},
{
name: "VentureChat Convert",
short: "VentureChat",
icon: faComment,
description: "Convert VentureChat Configs to ChatChat Configs",
link: "/converters/chatchat/venturechat",
},
],
Legacy: [
{
name: "Legacy Text Convert",
short: "MiniMessage",
icon: faTurnUp,
description: "Convert Legacy Strings to MiniMessage Strings",
link: "/converters/legacy/minimessage",
},
],
},
Validators: [
{
name: "Yaml Validator",
short: "Yaml",
icon: faFileCode,
description: "Check your config before you wreck your config",
link: "/validators/yaml",
},
{
name: "Properties Validator",
short: "Properties",
icon: faFileCircleCheck,
description: "Validate Properties Files",
link: "/validators/properties",
},
{
name: "Toml Validator",
short: "Toml",
icon: faFilePen,
description: "Validate Toml Files",
link: "/validators/toml",
export const Tools: Record<string,
ToolboxTool[] | Record<string, ToolboxTool[]>> = {
Converters: {
ChatChat: [
{
name: "DeluxeChat Convert",
short: "DeluxeChat",
icon: faCommentDots,
description: "Convert DeluxeChat Configs to ChatChat Configs",
link: "/converters/chatchat/deluxechat",
},
{
name: "Essentials Convert",
short: "Essentials",
icon: faHouseCircleCheck,
description: "Convert EssentialsChat Configs to ChatChat Configs",
link: "/converters/chatchat/essentialschat",
},
{
name: "VentureChat Convert",
short: "VentureChat",
icon: faComment,
description: "Convert VentureChat Configs to ChatChat Configs",
link: "/converters/chatchat/venturechat",
},
],
Legacy: [
{
name: "Legacy Text Convert",
short: "MiniMessage",
icon: faTurnUp,
description: "Convert Legacy Strings to MiniMessage Strings",
link: "/converters/legacy/minimessage",
},
],
UUID: [
{
name: "UUID Converter",
short: "UUID",
icon: faIdCard,
description: "Convert UUIDs to Names",
link: "/converters/uuid",
}
]
},
{
name: "Hocon Validator",
short: "Hocon",
icon: faPaste,
description: "Validate Hocon Files",
link: "/validators/hocon",
},
{
name: "XML Validator",
short: "XML",
icon: faFileCircleQuestion,
description: "Validate XML Files",
link: "/validators/xml",
},
],
Validators: [
{
name: "Yaml Validator",
short: "Yaml",
icon: faFileCode,
description: "Check your config before you wreck your config",
link: "/validators/yaml",
},
{
name: "Properties Validator",
short: "Properties",
icon: faFileCircleCheck,
description: "Validate Properties Files",
link: "/validators/properties",
},
{
name: "Toml Validator",
short: "Toml",
icon: faFilePen,
description: "Validate Toml Files",
link: "/validators/toml",
},
{
name: "Hocon Validator",
short: "Hocon",
icon: faPaste,
description: "Validate Hocon Files",
link: "/validators/hocon",
},
{
name: "XML Validator",
short: "XML",
icon: faFileCircleQuestion,
description: "Validate XML Files",
link: "/validators/xml",
},
],
};

export type ToolboxTool = {
name: string;
short: string;
icon: IconProp;
description: string;
link: string;
name: string;
short: string;
icon: IconProp;
description: string;
link: string;
};
55 changes: 55 additions & 0 deletions pages/converters/uuid.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import {NextPage} from "next";
import Head from "next/head";
import tw, {css} from "twin.macro";
import {useState} from "react";

const UUIDConverter: NextPage = () => {
const [input, setInput] = useState("");
return (
<div>
<Head>
<title>UUID Converter</title>
<meta name="description" content={`Convert UUIDs`}/>
</Head>

<main
css={css`
${tw`flex flex-col min-height[calc(100vh - 3.5rem)] flex-col`}
`}
>
<div css={tw`w-full md:px-8 p-16 h-48 text-center`}>
<p css={tw`text-3xl font-bold`}>HelpChat</p>
<p css={tw`text-lg`}>UUID Converter</p>
</div>
<div>
<textarea css={css`
transition: width 0.3s, height 0.3s;
${tw`text-black width[50vw]`}
${input.length > 36 ? tw`width[50vw] h-full` : tw`w-full h-6`}
`} value={input} onChange={(v) => setInput(v.target.value)}/>
</div>
</main>
</div>
);
};

async function getUserData(id: string): Promise<({ error: string } | {
id: string;
name: string;
properties?: ({
name: string;
value: string;
signature: string;
})[];
})> {
const data = await fetch(`https://crafthead.net/profile/${id}`)
if (data.ok || data.status === 404) {
return data.json()
} else {
return {
error: "Failed to fetch user data"
}
}
}

export default UUIDConverter;