<body>
  <div id="progress"></div>
  <main>
    <h1>L'interMEDIAire</h1>
    <h2>Titre 2 - <span class="status_progressbar">0</span>% de lu</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quibusdam ipsam delectus sapiente officia temporibus quam dolorum nam iusto asperiores vitae, quia, ratione hic quod vel unde quae tempore a in.Earum sapiente cupiditate ducimus amet quo provident! Adipisci eaque ducimus incidunt tempora ipsa? Iusto, repellat aliquam reprehenderit fugit! Perspiciatis, reprehenderit quisquam excepturi!</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsum velit nam illo molestiae earum, distinctio recusandae omnis eius soluta. Saepe asperiores libero modi est eum rem aliquid dolorum laudantium magnam.</p>
    <a href="#">Plus d'infos</a>
    <hr />
    <h3>Titre 3</h3>
    <ul>
      <li>Puces</li>
      <li>Puces 1</li>
      <li>Puces 2</li>
      <li>Puces 3</li>
      <li>Puces 4</li>
    </ul>
    <img src="http://placekitten.com/g/1080/540" alt="Chat !" />
  </main>
</body>
/*COULEURS*/
$noir:        rgba(0,0,0,1);
$noirfonce:   rgba(29,31,32,1);
$noiropaque:  rgba(29,31,32,.9);
$rose:        rgba(152,38,114,1);
$bleu:        rgba(128,155,189,1);
$blanc:       rgba(255,255,255,1);
$gris:        rgba(55,55,55,1);
$gris2:       rgba(255,255,255,.8);
$gris3:       rgba(204,204,204,1);
$padding:     20px 10px;

/*PROGRESS BAR*/
#progress {
  z-index: 99;

  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;

  background-color: $rose;
}

/*TOUS LES ELEMENTS*/
*,*:after,*:before {
  box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
}

body {
  margin: 0px auto;
  width: 640px;
  background: $noir;
  color: $blanc;
  font-size: 1em;
  padding: $padding;
}

main {
  margin-top: 24px;
  padding: $padding;
  background: $noirfonce;
}

a {
  color: $bleu;
  text-decoration: none;
  transition: all .3s ease-in-out;
}

a:hover,a:active {
  color: $blanc
}

h1 {
  margin: 0;
  padding: 0;
  font-size: 1.4em;
  color: $bleu;
}

h2 {
  z-index: 100;
  position: fixed;
  top: 3px;
  left: 0px;
  
  width: 100%;
  color: $rose;
  background: black;
  text-align: center;
}

h3 {
  display: inline-block;
  margin: 10px 0px;
  color: $gris2;
  text-transform: uppercase;
}

h1,h2,h3 {
  font-family: 'Inconsolata', monospace;
}

hr {
  margin-top: 20px;
  border: 0px solid $bleu;
  border-bottom-width: 1px;
}

p {
  opacity: .85;
  color: $gris2;
  line-height: 1.6em;
}

img {
  margin-top: 20px;
  width: 100%;
  height: auto;
  -webkit-filter: grayscale(100%); /* Safari 6.0 - 9.0 */
  filter: grayscale(100%);
}
/*https://lintermediaire.be*/
View Compiled
$(function(){
  $(document).on('scroll',function(){ // Détection du scroll
    // Calcul de la hauteur "utile"
    let hauteur = $(document).height()-$(window).height()

    // Récupération de la position verticale
    let position = $(document).scrollTop()

    // Récupération de la largeur de la fenêtre
    let largeur = $(window).width()

    // Calcul de la largeur de la barre		
    let barre = position / hauteur * largeur		
    // Modification du CSS pour élargir ou réduire la barre		
    $("#progress").css("width",barre)
    var pourcent = parseInt(position*100/hauteur + 0.1);
    $(".status_progressbar").text(pourcent)
  });
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js