Night Shift documentation
Night Shift is a podcast landing page template in plain HTML, CSS and JavaScript. It has three home pages, eleven inner pages, a working audio player, and a Night and a Day theme. This guide assumes no experience with a build tool.
Getting started
- Unzip the download.
- Open the
nightshiftfolder and double-clickindex.html. It opens in your browser. Every page works from your disk. - To put the site online, upload the contents of the
nightshiftfolder to your web host (for example with FTP, or by dragging the folder into a static host).index.htmlmust be at the top of your site folder.
You do not need Node.js or any build tool to use the template. Edit the HTML and CSS files in nightshift/ with any text editor. The build tool in source/ is optional, for people who want to change many pages at once.
What is in the download
nightshift/ the template: ready-to-use pages
index.html ... 404.html 14 pages
assets/css/style.css the stylesheet (style.min.css is the same, minified)
assets/js/app.js the script (app.min.js is the same, minified)
assets/fonts/ the two fonts, self-hosted
assets/img/ placeholder images, one per photo slot
assets/audio/ two sample audio files
assets/favicon.svg
source/ optional: the files the pages are built from
documentation/ this guide
licenses/ font, icon and other license texts
changelog.txt
readme.txt
The pages link style.min.css and app.min.js. If you prefer to edit the readable versions, change the two links at the top and bottom of each page to style.css and app.js.
Pages
| File | Page | What it has |
|---|---|---|
index.html | Show home | One weekly show: hero player, recent episodes, hosts, chapters, membership, live dates, FAQ. |
index-network.html | Network home | A studio with several shows: show mosaic, show cards, latest episode list, sponsor band. |
index-launch.html | Launch home | A new series before it starts: countdown, trailer player, episode guide, notify form. |
episodes.html | Episodes | The archive, with season and topic filters, search and Show more. |
episode.html | Episode | One episode: player, show notes, chapters, transcript, guest card, related episodes. |
about.html | About | The story, hosts, locations, timeline, crew and values. |
membership.html | Membership | Tiers with a monthly and yearly switch, comparison table, gift card, join form, FAQ. |
live.html | Live shows | Venue cards, what to expect, and a waitlist form. |
advertise.html | Advertise | Audience numbers, an age chart, sponsor formats and a media kit form. |
contact.html | Contact | Contact cards, a story pitch form and a general contact form. |
sections.html | Sections | Every reusable section on one page, each labeled with its file name. |
privacy.html | Privacy | A sample privacy policy layout. |
terms.html | Terms | A sample terms of use layout. |
404.html | 404 | The page-not-found page. |
To make Network home or Launch home your main page, rename it to index.html (rename the old one first), then update the links that point to it.
Editing a page
Open a page in a text editor. Each section is a <section> tag with a data-section name, for example data-section="hero-show". Search for that name to find a section.
- Text: change it in place. The highlighted word in a heading is wrapped in
<em class="hl-word">. - Links: change the
hrefvalues. The demo links between pages. - Remove a section: delete from its
<sectiontag to the matching</section>. - Move a section: cut and paste the whole
<section>. Sections do not depend on each other. - Menu and footer: they repeat on every page. Change them in each page, or change them once in the source and rebuild (see Building from the source).
Colors and the Night and Day themes
Every color is a CSS variable at the top of assets/css/style.css. Change the value there and every page follows.
| Variable | Night | Day | Used for |
|---|---|---|---|
--bg | #110d14 | #f6efe4 | Page ground |
--bg-raised | #191320 | #efe5d6 | Alternate sections |
--bg-card | #1f1826 | #fbf7f0 | Cards |
--text | #f5efe6 | #1b1420 | Headings and body text |
--text-2, --text-3 | #c9bfb3, #9a8f84 | #4e4450, #645a66 | Secondary and small text |
--accent | #f79a3e in both | Buttons, the waveform, fills | |
--accent-text | #f79a3e | #9a3e0a | Accent text and lines |
The Night theme is the default. The moon and sun button in the header switches to Day and remembers the choice in the visitor's browser. To make Day the default, add data-theme="day" to the <html> tag of every page.
A section can keep its own colors whatever the theme is, with one class on the <section>:
tone-night: always darktone-day: always lighttone-invert: the opposite of the page (the membership steps on the Show home use it)tone-accent: for a section on the accent color, such as the newsletter band
All text and background pairs meet WCAG 2.2 AA contrast (4.5:1 or more for normal text) in both themes. If you change a color, check the contrast again.
Fonts and icons
The headings use Bricolage Grotesque and the text uses Hanken Grotesk. Both are in assets/fonts/ and load from your own site: there is no request to a font service. Both are under the SIL Open Font License.
To use other fonts, add their @font-face rules and change --font-display and --font-body at the top of the stylesheet.
Icons are Tabler Icons (MIT license), written straight into the HTML as small <svg> elements, so a copied section brings its icons with it. To add an icon, copy its SVG from the Tabler site and give the <svg> the class ic. Icons take the color of the text around them.
The audio player
The player is a real audio player. It plays, pauses, skips 15 seconds, changes the speed, seeks on the waveform (mouse, touch, or arrow keys), jumps to chapters and transcript lines, and shows a small player at the bottom of the screen when you scroll away. It remembers the place in each episode on the visitor's device, so they can pick up where they stopped. Without JavaScript, each player shows the browser's own audio controls.
Use your own episode
Every player card is an <article class="player" data-player>. Change its data attributes:
<article class="player" data-player
data-episode="47" a number, unique on the page
data-src="assets/audio/episode-47.mp3" your audio file (MP3 works everywhere)
data-title="The Last Bus on Route 12"
data-guest="Dennis Okafor"
data-duration="2892" the length in seconds, shown before the file loads
data-url="episode.html" the episode page, linked from the small player
data-tile="tangerine"> the tile color in the small player
Also change the src of the <audio> inside the <noscript> tag of the same card. The audio file can be on your own site or on your podcast host. The demo files in assets/audio/ are generated sound, made for this template; replace them.
Play buttons on tiles and lists
A button with data-play plays an episode in the small player. It takes the same attributes as the card, with data-play as the episode number:
<button class="tile-play" type="button" data-play="46" data-src="assets/audio/episode-46.mp3"
data-title="Proof at 3 a.m." data-guest="Tomasz Wierzbicki" data-duration="2466"
data-url="episode.html" data-tile="rust" aria-pressed="false" aria-label="Play episode 46">...</button>
Chapters and transcript
A chapter is a button with the start time in seconds and the episode number. Wrap the list in an element with data-chapters and data-episode, and the current chapter is highlighted as the episode plays. Transcript times work the same way inside data-transcript.
<button class="chapter" type="button" data-seek="756" data-seek-episode="47">...</button>
The waveform is decoration: it is the same shape for every file, drawn from the episode number. It is not read from the audio.
Episode tiles
Episode artwork is not an image. Each tile is set in type: the number, the title, and the show name. There are six fills: tile--tangerine, tile--amber, tile--rust, tile--burnt, tile--cocoa and tile--plum. Change the class to change the fill, and the text inside the tile to change the words. If you have cover art, put an <img> in place of the tile.
Sections
sections.html shows every reusable section on one page. The black label above each block names it. Each block is self-contained: copy the <section> into any page and it works, because the styles are in the one stylesheet and the script finds its parts by their data- attributes.
If you copy a section into a page that already has it, change any id values inside the copy so they stay unique on the page.
Forms
Every form checks its fields in the browser and shows a message. No form sends data by itself: a static site has no server to receive it. In the demo, a form waits a moment and then shows its success message.
To make a form send, connect it to a form service such as Formspree, Basin, or your own server script. Add the service's address to the form as data-endpoint:
<form class="inline-form" data-form novalidate
action="https://formspree.io/f/your-form-id" method="post"
data-endpoint="https://formspree.io/f/your-form-id"
data-success="Thanks. You are on the list.">
The script then sends the form with fetch(), and shows the success message or an error. data-success sets the success text.
For a newsletter, use your email service's signup address the same way, and give the email field the name your service expects.
The join form on the membership page does not take payments. Connect it to your payment or membership provider, or replace it with that provider's button.
Countdown
The Launch home counts down to the premiere. Change the date in the data-countdown attribute (with your time zone), and the date in the text next to it:
<div class="countdown" data-countdown="2027-03-04T00:01:00-05:00">
When the date passes, the countdown shows the text in data-countdown-done.
Images
The photos in the live demo are for the demo only and are not in the download. Each photo has a placeholder in assets/img/ with its name and size written on it. To add your photo, save it as a JPG with the same file name, at the size below (or the same shape, larger), and replace the placeholder. Nothing else needs to change.
Then write a short description of the photo in its alt attribute in the HTML. Photos that are only decoration have alt="".
| File | Size in pixels |
|---|---|
assets/img/host-obi.jpg | 960 x 1200 |
assets/img/host-teo.jpg | 960 x 1200 |
assets/img/guest-01.jpg | 800 x 800 |
assets/img/guest-02.jpg | 800 x 800 |
assets/img/guest-03.jpg | 800 x 800 |
assets/img/guest-04.jpg | 800 x 800 |
assets/img/avatar-01.jpg | 240 x 240 |
assets/img/avatar-02.jpg | 240 x 240 |
assets/img/avatar-03.jpg | 240 x 240 |
assets/img/avatar-04.jpg | 240 x 240 |
assets/img/avatar-05.jpg | 240 x 240 |
assets/img/avatar-06.jpg | 240 x 240 |
assets/img/avatar-07.jpg | 240 x 240 |
assets/img/avatar-08.jpg | 240 x 240 |
assets/img/crew-01.jpg | 640 x 800 |
assets/img/crew-02.jpg | 640 x 800 |
assets/img/crew-03.jpg | 640 x 800 |
assets/img/crew-04.jpg | 640 x 800 |
assets/img/scene-studio.jpg | 1200 x 1500 |
assets/img/scene-mic.jpg | 1200 x 1500 |
assets/img/scene-headphones.jpg | 1600 x 1067 |
assets/img/scene-recorder.jpg | 1600 x 1067 |
assets/img/scene-bakery.jpg | 1600 x 1067 |
assets/img/scene-harbor.jpg | 1600 x 1067 |
assets/img/scene-bus.jpg | 1600 x 1067 |
assets/img/scene-tower.jpg | 1600 x 1067 |
assets/img/scene-hospital.jpg | 1600 x 1067 |
assets/img/scene-diner.jpg | 1600 x 1067 |
assets/img/scene-city.jpg | 2400 x 1350 |
assets/img/scene-street.jpg | 2400 x 1350 |
assets/img/scene-venue.jpg | 1600 x 1067 |
assets/img/scene-venue-2.jpg | 1600 x 1067 |
The template shows photos with a light warm color filter (class photo--warm) so stock photos match the palette. Remove the class to show a photo as it is.
Building from the source (optional)
The pages are made from shared parts with Eleventy, so the menu, the footer and the episode list live in one place. Use this when you want to change something on every page at once.
- Install Node.js 20 or newer.
- Open a terminal in the
sourcefolder and runnpm install. - Run
npm run build. The finished site is written tosource/dist/nightshift/. - Run
npm run devto see changes as you work, athttp://localhost:8080.
| Folder | What is in it |
|---|---|
src/pages/ | One file per page |
src/_includes/sections/ | One file per section |
src/_includes/partials/ | Header, footer, the player card, the tile and other small parts |
src/_data/ | The content lists: episodes, hosts, reviews, tiers, live dates, FAQ, menu |
src/css/ | The stylesheet, in parts. main.css lists them. |
src/js/ | The script, in parts. main.js starts them. |
To add an episode, add a line to src/_data/episodes.js and rebuild: the archive, the tiles and the play buttons all update.
Browsers and accessibility
Night Shift works in the current versions of Chrome, Edge, Firefox and Safari, on desktop and phone (Chrome 111, Safari 16.4 and Firefox 128 or newer). It was tested in Chromium, Firefox and WebKit.
- Every page reads in full without JavaScript. The menus and the FAQ are plain HTML, and the pricing switch is CSS.
- Scroll effects turn off when the visitor asks the system for reduced motion. Add
?motion=offto an address to turn them off for a screenshot. - All controls work with a keyboard. Focus is always visible. The waveform and the small player's bar are sliders for screen readers.
- The theme choice and listening places are kept with
localStorage. When the browser blocks it, the site still works and forgets the choice.
Credits and licenses
- Bricolage Grotesque by Mathieu Triay, SIL Open Font License 1.1
- Hanken Grotesk by Alfredo Marco Pradil, SIL Open Font License 1.1
- Tabler Icons by Paweł Kuna, MIT License
- Sample audio: generated for this template, free to use with it
- Demo photos: from Unsplash, for the live demo only, not included
The license texts are in the licenses/ folder. All names, shows, outlets and quotes in the demo are made up.
Support
If something does not work as this guide says, contact us through the support tab on the item page. Please tell us the page, the browser, and what you expected to happen.