LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code
Day {{index+1}} — {{day.date | date}}
  • {{slot.display.h}}{{slot.display.m}}{{slot.display.a}}

  • Day {{index+1}}
    Before / After Hours
    play with the time traveler
CSS
@import url("https://fonts.googleapis.com/css?family=News+Cycle");
:root {
  --font: 'News Cycle', Helvetica, sans-serif;
  --accent: #9ccf5e;
  --bg: #403638;
  --transform: translate(-50%, -50%);
}

aside {
  position: relative;
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
  -webkit-box-ordinal-group: 2;
      -ms-flex-order: 1;
          order: 1;
}

main {
  position: relative;
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
  -webkit-box-ordinal-group: 3;
      -ms-flex-order: 2;
          order: 2;
  overflow: auto;
  height: 100vh;
}
main section {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  min-height: 100vh;
}

svg.logo {
  position: absolute;
  pointer-event: none;
  font-size: 100vmax;
  width: 1em;
  height: 1em;
  top: 50%;
  left: 50%;
  will-change: transform;
  -webkit-transform: var(--transform);
          transform: var(--transform);
  -webkit-transition: -webkit-transform 12000ms ease-in-out;
  transition: -webkit-transform 12000ms ease-in-out;
  transition: transform 12000ms ease-in-out;
  transition: transform 12000ms ease-in-out, -webkit-transform 12000ms ease-in-out;
  mix-blend-mode: overlay;
}
svg.logo path {
  fill: var(--accent);
  -webkit-transition: fill 3000ms linear;
  transition: fill 3000ms linear;
}

main {
  background: rgba(0, 0, 17, 0.8);
  color: #fff;
}
main header {
  -webkit-box-flex: 0;
      -ms-flex: 0 0 auto;
          flex: 0 0 auto;
  -webkit-writing-mode: vertical-rl;
      -ms-writing-mode: tb-rl;
          writing-mode: vertical-rl;
  padding: 1em .5em;
  color: rgba(0, 0, 17, 0.4);
  background: #fff;
}
main ul {
  list-style: none;
  margin: 0;
  padding: 2rem;
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
}
main li {
  position: relative;
  -webkit-transition: font-size 300ms ease-in, opacity 300ms ease-in;
  transition: font-size 300ms ease-in, opacity 300ms ease-in;
  font-size: .5em;
  opacity: .2;
  line-height: 1.2;
}
main li.current {
  font-size: 1em;
  opacity: 1;
}
main li.current::after {
  content: '';
  position: absolute;
  top: 0;
  left: -2rem;
  -webkit-transform: translateY(-0.5rem);
          transform: translateY(-0.5rem);
  border: .5em solid;
  border-width: 1em 0 1em .625em;
  border-color: transparent;
  border-left-color: currentColor;
}
main li.current ~ li {
  opacity: .4;
}
main li.current + li {
  font-size: .675em;
  opacity: .7;
}

h1 {
  position: relative;
  top: .65em;
  left: .65em;
  margin: 0;
  line-height: 1;
  display: inline;
}

h3 {
  margin: 0;
  text-transform: uppercase;
  font-weight: 200;
  font-size: 1.325em;
}
h3 b {
  font-weight: 900;
}

.clock {
  position: absolute;
  font-size: 1em;
  top: 1em;
  right: 1em;
  -webkit-transform: translate(0, calc(-1.3em + var(--y)));
          transform: translate(0, calc(-1.3em + var(--y)));
  -webkit-transition: -webkit-transform 300ms ease-out;
  transition: -webkit-transform 300ms ease-out;
  transition: transform 300ms ease-out;
  transition: transform 300ms ease-out, -webkit-transform 300ms ease-out;
}

small {
  font-size: .75em;
  color: var(--accent);
  -webkit-transition: color 3000ms linear;
  transition: color 3000ms linear;
}
small small {
  font-size: .85em;
}

main li.after-hours {
  -webkit-animation: fade-in 1000ms ease-in 80ms forwards;
          animation: fade-in 1000ms ease-in 80ms forwards;
  position: fixed;
  font-size: 1.2em;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  line-height: 1.5;
  width: 100vw;
  height: 100vh;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  opacity: 0;
  text-align: center;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
}

main li.current ~ li.after-hours {
  display: none;
  opacity: 0;
}

@-webkit-keyframes fade-in {
  100% {
    opacity: 1;
  }
}

