Skip to content

Commit aa44da7

Browse files
authored
Merge pull request #128 from musehq/dev
Upgrade Examples, Improve Site
2 parents 48b6d6e + ebce670 commit aa44da7

19 files changed

+180
-55
lines changed

examples/ideas/Analytics.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import posthog from "posthog-js";
2+
3+
const IS_PROD = process.env.NODE_ENV === "production";
4+
const IS_LOCAL = window.location.href.includes("localhost:");
5+
6+
if (IS_PROD && !IS_LOCAL) {
7+
posthog.init("PCoHEHV8I8etm7-gSY6RT8tcev9M3VWoejzJKjv2Ifw", {
8+
api_host: "https://app.posthog.com",
9+
});
10+
}
11+
12+
export default function Analytics() {
13+
return null;
14+
}

examples/ideas/Link.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function Link(props: LinkProps) {
1313
<group name={`link-${href}`} {...rest}>
1414
<FacePlayer>
1515
<Anchor href={href}>
16-
<Button>{children}</Button>
16+
<Button maxWidth={0.4}>{children}</Button>
1717
</Anchor>
1818
</FacePlayer>
1919
</group>

examples/ideas/Title.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
1-
import { FacePlayer } from "spacesvr";
1+
import { FacePlayer, Image } from "spacesvr";
22
import { GroupProps } from "@react-three/fiber";
33
import { Text } from "@react-three/drei";
44

55
type LinkProps = {
66
children: string;
7+
image?: string;
78
} & GroupProps;
89

910
const FONT = "https://d27rt3a60hh1lx.cloudfront.net/fonts/Quicksand_Bold.otf";
1011

1112
export default function Title(props: LinkProps) {
12-
const { children, ...rest } = props;
13+
const { children, image, ...rest } = props;
1314

1415
return (
1516
<group name="title" {...rest}>
1617
<FacePlayer>
18+
{image && (
19+
<Image src={image} position-z={-0.01} scale={3} position-y={0.25} />
20+
)}
1721
<Text color="black" font={FONT} fontSize={0.2}>
1822
{children}
1923
</Text>

examples/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"dependencies": {
1313
"@types/three": "0.139.0",
1414
"next": "12.1.6",
15+
"posthog-js": "^1.33.0",
1516
"react": "18.1.0",
1617
"react-dom": "18.1.0",
1718
"three": "^0.139.2"

examples/pages/_app.tsx

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,61 @@
11
import type { AppProps } from "next/app";
2+
import Head from "next/head";
23

34
function MyApp({ Component, pageProps }: AppProps) {
4-
return <Component {...pageProps} />;
5+
return (
6+
<>
7+
<Head>
8+
{/* Basic Info*/}
9+
<meta charSet="utf-8" />
10+
<meta name="language" content="english" />
11+
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
12+
<meta httpEquiv="content-type" content="text/html" />
13+
<title>spacesvr</title>
14+
{/* SEO tags */}
15+
<meta name="author" content="www.muse.place" />
16+
<meta
17+
name="description"
18+
content="An npm library that provides a standardized reality for the future of the 3D Web."
19+
/>
20+
<meta
21+
name="keywords"
22+
content="muse, spacesvr, 3d, webxr, 3d website, framework, npm"
23+
/>
24+
<meta name="distribution" content="web" />
25+
{/* open graph */}
26+
<meta property="og:url" content="https://www.spacesvr.io" />
27+
<meta property="og:type" content="website" />
28+
<meta property="og:title" content="spacesvr" />
29+
<meta
30+
property="og:description"
31+
content="An npm library that provides a standardized reality for the future of the 3D Web."
32+
/>
33+
<meta property="og:image" content="/android-chrome-512x512.png" />
34+
{/* icons */}
35+
<link
36+
rel="apple-touch-icon"
37+
sizes="180x180"
38+
href="/apple-touch-icon.png"
39+
/>
40+
<link
41+
rel="icon"
42+
type="image/png"
43+
sizes="32x32"
44+
href="/favicon-32x32.png"
45+
/>
46+
<link
47+
rel="icon"
48+
type="image/png"
49+
sizes="16x16"
50+
href="/favicon-16x16.png"
51+
/>
52+
<link rel="manifest" href="/site.webmanifest" />
53+
<meta name="msapplication-TileColor" content="#da532c" />
54+
<meta name="theme-color" content="#ffffff" />
55+
</Head>
56+
<Component {...pageProps} />
57+
</>
58+
);
559
}
660

761
export default MyApp;
23.4 KB
Loading
92.4 KB
Loading
13.7 KB
Loading

examples/public/browserconfig.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<browserconfig>
3+
<msapplication>
4+
<tile>
5+
<square150x150logo src="/mstile-150x150.png"/>
6+
<TileColor>#da532c</TileColor>
7+
</tile>
8+
</msapplication>
9+
</browserconfig>

examples/public/favicon-16x16.png

1.45 KB
Loading

0 commit comments

Comments
 (0)