GithubHelp home page GithubHelp logo

tmcw / big Goto Github PK

View Code? Open in Web Editor NEW
3.3K 3.3K 160.0 842 KB

presentations for busy messy hackers

Home Page: https://glitch.com/~tmcw-big-demo

License: Other

CSS 21.68% JavaScript 74.17% HTML 4.15%
javascript presentation slides slideshow

big's Introduction

Big

Big. The antidote to your presentation procrastination.

A presentation system that works great for creative, hurried people making focused presentations. Stop tweaking fonts and filling slides with text. Big is a configuration-free system that naturally encourages good style.

Features

  • The entire system is about 16kb
  • Slide layouts based on CSS Grid
  • Speakers notes appear in your developer console, which you can put on your other screen
  • Themes are just CSS, and easy to make

Quickstart installation: Glitch

The absolute fastest way to get started is with Glitch. Just click the link below, and you’ll get the freshest version of Big, in a Glitch app that you can edit and publish.

remix this

With Glitch, your presentation will be online and open source by default. You can download it and continue to work on it offline, or if you want to start offline by default and have the files locally, follow the alternative method below 👇

Alternative method: Local installation

If you use NPM, the fastest way to get a copy of Big is this way:

$ npx degit tmcw/big

Preview the presentation locally by double-clicking on index.html. Create a repository with it to share the presentation with Github Pages, or post the files to any other hosting service. You’ll want to eventually use a real server instead of opening the file - to do that, install serve and run it:

$ npm install -g serve
$ serve

Writing a presentation

Big presentations are webpages: slides are div elements, and any text styling or additional elements are addable by using HTML. The text in each div is sized to fit the screen. A slide can be as simple as:

<div>Big</div>

If you want speakers notes - notes that you can see on your laptop screen but aren't shown on the main projector - you can use a <notes> element:

<div>
  Citrus
  <notes>Aren't oranges, lemons, and limes great?</notes>
</div>

Open your developer console, and you'll see your speaker notes in it when you visit that slide! In most browsers, the console is detachable, so you can move it to a different screen or window when you're giving the presentation.

That's all you need to start writing presentations!

Giving presentations

You can advance slides the usual way, by clicking them. You can also use the left & right arrow keys, and the up and down arrow keys. On touch devices, you can navigate forward by tapping and also navigate forward and backwards by swiping.

Big also has three modes if you want to quickly jump to a slide, or print a presentation. You can switch between modes by hitting the t, p, and j keys.

  • talk is the default mode. Slides are shown one at a time.
  • print: is useful for print output or as an overview: it'll include two slides per printed page, and shows speakers notes along with slides
  • jump: Shows many slides per page, useful for quickly finding a slide and 'jumping' to it. When you're in jump mode, you can use the arrow keys to quickly select a slide and hit Enter to jump to that slide, or click the slide you want.

Using Big

Big is designed to be simple, so if you just want to give a Takahashi style presentation with just text, you don't need to read any further! But it can also go far beyond the basics.

Layouts & Images

Let's say you want to add some pictures to a presentation. If you just want the slide to be an image, you can just make it the only thing on the slide:

<div>
  <img src='airplane.gif'/>
</div>

And Big will appropriate size and place the image in the center.

If you want an image and text, you'll need a little more infrastructure: this is where layouts come in. See, the idea of Big is that it sizes text as big as it can be. This has the effect that if you include something else on a slide, like an image, then it'll be squeezed out by ever-expanding text. So if you want to include an image and some text, you'll need to set some ground rules for how much space each is permitted to take up. Luckily, this also lets us do flexible layouts of image and text - you can choose how they're arranged, and they'll gleefully comply.

<div
  class='layout'
  style='grid-template-columns: 1fr;grid-template-rows:75% 25%;'>
  <img src='airplane.gif'/>
  <div>A longer description!</div>
</div>

So you'll see that we have two new attributes for this laid-out slide:

class='layout' triggers a few styles from big.css that give the slide grid layout, make its subsections flexbox, and tweaks how images work. For all slides that use layout, they'll use the layout class.

