Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div class="vision-control">
<span class="lv-fonts">Шрифт<span class="lv-fonts-1 icon-lw">A</span><span class="lv-fonts-2 icon-lw">A</span><span class="lv-fonts-3 icon-lw">A</span></span>
<span class="lv-intervals">Интервал<span class="lv-intervals-1 icon-lw">||</span><span class="lv-intervals-2 icon-lw">|_|</span><span class="lv-intervals-3 icon-lw">|___|</span></span>
<span class="lv-colors">Цвет<span class="lv-colors-1 icon-lw">A</span><span class="lv-colors-2 icon-lw">A</span><span class="lv-colors-3 icon-lw">A</span></span>
<span class="lv-undo">Сбросить<i class="fa fa-undo" aria-hidden="true"></i></span>
</div>
<div class="some-text">
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean nisl felis, ultricies ut elementum et, ultricies ut nisi. Integer a neque augue. Curabitur ultricies, neque non mattis elementum, mi odio suscipit justo, vel pharetra erat ante nec elit. Nam vulputate arcu vitae nibh imperdiet, ut hendrerit lacus vestibulum. Praesent semper eu arcu non sagittis. Morbi ultricies a sapien vitae tincidunt. Sed condimentum vel lacus at mattis. Suspendisse potenti. In imperdiet massa dui, ut porttitor leo varius fermentum. Vestibulum scelerisque, libero vel congue sollicitudin, elit tortor auctor leo, euismod fringilla nunc odio mattis nulla. Mauris laoreet dolor nisi. Maecenas ut felis mi. Duis molestie, erat dictum interdum sodales, ipsum tellus sollicitudin est, non eleifend nisl turpis sed urna.</p>
  <p>Curabitur volutpat in justo vitae pulvinar. Nunc est felis, ultrices scelerisque maximus non, tincidunt iaculis eros. Fusce venenatis ex elit, eu malesuada diam gravida a. Fusce ultricies orci vel elit vehicula, tempor rutrum elit pretium. Quisque tellus velit, mattis at commodo non, efficitur sed nibh. Curabitur id pellentesque turpis. Phasellus quam leo, tempus gravida imperdiet et, auctor accumsan nibh. Aliquam sed sollicitudin elit. Curabitur elementum, nibh ac maximus venenatis, sapien diam tincidunt mauris, id pellentesque libero nunc id odio. Aenean ornare augue massa, quis rutrum lacus tempus ac. Proin blandit urna vel velit gravida, sed venenatis ipsum posuere. Phasellus in elementum sem. Integer consectetur vulputate mi, in suscipit est condimentum vel. Praesent vitae augue at sem tincidunt commodo ac non nisl. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin molestie turpis vitae metus pellentesque interdum.</p>
</div>
            
          
!
            
              // Настройка видимости для слабовидящих
.vision-control {
    padding: 8px;
    background: #eee;
    font-family: Open Sans;    
    color: #333;
    font-weight: bold;
    border-radius: 3px;
    .lv-fonts {
        margin-right: 32px;
        .lv-fonts-1 {
            margin-left: 8px;
            font-size: 12px;
        }
        .lv-fonts-2 {
            font-size: 16px;
        }
        .lv-fonts-3 {
            font-size: 20px;
        }
    }
    .lv-intervals {
        margin-right: 32px;
        img {
            vertical-align: baseline;
        }
        .lv-intervals-1 {
            margin-left: 8px;
        }
        .lv-intervals-2 {
            
        }
    }
    .lv-colors {
        margin-right: 32px;
        .lv-colors-1 {
            margin-left: 8px;
            background-color: #fff;
            color: #333;
        }
        .lv-colors-2 {
            background-color: #212121;
            color: #fff;
        }
        .lv-colors-3 {
            background-color: #9fd2fd;
            color: #333399;
        }
    }
    .icon-lw {
        margin-right: 6px;
        padding: 5px;
        border: 1px solid #ccc;
        border-radius: 2px;
        cursor: pointer;
    }
    .lv-undo {
        display: none;
        cursor: pointer;
        i {
            margin-left: 6px;
            font-size: 18px;
        }
    }
}

.some-text {
  font-size: 18px;
  font-family: Open Sans;
}
            
          
!
            
              $(document).ready(function(){
  // Размер шрифта
  $(".lv-fonts-1").click(function(){
      $('.some-text').css('font-size', '100%');
  });
  $(".lv-fonts-2").click(function(){
      $('.some-text').css('font-size', '130%');
  });
  $(".lv-fonts-3").click(function(){
      $('.some-text').css('font-size', '170%');
  });
  
  // Межбуквенный интервал
  $(".lv-intervals-1").click(function(){
      $('.some-text').css('letter-spacing', '0px');
  });
  $(".lv-intervals-2").click(function(){
      $('.some-text').css('letter-spacing', '2.4px');
  });
  $(".lv-intervals-3").click(function(){
      $('.some-text').css('letter-spacing', '4.8px');
  });
  
  // Цвет фона, текста
  $(".lv-colors-1").click(function(){
      $('.some-text').css('background', 'white');
      $('.some-text').css('color', '#333');
  });
  $(".lv-colors-2").click(function(){
      $('.some-text').css('background', '#212121');
      $('.some-text').css('color', 'white');
  });
  $(".lv-colors-3").click(function(){
      $('.some-text').css('background', '#9fd2fd');
      $('.some-text').css('color', '#333399');
  });
  
  // Кнопка "Сброс" 
  // Примечание: в CodePen можно сбросить сочетанием клавиш Ctrl + Shift + 5
  $('.icon-lw').click(function() {
      $('.lv-undo').css('display', 'inline');
  });
   $('.lv-undo').click(function() {
      location.reload();
  });
  
});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console