JSFiddle - React, Tailwind, and code Playground

by adamschwartz

HTML

<div id="color-changer"><div class="inner"><div class="message">Select a color:</div></div></div>
<div class='home' id='banner'>
    <div class='wrapper'>
        <form action='/form_results' class='enhanced' id='the_form'>
            <h3>Title of Form</h3>
            <div class='item'>
                <input id='name' placeholder='Your Name' type='text' />
            </div>
            <div class='item'>
                <input id='email' placeholder='Email Address' type='text' />
            </div>
            <div class='item'>
                <input id='email' placeholder='Phone Number' type='text' />
            </div>
            <div class='item'>
                <input id='name' placeholder='Company Name' type='text' />
            </div>
            <div class='item'>
                <input id='name' placeholder='Company Website' type='text' />
            </div>
            <div class='item'>
                <textarea id='message' placeholder='What did you not like about filling out this form?'></textarea>
            </div>
            <div class='item'>
                <input class='button' type='Submit' value='Submit the Form!' />
            </div>
        </form>
        <h2>Landing Page Title Goes Here</h2>
        <h1>This is where you might write about what amazing item you are offering in exchange for filling out the form. You may write anything here!</h1>
        <!-- ol>
        <li>Teachers make digital lessons and share them with their students using Tablo.</li>
        <li>Students learn content at home by watching these lessons, instead of homework.</li>
        <li class='bold'>Valuable classtime is free for students' questions, not wasted by lectures.</li>
    </ol-->
        <div class='clear'></div>
    </div>
    <div class='clear'></div>
</div>
<div class='home' id='content'>
    <div class='wrapper'>
        <div class='columns'>
            <div class='half'>
                <h2>Longer Description Heading</h2>
               ...

CSS

html, body { margin: 0px; padding: 0px; }

#color-changer { height: 66px; width: 100%; border-bottom: 2px solid #444; background: #eee url(http://subtlepatterns.com/images/bgnoise.gif); user-select: none; -webkit-user-select: none; -khtml-user-select: none; }
#color-changer .inner { padding: 0px 24px; margin: 0 auto; width: 960px; }
#color-changer div.message { text-shadow: 1px 1px 3px RGBA(0,0,0,0.4); color: #444; padding-left: 50px; margin: 22px; float: left; font-size: 20px; }
#color-changer div.color1, #color-changer div.color2 { color: #eee; height: 20px; width: 20px; padding: 10px 10px; margin: 13px 3px 13px 23px; border-radius: 10px; cursor: pointer; float: left; box-shadow: 1px 1px 3px RGBA(0,0,0,0.4); font-size: 18px; }
#color-changer div.color2 { margin-left: 8px; background: -webkit-linear-gradient(top, #eee, #ddd) #ddd; }
body #color-changer div.selected { margin: 10px 0px 10px 20px; border: 3px solid yellow; }
body #color-changer div.selected.color2 { margin-left: 5px; box-shadow: 1px 1px 3px RGBA(0,0,0,0.4), inset 0px 2px 13px RGBA(90,90,90,0.8); }
body #color-changer div.selected.color1 { box-shadow: 1px 1px 3px RGBA(0,0,0,0.4), inset 0px 4px 15px RGBA(0,0,0,0.8); }

div, span, h1, h2, h3, h4, h5, h6, #content.about .wrapper h6 span, #content.about h1.outside h6 span, #content.contact .wrapper h6 span, #content.contact h1.outside h6 span, #content.thanks .wrapper h6 span, #content.thanks h1.outside h6 span, #content.terms .wrapper h6 span, a, ul, li, input, img, textarea {
    list-style: none;
    list-style-type: none;
    font: 400 14px "Helvetica Neue", Helvetica, Arial, sans-serif;
    text-rendering: optimizeLegibility;
    text-align: left;
    line-height: normal; }

input::-moz-focus-inner {
    border: 0;
    padding: 0; }

.clear {
    clear: both;
    height: 0 !important;
    margin: 0 !important; }

form#the_form .centered { text-align: center; }

.wrapper {
    margin: 0 auto;
    width: 960px;
    padding: 24px; }

.gradient {
   ...

JavaScript

$([
    ['#444444','#777777'], //default
    ['#660033','#993366','#8F275B'], //purple
    ['#A8160F','#DB4939','#D63624'], //red
    ['#569078','#89C3AB','#428569'], //green
    ['#1D2F46','#4F5379','#444873'], //blue
    ['#FC7D3B','#FFAF6E','#EB5D13']  //orange
])
    .each(function(i, c){
       $('#color-changer').append(
           $('<div>')
               .addClass('color1')
               .css(
                   'background',
                   '-webkit-linear-gradient(top, ' + c[1] + ', ' + c[0] + ')'
               )
               .html('Ab')
               .click(function(){
                   $('.selected', '#color-changer').removeClass('selected');
                   $(this).addClass('selected');
                   $('#banner.home').css(
                       'background',
                       '-webkit-linear-gradient(top, ' + c[1] + ', ' + c[0] + ')'
                   );
                   $('body #banner h1').css('color', '#F0F0F0');
                   $('body #banner h2').css('color', '#FFF');
                   $('body #banner h1, body #banner h2').css('text-shadow', '0 1px 0 RGBA(0,0,0,0.5)');
                   $('form.enhanced').css('background', '-webkit-linear-gradient(top, #eee, #ccc) #eee');
                   $('#banner.home .wrapper form#the_form h3').css('color', '#777');
               })
       );
       if (i > 0) {
           $('#color-changer').append(
               $('<div>')
                   .addClass('color2')
                   .css('color', c[0])
                   .html('Ab')
                   .click(function(){
                       $('.selected', '#color-changer').removeClass('selected');
                       $(this).addClass('selected');
                       $('body #banner h1, body #banner h2').css('color', c[2]);
                       $('#banner.home').css('background','-webkit-linear-gradient(top, #eee, #ddd)');
                       $('body #banner h1, body #banner h2').css('text-shadow', '0 1px 0...