The second bit - the style attribute, is where the customization comes in. The MDN documentation for grid-template-rows and grid-template-columns is where to start if you want to learn this inside & out, but for those that tend to learn from examples, here are some!

50% / 50% split columns: picture on the left, text on the right

<div class=layout style='grid-template-columns: 50% 50%;'>
  <img src='airplane.gif'/>
  <div>A longer description!</div>
</div>

Grids read from left to right, top to bottom, unless you customize that with extra CSS. You'll need to specify at least grid-template-columns or grid-template-rows to divide up a cell: if you specify columns, it'll be divided horizontally, if rows, vertically.

75% image on the top, 25% text on the bottom

<div class='layout' style='grid-template-rows:75% 25%;'>
  <img src='airplane.gif'/>
  <div>A longer description!</div>
</div>

This slide will be laid out vertically, with the image taking up 75% of the vertical space, text 25%.

Three rows of a 25% image and 75% text

<div
  class=layout
  style='grid-template-columns: 25% 75%;grid-template-rows:repeat(3, 30%);'>
  <img src='airplane.gif'/>
  <div>Yes</div>
  <img src='airplane.gif'/>
  <div>No</div>
  <img src='airplane.gif'/>
  <div>Just right, a lot of text goes here.</div>
</div>

Customizing the aspect ratio

To keep presentations uniform across devices, Big keeps the aspect ratio of presentations constant by default: by default, presentations are 4:3 aspect ratio.

You can customize the aspect ratio by setting a BIG_ASPECT_RATIO variable before Big is included on a page:

<script>BIG_ASPECT_RATIO=2;</script>
<script src='big.js'></script>

You can also turn this feature off, by setting BIG_ASPECT_RATIO to false, which will let presentations occupy the aspect ratio of the device they're displayed on:

<script>BIG_ASPECT_RATIO=false;</script>
<script src='big.js'></script>

Avoiding line breaks

By default, Big will wrap lines of text. Sometimes you don't want this to happen, if you have some text that would look odd wrapped. In this case, you can use the nowrap class to keep some text from wrapping.

<div>
  beyond the <code>for</code> loop
  <br />
  <small class=nowrap>@tmcw / Tom MacWright</small>
</div>

Auto advancing slides

Sometimes you'll give presentations like PechaKucha and Ignite involve auto-advancing slides. You can achieve this by adding a data-time-to-next attributes to slides: this will cause them to auto-advance after a specific number of seconds:

<div data-time-to-next=20>
  My sales pitch in 20 seconds
</div>

Showing code

There are many ways to do code highlighting in presentations. My personal philosophy is that you should never show more than 8 lines of code on a slide, and instead of using traditional semantic highlighting, you should manually add emphasis to focus points in the code.

<div>
    problem one: make some animals rock
    <pre>var animals = <em>['cats', 'dogs']</em>;</pre>
</div>
pre {
  margin:0;
  padding:0.2em;
  background:#fff;
  color:#000;
  font-weight:normal;
}

pre em {
  color:#000;
  background:yellow;
}

But if you want traditional code highlighting, you can include highlight.js to do just that. You'll want to include the library, and use hljs.initHighlightingOnLoad(); like in their usage instructions.

Backgrounds & body classes

You might want to customize the class & style of the body element for a single slide. For example, maybe you want to change the background of the full page. You can do this with two attributes: data-body-style and data-body-class:

<div data-body-style="background-image:url(airplane.gif)">
  <div>Slide will have an airplane background</div>
</div>

Themes

Big presentations are hackable, so you can design yours from scratch, or by customizing one of the default themes, but there are also a few default themes so that you can get going with a solid aesthetic right off the bat.

At the very least, themes are CSS files. You can pick a theme by picking one in the themes directory. Bundled with Big are these themes:

  • dark: near-black background and near-white text, this one is my go-to for most presentations that rely on underpowered projectors.
  • light: like dark, but flipped.
  • white: instead of tastefully off-white and off-black, this theme uses stark, literal black & white colors.

big's People

Contributors

