-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
66 changed files
with
7,022 additions
and
650 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
extends: [require.resolve("config/eslint/web.js")], | ||
parserOptions: { | ||
tsconfigRootDir: __dirname, | ||
project: "./tsconfig.json", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
pnpm-lock.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Cap Embed App | ||
|
||
This Next.js app is used for Cap web embeds. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
.wrapper { | ||
@apply mx-auto w-[92%] max-w-screen-xl; | ||
} | ||
|
||
.wrapper-max { | ||
@apply max-w-screen-2xl; | ||
} | ||
|
||
.wrapper-sm { | ||
@apply max-w-5xl; | ||
} | ||
|
||
*, | ||
*:before, | ||
*:after { | ||
box-sizing: border-box; | ||
} | ||
|
||
* { | ||
min-width: 0; | ||
min-height: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import "@/app/globals.css"; | ||
import { Toaster } from "react-hot-toast"; | ||
import type { Metadata } from "next"; | ||
|
||
export const metadata: Metadata = { | ||
title: | ||
"Cap — Effortless, instant screen sharing. Open source and cross-platform.", | ||
description: | ||
"Cap is the open source alternative to Loom. Lightweight, powerful, and stunning. Record and share in seconds.", | ||
openGraph: { | ||
title: | ||
"Cap — Effortless, instant screen sharing. Open source and cross-platform.", | ||
description: | ||
"Cap is the open source alternative to Loom. Lightweight, powerful, and stunning. Record and share in seconds.", | ||
type: "website", | ||
url: "https://cap.so", | ||
images: ["https://cap.so/og.png"], | ||
}, | ||
}; | ||
|
||
export default async function RootLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<html lang="en"> | ||
<head> | ||
<link | ||
rel="apple-touch-icon" | ||
sizes="180x180" | ||
href="/apple-touch-icon.png" | ||
/> | ||
<link | ||
rel="icon" | ||
type="image/png" | ||
sizes="32x32" | ||
href="/favicon-32x32.png" | ||
/> | ||
<link | ||
rel="icon" | ||
type="image/png" | ||
sizes="16x16" | ||
href="/favicon-16x16.png" | ||
/> | ||
<link rel="manifest" href="/site.webmanifest" /> | ||
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" /> | ||
<meta name="msapplication-TileColor" content="#da532c" /> | ||
<meta name="theme-color" content="#ffffff" /> | ||
</head> | ||
<body className="w-screen h-screen"> | ||
<Toaster /> | ||
<main className="w-full h-full overflow-hidden">{children}</main> | ||
</body> | ||
</html> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default async function EmbedPage() { | ||
return ( | ||
<div> | ||
<p>Embed</p> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
"use client"; | ||
|
||
import { ShareVideo } from "./_components/ShareVideo"; | ||
import { comments as commentsSchema, videos } from "@cap/database/schema"; | ||
import { userSelectProps } from "@cap/database/auth/session"; | ||
|
||
export const Share = ({ | ||
data, | ||
user, | ||
comments, | ||
}: { | ||
data: typeof videos.$inferSelect; | ||
user: typeof userSelectProps | null; | ||
comments: (typeof commentsSchema.$inferSelect)[]; | ||
}) => { | ||
return ( | ||
<div className="w-full h-full space-y-6"> | ||
<ShareVideo data={data} user={user} comments={comments} /> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { memo, forwardRef, useEffect } from "react"; | ||
import Hls from "hls.js"; | ||
|
||
export const AudioPlayer = memo( | ||
forwardRef<HTMLAudioElement, { src: string; onReady: () => void }>( | ||
({ src, onReady }, ref) => { | ||
useEffect(() => { | ||
const audio = ref as React.MutableRefObject<HTMLAudioElement | null>; | ||
|
||
if (!audio.current) return; | ||
|
||
let hls: Hls | null = null; | ||
|
||
if (Hls.isSupported()) { | ||
hls = new Hls(); | ||
hls.loadSource(src); | ||
hls.attachMedia(audio.current); | ||
hls.on(Hls.Events.MANIFEST_PARSED, () => { | ||
onReady(); | ||
}); | ||
} else if (audio.current.canPlayType("application/vnd.apple.mpegurl")) { | ||
audio.current.src = src; | ||
audio.current.addEventListener( | ||
"loadedmetadata", | ||
() => { | ||
onReady(); | ||
}, | ||
{ once: true } | ||
); | ||
} | ||
|
||
return () => { | ||
if (hls) { | ||
hls.destroy(); | ||
} | ||
}; | ||
}, [src, onReady, ref]); | ||
|
||
return <audio ref={ref} controls={false} style={{ display: "none" }} />; | ||
} | ||
) | ||
); |
Oops, something went wrong.