Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

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="alignfull wrap_about__me">
  <section class="about__me alignfull" id="presentazione">
    <header class="about__me__cover">
      <img src="https://source.unsplash.com/36hcN-jZqNQ/1000x2000" class="about__me__image">
      <div class="about__me__header">
        <span class="about__me__eyebrow">Chapter one</span>
        <h1 class="about__me__title">Chi sono</h1>
        <p class="about__me__subtitle">User Experience Evangelist e Web Designer</p>
      </div>
    </header>
    <div class="about__me__body">
      <nav class="about__me__navigation">
        <a href="#take-in-the-view" class="about__me__navlink about__me__navlink--current">
          <span class="about__me__chapter">Current chapter</span>
          <span class="about__me__navtitle">Take in the view</span>
        </a>
        <a href="#introduction" class="about__me__navlink about__me__navlink--previous">
          <span class="about__me__chapter">Introduction</span>
          <span class="about__me__navtitle">A lighthearted warning</span>
        </a>
        <a href="#escalate-and-escape" class="about__me__navlink about__me__navlink--next">
          <span class="about__me__chapter">Chapter two</span>
          <span class="about__me__navtitle">Escalate &amp; Escape</span>
        </a>
        <progress class='progresso_1'></progress>
      </nav>
      <div class="about__me__content cont1">
        <div class="about__me__lead txt1">
          <p>Nato Brasiliano, cresciuto Italiano. Ottimismo e curiosità come mantra di vita.</p>
        </div>

        <picture class="about__me__media">
          <source srcSet="https://avif.io/images/butterfly.avif" type="image/avif" />
          <source srcSet="https://avif.io/images/butterfly.png" type="image/png" />
          <img width="1280" height="720" decoding="async" loading="lazy" src="https://avif.io/images/butterfly.png" alt="an avif image" />
        </picture>

        <p>Un ragioniere mancato, che ha sempre avuto la passione per l'informatica.</p>
        <p>Già alle scuole media esisteva il corso di Trattamento Testi, dove tra una partita a Pinball, Solitario e i corsi di Powerpoint, Word ed Excel, capii che l'informatica sarebbe stata la mia passione.</p>

        <p>Non mi sono laureato, ma sono entrato all'Università invitato direttamente come docente. Ai tempi non esistevano corsi universitari indirizzati verso ciò in cui mi sono specializzato ed insegno quotidianamente.</p>

        <!--
 <img class="about__me__media" src="https://source.unsplash.com/St08jKkPVHw/800x500">
 -->

        <div class="about__me__media__before__after">
          <div class="comparisonImage beforeImage">
            <img src="https://assets.codepen.io/16327/before.jpg" alt="before">
          </div>
          <div class="comparisonImage afterImage">
            <img src="https://assets.codepen.io/16327/after.jpg" alt="after">
          </div>
        </div>

        <p>Lavoro come UI e UX designer a <span class="txt_rotator">Milano</span> e collaboro come docente nel corso di alta formazione in Web Design, Marketing Digitale e User Experience Design con Università Cattolica e Rizzoli Academy.</p>

        <p>È sempre più importante avere un approccio user centric, per riuscire a gestire un progetto di User Experience affiancando un team di sviluppatori e analisti. Nei miei corsi, e nella relazione con i clienti, cerco sempre di impostare una metodologia chiara ed efficace per poter piantare il seme migliore e cogliere i frutti più dolci.</p>
      </div>
    </div>
  </section>

  <section class="about__me alignfull" id="esperienza">
    <header class="about__me__cover">
      <img src="https://source.unsplash.com/2ozmgnoEQVo/1000x2000" class="about__me__image">
      <div class="about__me__header">
        <span class="about__me__eyebrow">Chapter two</span>
        <h1 class="about__me__title">Cosa faccio</h1>
        <p class="about__me__subtitle">Studio, analizzo, sperimento e metto in pratica.</p>
      </div>
    </header>
    <div class="about__me__body">
      <nav class="about__me__navigation">
        <a href="#escalate-and-escape" class="about__me__navlink about__me__navlink--current">
          <span class="about__me__chapter">Current chapter</span>
          <span class="about__me__navtitle">Escalate &amp; Escape</span>
        </a>
        <a href="#take-in-the-view" class="about__me__navlink about__me__navlink--previous">
          <span class="about__me__chapter">Chapter one</span>
          <span class="about__me__navtitle">Take in the view</span>
        </a>
        <a href="#nosedive" class="about__me__navlink about__me__navlink--next">
          <span class="about__me__chapter">Chapter three</span>
          <span class="about__me__navtitle">Nosedive</span>
        </a>
        <progress class='progresso_2'></progress>
      </nav>
      <div class="about__me__content">
        <div class="about__me__lead">
          <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quisquam ad praesentium voluptatibus deleniti dicta debitis quas autem? Nihil sint molestias, facere libero nam aperiam molestiae alias, quos numquam tenetur repudiandae?</p>
        </div>

        <p> Tenetur excepturi praesentium illum voluptatibus cum repellat consectetur eum dolor provident modi ad odit quo maxime aliquam harum vitae explicabo autem aspernatur ut, hic voluptas repudiandae incidunt commodi est. Aut nobis vero sapiente et deleniti quam mollitia quia nihil natus suscipit minima, sequi asperiores, earum reprehenderit quas consequatur ipsa officia numquam repellendus saepe similique.</p>

        <p>Distinctio, nobis. Labore ex, necessitatibus veritatis cumque commodi voluptate amet optio quaerat quos tenetur voluptatum nobis ratione deserunt consequatur, quis explicabo cum? Alias magni amet, iusto aperiam dolorem suscipit adipisci veniam minus quia, cumque, porro voluptatibus dignissimos nihil blanditiis incidunt quo molestias ipsum libero est ea. Distinctio, alias ex aperiam sed fuga quae architecto quasi assumenda soluta illum iusto, quod asperiores consectetur repudiandae quisquam in recusandae, possimus ipsum. </p>

        <p>Molestiae possimus dolore magnam a corporis, quidem voluptates accusantium nam ea odit, placeat voluptatum consectetur, quibusdam suscipit delectus laborum quisquam. Quis ducimus quo nostrum expedita eligendi possimus consequuntur. Corporis fugit rem velit minus vitae modi quia quas possimus! Consequuntur incidunt quae quibusdam corrupti provident odio placeat enim sunt, nisi ab! Accusamus, magni minima dolorem ad, nam totam ipsa numquam esse unde doloremque corporis ex maxime error mollitia ducimus, deserunt beatae molestias commodi! Doloremque culpa est dolorem quo quae amet tempore et, nam iure a labore soluta quia ducimus repellendus magni rem in impedit debitis. Enim consequuntur eligendi commodi alias molestias sed unde totam aspernatur, atque cupiditate debitis qui nobis, sunt nam dolorum nemo, et ullam incidunt nesciunt itaque? Totam architecto soluta atque dolores recusandae aspernatur, repellat expedita voluptate dignissimos, repudiandae, esse repellendus consectetur numquam ex aperiam dolorum illo est. Error quia similique, quidem voluptatem alias assumenda quas harum, totam quam aliquid magni amet quae vitae. Earum, veniam nemo libero repellendus esse nulla qui dicta, velit error aperiam consectetur repudiandae deleniti illo explicabo consequatur similique, rem enim? </p>

        <img class="about__me__media" src="https://source.unsplash.com/gvfR7wg292M/800x500">

        <p>Deserunt obcaecati necessitatibus similique neque optio ex distinctio, dolorum, veritatis atque sint cupiditate laboriosam perferendis architecto libero deleniti fugit! Omnis quam quasi deleniti facere eveniet enim, quidem laborum temporibus sit deserunt velit sed accusamus est modi natus eius ab pariatur ipsam fuga, magni tenetur dolor veniam. Corporis nobis sequi ex, vel excepturi facere qui cumque dolor alias esse sit deleniti porro in temporibus, natus recusandae similique neque, accusamus ducimus quia beatae nulla magnam quod? Praesentium modi expedita sint dolorem voluptatum vitae asperiores quaerat facilis tempore vero debitis, consectetur reprehenderit temporibus dolor. Ipsa impedit maxime temporibus. Minus asperiores illo, adipisci dignissimos ad animi voluptas alias dolore quaerat nesciunt ratione corrupti vero aliquid quasi aspernatur consequatur! Eaque ab reprehenderit magni, fugit itaque repellendus sapiente nulla, voluptate vitae enim sequi voluptatem? Amet maiores eius labore sint deleniti ipsa? Quaerat rem modi cumque nisi repellat laborum culpa tempora repellendus accusamus rerum! Est voluptates quisquam repellendus! Harum libero natus eveniet ab iusto blanditiis inventore quibusdam magni sapiente, sed consequuntur aspernatur ut doloremque, unde facilis expedita laborum quae!</p>
      </div>
    </div>
  </section>

  <section class="about__me alignfull" id="lavori_e_contatti">
    <header class="about__me__cover">
      <img src="https://source.unsplash.com/36hcN-jZqNQ/1000x2000" class="about__me__image">
      <div class="about__me__header">
        <span class="about__me__eyebrow">Chapter three</span>
        <h1 class="about__me__title">Colleghiamoci</h1>
        <p class="about__me__subtitle">Un'idea. Basta quello per far partire la creativita</p>
      </div>
    </header>
    <div class="about__me__body">
      <nav class="about__me__navigation">
        <a href="#take-in-the-view" class="about__me__navlink about__me__navlink--current">
          <span class="about__me__chapter">Current chapter</span>
          <span class="about__me__navtitle">Take in the view</span>
        </a>
        <a href="#introduction" class="about__me__navlink about__me__navlink--previous">
          <span class="about__me__chapter">Introduction</span>
          <span class="about__me__navtitle">A lighthearted warning</span>
        </a>
        <a href="#escalate-and-escape" class="about__me__navlink about__me__navlink--next">
          <span class="about__me__chapter">Chapter two</span>
          <span class="about__me__navtitle">Escalate &amp; Escape</span>
        </a>
        <progress class='progresso_3'></progress>
      </nav>
      <div class="about__me__content">
        <div class="about__me__lead">
          <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quisquam ad praesentium voluptatibus deleniti dicta debitis quas autem? Nihil sint molestias, facere libero nam aperiam molestiae alias, quos numquam tenetur repudiandae?</p>
        </div>

        <p> Tenetur excepturi praesentium illum voluptatibus cum repellat consectetur eum dolor provident modi ad odit quo maxime aliquam harum vitae explicabo autem aspernatur ut, hic voluptas repudiandae incidunt commodi est. Aut nobis vero sapiente et deleniti quam mollitia quia nihil natus suscipit minima, sequi asperiores, earum reprehenderit quas consequatur ipsa officia numquam repellendus saepe similique.</p>

        <p>Distinctio, nobis. Labore ex, necessitatibus veritatis cumque commodi voluptate amet optio quaerat quos tenetur voluptatum nobis ratione deserunt consequatur, quis explicabo cum? Alias magni amet, iusto aperiam dolorem suscipit adipisci veniam minus quia, cumque, porro voluptatibus dignissimos nihil blanditiis incidunt quo molestias ipsum libero est ea. Distinctio, alias ex aperiam sed fuga quae architecto quasi assumenda soluta illum iusto, quod asperiores consectetur repudiandae quisquam in recusandae, possimus ipsum. </p>

        <img class="about__me__media" src="https://source.unsplash.com/St08jKkPVHw/800x500">

        <p>Molestiae possimus dolore magnam a corporis, quidem voluptates accusantium nam ea odit, placeat voluptatum consectetur, quibusdam suscipit delectus laborum quisquam. Quis ducimus quo nostrum expedita eligendi possimus consequuntur. Corporis fugit rem velit minus vitae modi quia quas possimus! Consequuntur incidunt quae quibusdam corrupti provident odio placeat enim sunt, nisi ab! Accusamus, magni minima dolorem ad, nam totam ipsa numquam esse unde doloremque corporis ex maxime error mollitia ducimus, deserunt beatae molestias commodi! Doloremque culpa est dolorem quo quae amet tempore et, nam iure a labore soluta quia ducimus repellendus magni rem in impedit debitis. Enim consequuntur eligendi commodi alias molestias sed unde totam aspernatur, atque cupiditate debitis qui nobis, sunt nam dolorum nemo, et ullam incidunt nesciunt itaque? Totam architecto soluta atque dolores recusandae aspernatur, repellat expedita voluptate dignissimos, repudiandae, esse repellendus consectetur numquam ex aperiam dolorum illo est. Error quia similique, quidem voluptatem alias assumenda quas harum, totam quam aliquid magni amet quae vitae. Earum, veniam nemo libero repellendus esse nulla qui dicta, velit error aperiam consectetur repudiandae deleniti illo explicabo consequatur similique, rem enim? </p>

        <p>Deserunt obcaecati necessitatibus similique neque optio ex distinctio, dolorum, veritatis atque sint cupiditate laboriosam perferendis architecto libero deleniti fugit! Omnis quam quasi deleniti facere eveniet enim, quidem laborum temporibus sit deserunt velit sed accusamus est modi natus eius ab pariatur ipsam fuga, magni tenetur dolor veniam. Corporis nobis sequi ex, vel excepturi facere qui cumque dolor alias esse sit deleniti porro in temporibus, natus recusandae similique neque, accusamus ducimus quia beatae nulla magnam quod? Praesentium modi expedita sint dolorem voluptatum vitae asperiores quaerat facilis tempore vero debitis, consectetur reprehenderit temporibus dolor. Ipsa impedit maxime temporibus. Minus asperiores illo, adipisci dignissimos ad animi voluptas alias dolore quaerat nesciunt ratione corrupti vero aliquid quasi aspernatur consequatur! Eaque ab reprehenderit magni, fugit itaque repellendus sapiente nulla, voluptate vitae enim sequi voluptatem? Amet maiores eius labore sint deleniti ipsa? Quaerat rem modi cumque nisi repellat laborum culpa tempora repellendus accusamus rerum! Est voluptates quisquam repellendus! Harum libero natus eveniet ab iusto blanditiis inventore quibusdam magni sapiente, sed consequuntur aspernatur ut doloremque, unde facilis expedita laborum quae!</p>
      </div>
    </div>
  </section>
