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

              
                <body>

  <nav>
    <ul>
      <li><a href="#slide-1" id="Slide01" class="active"><span></span></a></li>
      <li><a href="#slide-2" id="Slide02"><span></span></a></li>
      <li><a href="#slide-3" id="Slide03"><span></span></a></li>
      <li><a href="#slide-4" id="Slide04"><span></span></a></li>
      <li><a href="#slide-5" id="Slide04"><span></span></a></li>
    </ul>
  </nav>
  <div class="slides-container">
    <div class="slide active" id="slide-1">
        <div class="cover">
          <svg class="yes" version="1.1" id="эквалайзер" x="0px" y="0px" width="108px" height="72px" viewBox="0 0 108 72" xmlns="http://www.w3.org/2000/svg">
            <path class="eqz" d="M0,46h16v26H0V46z M0,36h16v6H0V36z" id="eqz1"/>
            <path class="eqz" d="M23,10h16v62H23V10z M23,0h16v6H23V0z" id="eqz2"/>
            <path class="eqz" d="M46,36h16v36H46V36z M46,26h16v6H46V26z" id="eqz3"/>
            <path class="eqz" d="M69,26h16v46H69V26z M69,16h16v6H69V16z" id="eqz4"/>
            <path class="eqz" d="M92,59h16v13H92V59z M92,49h16v6H92V49z" id="eqz5"/>
          </svg>
        </div>
    </div>
    <div class="slide" id="slide-2">
      <div class="cover">
      </div>
      <div class="againPIN">Again ?</div>
    </div>
    <!-- ============  ME =========================================  -->
    <div class="slide" id="slide-3">
      <div class="cover">
        <div class="wrapME centered">
        </div>
      </div>
      <div class="againME">Again ?</div>
    </div>
    <!-- ============  GreenAttack =========================================  -->
    <div class="slide" id="slide-4">
      <div class="cover">
      </div>
      <div class="againGreenAttack">Again ?</div>
    </div>
    <!-- ============  HELMUT =========================================  -->
    <div class="slide" id="slide-5">
      <div class="cover">

      </div>
      <div class="againHELMUT">Again ?</div>
    </div>
  </div>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js" type="text/javascript"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.20.2/TweenMax.min.js" type="text/javascript"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.0/plugins/ScrollToPlugin.min.js" type="text/javascript"></script>
  <script src="js/yeeees.js" type="text/javascript"></script>
</body>
              
            
!

CSS

              
                body, div, p {
    margin: 0;
    padding: 0;
}

body {
    font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
    font-weight: 300;
    letter-spacing: 0.0625em;
}

a {
    text-decoration: none;
    color: black;
    font-style: italic;
}
a:hover {
	color: #0D6708;
}
h1 {
	text-align: center;
    font-weight: 300;
    font-size: 3em;
}
nav {
    position: absolute;
    bottom: 0%;
    left: 50%;
	width: 240px;
    z-index: 100;
	visibility: hidden;
}

nav ul {
	margin: 0;
    padding: 0;
}

nav ul li {
    display: block;
    width: 14px;
    height: 13px;
    margin: 7px 2px 2px 40px;
	position: relative;
	float: left;
}

nav ul li:first-child {
    margin-left: 0;
}

nav a {
   display: block;
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    cursor: pointer;
    text-decoration: none;

}
nav  span {
    border-radius: 50%;
    position: absolute;
    z-index: 1;
    height: 4px;
    width: 4px;
    border: 0;
    background: black;
    left: 50%;
    top: 50%;
    margin: -2px 0 0 -2px;
    -webkit-transition: all 0.1s ease-in-out;
    -moz-transition: all 0.1s ease-in-out;
    -o-transition: all 0.1s ease-in-out;
    transition: all 0.1s ease-in-out;
}
a.active span {
    height: 16px;
    width: 16px;
    margin: -9px 0 0 -9px;
    border-radius: 100%;
}
 ul li:hover  span {
    height: 20px;
    width: 20px;
    margin: -13px 0 0 -9px;
    border-radius: 100%;
}


.slides-container {
   position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 10;
    text-align: center;
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

#slide-1 {
   z-index: 10;
}

.slide .centered {
    position: absolute;
    width: 100%;
    top: 40%;
    left: 50%;
	visibility: hidden;
}

.slide .centered h1 {
  text-align: center;
	margin: 0;
}

.slide .centered p {
    text-align: center;
    margin: 0;
    font-size: 15px;
}

#slide-1 {
    background-color: #FFFFFF;
}

#slide-2 {
    background-color: #45959b;
}

#slide-3 {
    background-color: #778899;
}

