Skip to content

Commit 2f70e0b

Browse files
committed
Add example of using the plugin
1 parent 9ec5456 commit 2f70e0b

File tree

5 files changed

+8
-18
lines changed

5 files changed

+8
-18
lines changed

examples/nextjs/src/app/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import MyButton from "./button";
22
import { LandingPage } from "@repo/shared/dist/server";
3-
import { Demo } from "@repo/shared";
3+
import { Demo, RotatingCube } from "@repo/shared";
44

55
export const metadata = {
66
title: "Esbuild Plugin Webgl",
@@ -10,6 +10,7 @@ export const metadata = {
1010
export default function Page(): JSX.Element {
1111
return (
1212
<LandingPage title="Next.js Example">
13+
<RotatingCube />
1314
<Demo />
1415
<MyButton />
1516
</LandingPage>
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
.cube {
22
/* create your container styles here */
3-
height: 400px;
4-
width: 600px;
3+
height: 480px;
4+
width: 640px;
5+
margin: auto;
6+
display: block;
57
}

packages/shared/src/client/rotating-cube/rotating-cube.test.tsx

Lines changed: 0 additions & 13 deletions
This file was deleted.

packages/shared/src/client/rotating-cube/utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { mat4, glMatrix } from "gl-matrix";
44

55
/** Create rotating Cube */
66
export const createCube = (canvas: HTMLCanvasElement, gl: WebGLRenderingContext) => {
7-
gl.clearColor(2.55, 2.55, 2.55, 1);
7+
gl.clearColor(0, 0, 0, 0);
88
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
99
gl.enable(gl.DEPTH_TEST);
1010
gl.enable(gl.CULL_FACE);
@@ -162,7 +162,6 @@ export const createCube = (canvas: HTMLCanvasElement, gl: WebGLRenderingContext)
162162
mat4.mul(worldMatrix, yRotationMatrix, xRotationMatrix);
163163
gl.uniformMatrix4fv(matWorldUniformLocation, false, worldMatrix);
164164

165-
gl.clearColor(2.55, 2.55, 2.55, 1.0);
166165
gl.clear(gl.DEPTH_BUFFER_BIT | gl.COLOR_BUFFER_BIT);
167166

168167
gl.drawElements(gl.TRIANGLES, boxIndices.length, gl.UNSIGNED_SHORT, 0);

packages/shared/src/server/cards/cards.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
background: rgba(var(--card-rgb), 0);
1818
border: 1px solid rgba(var(--card-border-rgb), 0.1);
1919
cursor: pointer;
20+
max-width: 300px;
2021
transition:
2122
background 200ms,
2223
border 200ms;

0 commit comments

Comments
 (0)