Full Page Presentations With jQuery And CSS Animations

Full Page Presentations With jQuery And CSS Animations
File Size: 2.77 KB
Views Total: 181
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A vertical full-page presentation app (also called fullscreen page slider) implemented in JavaScript (jQuery) and CSS animations.

How to use it:

1. Add presentations to the webpage.

<!--Page 1-->
<section id="page_1" class="page">
  <h1>Welcome To My Presentation</h1>
  <p>
    Presentation 1
  </p>
  <a href="#page_2" class="btn"
    >Next Page
  </a>
</section>
<!--Page 2-->
<section id="page_2" class="page">
  <h1>Welcome To Page-2</h1>
  <p>
    Presentation 2
  </p>
  <div>
    <a href="#page_1" class="btn btn_dark"
      >Prev Page>
    </a>
    <a href="#page_3" class="btn"
      >Next Page
    </a>
  </div>
</section>
<!--Page 3-->
<section id="page_3" class="page">
  <h1>Welcome To Page-3</h1>
  <p>
    Presentation 3
  </p>
  <div>
    <a href="#page_2" class="btn btn_dark"
      >Prev Page <i class="fas fa-arrow-circle-up"> </i>
    </a>
  </div>
</section>
<!-- More Presentations Here -->

2. The main CSS styles for the presentation layout.

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  line-height: 1.5;
  color: #fff;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 4rem;
}

.page h1 {
  font-size: 4rem;
  line-height: 1.2;
  margin: 1rem;
}

.page p {
  font-size: 1.3rem;
}

.btn {
  display: inline-block;
  padding: 1rem 2rem;
  background: #f4f4f4;
  color: #333;
  border-radius: 5px;
  border: none;
  margin-top: 1rem;
  font-size: 1.1rem;
  text-decoration: none;
  transition: all ease-in 0.3s;
}

.btn:hover,
.btn_dark {
  background: #333;
  color: #fff;
}

.btn_dark:hover {
  background: #f4f4f4;
  color: #333;
}

3. Customize the background colors of your presentations.

#page_1 {
  background: '#222';
}

#page_2 {
  background: '#333';
}

#page_3 {
  background: '#444';
}

4. Customize the background colors of your presentations.

#page_1 {
  background: '#222';
}

#page_2 {
  background: '#333';
}

#page_3 {
  background: '#444';
}

5. Animate content using CSS3 animations.

#page_1 h1 {
  transform: translateY(-1000px);
  animation: heading 1s forwards ease-in;
}

@keyframes heading {
  to {
    transform: translateY(0);
  }
}

#page_1 p {
  transform: translateX(-2000px);
  animation: text 2.7s forwards ease-in;
}

@keyframes text {
  to {
    transform: translateX(0);
  }
}

6. The JavaScript (jQuery script) to enable the presnetations.

$(".btn").on("click", function(event) {
  if (this.hash !== "") {
    event.preventDefault();
    const hash = this.hash;
    $("html, body").animate(
      {
        scrollTop: $(hash).offset().top
      },
      800
    );
  }
});

This awesome jQuery plugin is developed by sivanare. For more Advanced Usages, please check the demo page or visit the official website.