@keyframes fade-in {
  100% {
    opacity: 1;
  }
}
.control {
  position: absolute;
  z-index: 2;
  bottom: 0;
  right: 0;
  font-size: .5em;
  background: rgba(0, 0, 0, 0.7);
  -webkit-transform: translateY(calc(100% - 2em));
          transform: translateY(calc(100% - 2em));
  -webkit-transition: -webkit-transform 300ms ease-out;
  transition: -webkit-transform 300ms ease-out;
  transition: transform 300ms ease-out;
  transition: transform 300ms ease-out, -webkit-transform 300ms ease-out;
}
.control header {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  text-transform: uppercase;
  cursor: pointer;
}
.control header div {
  padding-left: 1em;
}
.control > div {
  padding: 1em;
}
.control p {
  margin: 0;
}
.control p + p {
  margin-top: 1em;
}
.control input[type=range] {
  padding: 0;
  border: 0;
  width: 15em;
  vertical-align: middle;
  border-radius: 1em;
  background: rgba(255, 255, 255, 0.3);
  font-size: 1rem;
  line-height: 1;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  outline: none;
  -webkit-transition: all .3s;
  transition: all .3s;
  outline-offset: 0;
  margin: 0;
}
.control input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
          appearance: none;
  width: 1em;
  height: 1em;
  border: none;
  border-radius: 1em;
  background: #E2E4E6;
  background-image: none;
  -webkit-transform: scale(2);
          transform: scale(2);
  -webkit-transition: all .3s;
  transition: all .3s;
}
.control button {
  font: inherit;
  border: none;
  color: inherit;
  width: 2em;
  height: 2em;
  font-size: 1em;
  font-weight: 100;
  background: rgba(255, 255, 255, 0.4);
  outline: none;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  line-height: 0;
  -webkit-transform: rotate(180deg);
          transform: rotate(180deg);
}
.control.show {
  -webkit-transform: translateY(0%);
          transform: translateY(0%);
}
.control.show button {
  -webkit-transform: rotate(0deg);
          transform: rotate(0deg);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-flow: row wrap;
      flex-flow: row wrap;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  overflow: hidden;
  font-family: var(--font);
  font-size: calc(1em + 1.5vmin);
  -webkit-transition: background 1500ms linear;
  transition: background 1500ms linear;
  color: #fff;
}

main header {
  height: 100%;
}

