diff --git a/assets/unicord.png b/assets/unicord.png index 8ea57c3..adeae7b 100644 Binary files a/assets/unicord.png and b/assets/unicord.png differ diff --git a/package.json b/package.json index 5b52522..338fbbe 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "files": [ "out" ], + "repository": "github:jaronpate/unicord", "scripts": { "test": "bun run testing/demo.test.ts", "test:inspect": "bun --inspect testing/demo.test.ts", diff --git a/unicord.code-workspace b/unicord.code-workspace new file mode 100644 index 0000000..47c0d69 --- /dev/null +++ b/unicord.code-workspace @@ -0,0 +1,13 @@ +{ + "folders": [ + { + "name": "unicord", + "path": "." + }, + { + "name": "quotes-bot", + "path": "../quotes-bot" + } + ], + "settings": {} +} \ No newline at end of file diff --git a/website/src/app/layout.tsx b/website/src/app/layout.tsx index c1dfad2..76363c0 100644 --- a/website/src/app/layout.tsx +++ b/website/src/app/layout.tsx @@ -21,7 +21,7 @@ export const metadata: Metadata = { description: 'Unicord is a simple, type-safe, and modular framework for building Discord bots in TypeScript.', images: [ { - url: '/unicord.png', + url: 'https://unicord.hat.fish/unicord.png', width: 1024, height: 1024, alt: 'Unicord logo' diff --git a/website/src/app/page.module.css b/website/src/app/page.module.css index 941e1ed..651bf23 100644 --- a/website/src/app/page.module.css +++ b/website/src/app/page.module.css @@ -267,58 +267,6 @@ line-height: 1.6; } -@media (max-width: 1200px) { - .pillars { - padding: 4rem 2rem; - } - - .pillarContainer { - flex-direction: column; - gap: 2rem; - } - - .pillar { - max-width: 400px; - margin: 0 auto; - } - - .hydrationSection { - padding: 4rem 2rem; - } - - .hydrationContainer { - flex-direction: column; - gap: 2rem; - } - - .hydrationCode { - width: 100%; - } - - .hydrationText { - width: 100%; - padding: 1rem; - } - - .typeSection { - padding: 4rem 2rem; - } - - .typeContainer { - flex-direction: column; - gap: 2rem; - } - - .typeCode { - width: 100%; - } - - .typeText { - width: 100%; - padding: 1rem; - } -} - .typeSection { padding: 6rem 12em; min-height: 50vh; @@ -456,7 +404,70 @@ background: var(--gray-alpha-200); } + @media (max-width: 1200px) { + .hero { + padding: 0 2rem; + height: calc(100vh - 4rem); + flex-direction: column; + align-items: center; + justify-content: center; + } + + .hero .codeExample, .hero::after { + display: none; + } + + .pillars { + padding: 4rem 2rem; + } + + .pillarContainer { + flex-direction: column; + gap: 2rem; + } + + .pillar { + max-width: 400px; + margin: 0 auto; + } + + .hydrationSection { + padding: 4rem 2rem; + } + + .hydrationContainer { + flex-direction: column-reverse; + gap: 2rem; + } + + .hydrationCode { + width: 100%; + } + + .hydrationText { + width: 100%; + padding: 1rem; + } + + .typeSection { + padding: 4rem 2rem; + } + + .typeContainer { + flex-direction: column; + gap: 2rem; + } + + .typeCode { + width: 100%; + } + + .typeText { + width: 100%; + padding: 1rem; + } + .installSection { padding: 4rem 2rem; } diff --git a/website/src/app/page.tsx b/website/src/app/page.tsx index b378e2a..a185b8e 100644 --- a/website/src/app/page.tsx +++ b/website/src/app/page.tsx @@ -1,6 +1,6 @@ 'use client'; -import { useState } from 'react'; +import { useEffect, useState } from 'react'; import styles from "./page.module.css"; import dynamic from 'next/dynamic'; @@ -12,6 +12,22 @@ import { simpleExample, hydrationExample, typeCoercionExample } from '../compone export default function Home() { const [activeTab, setActiveTab] = useState('npm'); + const [windowWidth, setWindowWidth] = useState(1200); + + useEffect(() => { + setWindowWidth(window.innerWidth); + + const handleResize = () => { + setWindowWidth(window.innerWidth); + }; + + window.addEventListener('resize', handleResize); + + return () => { + window.removeEventListener('resize', handleResize); + }; + }, []); + return (
@@ -21,7 +37,7 @@ export default function Home() {
@@ -32,11 +48,11 @@ export default function Home() { Welcome to unicord

- Finally a simpler way to build Discord bots.{" "} + Build good bots fast.

- +
@@ -63,7 +79,7 @@ export default function Home() {
- +

Smart Hydration

@@ -94,7 +110,7 @@ export default function Home() {

- +
diff --git a/website/src/components/CodeExample.tsx b/website/src/components/CodeExample.tsx index b8c17e4..8dd5f36 100644 --- a/website/src/components/CodeExample.tsx +++ b/website/src/components/CodeExample.tsx @@ -1,7 +1,8 @@ 'use client'; -import Editor from "@monaco-editor/react"; +import Editor, { Monaco } from "@monaco-editor/react"; import styles from './CodeExample.module.css'; +import { useEffect, useState } from "react"; type CodeExampleProps = { code: string; @@ -9,10 +10,69 @@ type CodeExampleProps = { noScroll?: boolean; } + export default function CodeExample({ code, height = "100%", noScroll = false }: CodeExampleProps) { + // const [unicordLib, setUnicordLib] = useState(""); + + // useEffect(() => { + // setUnicordLib(` + // declare module 'unicord' { + // export enum Intent { + // GUILDS = 1 << 0, + // } + // } + // `); + + // }, []); + + // const handleEditorDidMount = (monaco: Monaco) => { + // monaco.languages.typescript.typescriptDefaults.addExtraLib(unicordLib); + + // monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions({ + // noSemanticValidation: false, + // noSyntaxValidation: false, + // noSuggestionDiagnostics: false, + // }); + // monaco.languages.typescript.typescriptDefaults.setCompilerOptions({ + // target: monaco.languages.typescript.ScriptTarget.ESNext, + // module: monaco.languages.typescript.ModuleKind.ESNext, + // allowJs: true, + // checkJs: true, + // allowNonTsExtensions: true, + // strict: true, + // noEmit: true, + // lib: [ + // "ESNext", + // "DOM", + // "DOM.Iterable", + // "ESNext.AsyncIterable", + // "ESNext.BigInt" + // ], + // types: ["node", "unicord"], + // baseUrl: "./", + // paths: { + // "index": ["./src/index.ts"], + // "unicord": ["./node_modules/unicord/dist/index.d.ts"] + // } + // }); + + // }; + + // useEffect(() => { + // fetch("https://www.unpkg.com/unicord@0.0.4/out/types/common.d.ts") + // .then((response) => response.text()) + // .then((text) => { + // setUnicordLib(text); + // console.log("Fetched extra lib:", text); + // }) + // .catch((error) => { + // console.error("Error fetching extra lib:", error); + // }); + // }, []); + return (
-
+
@@ -36,7 +100,7 @@ export default function CodeExample({ code, height = "100%", noScroll = false }: // Export the example code snippets for reuse export const simpleExample = `\ -import { Client, type Context } from 'unicord'; +import { Client, type Context, Intent } from 'unicord'; // Initialize and configure const client = new Client({