Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div id="root"></div>
              
            
!

CSS

              
                @font-face {
  font-family: 'uglyquaitalic';
  src: url('../fonts/UglyQua-Italic-webfont.eot');
  src: url('../fonts/UglyQua-Italic-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/UglyQua-Italic-webfont.woff') format('woff'), url('../fonts/UglyQua-Italic-webfont.ttf') format('truetype'), url('../fonts/UglyQua-Italic-webfont.svg#uglyquaitalic') format('svg');
  font-weight: normal;
  font-style: normal;
}

body {
  background-color: black;
}

input:focus,
button:focus {
  outline: none;
}

.pirateMenuIntro,
#drinkSection,
#yourOrder {
  font-family: 'uglyquaitalic', serif;
  font-variant: small-caps;
  color: white;
  font-size: 1.9em;
  font-weight: 100;
}

.pirateMenuIntro {
  text-align: center;
}

.pirateMenuIntro > button {
  font-family: Papyrus, fantasy;
  font-variant: small-caps;
  padding: 0.5em 1.3em;
  font-size: 0.7em;
  border: none;
  border-radius: 69% 24% / 43% 55%;
  border-bottom: 2px solid #6E733A;
  background-color: #6F3232;
  color: #fff;
}

#drinkSection,
#foodSection,
.questionGroup,
#yourOrder {
  display: none;
}

#drinkSection {
  /*display: block;*/
  text-align: center;
  padding-top: 2em;
}

#drinkSection > * {
  /*display: block;*/
}

#drinkSection input {
  font-family: Papyrus, fantasy;
  font-variant: small-caps;
  padding: 1.5em 1.3em;
  font-size: 0.8em;
  border: none;
  border-radius: 69% 24% / 43% 55%;
  border-bottom: 2px solid #6E733A;
  background-color: #6F3232;
  color: #fff;
  transition: background-color .5s;
}

#drinkSection input:hover {
  background-color: #442525;
}

.introduction {
  margin: 0;
}

.questionGroup h2 {
  font-size: 2em;
}
              
            
!

JS

              
                class TopButton extends React.Component {
    constructor(props) {
        super(props);
        this.state = {buttonType:props.buttonType};
        this.handleStart = this.handleStart.bind(this);

    }

    handleStart() {
      return;
    }


    render() {

        return (
            <button onClick="{handleStart}" id="{this.state.buttonType}">{this.state.buttonType}</button>
        );
    }
}


class StaffMember extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            intro: props.intro,
            questions: props.questions,
            currentQuestionsIndex: 0
        }
    }

    askQuestion() {
        return this.state.questions[this.state.currentQuestionsIndex];
    }

    completeOrder(orderedItem) {

    }

}

var drinks =  {
    // drink menu code ref points (Must be string)
    // strong === "1000"
    // salty === "0100"
    // fruity  === "0010"
    // spicy === "0001"

    // therefore strong and fruity would be "1010"
    // strong + spicy === "0101"
    fixedDrinkMenu: [{
        name: "Grog Turbo",
        ingredients: ["Rum", "Ghost Peppers", "Pepperoni", "Nitrous Oxide"],
        type: "1111"
    },
    {
        name: "Kracken",
        ingredients: ["Ground Octopus Beak", "Pizza", "Sea Water", "Squid Ink"],
        type: "0111"
    },
    {
        name: "Cherry Grog",
        ingredients: ["Rum", "Red Dye #2", "Bath Scumm", "Reconstituted Cherry Extract"],
        type: "1011"
    },
    {
        name: "Grogulator",
        ingredients: ["Rum", "Kerosene", "Axle Grease", "Tonic"],
        type: '1101'
    },
    {
        name: "Near Grog",
        ingredients: ["Rum", "Red Dye #2", "Sulfuric Acid", "Hydrogenated starch hydrolysate"],
        type: "1110"

    },
    {
        name: "Grog Lite",
        ingredients: ["Rum", "Bread", "Old Battery Acid", "My Dandruff"],
        type: "0011"
    },
    {

        name: "Caffeine Free Grog",
        ingredients: ["Rum", "Palm Oil", "Acetone", "Paaaamplemoose"],
        type: "0101"
    },
    {
        name: "Diet Grog",
        ingredients: ["Rum", "Acetone", "Cactus Extract", "Diet Coke&trade;"],
        type: '0110'
    },
    {
        name: "Eau De Toilette",
        ingredients: ["Spit", "Dog Hair", "Lint", "Toilet Water"],
        type: "0000"
    }],
    drinkCode: "", // drink code is built from user options (see choice button manager at the end of the file)
    findDrink: function(code) {
        // loop through to find a drink 'type' that matches
        for (var i = 0; i < this.fixedDrinkMenu.length; i++) {
            if (this.fixedDrinkMenu[i].type === code) {
                return this.fixedDrinkMenu[i];
            }
        }
        // if there's no match send back the rubbish option at the end of the drink menu array
        return this.fixedDrinkMenu[this.fixedDrinkMenu.length - 1];
    }
}

function App() {
    return (
        <section className="pirateMenuIntro">
            <h1>Arrrrrrrrgh, What are ye looking for, land lubber?</h1>
            <TopButton buttonType={"slog"} />
            <TopButton buttonType={"grog"} />
        </section>
    );
}

ReactDOM.render(
  <App />,
  document.getElementById('root')
);
              
            
!
999px

Console