cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <div class="rvk">
  <div class="rocks">
    <h2>Reykjavik Rocks</h2>
    <h1>Your Luxury Agent in Iceland</h1>
    <p>We deliver high end, customized luxury. Complete tailored experience for Iceland whether it is rejuvenation and relaxation, a family trip, a romantic break for a couple, an individual only or a party experience – we can cater to your every need.</p>
    <button>About us</button><button>Contact us</button>	
  </div>
  <div class="info">
    <i><span></span></i>
    <div class="about-us">
      <p>Reykjavik Rocks is the <strong>complete personalized experience</strong>.</p>
      <p>Reykjavik Rocks was founded 2009 by Unnar Helgi Danielsson who has <strong>extensive experience in managing tailored events</strong> in Iceland and London.</p>
      <p>We have worked with many groups of people from corporate and educational backgrounds to celebrity and well known public figures.</p>
      <p>We also cater for bachelor and bachelorette parties plus weddings, anniversaries, film productions, location and set finding – <strong>any event can be created by Reykjavik Rocks</strong>.</p>
      <p>Our concierge phone is also <strong>available 24/7</strong>. Please see the number on the site to call.</p>
    </div>
    <div class="contact-us">
      <p>Our concierge phone is <strong>available 24/7</strong>!</p>
      <h3>+354 691 3350</h3>
      <p>Please contact us for a <strong>fast response</strong> via email: <a href="mailto:luxury@reykjavik.rocks">luxury@reykjavik.rocks<i></i></a></p>
    </div>
  </div>
  <div class="cover"></div>
  <div class="tv">
    <div class="screen" id="tv"></div>
  </div>
