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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

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

CSS

              
                // Настройка видимости для слабовидящих
.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;
}
              
            
!

JS

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

Console