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


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.


                <div id="main-container" class="container">
    <!-- TITLE BLOCK -->
    <div class="row">
      <h1 class="center">Flickr Search</h1>
    <!-- SEARCH BLOCK -->
    <div class="row">
      <div class="one-half column offset-by-three">
        <input type="text" v-model="query" debounce="500" class="u-full-width" placeholder="Enter your search string..." />
    <!-- RESULTS BLOCK -->
    <div class="row">
      <div id="no-results" v-show="images.length < 1"><p class="center">Your results will appear here</p></div>
      <div id="loading"></div>
      <div id="search-results">
          <div class="flickr-image" v-for="image in images">
            <div class="thumbnail">
              <a :href="" target="_blank">
                <img src="" style="width: 100%;" v-img="">
            <div class="author">
              <a :href="" target="_blank">{{ }}</a>
            <div class="tags" v-if="image.tags">
              <div class="tag" v-for="tag in filters.splitTags(image.tags)">{{ tag }}</div>
    <!-- END OF PAGE -->


                /* variables */
@text-color: #222222;
@link-color: #128fdc;
@tag-color: #128fdc;

/* styles */
.author {
  line-height: 2rem;
  margin-bottom: 1.5rem;
  a {
    color: @text-color;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-decoration: none;
    font-weight: bold;
    &:hover {
      color: @link-color;

.tag {
  float: left;
  margin: 2px;
  color: @tag-color;
  border: 1px solid @tag-color;
  padding: 0.15rem 0.3rem;
  border-radius: 5px;
  &:hover {
    background-color: @tag-color;
    color: white;

#search-results {
  -moz-column-width: 13em;
  -webkit-column-width: 13em;
  column-width: 13em;
  -moz-column-gap: 1em;
  -webkit-column-gap: 1em;
  column-gap: 1em;
  .flickr-image {
    display: inline-block;
    margin:  0.25rem;
    padding:  1rem;
    width:  100%;
    background:  #efefef;

/* utilities */
.center {
  text-align: center;

*, *:before, *:after {
  box-sizing:  border-box !important;


                var callApiTimeout = null;

/* VUE.JS logic */
var vm = new Vue({
  el: '#main-container',
  data: {
    images: [],
    query: ''
  watch: {
    query: function (value) {
      callApiTimeout = setTimeout(function () {
        var reqURL = "";
        var options = {
          params: {
            format: 'json',
            tags: this.query

        this.$http.jsonp(reqURL, options);
      }.bind(this), 250);

/* JSONP callback function */
function jsonFlickrFeed(response) {
  vm.$data.images = response.items;

/* VueJs utilites */
Vue.directive('img', {
  inserted: function (el, binding) {
    lazyload(el, binding);
  update: function (el, binding) {
    lazyload(el, binding);

Vue.prototype.filters = {
  splitTags: function (value) {
    // showing only first 5 tags
    return value.split(' ').slice(0,5);

/* General utility functions */
function lazyload(el, binding) {
  var img = new Image();
  img.src = binding.value;

  img.onload = function() {
    el.src = binding.value;