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. 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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

โš ๏ธ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

<main id="vue-context">

	<form class="price" action="javascript:void()">
		<div class="display-total">bill: ${{subTotal}}</div> <br />

		<div class="min">$5</div>
		<input type="range" v-model='subTotal' min="5" max="300" />
		<div class="max">$300</div>

	<figure class='big-face'>

	<form class="feel" action="javascript:void()">
			min="5" max="25" step="2"

	<output class='outcome' v-if='subTotal'>
		<div class="sub-total">${{subTotal}}</div>
		<div class="tip">${{tip}}</div>
		<div class="to">${{totalWithTip}}</div>


<div class="thing">

๐Ÿ™โ˜น๐Ÿ˜ฆ๐Ÿ˜ง๐Ÿ˜–๐Ÿ˜ ๐Ÿ˜ก๐Ÿ˜ž
	background: lightblue
	font-family: helvetica

	overflow: hidden
	display: block
	margin-top: 1rem
		font-weight: bold

	display: block
	margin-top: 1rem
		padding: .5rem
		font-size: 18px
		opacity: .2

	margin-top: 1rem
		display: inline-block
		vertical-align: middle
		font-size: 40px

	text-align: center
	width: 100%
		width: 70vw
		max-width: 400px
		font-size: 50px
	text-align: center
	width: 100%
		width: 70vw
	border: 1px solid gray
	padding: .5rem
	font-size: 24px
	text-align: right
	max-width: 100px
	margin: 0 auto
	margin-top: 1rem
		color: green
	font-size: 50px
	display: none
	font-size: 200px
	display: flex
	flex-direction: row
	justify-content: center
	align-items: center
	margin-top: 2rem
const options = ['๐Ÿ˜ก','๐Ÿ˜ฆ','๐Ÿ™','๐Ÿ˜','๐Ÿ˜ฌ','๐Ÿ™‚','๐Ÿ˜Š','๐Ÿ˜€','๐Ÿ˜ƒ','๐Ÿค—', '๐Ÿ˜'];
																// ๐Ÿ˜ƒ๐Ÿ˜€๐Ÿ˜„๐Ÿ™‚๐Ÿ˜Š

new Vue({
	el: '#vue-context',
	data: function() {
		return {
			excerciseNumber: 0,
			subTotal: '40',
			tipPercentage: '15',
			optionsData: options,
	computed: {
		tip() {
			let tipInDecimal = this.tipPercentage / 100;
			let rawTip = this.subTotal * tipInDecimal;
			return rawTip.toFixed(2);
		totalWithTip() {
			let tip = Number(this.tip);
			let subTotal = Number(this.subTotal);
			return (subTotal + tip).toFixed(2);
		face() {
			let x = (this.tipPercentage - 5)/2;
			return this.optionsData[x];

๐Ÿ•‘ One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.