dev

ReadProgressBar — скрипт, добавляющий полоску прогресса в верхнюю часть страницы. Полоска увеличивается по мере того, как пользователь прокручивает страницу вниз, и таким образом показывает прогресс чтения блога.

Как только полоска доходит до конца (а пользователь дочитывает блог), она прячется позади локального навигационного меню.

Configuration

You can customize the progress bar by using the following CSS snippet:

:root {
  --progress-bar-border-radius: (радиус скругления углов);
  --progress-bar-color: (код цвета);
  --progress-bar-height: (ширина полоски);
}

You can set the bar's height and border-radius to up to 8px. So if you want, for example, an 6px tall hotpink progress bar with slightly rounded edges, this would be the code you'd use:

:root {
  --progress-bar-border-radius: 4px;
  --progress-bar-color: hotpink;
  --progress-bar-height: 6px;
}

To show the progress bar on articles add window.enableReadProgressBarOnArticles = true to your common.js before importing the script.

Demo

Click the checkbox below to toggle the styles used above.

Installation