</div>
              
            
!

CSS

              
                * {
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --main-font-size: 4rem;
  --ColorDarkA: hsl(0, 0%, 0%);
  --ColorDarkB: hsl(0, 0%, 18%);
  --ColorWhiteA: hsl(0, 0%, 94%);
  --ColorWhiteB: hsl(0, 0%, 90%);
  --gap: 5px;
}

@supports not (-webkit-overflow-scrolling: touch) {
  html {
    scroll-behavior: smooth;
    scroll-margin-top: 5vh;
  }
}

body {
  width: 100%;
  min-height: 100%;
  padding: 0;
  margin: 0;
  overflow-x: hidden;
}

.wrap_about__me,
:is(.wrap_about__me) :is(*),
:where(.wrap_about__me) :where(*) :where(*) {
  -webkit-overflow-scrolling: auto;
}
.wrap_about__me *:before,
.wrap_about__me *:after {
  box-sizing: border-box;
}

.wrap_about__me {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f7f9fa;
  position: relative;
}

.about__me {
  width: 100vw;
  min-width: -webkit-fill-available;
  min-height: 100vh;
  display: flex;
  flex-wrap: wrap;
  overflow: clip;
}
.about__me__cover {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  flex-grow: 1;
  height: 50vh;
  min-height: 400px;
  width: 100%;
  z-index: 0;
  overflow: clip;
  object-fit: cover;
}