#slide-4 {
    color: #FFFFFF;
    background-color: #FFFFFF;
}
#slide-5 {
    color: #FFFFFF;
    background-color: #413257;
}
.go-prev, .go-next {
    cursor: pointer;
    font-weight: bold;
    text-decoration: underline;
}

.action {
	position: absolute;
	left:50%; top:50%;
	width: 200px !important; height: 200px;
	background: red;
}
.cover {
	width: 90vw;
    height: 50.625vw;
    max-height: 90vh;
    max-width: 160vh;
    margin: auto;
    margin-bottom: 20px;
    position: absolute;
    top: 7%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cover img {
	position: relative;
	width: 100%;
	height: auto;
}
svg {
	position: absolute;
    display: block;
    width: auto;
    height: 80%;
    overflow: visible;
}
#text, #kopf02, #mund02, #mund03, #hand01, .hidden {visibility: hidden;}


.wrapME {
	position: absolute;
	top: 27%;
	left: 11%;
  height: 75%;
	width: inherit;
	overflow: hidden;
}
.me {
	height: 85%;
  top: 58% !important;
}
#YOU {
	top: 89%;
    left: 55%;
    height: 8%;
}
.you {
	fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 8;
    stroke: #000;
}
#greenattack {width: 66%; overflow: hidden;}
.greenattack {
	fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 8px;
    stroke: #000;
}
.sonne {visibility: hidden; left:0%;}
.kugel {fill: black; visibility: hidden;}

#slide-5 .cover {
	overflow: visible;
}
.helmut {
	height: 44%;
	left: 4%;
}
.rauch {
	fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 12;
    stroke: #fff;
	visibility: hidden;
}

.close {
    position: absolute;
    top: -1px;
    right: 25px;
    font-size: 55px;
    font-weight: 300;
	color: #49D549;
    cursor: pointer;
    z-index: 1000;
}
.againPIN, .againME, .againHELMUT, .againGreenAttack {
    position: absolute;
    top: auto;
    bottom: 5%;
    right: 5%;
    color: #0D6708;
    cursor: pointer;
    visibility: hidden;
    z-index: 1000;
}


// *=============================================*

.yes {
   width: 800px;
   height: 400px;
}

.eqz {
   fill: pink;
}

              
            
!

JS

              
                //  =============  xxxxx  ==========================

TweenMax.set(".centered, nav", {
  autoAlpha: 1,
  xPercent: -50,
  yPercent: -50,
  force3D: true
});


//Forked from [Chrysto](http://codepen.io/bassta/)'s Pen [Fullscreen slides with TweenLite, CSSPlugin and ScrollToPlugin](http://codepen.io/bassta/pen/kDvmC/).  Optimized with the help of Blake Owen

//First the variables our app is going to use need to be declared

//References to DOM elements
var $window = $(window);
var $document = $(document);
//Only links that starts with #
var $navButtons = $("nav a").filter("[href^=#]");
var $navGoPrev = $(".go-prev");
var $navGoNext = $(".go-next");
var $slidesContainer = $(".slides-container");
var $allSlides = $(".slide");
var $currentSlide = $allSlides.first();
var slideControl = $("nav a")


//Animating flag - is our app animating
var isAnimating = false;

//The height of the window
var pageHeight = $window.innerHeight();

//Key codes for up and down arrows on keyboard. We'll be using this to navigate change slides using the keyboard
var keyCodes = {
  UP: 38,
  DOWN: 40
};


var currentIndex = 0;

var timeline1 = new TimelineLite()
  .to('.eqz', 1, {
    x: "+80%",
    ease: Power4.easeNone
  })
.reverse();


var timeline2 = new TimelineLite()
  .to('.eqz', 1, {
    x: "-80%",
    ease: Power4.easeNone
  })
  .to('.againPIN', 0.5, {
    autoAlpha: 1
  })
.reverse();

$(".againPIN").on("click", function() {
  timeline2.restart();
});


var timeline3 = new TimelineLite()
.to('.eqz', 1, {
  transform: "scale(3)",
  ease: Power4.easeNone
})
  .to('.againME', 0.5, {
    autoAlpha: 1
  })
.reverse();

$(".againME").on("click", function() {
  timeline3.restart();
});

var timeline4 = new TimelineLite()
.to('.eqz', 2, {
  transform: "scale(2)",
  ease: Power4.easeNone
})
  .to('.againGreenAttack', 0.5, {
    autoAlpha: 1
  })
.reverse();

$(".againGreenAttack").on("click", function() {
  timeline4.restart();
});

var timeline5 = new TimelineLite()
  .to('.againHELMUT', 0.5, {
    autoAlpha: 1
  })
.reverse();