</div>
            
          
!
            
              
  @import url(https://fonts.googleapis.com/css?family=Oswald);
  @import url(https://fonts.googleapis.com/css?family=Montserrat:400,700);

  .font(@family,@size,@line,@spacing) {
    font-family: @family, sans-serif;
    font-weight: 400;
    font-size: @size*1px;
    line-height: @size*@line*1px;
    letter-spacing: @spacing*1px;
  }

  html {
    width: 100%;
    height: 100%;

    body {
      width: 100%;
      height: 100%;

      margin: 0;
      padding: 0;
      overflow: hidden;

      background: #000;
      color: #ded4b9;		

      * {
        box-sizing: border-box;
      }

      .disabled {
        pointer-events: none;
      }
    }

    ::selection {
      background: #777;
      color: #777;
    }
  }

  .rvk {

    .rocks {
      position: absolute;
      top: 50%;
      left: 0;
      transform: translateY(-50%);
      -webkit-transform: translateY(-50%);
      z-index: 3;

      max-width: 1440px;
      min-width: 789px;

      margin: 0 auto;
      padding: 0 80px;

      transition: left .75s cubic-bezier(.75,0,.25,1);
      -webkit-transition: left .75s cubic-bezier(.75,0,.25,1);

      &.on {
        left: 360px;
      }

      h2 {
        width: 235px;
        height: 81px;

        margin: 0 0 12px;
        padding: 0;
        overflow: hidden;

        background: url('http://reykjavik.rocks/cnt/reykjavik-rocks.svg');
        background-size: cover;
        opacity: 0;

        text-indent: -234%;

        &.show {
          opacity: 1;
          transition: opacity 3s 0s;
          -webkit-transition: opacity 3s 0s;
        }
      }

      h1 {
        max-width: 765px;

        margin: 0 0 24px;
        padding: 0;

        opacity: 0;

        .font('Oswald',120,1.19,-5);
        text-transform: uppercase;
        text-align: left;

        &.show {
          opacity: 1;
          transition: opacity 3s 0s;
          -webkit-transition: opacity 3s 0s;
        }
      }

      p {
        max-width: 632px;

        margin: 0 0 48px 9px;

        .font(Montserrat,16,1.625,0);

        opacity: 0;

        &.show {
          opacity: 1;
          transition: opacity 3s 1.5s;
          -webkit-transition: opacity 3s 1.5s;
        }
      }

      button {
        display: inline-block;

        position: relative;

        width: auto;
        height: 77px;

        margin: 0;
        padding: 0 39px;
        overflow: hidden;

        .font(Oswald,20,1,0);
        text-transform: uppercase;

        background: none;
        color: #ded4b9;
        opacity: 0;

        border: solid 2px #ded4b9;
        outline: none;

        cursor: pointer;

        &.show {
          opacity: 1;
          transition: opacity 2s 2.5s, color .5s cubic-bezier(.75,0,.25,1);
          -webkit-transition: opacity 2s 2.5s, color .5s cubic-bezier(.75,0,.25,1);
        }

        &:before {
          content: '';

          position: absolute;
          top: 0;
          left: 0;
          z-index: -1;

          width: .01%;
          height: 100%;

          background: #ded4b9;

          transition: width .5s cubic-bezier(.75,0,.25,1);
          -webkit-transition: width .5s cubic-bezier(.75,0,.25,1);
        }

        &:hover, &.on {
          color: #000;

          &:before {
            width: 100%;
          }
        }

        &.on {
          pointer-events: none;
        }

        &:first-of-type {
          margin-left: 9px;					
        }

        &:last-of-type {
          border-left: none;
        }
      }
    }

    .info {
      position: absolute;
      top: 0;
      left: -360px;
      z-index: 3;

      width: 360px;
      height: 100%;

      background: #f7f3e8;
      color: #111;

      transition: left .75s cubic-bezier(.6,0,.25,1);
      -webkit-transition: left .75s cubic-bezier(.6,0,.25,1);

      > i {
        position: absolute;
        top: 0;
        left: 0;
        z-index: 2;

        width: 48px;
        height: 48px;

        margin: 0;
        padding: 15px;

        opacity: 0;

        cursor: pointer;

        transition: opacity .5s 1.2s;
        -webkit-transition: opacity .5s 1.2s;

        span {
          position: relative;

          display: block;

          width: 18px;
          height: 18px;

          &:before, &:after {
            content: '';

            position: absolute;
            top: 50%;
            left: 50%;

            width: 100%;
            height: 1px;

            background: #111;
          }

          &:before {
            transform: translate(-50%,-50%) rotate(45deg);
            -webkit-transform: translate(-50%,-50%) rotate(45deg);
          }

          &:after {
            transform: translate(-50%,-50%) rotate(-45deg);
            -webkit-transform: translate(-50%,-50%) rotate(-45deg);
          }
        }
      }

      > div {
        position: absolute;
        top: 150%;
        left: 0;
        transform: translateY(-50%);
        -webkit-transform: translateY(-50%);

        padding: 40px;

        transition: top .75s cubic-bezier(.75,0,.25,1);
        -webkit-transition: top .75s cubic-bezier(.75,0,.25,1);

        p {
          .font(Montserrat,14,1.625,0);
          margin: 0 0 16px;

          strong {
            font-weight: 700;
          }
        }

        h3 {
          margin: 18px 0;
          .font(Montserrat,24,1,0);
        }

        a {
          position: relative;
          color: #000;
          text-decoration: none;

          i {
            position: absolute;
            bottom: -1px;
            left: 0;

            width: 100%;
            height: 1px;

            &:before {
              content: '';
              display: block;

              position: absolute;
              bottom: 0;
              left: 0;

              width: 0.001%;
              height: 100%;

              transition: width 0s, background .5s;
              -webkit-transition: width 0s, background .5s;
            }

            &:after {
              content: '';
              display: block;

              position: absolute;
              right: 0;
              bottom: 0;

              width: 0.001%;
              height: 100%;

              background: #000;

              transition: width .5s;
              -webkit-transition: width .5s;
            }
          }

          &:hover {

            i {
              &:before {
                width: 100%;

                background: #000;

                transition: width .5s;
                -webkit-transition: width .5s;
              }

              &:after {
                width: 100%;

                background: transparent;

                transition: background 0s;
                -webkit-transition: background 0s;
              }
            }
          }
        }

        &.on {
          top: 50%;
          transition: top 1.25s cubic-bezier(.75,0,.25,1);
          -webkit-transition: top 1.25s cubic-bezier(.75,0,.25,1);
        }
      }

      &.on {
        left: 0;

        > i {
          opacity: 1;
        }
      }
    }

    .cover {
      position: absolute;
      top: 0;
      left: 0;
      z-index: 2;

      width: 100%;
      height: 100%;

      background: #000;
      opacity: 0;

      transition: opacity 4s;
      -webkit-transition: opacity 4s;

      &.on {
        opacity: .6;
      }

      &.off {
        display: none;
      }
    }

    .tv {
      position: absolute;
      top: 0;
      left: 0;
      z-index: 1;

      width: 100%;
      height: 100%;

      overflow: hidden;

      background-image: url('http://reykjavik.rocks/cnt/iceland.jpg');
      background-size: cover;
      background-position: center;

      transition: left .75s cubic-bezier(.6,0,.25,1);
      -webkit-transition: left .75s cubic-bezier(.6,0,.25,1);

      &.on {
        left: 360px;
        transition: left 2s;
        -webkit-transition: left 2s;
      }

      .screen {
        position: absolute;
        top: 0;
        left: 0;
        z-index: 1;

        margin: auto;

        opacity: 0;
        transition: opacity 4s;
        -webkit-transition: opacity 4s;

        &.on {
          opacity: 1;
        }

        &.off {
          display: none;
        }
      }
    }
  }

  @media (max-width: 920px) {

    .rvk {

      .rocks {
        padding: 0 40px;

        &.on {
          left: 288px;
        }

        h2 {
          width: 188px;
          height: 64px;
        }

        h1 {
          max-width: 620px;
          .font('Oswald',96,1.19,-4);
        }

        p {
          max-width: 490px;
          margin: 0 0 38px 7px;
          .font(Montserrat,14,1.625,0);
        }

        button {
          height: 62px;
          padding: 0 32px;
          font-size: 16px;

          &:first-child {
            margin-left: 7px;
          }
        }
      }

      .info {
        left: -288px;
        width: 288px;

        > div {

          p {
            .font(Montserrat,12,1.625,0);
            margin: 0 0 12px;
          }

          h3 {
            margin: 14px 0;
            font-size: 19px;
          }
        }
      }

      .tv.on {
        left: 288px;
      }
    }
  }

  @media (max-width: 680px) {

    .rvk {

      .rocks {
        max-width: inherit;
        min-width: inherit;

        h2 {
          width: 141px;
          height: 48px;
        }

        h1 {
          max-width: inherit;
          .font('Oswald',48,1.19,-2);
        }

        p {
          max-width: 75%;
          margin-bottom: 32px;
          .font(Montserrat,13,1.625,0);
        }

        button {
          height: 49px;
          padding: 0 25px;
          font-size: 13px;
        }
      }
    }
  }

  @media (max-width: 380px) {

    .rvk {

      .rocks {
        min-width: 320px;

        p {
          max-width: inherit;
        }
      }
    }
  }

  @media (max-width: 340px) {

    .rvk {

      .rocks {
        padding: 0 20px;
      }
    }
  }

  @media (max-width: 320px) and (max-height: 570px) {

    .rvk {

      .rocks {

        h1 {
          .font('Oswald',40,1.19,-1);
        }

        p {
          .font(Montserrat,11,1.4,0);
        }
      }

      .info {
        left: -248px;
        width: 248px;

        > div {

          p {
            .font(Montserrat,9,1.4,0);
            margin: 0 0 9px;
          }

          h3 {
            margin: 8px 0;
            font-size: 13px;
          }
        }
      }

      .tv.on {
        left: 248px;
      }
    }
  }
            
          
!
            
              
  var mobCheck = false;

  (function checkIfMobile(){
    (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))mobCheck = true})(navigator.userAgent||navigator.vendor||window.opera);
    return mobCheck;
  })();

  var tag = document.createElement('script');
    tag.src = 'https://www.youtube.com/player_api';
  var firstScriptTag = document.getElementsByTagName('script')[0];
    firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
  var tv,
    playerDefaults = {autoplay: 0, autohide: 1, modestbranding: 0, rel: 0, showinfo: 0, controls: 0, disablekb: 1, enablejsapi: 0, iv_load_policy: 3};
  var vid = {'videoId': 'E4tRyYxrU5w', 'suggestedQuality': 'hd1080', 'startSeconds': 1, 'endSeconds': 196};

  function onYouTubePlayerAPIReady(){
    tv = new YT.Player('tv', {events: {'onReady': onPlayerReady, 'onStateChange': onPlayerStateChange}, playerVars: playerDefaults});
  }

  function onPlayerReady(){
    tv
      .loadVideoById(vid)
      .seekTo(Math.floor(Math.random() * (180 - 1 + 1)))
      .mute();
  }

  function onPlayerStateChange(e){
    if (e.data === 1){
      $('#tv, .cover').addClass('on');
    } else if (e.data === 0){
      tv.seekTo(vid.startSeconds);
    }
  }

  function vidRescale(){

    var w = $(window).width() + 200,
      h = $(window).height() + 200;

    if (w/h > 16/9){
      tv.setSize(w, w/16*9);
      $('.tv .screen').css({'left': '0px'});
    } else {
      tv.setSize(h/9*16, h);
      $('.tv .screen').css({'left': -($('.tv .screen').outerWidth()-w)/2});
    }
  }

  $(document).on('ready', function(){

    if (mobCheck){
      $('.tv .screen, .cover').addClass('off');
    }

    $('button').on('click', function(e){
      e.stopPropagation();
      $('button').removeClass('on');
      $(this).toggleClass('on');
      $('.rocks, .info, .tv').addClass('on');
    });

    $('button:first-of-type').on('click', function(){
      $('.info > div').removeClass('on');
      $('.about-us').addClass('on');
    });

    $('button:last-of-type').on('click', function(){
      $('.info > div').removeClass('on');
      $('.contact-us').addClass('on');
    });

    $('.info').on('click', function(e){
      e.stopPropagation();
    });

    $('html, .info > i').on('click', function(){
      $('button, .rocks, .info, .tv, .about-us, .contact-us').removeClass('on');
    });
  });

  $(window)
    .on('load', function(){
      vidRescale();
      $('.rocks').children().addClass('show');
    })
    .on('resize', function(){
      vidRescale();
    });

  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  ga('create', 'UA-59016839-1', 'auto');
  ga('send', 'pageview');

            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console