.about__me__cover img {
  overflow: hidden;
  z-index: -1;
}

@media (min-width: 652px) {
  .about__me__cover {
    height: 100vh;
    width: 38%;
  }
}
@media (min-width: 768px) {
  .about__me__cover {
    width: 42%;
  }
}
@media (min-width: 992px) {
  .about__me__cover {
    width: 46%;
  }
}
.about__me__body {
  flex-grow: 1;
  width: 50%;
  background: white;
  position: relative;
  z-index: 2;
}

.about__me__body:after {
  content: "";
  position: absolute;
  display: flex;
  width: 100%;
  height: 100%;
  box-shadow: 0px -20px 20px -5px hwb(0deg 0% 100% / 20%);
  z-index: -1;
  pointer-events: none;
}

.about__me__lead {
  font-size: 2.1rem;
  grid-column-start: 2;
  grid-column-end: 10;
}
.about__me__content {
  width: 100%;
  padding: 10% 0;
  font-size: /*1.7rem*/ inherit;
  line-height: 1.55;
  color: #3b424a;
  font-weight: 300;
  border-bottom: 1px solid #eef0f1;
  display: grid;
  grid-template-columns: repeat(10, 10%);
}
.about__me__content p {
  margin: 0 0 1.5em;
  grid-column-start: 2;
  grid-column-end: 10;
}
.about__me__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.about__me__header {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  padding: 2rem;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 15, 27, 0.25),
    rgba(1, 42, 77, 0.45)
  );
  text-align: center;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2), 2px 2px 24px rgba(0, 0, 0, 0.16);
}
@media (min-width: 552px) {
  .about__me__header {
    padding: 3rem;
  }
}
@media (min-width: 768px) {
  .about__me__header {
    padding: 3rem 4rem;
  }
}
@media (min-width: 992px) {
  .about__me__header {
    padding: 3rem 6rem;
  }
}
.about__me__eyebrow {
  display: block;
  width: 100%;
  text-transform: uppercase;
  margin-bottom: 0.35em;
  font-size: 1.4rem;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.12em;
  position: absolute;
  left: 0;
  right: 0;
}
.about__me__title {
  color: #fff;
  font-size: 3.2rem;
  line-height: 1.3;
  width: 100%;
}
@media (min-width: 992px) {
  .about__me__title {
    font-size: 3.8rem;
  }
}
.about__me__subtitle {
  color: #fff;
  font-size: 2rem;
  margin-top: 0.65em;
  line-height: 1.5;
  width: 100%;
}
@media (min-width: 768px) {
  .about__me__subtitle {
    font-size: 2.2rem;
  }
}
.about__me__media,
.about__me__media__before__after {
  width: 100%;
  height: auto;
  display: block;
  margin: 1.5em 0;
  grid-column-start: 1;
  grid-column-end: 11;
}
.about__me__navigation {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  left: 0;
  background: white;
  padding: 2rem;
  border-bottom: 1px solid #eef0f1;
  container-type: inline-size;
  container-name: width__about__me__navigation;
}
@media (min-width: 552px) {
  .about__me__navigation {
    padding: 3rem;
  }
}
@media (min-width: 768px) {
  .about__me__navigation {
    padding: 3rem 4rem;
  }
}
.about__me__navlink {
  text-decoration: none;
}
.about__me__navlink:hover .about__me__navtitle,
.about__me__navlink:focus .about__me__navtitle {
  color: #037de4;
}
.about__me__navlink--current {
  order: 2;
  color: #b3bac2;
  margin: 2rem 0 0;
  width: 100%;
  display: flex;
  justify-content: center;
}
@media (min-width: 1200px) {
  .about__me__navlink--current {
    margin: 0 1rem;
    width: auto;
    order: 1;
  }
}
.about__me__navlink--current .about__me__chapter {
  margin-right: 1em;
}
.about__me__navlink--current .about__me__navtitle {
  margin-top: 0;
  text-transform: uppercase;
  font-weight: 600;
  font-size: 1.3rem;
}
.about__me__navlink--previous {
  order: 0;
}
.about__me__navlink--next {
  order: 1;
  text-align: right;
}
@media (min-width: 1200px) {
  .about__me__navlink--next {
    order: 2;
  }
}
@media (max-width: 651px) {
  .about__me__navlink:not(.about__me__navlink--current) .about__me__navtitle {
    display: none;
  }
}
.about__me__chapter {
  text-transform: uppercase;
  font-weight: 600;
  font-size: /*1.3rem*/ inherit;
  display: block;
  color: #a5aeb6;
}
.about__me__navtitle {
  display: inline-block;
  margin-top: 0.35em;
  font-size: 1.5rem;
  color: #444d55;
}

