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

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

              
                <div id="app">
  <v-app class="tasks_app">
    <v-content>
      <v-container style="max-width: 550px">
        <div class="logo_container">
        <img src="https://static.platzi.com/static/css/logo.a76b2a87162b3b46529c30d1cb91ccc6.png">
        </div>
        
        <v-card class="pa-4 platzi__tasks_card">
        <v-text-field v-model="task" label="Agrega una tarea para navidad :D" solo @keydown.enter="create">
          <v-fade-transition slot="append">
            <v-icon v-if="task" @click="create">
              add_circle
            </v-icon>
          </v-fade-transition>
        </v-text-field>
        <h2 class="display-1 red--text pl-3">Tareas:&nbsp;
          <v-fade-transition leave-absolute>
            <span :key="`tasks-${tasks.length}`">
              {{ tasks.length }}
            </span>
          </v-fade-transition>
        </h2>
        <v-divider class="mt-3"></v-divider>
        <v-layout my-1 align-center class="white">
          <strong class="mx-3 grey--text text--darken-2">
            Restantes: {{ remainingTasks }}
          </strong>
          <v-divider vertical></v-divider>
          <strong class="mx-3 green--text text--darken-2">
            Complatedas: {{ completedTasks }}
          </strong>
          <v-spacer></v-spacer>
          <v-progress-circular :value="progress" color="green darken-2" class="mr-2"></v-progress-circular>
        </v-layout>
        <v-divider class="mb-3"></v-divider>
        <v-card v-if="tasks.length > 0">
          <v-slide-y-transition class="py-0" group tag="v-list">
            <template v-for="(task, i) in tasks">
              <v-divider v-if="i !== 0" :key="`${i}-divider`"></v-divider>
              <v-list-tile :key="`${i}-${task.text}`" class="task__list_item" :class="{'task__done': task.done}">
                <v-list-tile-action>
                  <v-checkbox v-model="task.done" color="success darken-1">
                    <div slot="label" :class="task.done && 'grey--text' || 'text--primary'" class="ml-3" v-text="task.text"></div>
                  </v-checkbox>
                </v-list-tile-action>
                <v-spacer></v-spacer>
                <v-scroll-x-transition>
                  <v-icon color="red" class="pl-5" @click="removeTask(task)">cancel</v-icon>
                </v-scroll-x-transition>
              </v-list-tile>
            </template>
          </v-slide-y-transition>
        </v-card>
      </v-container>
    </v-content>
  </v-app>
</div>
              
            
!

CSS

              
                .logo_container{
  text-align: center;
  margin-bottom: 10px;
}

.logo_container img{
  max-width: 30%;
}

.platzi__tasks_card{
  background-image: url(//i.imgur.com/OfktMjtg.png);
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.task__list_item{
  position: relative;
}

.task__list_item::after{
  content: " ";
  background-image: url(//i.imgur.com/tFi3w5I.png);
  background-size: cover;
  width: 25px;
  height: 25px;
  position: absolute;
  top: 13px;
  right: 50px;
}

.task__done{
  position: relative;  
}

.task__done::after{
  background-image: url(//i.imgur.com/IN7ptPPg.jpg);
}

.theme--light.application{
    background: -webkit-linear-gradient(0deg, #1c3643 0, #273b47 25%, #1e5372);
    background: -moz-linear-gradient(0deg, #1c3643 0, #273b47 25%, #1e5372);
    background: -o-linear-gradient(0deg, #1c3643 0, #273b47 25%, #1e5372);
    background: -ms-linear-gradient(0deg, #1c3643 0, #273b47 25%, #1e5372);
    background: linear-gradient(90deg, #1c3643 0, #273b47 25%, #1e5372);
}
              
            
!

JS

              
                var STORAGE_KEY = 'tasks'
var taskStorage = {
  fetch: function () {
    var tasks = JSON.parse(localStorage.getItem(STORAGE_KEY) || '[{"text":"Adornar el arbol de navidad","done":true},{"text":"Comprar Cerveza","done":false},{"done":false,"text":"Aprender React Native en Platzi"}]')
    return tasks
  },
  save: function (tasks) {
    localStorage.setItem(STORAGE_KEY, JSON.stringify(tasks))
  }
}

new Vue({ 
  el: '#app',
  data: () => ({
    tasks: taskStorage.fetch(),
    task: null
  }),
  computed: {
    completedTasks () {
      return this.tasks.filter(task => task.done).length
    },
    progress () {
      return this.completedTasks / this.tasks.length * 100
    },
    remainingTasks () {
      return this.tasks.length - this.completedTasks
    }
  },
  methods: {
    create () {
      this.tasks.push({
        done: false,
        text: this.task
      })
      this.task = null
    },
    removeTask(task) {
      this.tasks.splice(this.tasks.indexOf(task), 1)
    }
  },
  watch: {
    tasks: {
      handler: function (tasks) {
        taskStorage.save(tasks)
      },
      deep: true
    }
  }
})
              
            
!
999px

Console