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.

            
              %header.container-fluid
  %h1.brand
    hearth hotels
    %span> bring home with you
  %nav
    %ul
      %li
        %a{:href => '#'} sign out
%main.container-fluid
  %ul.options
    %li#lighting.col-xs-6.col-sm-2.option.active
      %span.glyphicon.glyphicon-lamp.smaller
      lighting
    %li#temperature.col-xs-6.col-sm-2.option
      %span.wi.wi-thermometer
      temperature
    %li#bedding.col-xs-6.col-sm-2.option
      %span.glyphicon.glyphicon-bed.smaller
      bedding
    %li#amenities.col-xs-6.col-sm-2.option
      %span.glyphicon.glyphicon-gift.smaller
      amenities
    %li#tv.col-xs-6.col-sm-2.option
      %span.glyphicon.glyphicon-film.smaller
      tv
    %li#music.col-xs-6.col-sm-2.option
      %span.glyphicon.glyphicon-music.smaller
      music
  .option-display.col-xs-12
    .lighting.option-details.col-xs-12.col-sm-offset-2.col-sm-8.hidden
      .option-details_setting.col-xs-12
        .labels.col-xs-6
          %h4.bold
            privacy curtains
        .inputs.col-xs-6
          %input#privacy-curtains.toggle{type: "checkbox", :checked => 'true', name: "privacy-curtains"}/
          %label.toggle-button{:for => "privacy-curtains"}
      .option-details_setting.col-xs-12
        .labels.col-xs-6
          %h4.bold
            darkening curtains
        .inputs.col-xs-6
          %input#darkening-curtains.toggle{type: "checkbox", checked: 'true', name: "darkening-curtains"}/
          %label.toggle-button{:for => "darkening-curtains"}
      .option-details_setting.col-xs-12
        .labels.col-xs-6
          %label{:for => "overhead"}> overhead light
        .inputs.col-xs-6
          %input#overhead{type: "range", name: "overhead"}/
          %span.wi.wi-day-sunny
      .option-details_setting.col-xs-12
        .labels.col-xs-6
          %label{:for => "ambient-light"}> ambient light
        .inputs.col-xs-6
          %input#overhead{type: "range", name: "ambient-light"}/
          %span.wi.wi-day-sunny
      .option-details_setting.col-xs-12
        .labels.col-xs-6
          %label{:for => "overhead-hue"}> overhead hue
        .inputs.col-xs-6
          %input#overhead{type: "range", name: "overhead-hue"}/
      .option-details_setting.col-xs-12
        .labels.col-xs-6
          %label{:for => "ambient-hue"}> ambient hue
        .inputs.col-xs-6
          %input#overhead{type: "range", name: "ambient-hue"}/
    .temperature.option-details.col-xs-12.col-sm-8.hidden
      .option-details_setting.col-xs-12
        .labels.col-xs-6
          %label{:for => "day-temp"}> daytime
        .inputs.col-xs-6
          %input#day-temp{type: "range", name: 'day-temp'}/
          %span.wi.wi-fahrenheit
      .option-details_setting.col-xs-12
        .labels.col-xs-6
          %label{:for => "night-temp"}> nighttime
        .inputs.col-xs-6
          %input#night-temp{type: "range", name: 'night-temp'}/
          %span.wi.wi-fahrenheit
    .bedding.option-details.col-xs-12.col-sm-8.hidden
      .option-details_setting.col-xs-12
        .labels.col-xs-6
          %h4.bold> bed size
        .inputs.col-xs-6
          .btn-group
            %button.btn.btn-default.btn-sm> King
            %button.btn.btn-default.btn-sm> Queen
            %button.btn.btn-default.btn-sm> Doubles
      .option-details_setting.col-xs-12
        .labels.col-xs-6
          %h4.bold> pillows
        .inputs.col-xs-6
          .btn-group
            %button.btn.btn-default.btn-sm> Feather
            %button.btn.btn-default.btn-sm> Feather+Foam
            %button.btn.btn-default.btn-sm> Foam
      .option-details_setting.col-xs-12
        .labels.col-xs-6
          %h4.bold> extra pillow
        .inputs.col-xs-6
          %input#extra-pillow.toggle{type: "checkbox", name: "extra-pillow"}/
          %label.toggle-button{:for => "extra-pillow"}
    .amenities.option-details.col-xs-12.col-sm-8.hidden
      %h2> amenities
    .tv.option-details.col-xs-12.col-sm-8.hidden
      %p> Integrate with streaming services
      %p> Preferred channels
      %p> Preferred volume
      %p> Power off timer
    .music.option-details.col-xs-12.col-sm-8.hidden
      %p> Integrate with streaming services
      %p> Preferred Volume
            
          
!
            
              /* *********************************  */