.wrap_about__me progress {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  bottom: 1em;
  width: 100%;
  max-width: calc(100cqw - 20vmax);
  height: 3px;
  background: 0;
  margin: auto;
  left: 0;
  right: 0;
}

.wrap_about__me progress::-webkit-progress-bar {
  background: transparent;
}

.wrap_about__me progress::-webkit-progress-value {
  background: linear-gradient(
    to left,
    #db38b5,
    #01b3e3,
    #25ce7b,
    #fdc741,
    #ff6b01,
    #fc4236
  );
  background-attachment: fixed;
}
.wrap_about__me progress::-moz-progress-bar {
  background: linear-gradient(
    to left,
    #db38b5,
    #01b3e3,
    #25ce7b,
    #fdc741,
    #ff6b01,
    #fc4236
  );
  background-attachment: fixed;
}

.about__me__media__before__after {
  height: 300px;
  width: 100%;
  overflow: hidden;
  z-index: -1;
}

.comparisonImage {
  width: 100%;
  height: 100%;
  position: relative;
}
.afterImage {
  position: absolute;
  overflow: hidden;
  top: 0;
  transform: translate(100%, 0px);
}
.afterImage img {
  transform: translate(-100%, 0px);
}
.comparisonImage img {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
}

              
            
!

JS

              
                gsap.utils.toArray(".about__me__media__before__after").forEach((section) => {
  let tl = gsap.timeline({
    scrollTrigger: {
      trigger: section,
      start: "top top+=20%",
      // makes the height of the scrolling (while pinning) match the width, thus the speed remains constant (vertical/horizontal)
      end: () => "+=" + section.offsetWidth,
      scrub: true,
      anticipatePin: 1,
      pin: true
    },
    defaults: { ease: "none" }
  });
  // animate the container one way...
  tl.fromTo(
    section.querySelector(".afterImage"),
    { xPercent: 100, x: 0 },
    { xPercent: 0 }
  )
    // ...and the image the opposite way (at the same time)
    .fromTo(
      section.querySelector(".afterImage img"),
      { xPercent: -100, x: 0 },
      { xPercent: 0 },
      0
    );
});


document.querySelectorAll(".about__me").forEach((container) => {
  gsap.to(container.querySelector(".wrap_about__me progress"), {
    value: 1,
    ease: "none",
    scrollTrigger: {
      trigger: container.querySelector(".about__me__content"),
      start: "top top+=10%",
      end: "bottom bottom-=10%",
      scrub: true,
      markers: true
    }
  });
});

/*img comparison*/

              
            
!
999px

Console