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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <head>
  <link href='https://fonts.googleapis.com/css?family=IM Fell English' rel='stylesheet'>
 <style>
  </style>
</head>
<h1 id="results">Input your character type:</h1>
<p>Elf, Dwarf, Ranger, or Wizard</p>
<input name="caerecter" id="tip" type="text">
<br>
<button id="button1" type="button">Submit</button>
<h2 id="res"></h2>


              
            
!

CSS

              
                body {
  font-family: 'IM Fell English';font-size: 22px;
  background: #0e390e;
  text-align: center;
}
input {
  font-size: 1.2em;
  background: tan;
  border-color: gray;
  font-family: 'IM Fell English';
  padding: 3px;
  text-align: center;
}

p {
  font-size: 1.1em;
  color: gold;
  
}

h1 {
  color: white;
}

#button1 {
  width: 200px;
  height: 34px;
  margin: 20px;
  border-radius: 17px;
  font-family: 'IM Fell English';
  font-size: 1em;
  color: white;
  background-color: gray;
}

h2 {
  font-size: 1.1em;
  width: 650px;
  text-align: center;
  margin: auto;
  color: red;
}

              
            
!

JS

              
                document.getElementById("button1").onclick= lotr;

function lotr() {
  var char = document.getElementById("tip").value;
  var gatekeep;
  var password = prompt("Speak friend, and enter.", "Type the Elvish word for friend.");
  if (password === "Mellon" || password === "mellon" || password === "MELLON") {
    gatekeep = "Welcome to the Fellowship, friend."
  } else {
    gatekeep = "You are no friend, death awaits you here."
  }
  document.getElementById("results").innerHTML = gatekeep;
  
switch (char) {
  case "Elf":
  case "elf":
  case "ELF":
    show = "You have my bow. And some cool fighting knives. Also boyish good looks that your wife digs, this will kind of make you mad.";
    break;
  case "Dwarf":
  case "dwarf":
  case "DWARF":
    show = "I have an axe. And like two or three little axes. I throw them sometimes. I can't run very fast. Or far. Also very hairy.";
    break;
  case "Ranger":
  case "ranger":
  case "RANGER":
    show = "You have my sword. And my greasy hair. There were rumors about me being gay, but they're not true.";
    break;
  case "Wizard":
  case "wizard":
  case "WIZARD":
    show = "You have my staff. I don't use it that often, but when I do it's super cool and pretty effective. It will make you wonder why I dont use it more often. And you'll think, \"Like, is magic hard or something?\"";
    break;
  case "":
    show = "Type your character choice in the box.";
    break;
  default:
    show = "Nice spelling error. You're probably an orc lover. Or maybe you're into Goblins. Either way, you're not welcome here, servant of the dark lord."
}

document.getElementById("res").innerHTML = show;
}
    
              
            
!
999px

Console