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 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

              
                #app
  //pre {{currDay}} / {{inst_date}} / {{currYear}} / {{currMonth}} / {{currWD}} / {{daysInMonth}} / {{FstWeekD}}
  //pre {{daysInMonth}}
  center
    h4 сегодня: {{new Date().toLocaleDateString()}} г.
    h3 выбрано: 
      b(v-if="CURR") {{fixCURR}} {{months[currMonth]}} {{currYear}} г.
    br
  #calendar
    .head
      b.ltMonth(@click="ltMonth") «
      b {{months[currMonth]}} {{currYear}}
      b.gtMonth(@click="gtMonth") »
    .week
      b(v-for="day in days") {{day}}
    .days
      span(v-for="blank in nullWeek") &nbsp;
      time(v-for="i in daysInMonth", :class="{currDay: i == currDay, CURR: i == CURR}", @click="CURR = i") {{i}}

              
            
!

CSS

              
                *
  margin 0
  padding 0
  box-sizing border-box

body
  height 100vh
  display flex
  //color #444
  font-family sans-serif
  background: url(http://www.transparenttextures.com/patterns/swirl.png), linear-gradient(225deg, #FF3CAC 0%, #784BA0 50%, #2B86C5 100%)

  

[v-cloak]
  display:none

#app
  margin auto
  height 315px  
$width = 280px
$time = $width/7

.head
.week
.days
  display flex

#calendar  
  box-shadow 0 1em 10em -2em #000
  width: $width
  text-align center
.week
  border-bottom 1px solid rgba(#CCC, .3) //CCC
  line-height 2em
  b
    font-weight normal
    color rgba(#CCC, .5) //CCC
    width $time
.days
  flex-wrap wrap
  line-height $time

span
time
  width $time
time
  cursor pointer
  &:hover
    color #FFF
    border-radius 50%
    background rgba(#FFF, .2)
.currDay
  color #FFF
  background none !important
  border-radius none !important
  
  outline 2px solid rgba(#FFF, .5)
  outline-offset -5px
.CURR
  color gold !important

.head
  background rgba(#EEE, .3)
  justify-content space-between
  //align-items center
  line-height $time
.ltMonth
.gtMonth
  cursor pointer
  padding 0 1em
  background rgba(#EEE, .3)
  &:hover
    background rgba(#EEE, .2)
    color red
              
            
!

JS

              
                const NOW = new Date();
const vm = new Vue({
  el: "#app",
  data: {
    inst_date: NOW,
    days: ['Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс'],
    months: ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'],
    CURR: null,
  },
  computed: {
    fixCURR() {
      return (this.CURR <= this.daysInMonth) ? this.CURR : this.daysInMonth;
    },
    currYear() {
      return this.inst_date.getFullYear()
    },
    currMonth() {
      return this.inst_date.getMonth()
    },
    currWD() {
      return this.inst_date.getDay()
    },
    currDay() {
      if ( this.inst_date.getMonth() == NOW.getMonth() && this.inst_date.getFullYear() == NOW.getFullYear() ) {
        return NOW.getDate()
      } return
    },
    daysInMonth() {
      return new Date(this.currYear, this.currMonth+1, 0).getDate();
    },
    nullWeek() {
      return new Date(this.currYear, this.currMonth, 0).getDay();
    }
  },
  methods: {
    ltMonth() {
      this.inst_date = new Date( this.currYear, this.currMonth-1 )
    },
    gtMonth() {
      this.inst_date = new Date( this.currYear, this.currMonth+1 )
    }
  }
});
              
            
!
999px

Console