Middleman, Angular-powered HTML slides that make it super easy to add full-screen GIFs.
bundle install
Next, we need to set up the project dependencies via Bower. If you don't have Bower installed:
# Install Bower globally
npm install -g bower
Install the dependencies:
bower install
Start the Middleman server:
middleman s
Go to localhost:4567
and you should see the first slide.
To set the page title, open up config.rb
and change the page_title
.
All of the slides are in source/index.haml
. They are written as Angular directives in Haml.
Here are some different slide types you can use:
/ Text
%slide
.slide-content
%h1 Slide Title
/ Title Slide
%slide.slide--title
.slide-content
%h1 Slide Title
/ Centered Text + Subtitle
%slide
.slide-content
.middle.tac
%h1.mbxs Another Title
%p This is a subtitle.
/ Image
%slide
.slide-content
.middle.tac
= image_tag 'http://placehold.it/800x400', alt: 'Placeholder', class: 'slide-media'
%slide
.slide-content
.middle.tac
= image_tag 'http://placehold.it/800x400', alt: 'Placeholder', class: 'slide-img'
/ Light
%slide.slide--light
.slide-content
.middle.tac
%h1 Light
/ Dark
%slide.slide--dark
.slide-content
.middle.tac
%h1 Dark
/ Subdued
%slide.slide--subdue
.slide-content
.middle.tac
%h1 Subdued
/ Success
%slide.slide--success
.slide-content
.middle.tac
%h1 Success
/ Error
%slide.slide--error
.slide-content
.middle.tac
%h1 Error
/ Warning
%slide.slide--warning
.slide-content
.middle.tac
%h1 Warning
/ One-off Color
%slide(color='#f4f4f4')
.slide-content
.middle.tac
%h1 Slide Title
%slide.slide--light
.slide-content
.middle.middle--auto
:code
# lang: sass
// Code goes here...
/ Middle
%slide
.slide-content
.middle
%h1 Slide Title
/ Middle Center (text)
%slide
.slide-content
.middle.tac
%h1 Slide Title
/ Bottom
%slide
.slide-content
.bottom
%h1 Slide Title
/ Bottom Center
%slide
.slide-content
.bottom.tac
%h1 Slide Title
/ Bottom Right
%slide
.slide-content
.bottom.right
%h1 Slide Title
%slide.slide--light
.slide-content
%h1.mbs List of Things
.g
.g-b.g-b--1of2
%ul
%li One thing
%li Here's another thing
%li And another
.g-b.g-b--1of2
%ul
%li Oh man! Another thing
%li Here's another thing
%li And, finally, another
%slide
.slide-content
.bottom
%p.tsxl
What would happen if I put some longer, more thought-provoking
text here that fills up more space?
%slide
.slide-content
.bottom
%blockquote.mbxs
"What would happen if I put some longer, more thought-provoking
text here that fills up more space?"
%p — Drew Barontini
/ Basic
%slide.slide--fade(img='IMAGE_URL')
.slide-content
.middle.tac
%h1.mbxs Slide Title
%p This is standard slide.
/ Dark
%slide.slide--fade.slide--fade--dark(img='IMAGE_URL')
.slide-content
.middle.tac
%h1.mbxs Slide Title
%p This is standard slide.
/ Light
%slide.slide--fade.slide--fade--light(img='IMAGE_URL')
.slide-content
.middle.tac
%h1.mbxs Slide Title
%p This is standard slide.
/ Success
%slide.slide--fade.slide--fade--success(img='IMAGE_URL')
.slide-content
.middle.tac
%h1.mbxs Slide Title
%p This is standard slide.
/ Error
%slide.slide--fade.slide--fade--error(img='IMAGE_URL')
.slide-content
.middle.tac
%h1.mbxs Slide Title
%p This is standard slide.
/ Warning
%slide.slide--fade.slide--fade--warning(img='IMAGE_URL')
.slide-content
.middle.tac
%h1.mbxs Slide Title
%p This is standard slide.
/ Contain
%slide.slide--contain(img='IMAGE_URL')
/ Fill
%slide(img='IMAGE_URL')
/ Inset
%slide.slide--inset(img='IMAGE_URL')
/ Tiled
%slide.slide--tile(img='IMAGE_URL')
/ Local
%slide(img="#{image_path('IMAGE_URL')}")
You can use the %yt-video
directive to load a responsive YouTube video. Just add:
- The width
- The height
- The embed ID
%slide.slide--video
.middle.tac
.slide-video
%yt-video(width="1280" height="720" video-src="xZY43QSx3Fk")
- Use the
right arrow
orspacebar
to move right. - Use the
left arrow
to move left.
This will only occur on the .slide-content
within each slide. If you just have a fullscreen image, or no .slide-content
, the slide will just use the normal fade in/out transition. If you do have the .slide-content
section, which you almost always should, then you can apply a few different slide transitions per slide, like so:
/ Scale
%slide.slide--scale
.slide-content
/ ...
/ Translate X
%slide.slide--translateX
.slide-content
/ ...
/ Translate Y
%slide.slide--translateY
.slide-content
/ ...
source/assets/stylesheets/foundation/_settings.sass
:
$slide-transition: false
%slide.noTransition
.slide-content
.middle.tac
%h1 Slide Title
When you're slides get long enough, you might want to jump through sections (like chapters of a book) more easily. Add the following to your %slide
to define a section:
%slide(section)
.slide-content
%h1 Slide Title
Just add the section
attribute, and now you can cycle through defined sections using the S
keyboard shortcut.
By default, no elements have any margin
or padding
to keep the vertical alignment nice and happy. If you want to add spacing to headings, paragraphs, lists, etc., use the utility classes for spacing:
%slide
.slide-content
%h1.mbxs Slide Title
%p A description for the slide.
mbxs
stands for margin-bottom
extra-small
, and there are variants for extra-small xs
, small s
, medium m
, large l
, and extra-large xl
, for both margin
and padding
.
There are other various single-property classes in source/assets/stylesheets/foundation/_tools.sass
that you can peruse.
If you want to alter the design/settings of the application, open up sourse/assets/stylesheets/_config.sass
, and uncomment any line that you'd like to override. Available variables:
- Base variables for things like
border-width
,box-shadow
, andline-height
- Base color variables
- Base font variables, including changing the Google
@font-face
header or body font - Progress bar
height
andbackground-color
- All slide type colors (which generally pull from the base color variables)
- Slide options for transition
delay
,speed
, etc.