Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <link href="https://fonts.googleapis.com/css?family=Noto+Sans" rel="stylesheet">

<div id="app">
	<h1>Vue To-Do List</h1>
	<form @submit.prevent="addTodo">
		<input type="text" v-model="newTodo" placeholder="What to do next?"/>
		<button type="submit" id="btn_add">ADD</button>
	</form>
	<div v-if="list.length > 0">
		<draggable v-model="list">
			<transition-group name="slide" mode="out-in">
				<div v-for="(item,idx) in list" class="list" :class="{done: item.done}" :key="item">
					<label style="cursor:pointer">
						<input type="checkbox" v-model="item.done"/>
						{{item.name}}
					</label>
					<button type="button" class="btn_del" @click="{list.splice(idx, 1)}">&times;</button>
				</div>
			</transition-group>
		</draggable>
	</div>
	<div v-else>
		<h2 style="color:white; text-align:center">☕ Nothing ☕</h2>
	</div>
</div>

              
            
!

CSS

              
                @import url(//fonts.googleapis.com/earlyaccess/notosanstc.css);
body {
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans",
    "Droid Sans", "Helvetica Neue", sans-serif;
	display: flex;
	justify-content: center;

	background: url("https://images.unsplash.com/photo-1432821596592-e2c18b78144f?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2250&q=80") no-repeat center center fixed;
	background-size: cover;
	width: 100%;
	height: auto;
}

#app {
	padding: 20px 40px;
}
h1 {
	color: white;
	text-align: center;
	font-weight: 300;
}

input[type='checkbox']{
	appearance: none;
	display: none;
}

input[type="text"] {
	outline: none !important;
	padding: 10px 15px;
	margin: 5px 0;
	border: 0;
	font-size: 1.2em;
	border-radius: 0.4rem;
}
input[type="text"]:focus {
	box-shadow: inset 0px 0px 0px 2px #41baac;
}
#btn_add {
	cursor: pointer;
	outline: none !important;
	padding: 10px 15px;
	margin: 0 10px;
	background: #41baac;
	border-radius: 6px;
	border: none;
	font-size: 1.2em;
	color: white;
	box-shadow: 1px 1px 4px rgba(0,0,0,0.2);
	transition: all ease 0.3s;
}
#btn_add:hover {
	filter: brightness(1.05);
}

.btn_del {
	cursor: pointer;
	outline: none !important;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	font-size: 1.5em;
	color: #41baac;
	background: transparent;
	transition: all 0.3s linear;
}
.btn_del:hover{
	background: rgba(0,0,0,0.08);
}

draggable {
	list-style-type: none;
	margin: 60px 0;
	padding: 0;
}
.list {
	position: relative;
	list-style-type: none;
	font-size: 1.2em;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 15px;
	margin: 10px;
	border-radius: 8px;
	box-shadow: 5px 5px 12px rgba(0, 0, 0, 0.24);
	background-color: #f1f1f1;
	transition: all 0.2s;
}
.list:hover {
	transform: scale(1.02);
	box-shadow: 8px 8px 16px rgba(0, 0, 0, 0.24);
}
.done {
	filter: brightness(0.85);
	transition: all 0.3s;
}
.done > label {
	text-decoration: line-through;
}

/*Vue transition hook*/
.slide-enter,
.slide-leave-to {
	opacity: 0;
}
.slide-enter-active {
	animation: slide-in 0.3s ease-out;
	transition: all 0.3s ease-out;
}
.slide-leave-active {
	animation: slide-out 0.3s ease-out forwards;
	transition: all 0.3s ease-out;
	position: absolute;
}
.slide-move {
	transition: transform 0.3s ease-out;
}

@keyframes slide-in {
	from {
		transform: translateX(30px);
	}
	to {
		transform: translateX(0);
	}
}

@keyframes slide-out {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(30px);
	}
}

              
            
!

JS

              
                new Vue({
	el: '#app',
	data:{
		newTodo: '',
		list:[{
				name:'Learn Vue',
				done: false
		},{
				name:'Build an app',
				done: false
		}],
	},
	methods:{
		addTodo: function(){
			if( this.newTodo ){
				this.list.push({
					name: this.newTodo,
					done: false
				});
				this.newTodo = '';
			}
		},
	},
});
              
            
!
999px

Console