$(".againHELMUT").on("click", function() {
  timeline5.restart();
});

var timelines = [timeline1, timeline2, timeline3, timeline4, timeline5];

//Going to the first slide
goToSlide($currentSlide);
//TweenLite.set($currentSlide, {className: "+=active"});

/*
 *   Adding event listeners
 * */

$window.on("resize", onResize).resize();
$window.on("mousewheel DOMMouseScroll", onMouseWheel);
$document.on("keydown", onKeyDown);
$navButtons.on("click", onNavButtonClick);
$navGoPrev.on("click", goToPrevSlide);
$navGoNext.on("click", goToNextSlide);


/*
 *   Internal functions
 * */


/*
 *   When a button is clicked - first get the button href, and then slide to the container, if there's such a container
 * */
function onNavButtonClick(event) {
  //The clicked button
  var $button = $(this);

  //The slide the button points to
  var $slide = $($button.attr("href"));

  //If the slide exists, we go to it
  if ($slide.length) {
    goToSlide($slide);
    event.preventDefault();
  }
}

/*
 *   Getting the pressed key. Only if it's up or down arrow, we go to prev or next slide and prevent default behaviour
 *   This way, if there's text input, the user is still able to fill it
 * */
function onKeyDown(event) {

  var PRESSED_KEY = event.keyCode;

  if (PRESSED_KEY == keyCodes.UP) {
    goToPrevSlide();
    event.preventDefault();
  } else if (PRESSED_KEY == keyCodes.DOWN) {
    goToNextSlide();
    event.preventDefault();
  }

}

/*
 *   When user scrolls with the mouse, we have to change slides
 * */
function onMouseWheel(event) {
  //Normalize event wheel delta
  var delta = event.originalEvent.wheelDelta / 30 || -event.originalEvent.detail;

  //If the user scrolled up, it goes to previous slide, otherwise - to next slide
  if (delta < -1) {
    goToNextSlide();
  } else if (delta > 1) {
    goToPrevSlide();
  }

  event.preventDefault();


}

/*
 *   If there's a previous slide, slide to it
 * */
function goToPrevSlide() {
  if ($currentSlide.prev().length) {
    goToSlide($currentSlide.prev());
  }
}

/*
 *   If there's a next slide, slide to it
 * */
function goToNextSlide() {
  if ($currentSlide.next().length) {
    goToSlide($currentSlide.next());
  }
}


/*
 *   Actual transition between slides
 * */
function goToSlide($slide) {
  //If the slides are not changing and there's such a slide
  if (!isAnimating && $slide.length) {
    //setting animating flag to true
    isAnimating = true;
    $currentSlide = $slide;
    NextSlide = $currentSlide.next()

    //Sliding to current slide
    TweenLite.to($slidesContainer, 1, {
      scrollTo: {
        y: pageHeight * $currentSlide.index()
      },
      onComplete: onSlideChangeEnd,
      onCompleteScope: this
    });

    //Definig slide status
    TweenLite.to($allSlides.filter(".active"), 0.1, {
      className: "-=active"
    });
    TweenLite.to($allSlides.filter($currentSlide), 0.1, {
      className: "+=active"
    });

    //Animating menu items
    TweenLite.to($navButtons.filter(".active"), 0.5, {
      className: "-=active"
    });
    TweenLite.to($navButtons.filter("[href=#" + $currentSlide.attr("id") + "]"), 0.5, {
      className: "+=active"
    });


  }
}

/*
 *   Once the sliding is finished, we need to restore "isAnimating" flag.
 *   You can also do other things in this function, such as changing page title
 * */
function onSlideChangeEnd() {
  isAnimating = false;

  // Reverse the timeline for the previous slide
  timelines[currentIndex].reversed(true).progress(0);

  // Change the index
  currentIndex = $currentSlide.index();

  // Play the timeline for the current slide
  timelines[currentIndex].reversed(false);
}

/*
 *   When user resize it's browser we need to know the new height, so we can properly align the current slide
 * */
function onResize(event) {

  //This will give us the new height of the window
  var newPageHeight = $window.innerHeight();

  /*
   *   If the new height is different from the old height ( the browser is resized vertically ), the slides are resized
   * */
  if (pageHeight !== newPageHeight) {
    pageHeight = newPageHeight;

    //This can be done via CSS only, but fails into some old browsers, so I prefer to set height via JS
    TweenLite.set([$slidesContainer, $allSlides], {
      height: pageHeight + "px"
    });

    //The current slide should be always on the top
    TweenLite.set($slidesContainer, {
      scrollTo: {
        y: pageHeight * $currentSlide.index()
      }
    });
  }

}

              
            
!
999px

Console