JSFiddle - React, Tailwind, and code Playground

by JohnFish

HTML

<body>
    <div id="wrapper">
        <div id="words">
            <ul class="word-container">
                <li data-author="---  Morrie Schwartz" data-easeout="lightSpeedOut" data- authorlink="http://codecanyon.net/user/sike">The most important thing in life is to learn how to give out love, and to let it come in.</li>
                <li data-link="http://codecanyon.net/user/sike" data-linkword="1" data-author="" data-easeout="fadeOutDown">Support link now. The animation can be in random or pre-defined in the HTML. Next quote animation will be all in fadeInDown. Optional click to next quote and hover to pause the slideshow.</li>
                <li data-author="" data-link="http://codecanyon.net/user/sike/portfolio" data-linkword="all">所 有 的 瞬 间 都 会 淹 没 于 时 间 的 洪 流,就 像 泪 水 消 逝 在 雨 中。 All those moments will be lost in time, like tears in rain.</li>
                <li data-author="Mark Twain (1835 - 1910)" data-easein="fadeInDown">Always do right. This will gratify some people and astonish the rest.</li>
                <li data-author="---  Susan Rice, Stanford University Commencement, 2010" data-easeout="bounceOut">Progress is the product of human agency. Things get better because we make them better. Things go wrong when we get too comfortable, when we fail to take risks or seize opportunities.</li>
                <li data-author="---  Arlo Guthrie (1947 - )" data-easein="bounceIn">You can't have a light without a dark to stick it in.</li>
                <li data-author="---  Mahatma Gandhi (1869 - 1948)" data-easein="lightSpeedIn">You must not lose faith in humanity. Humanity is an ocean; if a few drops of the ocean are dirty, the ocean does not become dirty.</li>
                <li data-author="---  Abraham Lincoln (1809 - 1865), (attributed)">When I do good, I feel good; when I do bad, I feel bad, and that is my religion.</li>
                <li data-author="---  John Wanamaker (1838 - 1922), (attributed)">Half the money I spend on advertising is...

JavaScript

function randomizeQuotes() {
    var quote_children = $(".word-container").children();
    var children_len = quote_children.length;
    shuffle(quote_children);
    $(".word-container").empty();
    for(i=0;i<children_len;i++){
        $(".word-container").append(quote_children[i]);
    }
}
function shuffle(unshuffled_object) {
    obj_len = unshuffled_object.length;
	for (i=0; i<obj_len; i++) {
		var temp = unshuffled_object[i];
		var j = Math.floor(Math.random()*obj_len);
		unshuffled_object[i]=unshuffled_object[j];
		unshuffled_object[j]=temp;
	}
}
$(document).ready(function(){
    randomizeQuotes();
});