diff --git a/.yarn/cache/graceful-fs-npm-4.2.10-79c70989ca-3f109d70ae.zip b/.yarn/cache/graceful-fs-npm-4.2.10-79c70989ca-3f109d70ae.zip deleted file mode 100644 index 2d04255c..00000000 Binary files a/.yarn/cache/graceful-fs-npm-4.2.10-79c70989ca-3f109d70ae.zip and /dev/null differ diff --git a/.yarn/cache/graceful-fs-npm-4.2.9-ee48e00aaa-68ea4e07ff.zip b/.yarn/cache/graceful-fs-npm-4.2.9-ee48e00aaa-68ea4e07ff.zip new file mode 100644 index 00000000..cb6a65e2 Binary files /dev/null and b/.yarn/cache/graceful-fs-npm-4.2.9-ee48e00aaa-68ea4e07ff.zip differ diff --git a/.yarn/cache/lru-cache-npm-7.7.3-ab4c99947f-1789743a68.zip b/.yarn/cache/lru-cache-npm-7.7.1-726274dc4d-f362c5a2cf.zip similarity index 55% rename from .yarn/cache/lru-cache-npm-7.7.3-ab4c99947f-1789743a68.zip rename to .yarn/cache/lru-cache-npm-7.7.1-726274dc4d-f362c5a2cf.zip index 46df0896..691c67d9 100644 Binary files a/.yarn/cache/lru-cache-npm-7.7.3-ab4c99947f-1789743a68.zip and b/.yarn/cache/lru-cache-npm-7.7.1-726274dc4d-f362c5a2cf.zip differ diff --git a/.yarn/cache/make-fetch-happen-npm-10.1.1-ca9d763248-3f1b0acc20.zip b/.yarn/cache/make-fetch-happen-npm-10.1.0-acd89da8f5-fae1c2f255.zip similarity index 63% rename from .yarn/cache/make-fetch-happen-npm-10.1.1-ca9d763248-3f1b0acc20.zip rename to .yarn/cache/make-fetch-happen-npm-10.1.0-acd89da8f5-fae1c2f255.zip index ee125e2f..ae49ff0c 100644 Binary files a/.yarn/cache/make-fetch-happen-npm-10.1.1-ca9d763248-3f1b0acc20.zip and b/.yarn/cache/make-fetch-happen-npm-10.1.0-acd89da8f5-fae1c2f255.zip differ diff --git a/gatsby-config.js b/gatsby-config.js index 9dc84ec5..02234f75 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -24,7 +24,7 @@ module.exports = { logoUrl: `${siteUrl}/logo-black-raster.png`, }, plugins: [ - 'gatsby-plugin-preact', + // 'gatsby-plugin-preact', 'gatsby-plugin-react-helmet', 'gatsby-plugin-styled-components', 'gatsby-plugin-typescript', @@ -34,7 +34,7 @@ module.exports = { resolve: `gatsby-plugin-page-creator`, options: { path: `${__dirname}/src/pages`, - ignore: ['**/styled.ts', '**/*.styled.ts'], + ignore: ['**/styled.ts', '**/*.styled.ts', 'talks/**/*.content.tsx'], }, }, { diff --git a/src/components/Logo/index.tsx b/src/components/Logo/index.tsx index efe5a3d0..39a20d65 100644 --- a/src/components/Logo/index.tsx +++ b/src/components/Logo/index.tsx @@ -1,6 +1,6 @@ import classnames from 'classnames'; import * as React from 'react'; -import { Helmet } from 'react-helmet'; +import Script from '../Script'; import { LogoSvg } from './styled'; interface LogoProps { @@ -26,34 +26,27 @@ const Logo = ({ color={logoKind === LogoKind.Black ? 'black' : 'white'} /> {isPlayful && ( - - - + document.querySelector('.js--site-logo').addEventListener('click', playAnimation); + document.querySelector('.js--site-logo').addEventListener('mouseenter', playAnimation); + document.querySelector('.js--site-logo').addEventListener('animationend', stopAnimationIfAllDone); + `} + /> )} ); diff --git a/src/components/Logo/styled.ts b/src/components/Logo/styled.ts index 47e4f0bb..3ce8afaa 100644 --- a/src/components/Logo/styled.ts +++ b/src/components/Logo/styled.ts @@ -8,7 +8,7 @@ const moveLetters = keyframes` 50% { transform: translateY(-3px); - } + } 100% { transform: translateY(0); diff --git a/src/components/talks/LiveDemo/index.tsx b/src/components/talks/LiveDemo/index.tsx new file mode 100644 index 00000000..3b13baff --- /dev/null +++ b/src/components/talks/LiveDemo/index.tsx @@ -0,0 +1,40 @@ +import * as React from 'react'; +import { Container, Caption, CaptionHeader, Video } from './styled'; + +interface LiveDemoProps { + slideId: string; + title: string; + videoSource: string; + videoType: 'video/mp4'; // Add new types if necessary + videoWidth: number; + videoHeight: number; + className?: string; +} + +// TODO: #-link to the demo +const LiveDemo = ({ + slideId, + title, + className, + videoSource, + videoType, + videoWidth, + videoHeight, +}: LiveDemoProps) => ( + + + Live Demo: {title} + + + +); + +export default LiveDemo; diff --git a/src/components/talks/LiveDemo/styled.ts b/src/components/talks/LiveDemo/styled.ts new file mode 100644 index 00000000..391d83ab --- /dev/null +++ b/src/components/talks/LiveDemo/styled.ts @@ -0,0 +1,54 @@ +import styled from 'styled-components'; +import media from '../../../styles/media'; +import { colors, gridSize, sizes } from '../../../styles/variables'; + +export const Container = styled.figure` + position: relative; + margin: 0; + padding: ${gridSize * 4}px 0 ${gridSize * 6}px; + + color: white; + + ${media.small` + padding: ${gridSize * 2}px 0 ${gridSize * 3}px; + `} + + &::before { + content: ''; + + /* Positioning is based on https://css-tricks.com/full-width-containers-limited-width-parents/#no-calc-needed */ + position: absolute; + top: 0; + left: 50%; + right: 50%; + bottom: 0; + z-index: -1; + + margin-left: -50vw; + margin-right: -50vw; + + background: #222; + } +`; + +export const Caption = styled.figcaption` + font-size: 36px; + margin-bottom: ${gridSize * 2}px; + + ${media.small` + font-size: 24px; + margin-bottom: ${gridSize * 1.5}px; + `} +`; + +export const CaptionHeader = styled.span` + font-weight: 900; + background: ${colors.brightYellow}; + color: black; + padding: 0 ${gridSize}px; + margin-left: -${gridSize}px; +`; + +export const Video = styled.video` + width: 100%; +`; diff --git a/src/components/talks/SectionHeader/index.ts b/src/components/talks/SectionHeader/index.ts deleted file mode 100755 index 1ed998e6..00000000 --- a/src/components/talks/SectionHeader/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -import styled from 'styled-components'; -import media from '../../../styles/media'; - -const SectionHeader = styled.h2` - font-size: 60px; - font-weight: bold; - white-space: nowrap; - letter-spacing: -1px; - - ${media.small` - font-size: 48px; - white-space: normal; - line-height: 1; - `}; -`; - -export default SectionHeader; diff --git a/src/components/talks/SectionHeader/index.tsx b/src/components/talks/SectionHeader/index.tsx new file mode 100755 index 00000000..a929f79f --- /dev/null +++ b/src/components/talks/SectionHeader/index.tsx @@ -0,0 +1,21 @@ +import React from 'react'; +import { JSXChildrenProp } from '../../../types'; +import { Container, Link } from './styled'; + +const SectionHeader = ({ + id, + className, + children, +}: { + id: string; + className?: string; + children: JSXChildrenProp; +}) => { + return ( + + {children} + + ); +}; + +export default SectionHeader; diff --git a/src/components/talks/SectionHeader/styled.ts b/src/components/talks/SectionHeader/styled.ts new file mode 100644 index 00000000..b35197f5 --- /dev/null +++ b/src/components/talks/SectionHeader/styled.ts @@ -0,0 +1,51 @@ +import styled from 'styled-components'; +import media from '../../../styles/media'; + +export const Container = styled.h2``; + +export const Link = styled.a` + color: inherit; + border: none; + position: relative; + + font-size: 60px; + font-weight: bold; + white-space: nowrap; + letter-spacing: -1px; + + ${media.small` + font-size: 48px; + white-space: normal; + line-height: 1; + `}; + + &::before { + content: '#'; + + position: absolute; + left: -135px; + + /* Increase the area to allow moving the mouse from the image to the element */ + width: 180px; + text-align: center; + + color: #ccc; + + /* Hide & animate the element */ + opacity: 0; + transform: scale(0.8); + pointer-events: none; + transition: all 0.15s ease-out; + } + + &:hover, + &:focus, + &:active { + &::before { + opacity: 1; + transform: scale(1); + pointer-events: auto; + transition: none; + } + } +`; diff --git a/src/components/talks/Slide/styled.ts b/src/components/talks/Slide/styled.ts index 09f65145..57506f92 100644 --- a/src/components/talks/Slide/styled.ts +++ b/src/components/talks/Slide/styled.ts @@ -1,6 +1,6 @@ import styled, { css } from 'styled-components'; import media from '../../../styles/media'; -import { sizes } from '../../../styles/variables'; +import { gridSize, sizes } from '../../../styles/variables'; import GatsbyImage from '../../Image'; export const Container = styled.figure` @@ -58,7 +58,8 @@ export const ImageWrapper = styled.a` line-height: 120px; color: #ccc; - font-size: 48px; + font-family: 'Montserrat', sans-serif; + font-size: 60px; font-weight: bold; /* Hide & animate the element */ @@ -99,6 +100,13 @@ export const Text = styled.figcaption` font-size: 1.25em; `} `} + + > pre > code { + display: block; + padding: ${gridSize / 2}px ${gridSize}px; + margin: 0 -${gridSize}px; + white-space: pre-wrap; + } `; export const SlideLink = styled.a` diff --git a/src/pages/talks/cwv-cnn/index.tsx b/src/pages/talks/cwv-cnn/index.tsx new file mode 100755 index 00000000..bb3c221e --- /dev/null +++ b/src/pages/talks/cwv-cnn/index.tsx @@ -0,0 +1,160 @@ +import { graphql } from 'gatsby'; +import * as React from 'react'; +import { Helmet } from 'react-helmet'; +import { ImageFluid, ImageFixed } from '../../../components/Image'; +import Layout from '../../../components/Layout'; +import { LogoKind } from '../../../components/Logo'; +import WidthWrapper from '../../../components/WidthWrapper'; +import TalkHeader from '../../../components/talks/TalkHeader'; +import { Footer, Footnote, Nav, Slides } from '../styled'; +import SlidesContent from './slides.content'; +import indexCoverUrl from './slides/slide1.png'; + +interface CwvCnnPageProps { + data: { + indexSlide: { + childImageSharp: { + fluid: ImageFluid; + }; + }; + iamakulovPhoto: { + childImageSharp: { + fixed: ImageFixed; + }; + }; + }; +} + +const resolvedCoverUrl = `https://3perf.com${indexCoverUrl}`; + +const publishedDate = new Date(2022, 6, 8); + +const CwvCnnPage = ({ data }: CwvCnnPageProps) => { + return ( + + + + [Draft] Core Web Vitals (CNN Case Study) + {/* TODO: remove when done ↓ */} + + + + + + + + + + + + + + + + + + + + + + + +