JSFiddle - React, Tailwind, and code Playground

by Anik Islam Abhi

HTML

<div id="storybox"></div>

JavaScript

function onStart()  {
     document.getElementById("storybox").innerHTML = "<p><em>You are Drogon Barre, aka Dragon-Bear.</em></p><p>The date is October 3rd. You are sitting quietly at your father's house when a letter arrives through the door with details of a rape and murder. The letter says that the murder was committed by a member of the infamous cult <strong>The Order of the Mouse</strong>. The writer claims the victim was her sister and that she looked on powerless as the assailant took her sister's life. She claims the perpetrator currently resides in a hotel just outside Plymouth. The letter gives a time and an address but no further details.</p><p>Do you choose to investigate?</p><button type='button' class='btn btn-success' id='yesbtn' onclick='buttonClicked(\"YesStart\")'>Yes</button><button type='button' class='btn btn-danger' id='nobtn' onclick='buttonClicked(\"NoStart\")'>No</button>";
};

function buttonClicked(buttonid)  {
  switch(buttonid) {
    case "YesStart":
        document.getElementById("storybox").innerHTML = "You take the train down to Plymouth and meet at the location specificied. Initially the woman fails to notice you and stares into the distance with the dazed look of someone who has considered the exact point at which the universe might have ended, present within a kind of altered dimensionality that places her materially at a similar point of existence to you, while leaving her utterly absent from it in some other, more absolute sense. Two nuns scurry past her, heading towards a small, fluffy dog, who they pet while making cooing sounds; a stern man in an ill-fitting police officer's uniform eyes them suspiciously. This spectacle seems to rouse her from her trance, and she looks quizzically at them, tilting her head to one side, before spotting you out of the corner her eye and waving you over.</p><button type='button' class='btn btn-success' id='continuebtn' onclick='buttonClicked(\"ContinueStart\")'>Continue</button>";
       ...