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="ui grid">
<div class="four wide column">
<div class="ui fluid inverted vertical menu">
<h4 class="ui teal icon header center aligned">
<i class="instagram icon"></i>
<div class="content">
Insta tags
</div>
</h4>
<div class="item">
<div class="ui fluid action input">
<input type="text" placeholder="Search..." v-model="searchString">
<button class="ui icon button" v-on:click="addTag(searchString)">
<i class="search icon"></i>
</button>
</div>
</div>
<a class="teal item"
v-bind:class="{'active': tag.active}"
v-for="tag in tags"
v-on:click="selectTag($index)">
{{tag.label}}
<i class="close icon" v-on:click="removeTag(tag)"></i>
</a>
</div>
</div>
<div class="twelve wide column">
<div id="content">
<h3 class="ui dividing header">
Search for : {{tags[activeIndex].label}}
</h3>
<p>
Currently search for {{tags[activeIndex].label}} ...
<br /><br />
instagram search is not installed yet :)
</p>
</div>
</div>
</div>
.vertical.menu{
height:100vh;
padding-top:20px;
}
#content{
padding-top:20px;
}
new Vue({
el: '#app',
data: {
searchString: '',
activeIndex: 0,
tags: [
{ label: '#cats', active: true, images: [] },
{ label: '#chickens', active: false, images: [] },
{ label: '#ducks', active: false, images: [] }
]
},
methods: {
addTag(tagLabel){
alert('search '+tagLabel)
let isActive = false
if(_.filter(this.tags, {active:true}).length==0){
isActive = true
}
this.tags.push({
label: '#'+tagLabel,
active: isActive,
images: []
})
this.searchString = ''
},
removeTag(tag){
alert('remove '+tag.label)
let isActive = tag.active
this.tags = _.without(this.tags, tag)
if(this.tags.length>0 && isActive){
this.tags[0].active=true;
}
},
selectTag(index){
this.tags.forEach(function(val, key){
val.active = false
})
this.tags[index].active = true
this.activeIndex = index
}
}
})
Also see: Tab Triggers