JavaScript preprocessors can help make authoring JavaScript easier and more convenient. For instance, CoffeeScript can help prevent easy-to-make mistakes and offer a cleaner syntax and Babel can bring ECMAScript 6 features to browsers that only support ECMAScript 5.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
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.
<div id="app" class="container">
<div class="container">
<div class="columns is-mobile">
<div class="pokemon column">
<pokemon-card :pokemon="pokemon"></pokemon-card>
<div class="pokemon-links">
<a @click=setPokemon('charizard') :class="{ active: pokemon === 'charizard' }">Charizard</a>
<a @click=setPokemon('blastoise') :class="{ active: pokemon === 'blastoise' }">Blastoise</a>
<a @click=setPokemon('venusaur') :class="{ active: pokemon === 'venusaur' }">Venusaur</a>
</div>
</div>
</div>
</div>
</div>
@import url('https://fonts.googleapis.com/css?family=Cinzel+Decorative:400,700|Nunito:600');
html, body {
height: 100%;
padding-top: 10px;
background: linear-gradient(to bottom right,#024,#402);
}
#app {
height: 100%;
padding-top: 0px;
font-family: Cinzel Decorative, sans-serif;
}
.container, .columns {
height: 100%;
}
.pokemon {
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.pokemon .card {
border-radius: 20px;
border: 1px solid #ffdd56;
margin-bottom: 2.5rem;
background: none;
}
.pokemon .card--charizard {
border-color: #ffdd56;
.card-image-container {
position: absolute;
width: 290px;
top: -85px;
}
.card-content .main .hp::before {
background: linear-gradient(to right, #a86e3c, #f5ae67);
}
.card-content .stats .tag {
background-color: #ffdd57;
}
}
.pokemon .card--blastoise {
border-color: #72d0fb;
.card-image-container {
position: absolute;
width: 200px;
top: -10px;
left: 40px;
}
.card-content .main .hp::before {
background: linear-gradient(to right, #c3fcff, #00a5f8);
}
.card-content .stats .tag {
background-color: azure;
}
}
.pokemon .card--venusaur {
border-color: #ff3860;
.card-image-container {
position: absolute;
width: 290px;
top: -10px;
left: -6px;
}
.card-content .main .hp::before {
background: linear-gradient(to right, #92df00, #4ea13f);
}
.card-content .stats .tag {
background-color: #ff3860;
color: #fff;
}
}
.pokemon .card .card-image {
position: relative;
display: block;
height: 185px;
}
.pokemon .card-content .main {
padding-bottom: 10px
}
.pokemon .card-content .title {
font-family: Cinzel Decorative, sans-serif;
font-size: 25px;
margin-bottom: 1rem;
letter-spacing: 4px;
}
.pokemon .card-content .stats {
font-size: 15px;
}
.pokemon .card-content .stats .tag {
font-size: 10px;
border-radius: 10px;
}
.pokemon .card-content .stats .column {
width: 75px;
}
.pokemon .card-content .stats .center-column {
min-width: 100px;
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
}
.pokemon .hp {
position: relative;
font-size: 15px;
}
.pokemon .hp::before {
position: absolute;
top: -8px;
left: 50%;
width: 50%;
height: 5px;
border-radius: 3px;
content: ' ';
transform: translateX(-50%);
}
.pokemon-links a {
letter-spacing: 1px;
color: #68c8b7;
margin: 0 20px;
}
.pokemon-links a.active {
color: #FFF;
font-weight: 600;
}
// For thumbnail preview; hack :P
@media(max-width: 758px) and (max-height: 500px) {
.pokemon .card {
margin-bottom: 1.5rem;
}
.pokemon .card-content {
padding: 1.0rem;
}
}
const pokemonData = {
"charizard": {
name: "Charizard",
imageTag: "6-Charizard.png",
hp: 78,
type: '🔥',
weight: 199,
height: 1.7
},
"blastoise": {
name: "Blastoise",
imageTag: "9-Blastoise.png",
hp: 79,
type: '💧',
weight: 223,
height: 1.6
},
"venusaur": {
name: "Venusaur",
imageTag: "8003-Mega-Venusaur.png",
hp: 80,
type: '🍃',
weight: 220,
height: 2.0
}
}
const PokemonCard = {
template: `
<div class="card has-text-weight-bold has-text-white" :class="['card--' + pokemon]">
<div class="card-image">
<div class="card-image-container">
<img :src="'http://static.pokemonpets.com/images/monsters-images-800-800/' + getPokemon.imageTag"/>
</div>
</div>
<div class="card-content has-text-centered">
<div class="main">
<div class="title has-text-white">{{ getPokemon.name }}</div>
<div class="hp">hp {{ getPokemon.hp }}</div>
</div>
<div class="stats columns is-mobile">
<div class="column has-text-centered">{{ getPokemon.type }}<br><span class="tag">Type</span></div>
<div class="column has-text-centered center-column">{{ getPokemon.weight }} lbs<br><span class="tag">Weight</span></div>
<div class="column has-text-centered">{{ getPokemon.height }} m <br><span class="tag">Height</span></div>
</div>
</div>
</div>
`,
props: ['pokemon'],
computed: {
getPokemon() {
return pokemonData[this.pokemon];
}
}
}
new Vue({
el: '#app',
data: {
pokemon: 'charizard'
},
methods: {
setPokemon(pokemon) {
this.pokemon = pokemon;
}
},
components: {
'pokemon-card': PokemonCard
}
})
Also see: Tab Triggers