Skip to content

Commit 00cfecf

Browse files
committed
feat: add video play event
1 parent 733e13c commit 00cfecf

File tree

4 files changed

+54
-34
lines changed

4 files changed

+54
-34
lines changed

components/Head/Head.tsx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import NextHead from "next/head";
2+
3+
const Head = () => {
4+
return (
5+
<NextHead>
6+
<title>IBM Research | CodeFlare</title>
7+
<meta name="description" content="CodeFlare by IBM Research" />
8+
<meta
9+
name="description"
10+
content="Let your AI and ML teams innovate where it matters. We‘ll handle the rest."
11+
/>
12+
13+
{/* <!-- Facebook Meta Tags --> */}
14+
<meta property="og:url" content="https://codeflare.dev" />
15+
<meta property="og:type" content="website" />
16+
<meta property="og:title" content="IBM Research | CodeFlare" />
17+
<meta
18+
property="og:description"
19+
content="Let your AI and ML teams innovate where it matters. We‘ll handle the rest."
20+
/>
21+
<meta property="og:image" content="https://i.imgur.com/keyAdnw.png" />
22+
23+
{/* <!-- Twitter Meta Tags --> */}
24+
<meta name="twitter:card" content="summary_large_image" />
25+
<meta property="twitter:domain" content="codeflare.dev" />
26+
<meta property="twitter:url" content="https://codeflare.dev" />
27+
<meta name="twitter:title" content="IBM Research | CodeFlare" />
28+
<meta
29+
name="twitter:description"
30+
content="Let your AI and ML teams innovate where it matters. We‘ll handle the rest."
31+
/>
32+
<meta
33+
name="twitter:image"
34+
content="https://i.imgur.com/keyAdnw.png"
35+
></meta>
36+
<link rel="icon" href="/favicon.ico" />
37+
</NextHead>
38+
);
39+
};
40+
41+
export default Head;

components/Head/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from "./Head";
2+
export { default } from "./Head";

pages/index.tsx

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import type { NextPage } from "next";
22
import { useState } from "react";
3-
import Head from "next/head";
43
import { Innovate, Spaceship, Streamline } from "@carbon/pictograms-react";
54
// import LiteYouTubeEmbed from "react-lite-youtube-embed";
65

76
import Hero from "components/Hero";
7+
import Head from "components/Head";
88
import Callout, { CalloutBody, CalloutHeading } from "components/Callout";
99
import Lightbox from "components/Lightbox";
1010
import { TwoColumn, TwoColumnFeature } from "components/TwoColumn";
@@ -19,43 +19,16 @@ const Home: NextPage = () => {
1919
const [lightboxOpen, setLightboxOpen] = useState(false);
2020
return (
2121
<>
22-
<Head>
23-
<title>IBM Research | CodeFlare</title>
24-
<meta name="description" content="CodeFlare by IBM Research" />
25-
<meta
26-
name="description"
27-
content="Let your AI and ML teams innovate where it matters. We‘ll handle the rest."
28-
/>
29-
30-
{/* <!-- Facebook Meta Tags --> */}
31-
<meta property="og:url" content="https://codeflare.dev" />
32-
<meta property="og:type" content="website" />
33-
<meta property="og:title" content="IBM Research | CodeFlare" />
34-
<meta
35-
property="og:description"
36-
content="Let your AI and ML teams innovate where it matters. We‘ll handle the rest."
37-
/>
38-
<meta property="og:image" content="https://i.imgur.com/keyAdnw.png" />
39-
40-
{/* <!-- Twitter Meta Tags --> */}
41-
<meta name="twitter:card" content="summary_large_image" />
42-
<meta property="twitter:domain" content="codeflare.dev" />
43-
<meta property="twitter:url" content="https://codeflare.dev" />
44-
<meta name="twitter:title" content="IBM Research | CodeFlare" />
45-
<meta
46-
name="twitter:description"
47-
content="Let your AI and ML teams innovate where it matters. We‘ll handle the rest."
48-
/>
49-
<meta
50-
name="twitter:image"
51-
content="https://i.imgur.com/keyAdnw.png"
52-
></meta>
53-
<link rel="icon" href="/favicon.ico" />
54-
</Head>
22+
<Head />
5523
<Hero setLightboxOpen={setLightboxOpen} src={heroImage} />
5624
<Lightbox open={lightboxOpen} setOpen={setLightboxOpen}>
5725
<video
5826
onEnded={() => setLightboxOpen(false)}
27+
onPlay={() => {
28+
if ((window as any).plausible) {
29+
(window as any).plausible("Video played");
30+
}
31+
}}
5932
preload="auto"
6033
autoPlay
6134
playsInline

types.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@ declare module "@carbon/react";
22
declare module "@carbon/icons-react";
33
declare module "@carbon/pictograms-react";
44
declare module "*.mp4";
5+
6+
declare global {
7+
plausible: any;
8+
}

0 commit comments

Comments
 (0)