/* Typography styles   */
/* *********************************  */
/* Oxygen Font */
@import url(https://fonts.googleapis.com/css?family=Oxygen:400,300,700);
/* Additional Icon Font */
@import url("https://cdnjs.cloudflare.com/ajax/libs/weather-icons/1.3.2/css/weather-icons.min.css");
/* Variables */
$spacing: 14px;
$blue: #3d79f2;
$teal: #168876;
$green: #30bf78;
$yellow: #f4d400;
$light-yellow: #fff280;
$tangerine: #e5ac00;
$orange: #e57339;
$red: #f23d3d;
$pink: #e5398f;
$purple: #973df2;
$light-gray: #a0a0a0;
$gray: #414141;
$near-black: #1a1a1a;
/* Typography Styles */
body {
  color: $near-black;
  font-family: 'Oxygen', sans-serif;
  font-size: $spacing;
  font-weight: 300;
  line-height: $spacing*1.5;
}
p {
  margin-bottom: $spacing;
}
h1, h2, h3, h4, h5, h6 {
  margin-bottom: $spacing/2;
  font-weight: 400;
  line-height: 1em;
}
h1, h2 {
  font-size: $spacing*1.75;
  margin-bottom: $spacing*2;
}
h3 {
  font-size: $spacing*1.15;
}
h4, h5, h6 {
  font-size: $spacing;
}
.bold {
  font-weight: 700;
}
.light {
  font-weight: 300;
}
.hidden {
  display: none;
}
a {
  color: $orange;
  transition: color 0.25s ease-out;
}
a:visited {
  color: $tangerine;
}
a:hover {
  color: $yellow;
}
/* ******************** */
/* App styles        */
/* ******************** */
html {
  box-sizing: border-box;
}
*,*:before,*:after {
  box-sizing: border-box;
}
header {
  background: rgba(250,250,250,0.3);
  box-shadow: 0px 20px 20px 0px rgba(0,0,0,0.1);
  display: block;
  position: absolute;
  top: 0;
  z-index: 10;
  width: 100%;
  h1 {
    float: left;
    text-shadow: 0px 0px #000;
    span {
      font-size: 0.5em;
      margin-left: 0.5em;
      color: $teal;
    }
  }
}
nav {
  float: right;
  margin: 1.75em 0 0;
  ul {
    list-style-type: none;
  }
}
main {
  background: #C5B9B9 url('https://i.imgur.com/V10Tq6v.jpg')  no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
}
/* Options List */
.options {
  list-style-type: none;
  padding: 0;
  margin: 0;
  margin-top: 8em;
  width: 100%;
  .option {
    display: block;
    background: rgba(250,250,250,0.3);
    text-align: center;
    height: 16vw;
    line-height: 23vw;
    transition: background 0.15s ease-out;
    span {
      display: block;
      position: absolute;
      top: 40%; left: 50%;
      transform: translate(-50%,-50%)
    }
  }
}
/* Icons */
.option .wi:before,
.option .glyphicon:before {
  font-size: 4em;
  color: $near-black;
  transition: color 0.15s ease-out;
}
.option .smaller:before {
  font-size: 3em;
}
.option:hover, .option.active {
  background: rgba(250,250,250,0.5);
}
.option:hover .wi:before,
.option:hover .glyphicon:before {
  color: $teal;
}
/* Settings display */
.option-display {
  background: rgba(250,250,250,0.5);
  padding: 3em 1em;
  overflow: auto;
  h4, .toggle-button {
    display: inline-block;
  }
  h4 {
    margin-top: -2em;
  }
}
.option-details {
  [type="range"] {
    display: inline-block;
    width: 90%;
  }
  .labels {
    text-align: right;
  }
  .inputs {
    text-align: left;
  }
}
.option-details_setting {
  margin-bottom: 1em;
}

/* ************************** */
/* Mobile-First Media Queries */
/* ************************** */
@media (min-width: 650px) {
  .option .wi:before,
  .option .glyphicon:before {
    font-size: 5em;
    color: $near-black;
    transition: color 0.15s ease-out;
  }
  .option .smaller:before {
    font-size: 4em;
  }
  .options li {
    height: 16vw;
    line-height: 24vw;
  }
}

/* ****************************** */
/* Toggle styles adapted from     */
/* codepen.io/mallendeo/pen/eLIiG */
/* ****************************** */
.toggle {
	display: none;
}
.toggle + .toggle-button {
  outline: 0;
  user-select: none;
  cursor: pointer;
  width: 4em;
  height: 2em;
  position: relative;
  background: #fbfbfb;
  border-radius: 2em;
  padding: 2px;
  -webkit-transition: all .4s ease;
          transition: all .4s ease;
  border: 1px solid #e8eae9;
}
.toggle + .toggle-button:after, 
.toggle + .toggle-button:before {
  position: relative;
  display: block;
  content: "";
  width: 50%;
  height: 100%;
}
.toggle + .toggle-button:after {
  left: 0;
  border-radius: 2em;
  background: #fbfbfb;
  -webkit-transition: left 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), padding 0.3s ease, margin 0.3s ease;
          transition: left 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), padding 0.3s ease, margin 0.3s ease;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 4px 0 rgba(0, 0, 0, 0.08);
}
.toggle + .toggle-button:before {
  display: none;
}
.toggle:checked + .toggle-button:after {
  left: 50%;
}
.toggle + .toggle-button:active {
  box-shadow: inset 0 0 0 2em #e8eae9;
}
.toggle + .toggle-button:active:after {
  padding-right: .8em;
}
.toggle:checked + .toggle-button {
  background: $teal;
}
.toggle:checked + .toggle-button:active {
  box-shadow: none;
}
.toggle:checked + .toggle-button:active:after {
  margin-left: -.8em;
}

            
          
!
            
              AllOptions = $('.option');
AllDetails = $('.option-details');

function displayDetails(option) {
  $(AllDetails).each(function(i,el) {
    $(el).addClass('hidden').removeClass('active');
  });
  $('.option-display').find('.'+option).removeClass('hidden').addClass('active');
}

$(AllOptions).each(function(i,el) {
  $(el).click(function() {
    $(AllOptions).each(function(i,option) {
      $(option).removeClass('active');
    });
    $(el).addClass('active');
    displayDetails($(el).attr('id'));
  })
});

displayDetails('lighting');
            
          
!
999px
Loading ..................

Console