Skip to content

Commit

Permalink
V0.2 (#3)
Browse files Browse the repository at this point in the history
* Rewrite animation loop and examples

* Fix lints

* Change all the things
  • Loading branch information
kirkegaard authored Mar 31, 2024
1 parent c2cb9ca commit ff65d02
Show file tree
Hide file tree
Showing 23 changed files with 550 additions and 509 deletions.
40 changes: 40 additions & 0 deletions example/app/(examples)/examples/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { Simple } from "components/examples/Simple";
import { WebGL } from "components/examples/Webgl";
import { Game } from "components/examples/Game";
import { Confetti } from "components/examples/Confetti";
import { BounceText } from "components/examples/BounceText";
import { Math } from "components/examples/Math";

import styles from "./page.module.css";

const Examples = () => {
return (
<article className={styles.examples}>
<section>
<h3>Simple</h3>
<Simple />
</section>
<section>
<h3>Confetti</h3>
<Confetti />
</section>
<section>
<h3>Bouncing text</h3>
<BounceText />
</section>
<section>
<h3>WebGL</h3>
<WebGL />
<p>
<a href="https://www.instagram.com/p/C3Oh8Nwst0z/">Source</a>
</p>
</section>
<section>
<h3>Game</h3>
<Game />
</section>
</article>
);
};

export default Examples;
7 changes: 7 additions & 0 deletions example/app/(examples)/examples/page.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.examples {
display: block;
}

.examples section {
margin: 1rem 0;
}
17 changes: 17 additions & 0 deletions example/app/(home)/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"use client";

import Link from "next/link";

import { WebGL } from "components/examples/Webgl";

export default function Home() {
return (
<article>
<p>
A tiny hook that&apos;ll help you write neat canvas things. If
you&apos;re familiar with processing it might seem familiar.
</p>
<WebGL />
</article>
);
}
26 changes: 0 additions & 26 deletions example/app/01-simple.js

This file was deleted.

61 changes: 0 additions & 61 deletions example/app/02-state.js

This file was deleted.

41 changes: 0 additions & 41 deletions example/app/03-props.js

This file was deleted.

52 changes: 0 additions & 52 deletions example/app/07-bounce-text.js

This file was deleted.

Binary file removed example/app/favicon.ico
Binary file not shown.
20 changes: 18 additions & 2 deletions example/app/layout.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Link from "next/link";
import { Inter } from "next/font/google";
import "./globals.css";
import "styles/globals.css";

const inter = Inter({ subsets: ["latin"] });

Expand All @@ -11,7 +12,22 @@ export const metadata = {
export default function RootLayout({ children }) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
<body className={inter.className}>
<main>
<h1>useCanvas</h1>
<nav>
<ul>
<li>
<Link href="/">Home</Link>
</li>
<li>
<Link href="/examples">Examples</Link>
</li>
</ul>
</nav>
{children}
</main>
</body>
</html>
);
}
97 changes: 0 additions & 97 deletions example/app/page.js

This file was deleted.

4 changes: 0 additions & 4 deletions example/app/page.module.css

This file was deleted.

Loading

0 comments on commit ff65d02

Please sign in to comment.