JSFiddle - React, Tailwind, and code Playground
HTML
<h1>Time for some fresh ideas!</h1>
<input class="myButton" id="clickMe" type="button" value="Imagineer"/>
<h2>Object: <span id="newObject"></span></h2>
<h2>Subject: <span id="newSubject"></span></h2>
<h2>Mood: <span id="newMood"></span></h2>
<h2>Era: <span id="newEra"></span></h2>
<h3>Try to come up with an idea that mashes together the above prompts. Don't worry about it - it's just a fun idea generation game. Will your idea be the next great thing to fix the world?</h3>
CSS
span { color: red}
.myButton {
-moz-box-shadow: 3px 4px 0px 0px #8a2a21;
-webkit-box-shadow: 3px 4px 0px 0px #8a2a21;
box-shadow: 3px 4px 0px 0px #8a2a21;
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #c62d1f), color-stop(1, #f24437));
background:-moz-linear-gradient(top, #c62d1f 5%, #f24437 100%);
background:-webkit-linear-gradient(top, #c62d1f 5%, #f24437 100%);
background:-o-linear-gradient(top, #c62d1f 5%, #f24437 100%);
background:-ms-linear-gradient(top, #c62d1f 5%, #f24437 100%);
background:linear-gradient(to bottom, #c62d1f 5%, #f24437 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#c62d1f', endColorstr='#f24437',GradientType=0);
background-color:#c62d1f;
-moz-border-radius:18px;
-webkit-border-radius:18px;
border-radius:18px;
border:1px solid #d02718;
display:inline-block;
cursor:pointer;
color:#ffffff;
font-family:Arial;
font-size:28px;
padding:16px 76px;
text-decoration:none;
text-shadow:0px 1px 0px #810e05;
}
.myButton:hover {
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f24437), color-stop(1, #c62d1f));
background:-moz-linear-gradient(top, #f24437 5%, #c62d1f 100%);
background:-webkit-linear-gradient(top, #f24437 5%, #c62d1f 100%);
background:-o-linear-gradient(top, #f24437 5%, #c62d1f 100%);
background:-ms-linear-gradient(top, #f24437 5%, #c62d1f 100%);
background:linear-gradient(to bottom, #f24437 5%, #c62d1f 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f24437', endColorstr='#c62d1f',GradientType=0);
background-color:#f24437;
}
.myButton:active {
position:relative;
top:1px;
}
JavaScript
/**
* An random idea seed generator.
*/
var imagineer = function () {
//First set up all the possibilities
var ideaCatalyst = {};
ideaCatalyst.subjects = ["Genetics","Philosophy","Politics","Electronics","Linguistics","Friendship","War","Peace","Education","Efficiency","Telecommunications","Mathematics","Space/Time","Existentialism","Chemistry","Biology","Computer Science","Internet","Cooking","Fishing","Trolling","Countertrolling","Terrorism","Doublethink","Financial Engineering","Democracy","Anarchy","Imagineering","Institutions","Randomness"];
ideaCatalyst.objects = ["Statue","Book","Manifesto","Consumer Product","Bacteria","Computer","Food","Building","Icon","Avatar","Clothing","Bike","Vehicle","Financial Product","Contract","Animal","Accessory","Tool","Sticker","Poster","Plan","Institution","Webapp"];
ideaCatalyst.eras = ["Tomorrow","Next Year","Next Decade (10 Years)","Next Century (100 Years)","Next Generation","Next Gigasecond (31.558 Years)","Next Millennium (1000 Years)","After time travel is discovered"];
ideaCatalyst.moods = ["Optimistic","Pessimistic","Suspicious","Loving","Tired","Inquisitive","Quixotic","Frantic","Hysterical","Enraged","Indignant","Joyous","Excited","Horny","Hella","Courageous","Stimulated","Energetic","Radioactive","Questing","Victorious","Meta"];
//Pick only one of these possible futures
var newIdea = {};
newIdea.object = ideaCatalyst.objects[Math.floor(Math.random() * ideaCatalyst.objects.length)];
newIdea.subject = ideaCatalyst.subjects[Math.floor(Math.random() * ideaCatalyst.subjects.length)];
newIdea.mood = ideaCatalyst.moods[Math.floor(Math.random() * ideaCatalyst.moods.length)];
newIdea.era = ideaCatalyst.eras[Math.floor(Math.random() * ideaCatalyst.eras.length)];
//Know it
console.log(newIdea);
//Show it
displayNewIdea(newIdea);
//Set it free
return newIdea;
};
//Allow it to set others free
//module.exports = imagineer;
//Make it happen
//imagineer();
var el = document.getElementById("clickMe");
if...