rad randomizer

a RadReveal addon for Reveal.js

What does it do?

rad randomizer can add a
seeded pseudo random number generater (PRNG)
to your slides.

Why would you want to?

You can use these PRNGs in other reveal.js add-ons to attach random seeming but predictable behaviors.

That can make your slideshow seem more interesting with less work!

How is do you use it?

Just add a data-rad-randomizer attribute with a non-blank value to any slide.

Those slide's data property will have a property randomizer attached.

That will be a Rng-js object, which has a random() method that supplies a random seeming number.

What are the special values for data-rad-randomizer?

  • "TEXT" will use the slide text as a seed.
  • "HEADING" uses text from all h1 ... h6 tags as a seed.
  • "H1"..."H6" uses text from that tag.
  • "HTML" uses the slide html as a seed.
  • "RANDOM" uses a Math.random() as the seed (so it will change each reload).
  • If you supply a number, then that will be used as the seed.
  • Supply any other value, then that will be used as the seed.

So for example

Take a look at the rest of these slides in view-source and see how they are using these special values to get repeatable lists of random seeming numbers.

Using value "TEXT"

As long as the text of this slide doesn't change, the sequence of numbers won't either.

Using value "HTML"

As long as the html of this slide doesn't change, the sequence of numbers won't either.

Using value "RANDOM"

This sequence should be different every reload of the page.

Using value "RANDOM"

And also different than the last one.

Using value "99"

This sequence of numbers won't change unless we change the attribute value.

Using value "Super"

This sequence of numbers won't change unless we change the attribute value.

Still using value "Super"

And even though this slide's contents are totally different, the number sequence will be the same since we used the same value.

Using value "HEADING"

This sequence of numbers won't change unless we change the h* tag contents.

Using value "HEADING"

Since the heading is the same as previous, the number sequence should match.

Using value "H3"

This is a subtitle


The sequence here will be based on the subtitle,
which is in an H3 tag.

getRandomizerFor()

You can also get a new custom randomizer within the slide for specific purposes.

getRandomizerFor()

Now reverse order, but still the same values

That's all folks

Happy randomizing!