main header {
  width: 0px;
  padding: 1em 1.25em;
  line-height: 0;
}
JS
((window) => {
  let now = moment()

  // JSON DATA
  let schedule = [
    {
      date: now,
      agenda: [
        {range: ['00:30', '08:59'], display: {h:8, m:30, a: 'am'}, location: 'Underscore Coffee Bar', desc: 'Breakfast Club Donuts + Coffee'},
        {range: ['09:00', '09:29'], display: {h:9, m:'', a: 'am'}, location: 'Solaris Terminal', desc: 'Registration + Team Check-in'},
        {range: ['09:30', '09:59'], display: {h:9, m:30, a: 'am'}, location: 'Underscore Coffee Bar', desc: 'Opening Remarks + Keynote'},
        {range: ['10:00', '11:59'], display: {h:10, m:'', a: 'am'}, location: '', desc: 'Hacking Session 1'},
        {range: ['12:00', '12:29'], display: {h:'Noon', m:'', a: '-ish'}, location: 'Atomic Lunch Pad', desc: 'LUNCH: Taco Tuesday!'},
        {range: ['12:30', '17:59'], display: {h:12, m:30, a: 'pm'}, location: '', desc: 'Hacking Session 2'},
        {range: ['18:00', '21:15'], display: {h:6, m:'', a: 'pm'}, location: 'Hackers Bar & Grill 
@ Second and Main', desc: 'Welcome Reception + Dinner!'} ] // }, // { // date: moment(now).add(1, 'day'), // agenda: [ // {start: 0, end: 859, display: {h:8, m:30, a: 'am'}, location: 'Underscore Coffee Bar', desc: 'Breakfast Club Donuts + Coffee'}, // {start: 900, end: 959, display: {h:9, m:'', a: 'am'}, location: 'Solaris Terminal', desc: 'Aspirin Session Open forum to discuss headaches and pains, Q&A, tools & tricks, etc.'}, // {start: 1000, end: 1159, display: {h:10, m:'', a: 'am'}, location: '', desc: 'Hacking Session 3'}, // {start: 1200, end: 1229, display: {h:'Noon', m:'', a: '-ish'}, location: 'Break Room', desc: 'LUNCH: Taco Tuesday!'}, // {start: 1230, end: 1529, display: {h:12, m:30, a: 'pm'}, location: '', desc: 'Hacking Session 4'}, // {start: 1530, end: 1900, display: {h:3, m:30, a: 'pm'}, location: 'Underscore Coffee Bar', desc: 'Team Check-in'}, // {start: 1901, end: 1959, display: {h:7, m:'', a: 'pm'}, location: 'Hackers Bar & Grill
@ Second and Main', desc: 'Dinner!'} // ] // }, // { // date: moment(now).add(2, 'day'), // agenda: [ // {start: 0, end: 829, display: {h:8, m:30, a: 'am'}, location: 'Underscore Coffee Bar', desc: 'Breakfast Club Donuts + Coffee'}, // {start: 1000, end: 1159, display: {h:10, m:'', a: 'am'}, location: '', desc: 'Hacking Session 5'}, // {start: 1200, end: 1229, display: {h:'Noon', m:'', a: '-ish'}, location: 'Break Room', desc: 'LUNCH: Taco Tuesday!'}, // {start: 1230, end: 1529, display: {h:12, m:30, a: 'pm'}, location: '', desc: 'am Hacking Session 6'}, // {start: 1530, end: 1900, display: {h:3, m:30, a: 'pm'}, location: 'Underscore Coffee Bar', desc: 'Show & Tell Happy Hour'}, // ] } ] let timeFromNum = (num, sep, ampm) => { let hh = parseInt(num) let mm = Math.round((num-hh) * 60) sep = sep || '' return (hh>12&&m?hh-12:hh)+sep+('00'+mm).substr(-2)+(ampm?(hh>11?' pm':' am'):'') } let numFromTime = (time) => { let set = time.split(/[.:]/) let hh = parseInt(set[0]) let mm = set[1] ? parseInt(set[1]) : 0 return parseFloat((hh + mm / 60).toFixed(1)) } let app = new Vue({ el: 'aside', data: { now: numFromTime(moment(now).format('HH:mm')), time: moment().format('h:mm a'), showTimeTraveller: false } }) let sked = new Vue({ el: 'main', filters: { date: function(date) { return date.format('ddd, MMM D'); } }, data: { now: numFromTime(moment(now).format('HH:mm')), schedule: schedule }, methods: { checkTime: function(ts, te) { return (this.now >= numFromTime(ts) && this.now < numFromTime(te)) } } }) let setClockPos = () => { setTimeout(() => { let anchor = document.querySelector('.current') let t = '1em' if(anchor) { t = Math.round(anchor.getBoundingClientRect().top) + 'px' } document.documentElement.style.setProperty('--y', t) }, 350) } let timeTraveler let setTime = function() { let now = moment() app.now = sked.now = numFromTime(moment(now).format('HH:mm')) app.time = moment(now).format('h:mm a') } let runTimer = () => { setClockPos() timeTraveler = setInterval(function() { setTime() }, 30000) } runTimer() document.querySelector('#traveler').addEventListener('input', (e) => { app.time = timeFromNum(e.target.value, ':', true) sked.now = e.target.value setClockPos() clearInterval(timeTraveler) }, false) document.querySelector('.control header').addEventListener('click', (e) => { setTime() runTimer() }, false) let randum = function(min, max) { return Math.round((Math.random() * min) + (Math.random() * max)); } let randex = function() { return '#' + ( '00' + Math.floor( Math.random() * 16777216 ).toString(16) ).substr(-6) } let colorizer = () => { let hex = randex() let reverseHex = '#' + hex.replace('#', '').split("").reverse().join("") document.documentElement.style.setProperty('--bg', hex) document.documentElement.style.setProperty('--accent', reverseHex) } let transformer = () => { document.documentElement.style.setProperty('--transform', 'translate(-50%, -50%) rotate(' + randum(-360, 360) + 'deg)'); } setTimeout(() => { colorizer() }, 1000) setTimeout(() => { transformer() }, 100) let adventureTime = window.setInterval(function() { colorizer() }, 7500); let partyTime = window.setInterval(function() { transformer() }, 12000); // resize capture let resizeTimer window.addEventListener('resize', (e) => { clearTimeout(resizeTimer); resizeTimer = setTimeout(() => { setClockPos() }, 60); }, false) })(window)
Host Instantly Drag and Drop Website Builder

 

Description

Trying to learn Vue.js... This is a remix of one of my previous pens that we used at work for an internal hackathon. Converted this to Vue.js from AngularJS. Boo! Firefox doesn't like CSS writing-mode yet.
Term
Wed, 11/29/2017 - 11:20

Related Codes

Pen ID
Pen ID
Pen ID