Pen Settings



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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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 lang="en">

 <meta charset="UTF-8">
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
 <meta http-equiv="X-UA-Compatible" content="ie=edge">
 <title>Vue.js 101 - Exercise #2: Harry Potter World (Final)</title>

 <div id="diagon-alley" class="diagon-alley">
  <div class="parchment">
   <h1>{{ name }}</h1>
   <p>{{ house }}</p>
   <p>{{ wand }}</p>
   <ul class="wallet">
    <li v-for="(amount, name) in wallet" :class="name">
     {{ name }}: {{ amount }}
   <div class="parchment__cta">
    <button @click="visitGringotts">Visit Gringotts</button>
    <button @click="visitDiagonAlley">Visit Diagon Alley</button>
    <button @click="drinkButterbeer" :disabled="wallet.sickles < 5">Drink Butterbeer</button>
    <button @click="eatAtTheLeakyCauldron" :disabled="wallet.knuts < 25">Eat at The Leaky Cauldron</button>
  <div v-if="atGringotts" id="gringotts" class="gringotts" />

 <script src=""></script>



                body {
	font-family: 'Berkshire Swash', cursive;

.diagon-alley {
	width: 100%;
	height: 100vh;
	background-image: url('');
	background-size: cover;
	position: relative;
	transition: all 0.2s;

.gringotts {
	background-image: url('');
	width: 100%;
	height: 100vh;
	background-size: cover;
	position: absolute;

.parchment {
	width: 600px;
	background-image: url('');
	background-repeat: no-repeat;
	position: absolute;
	top: 30px;
	left: calc(50% - 300px);
	color: hsl(140, 52%, 30%);
	border: 3px solid hsl(38, 39%, 54%);
	padding: 30px;
    z-index: 1;
	&__cta {
		display: flex;
		justify-content: space-around;
		align-items: center;
		margin-top: 2rem;
	h1 {
		margin-top: 0;
	ul {
		margin: 0;
	li {
		font-size: 1.2rem;
		line-height: 1.5;
	p { color: #222 }
	button {
		font-family: 'Berkshire Swash', cursive;
		padding: 12px 20px 10px;
		line-height: 1;

.wallet {
	background-color: #222;
	padding-top: 10px;
    padding-bottom: 10px;
    .Galleons { color: gold; }
    .Sickles { color: silver; }
    .Knuts { color: #CD7F32; }


                const adventure = new Vue({
    el: '#diagon-alley',
    data: {
		name: 'Mr. B. Hong',
		house: 'Ravenclaw',
		wand: '12.5" larch wood w/ Dragon heartstring core',
		wallet: {
			Galleons: 12,
			Sickles: 38,
			Knuts: 274
		atGringotts: false
    methods: {
        visitGringotts() { 
			this.atGringotts = true
			this.wallet.Sickles = 50
			this.wallet.Knuts = 100
		visitDiagonAlley() {
			this.atGringotts = false
        drinkButterbeer() { 
			this.wallet.Sickles -= 5
        eatAtTheLeakyCauldron() { 
			this.wallet.Knuts -= 25