3b1b / 3Blue1Brown.com

https://www.3blue1brown.com
Other
345 stars 124 forks source link

3Blue1Brown Website

This is a Next.js project bootstrapped with create-next-app.

Build the site locally

  1. Install Node
  2. Install Yarn
  3. Install Git LFS
  4. Install an MDX syntax highlighting plugin for your code editor
  5. If installing Git LFS for the first time on your user account, run git lfs install
  6. Run yarn dev
  7. Open http://localhost:3000 to see the site

Background Knowledge

Basic

What you need to know if you're just authoring lessons or otherwise editing .mdx files:

Advanced

What you also need to know if you're editing the website more in depth:

Guidelines

Guidelines to ensure consistency and quality of contributions are listed in .github/pull_request_template.md. Some items may refer back to this readme for longer lists or documentation.

Components

Components (or "widgets") are building blocks for visual and interactive elements that go beyond basic Markdown. You can use components in your .mdx files and pass them options/parameters called "props".

The basic syntax is:

<SomeComponent someString="some string" someNumber={42} someFlag={true} />

Or for some components that may need longer-form inputs:

<SomeComponent>Lorem ipsum dolor</SomeComponent>

The inner contents are referred to as the children prop below.

This section only covers the components and props meant to be used in lessons. For documentation of other components and props, look in the components folder.

Accordion

An expandable/collapsible section.

Center

Centers a group of arbitrary elements. You shouldn't need to use this in lessons much, if ever. Most components align themselves as stylistically appropriate.

Clickable

A button is an element that does something on the current page. A link is an element that goes somewhere. This component is a big clickable that combines the two for stylistic consistency, hence the generic name "clickable".

Normal in-text links can still be made with regular Markdown syntax. This component is used outside of lessons, but in lessons you should only use this component for important links you want to emphasize.

Also required: icon or text

Figure

A component to show image and/or video and caption, with controls to switch between them.

For image and video, if you provide a relative url, links to that path in the Linode bucket. Omit width and height whenever possible to let the figure auto-size based on the aspect ratio of the image/video.

Interactive

Dynamically imports another react component and displays it in a frame.

Example of children: <Interactive>{(MyComponent) => <MyComponent someProp="some value" />}</Interactive>.

Lesson Link

An in-text link to another lesson that shows a preview of the lesson in a tooltip on hover/focus.

Pi Creature

A pi creature with a chosen emotion and optional speech/thought bubble text.

Question

Interactive multiple-choice question with explanation.

Section

Sections are the alternating white/off-white backgrounds that span the entire width of the page. Use these sparingly to divide your lesson into big groups.

Example:

... previous section of content

</Section><Section>

... next section of content

Spoiler

"Redacted" text that reveals itself on hover/focus, similar to spoilers on Reddit and other forums.

Twitter

Component to embed a tweet (and possibly other Twitter things in the future?).

tweet 🚨 - Id of tweet.