bcomnes avatar bertrandkeller avatar brauliovm avatar brooksbecton avatar calvinmetcalf avatar commadelimited avatar danielruf avatar delvedor avatar drewrwilson avatar greenkeeper[bot] avatar kathleenld avatar kgjenkins avatar kikobeats avatar lambda avatar maptastik avatar melvincarvalho avatar mikeal avatar olivierodo avatar philipodev avatar rgieseke avatar saleiva avatar sbma44 avatar seereadcode avatar stuartpb avatar tjscalzo avatar tmcw avatar tyrasd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

big's Issues

Publish to npm?

That way biggie (and other tools) can depend on the latest script?

Files empty on init

I followed the instructions in the README and ran big-presentation-init all-about-cats to initialize a new presentation. The files are all created, but are zero bytes.

I expected to see the files inside lib/ as the starter content, but that's not the case.

I'm on Node v10.0.0 and NPM v6.0.0

use KeyboardEvent.key instead of .which

I'm deciding between setting the minimum browser at IE9 or IE10 - but regardless, I should switch the current usage of .which, which is deprecated, with .key, which isn't.

Improve default styling of HTML elements

it seems the protips are pretty outdated now that v3 is out. I can update what i've noticed but it might be easier for you to go over it real fast.

otherwise working in v3 has been pretty nice.

vertically center content

@maxogden and I both used big for our talks at NodeDublin.

I'm in the back row and a slide with a long line, one line of code in a pre block, is way at the top, alone, and the projector sticks out of the ceiling and obscures the line from my view way in the back. really wish is was vertically centered.

Performance optimization

    function resize() {
        var w = window.innerWidth, h = window.innerHeight, e = s[big.current];
        e.style.fontSize = h + 'px';
        function pass(cinch, start) {
          for (var i = start; i > 0 && (e.offsetWidth > w || e.offsetHeight > h); i -= cinch) {
            e.style.fontSize = i + 'px';
          }
          return i + cinch;
        }
        pass(2, pass(5, pass(10, h - 2)));
        e.style.marginTop = (h - e.offsetHeight) / 2 + 'px';
    }

Maybe it's possible to express this in less code? Thx @ajashton for flagging the performance problem, I think this gives us a good almost-10x speedup

support a basic zip download

The node utility approach feels good, but I think it'd be useful for folks to have a click-and-go solution if they know about node servers?

Unresponsive Script at Line #21 returns for some slides

Within my presentation - http://skorasaurus.github.io/hotatnacis2013
there are a couple occasions when the slide does not load after waiting for over a minute.

I haven't found anything in common among the slides besides that they all are images.
It does not hang on all images, only on some - specifically http://skorasaurus.github.io/hotatnacis2013#3 ; http://skorasaurus.github.io/hotatnacis2013#25 ; which are at: https://github.com/skorasaurus/hotatnacis2013/blob/gh-pages/index.html#L18 and https://github.com/skorasaurus/hotatnacis2013/blob/gh-pages/index.html#L67

I'll receive an error within firefox (24, ubuntu 12.04, 64bit) that says big.js is unresponsive, at line 21.
https://github.com/tmcw/big/blob/gh-pages/big.js#L21

The problem images are not the largest images either. I had no problems loading a 1.8mb gif, but a 1.3mb jpg and 600kb png are the troublesome images.

I've also tried chromium 28.0.1500.71-0ubuntu1.12.04.1 and have same problems.
I've also checked the console in the dev tools while loading these problem slides - no information appears there.

Lastly, I've also replicated this error locally and in my gh-pages branch - http://skorasaurus.github.io/hotatnacis2013

<pre> tags don't big-ify properly

Hey there!

Huge fan of big here - I use it for all my presentations!

A big problem that I have (especially when viewing in small windows or on mobile phones) is that pre tags don't big-ify properly for large entries. This usually means that all of my code snippets get mangled into something unreadable.

For example:

screen shot 2016-10-11 at 5 38 54 pm

screen shot 2016-10-11 at 5 39 25 pm

Would be great if this was fixed, then I could share my big presentations without having to hear that they don't work from mobile users..

Use getAttribute instead of dataset object

