Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

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.

HTML

              
                <div id="app">
   <v-app>
      <v-content>
         <v-container fluid>
            <v-flex xs12 >
               <v-card fill-height>
                  <v-card-text class="text-xs-center">
                     <img class="logo" src="https://upload.wikimedia.org/wikipedia/commons/thumb/b/bb/Wikipedia_wordmark.svg/1280px-Wikipedia_wordmark.svg.png" alt="Wikipedia's logo">
                    
                        <v-select
                           :items="resultadosBusqueda"
                           v-model="resultadoSeleccionado"
                           :label="labelBusqueda"
                           item-text="title"
                           item-value="pageid"
                           return-object
						   autocomplete
						   clearable
                           :search-input.sync="busqueda"
                           >
							<template slot="no-data">
								<v-list-tile>
                                 <v-list-tile-content>
                                    <v-list-tile-title>No data available</v-list-tile-title>
                                    <v-list-tile-sub-title>I'm sorry, no data available for your search</v-list-tile-sub-title>
                                 </v-list-tile-content>
                              </v-list-tile>
							</template>
                           <template slot="item" slot-scope="data">
                              <v-list-tile>
                                 <v-list-tile-content>
                                    <v-list-tile-title>{{ data.item.title }}</v-list-tile-title>
                                    <v-list-tile-sub-title>{{ data.item.snippet }}...</v-list-tile-sub-title>
                                 </v-list-tile-content>
                              </v-list-tile>
                           </template>
                        </v-select>
                        <v-btn target="_blank" :href="rutaArticuloAleatorio" flat color="light-green">{{leyendaArticuloAleatorio}}&nbsp;&nbsp;<v-icon>cached</v-icon></v-btn>
						 <template style="text-align:justify;" v-if="resultadoSeleccionado">
							 <br>
							 <span class="headline">{{resultadoSeleccionado.title}}</span>
							 <p>{{resultadoSeleccionado.snippet}}...</p>
							 <v-btn target="_blank" :href="rutaArticulo" flat color="light-green"><v-icon>open_in_new</v-icon></v-btn>
						 </template>
						 
                  </v-card-text>
                  <v-card-actions>
                     <v-layout row wrap>
                     <v-flex xs12 sm3>
                        <v-select
                           :items="idiomas"
                           v-model="idiomaSeleccionado"
                           label="Language"
                           return-object
                           item-value="abreviacion"
                           item-text="idioma"
                           auto
                           prepend-icon="language"
                           hide-details
                           ></v-select>
                     </v-flex>
						 </v-layout>
                  </v-card-actions>
               </v-card>
            </v-flex>
         </v-container>
      </v-content>
   </v-app>
</div>
              
            
!

CSS

              
                img.logo{
	max-width: 100%;
	max-height: 120px;
}
              
            
!

JS

              
                new Vue({
    watch: {
        busqueda(termino) {
            termino && this.buscar(termino);
        },
    },
    mounted() {
        this.idiomaSeleccionado = this.idiomas[0];
    },
    computed: {
        rutaArticuloAleatorio() {
            if (!this.idiomaSeleccionado) return "";
            return `https://${this.idiomaSeleccionado.abreviacion}.wikipedia.org/wiki/Special:Random`;
        },
        rutaArticulo() {
            if (!this.idiomaSeleccionado || !this.resultadoSeleccionado) return "";
            return `https://${this.idiomaSeleccionado.abreviacion}.wikipedia.org/?curid=${this.resultadoSeleccionado.pageid}`;
        },
        leyendaArticuloAleatorio() {

            if (!this.idiomaSeleccionado) return "";
            return {
                "es": "Artículo aleatorio",
                "en": "Random article",
                "de": "Zufälliger Artikel",
                "fr": "Article aléatoire",
                "ru": "Случайная статья",
                "it": "Articolo casuale",
            }[this.idiomaSeleccionado.abreviacion];
        },
        labelBusqueda() {
            if (!this.idiomaSeleccionado) return "";
            return {
                "es": "Comienza a escribir",
                "en": "Start typing",
                "de": "Beginnen Sie zu tippen",
                "fr": "Commencez à taper",
                "ru": "Начните вводить текст",
                "it": "Inizia a digitare",
            }[this.idiomaSeleccionado.abreviacion];
        },
    },
    methods: {

        baseUrl() {
            return `https://${this.idiomaSeleccionado.abreviacion}.wikipedia.org/w/api.php?action=query&list=search&srprop=snippet&format=json&origin=*&utf8=&srsearch=`
        },
        buscar: _.debounce(function() {
            let url = `${this.baseUrl()}${encodeURIComponent(this.busqueda)}`;
            let esto = this;
            fetch(url)
                .then(function(respuesta) {
                    return respuesta.text().then(function(texto) {
                        return esto.quitarHTML(texto);
                    });
                })
                .then(function(jsonValido) {
                    let respuesta = JSON.parse(jsonValido),
						resultados = respuesta.query.search;
                    esto.resultadosBusqueda = resultados;
                });
        }, 500),
        quitarHTML(html) {
            return html.replace(/<\/?[^>]+>/gi, '');
        }
    },
    data: () => {
        return {
            idiomas: [{
                    abreviacion: "es",
                    idioma: "Español"
                },
                {
                    abreviacion: "en",
                    idioma: "English"
                }, {
                    abreviacion: "de",
                    idioma: "Deutsch"
                }, {
                    abreviacion: "fr",
                    idioma: "Français"
                }, {
                    abreviacion: "ru",
                    idioma: "русский"
                }, {
                    abreviacion: "it",
                    idioma: "italiano"
                },
            ],
            idiomaSeleccionado: null,
            resultadosBusqueda: [],
            resultadoSeleccionado: null,
            busqueda: null,
        }
    },

}).$mount("#app");
              
            
!
999px

Console