rad randomizer can add a
seeded pseudo random number generater (PRNG)
to your slides.
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!
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.
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).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.
"TEXT"
As long as the text of this slide doesn't change, the sequence of numbers won't either.
"HTML"
As long as the html of this slide doesn't change, the sequence of numbers won't either.
"RANDOM"
This sequence should be different every reload of the page.
"RANDOM"
And also different than the last one.
"99"
This sequence of numbers won't change unless we change the attribute value.
"Super"
This sequence of numbers won't change unless we change the attribute 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.
"HEADING"
This sequence of numbers won't change unless we change the h*
tag contents.
"HEADING"
Since the heading is the same as previous, the number sequence should match.
"H3"
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
Happy randomizing!