One thing I noticed, this slide deck doesn't load properly in IE10 (build 10.0.9200.17148). Debugging big.js in IE gives this message "SCRIPT5007: Unable to get property 'timeToNext' of undefined or null reference big.js, line 7 character 32"
Would that cause this IE issue?

1.0.0

Do a branch, do a first tagged release. The tires have been thoroughly kicked.

Array of keycodes for fwd/rev

Tom, I just had an idea. On #L37 there's a conditional which checks the keycode and assigns the fwd/rev methods to them:

document.onkeydown = function(e) {
    if (e.which === 39) fwd();
    if (e.which === 37) rev();
};

What if instead of a keycode the user could register an array in their HTML file which would append to 37/39. Since Big is already setting up the listener, it could be a simple matter of allowing the user to tap into code that's already there?

Improve `p` print margin handling

I have fiddled with the print settings in Chrome but am unable to get the slides to consistently stay on one page. Consider an enhancement to improve how the print view works.

Here's an example of how various tweaks to the print settings do not produce a clean result.

2018-04-17_10-34-42

Go opposite way

Note for when I need it: start big, go small. Will fix the condition.

Issues with bluetooth remote not working

This could completely be the fault of the remote, but when I tried my Kinsington BT remote with the presentation it would not advance slides. On a slide where the image was a bit big, it would scroll, but it wouldn't ever advance to the next slide.

Display text over an image

The following code should display a the text "Hello World" over the image. Only the image is displayed.

I apologize if this is the intended behaviour, I'm not trying to disguise a feature request. I think it's the expected behaviour, however if it is in conflict with the mission statement that's fine.


---

Hello World 

![](http://farm3.staticflickr.com/2608/3801835477_b87502a888.jpg)

---

Documentation

@tmcw Would you be open to me writing up some basic instructions for junior hackers like me? Just stuff that's probably obvious to most people, but tips for building out a presentation: where/how to add images, tweaking styles in line, etc.

Presenter remote controlling

One of Big's appeals is that it's so small, and does one thing quite well. However, I did two presentations earlier this week in Big and I couldn't get either of the two remotes I had available to me to work (this also ties in with #36 ). It would be awesome if there was a lightweight way to offer support for presenter remotes without compromising Big's defining characteristics.

Reveal.js has a plugin for remotes.io which could be an option. I'm not a fan though of enforcing an internet connection just for this. But it could be an add-on option though. Here's the remotes plugin which is used by Reveal:

https://github.com/hakimel/reveal.js/blob/master/plugin/remotes/remotes.js

Image tiling not working

It seems that background-size:100% in CSS is keeping the image-tiling feature from working. Perhaps this was intentional since tiling is described as a 'feature'.

Call for colors!

I'm looking to update big's default color scheme. The current colors leave me wanting

image

image


Left to my own devices, my main options are:

  • Try to find someone who has good taste in colors / presentations and steal their choices
  • Find a nice editor color scheme and steal its choices.

The main picks here are:

  • Background color (currently black)
  • Foreground color (currently white)
  • em color (currently image)
  • a color (currently image)

Also open to question is fonts. Right now Big uses the system font stack because

  • Webfonts don't always include UTF8, causing awkward mismatches
  • Speed
  • I don't want to rely on an external service for fonts, because presentations that rely on the internet are doomed.

That said, if we can have a nice webfont default that falls back, or which we can include the fonts for, I'd totally be open for it, but also don't trust my own sense of font-choosing here, I fear @mayagao will laugh at me.

Encode url() string for () characters

@nickidlugash uncovered a neat bug - presentations with directories with ( and ) symbols yield invalid background strings. This is something that big should handle better, and I think something like using encodeURIComponent would do the tricks.

Center images

I wish there was a way to center an image on screen. I'm not using it as a background, I just wanted it centered. Any suggestions?

Images push text off screen

If I have a slide like

<div><p>Text</p><img src="image.png"/>text</div>

you'd expect to have something similar to

Text
[image]
text

Big will display the text under certain aspect ratios, but sometimes it will make the image too large and then the text will be pushed off the slide. Putting css on the image to control it's size stops this from happening but ... shouldn't this just work?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.