Backgrounds

The background of a slide can be set through slide options. The types of background are:

  • Solid color
  • Image
  • Video
  • Iframe All of these become fullscreen, hence backgrounds are the way to show fullscreen content in nimiSlides.

Solid Color Background

The solid color is specified by passing a valid CSS color (e.g. red, #F1B434, etc) to the colorBackground parameter of slideOptions:

slide(slideOptions(colorBackground="#F1B434")):
  nbText: "Yellow Background!"

Yellow Background!

Gradient Color Background

The color gradient is specified by passing a valid CSS color (e.g. linear-gradient, radial-gradient, conic-gradient) to the gradientBackground parameter of slideOptions:

slide(slideOptions(gradientBackground="linear-gradient(to bottom, #F1B434, black)")):
  nbText: "Linear"

slide(slideOptions(gradientBackground="radial-gradient(#F1B434, black)")):
  nbText: "Radial"

slide(slideOptions(gradientBackground="conic-gradient(#F1B434, black)")):
  nbText: "Conic"

Linear

Radial

Conic

Image Background

The image is specified by passing a link to the imageBackground parameter of slideOptions:

slide(slideOptions(imageBackground="https://github.com/nim-lang/assets/raw/master/Art/logo-crown.png")):
  discard

As you can see, I didn't add any content to the slide and instead used a discard. You can add content to the slide, but it can be hard to see against an image.

Video Background

The video background can play a concrete video file (mp4 etc), but if you want to show a Youtube video you should use the Iframe background instead. The image is specified by passing a link to the videoBackground parameter of slideOptions:

slide(slideOptions(videoBackground="https://user-images.githubusercontent.com/5092565/178597724-16287a00-5c31-4500-83d8-e07160a36369.mp4")):
  discard

Iframe Background (Youtube videos as well)

If you want to show a website or youtube video in fullscreen, you should use an Iframe background. The background will be interactible unless iframeInteractive=false is passed to the slide option. The website is specified by passing a link to the iframeBackground parameter of slideOptions:

slide(slideOptions(iframeBackground="https://www.youtube-nocookie.com/embed/Sf1TndCcIlU")):
  discard