cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <!-- Gallery -->
<main id="js-gallery" role="main" class="gallery">

 <section class="gallery__body">

  <div id="js-poster" class="main__gallery-poster poster">
   <div class="poster__content">

    <!-- Poster Styles -->
    <link rel="stylesheet" href="../css/weltspartag.css" inline>
    <!-- Poster Styles -->

    <header class="poster__header">
     <h1 class="poster__title">Weltspartag 1978</h1>
     <h2 class="poster__subtitle">30.Oktober</h2>
    </header>

    <section class="poster__body">
     <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 419 486" class="graphic">
								<title>graphic</title>
								<path class="graphic__section graphic__section--7 graphic__section--green" d="M168 0h83a80 80 0 0 1 80 80H168V0z"/>
								<path class="graphic__section graphic__section--6 graphic__section--orange" d="M168 0v163H88V80a80 80 0 0 1 80-80z"/>
								<path class="graphic__section graphic__section--5 graphic__section--red" d="M419 243H168a80 80 0 0 1-80-80h331v80z"/>
								<path class="graphic__section graphic__section--4 graphic__section--orange" d="M0 243h251a80 80 0 0 1 80 80H0v-80z"/>
								<path class="graphic__section graphic__section--3 graphic__section--red" d="M251 486V323h80v83a80 80 0 0 1-80 80z"/>
								<path class="graphic__section graphic__section--2 graphic__section--yellow" d="M88 406h83a80 80 0 0 1 80 80H88v-80z" transform="rotate(180 169.5 446)"/>
								<path class="graphic__section graphic__section--1 graphic__section--violet" d="M251 80v83l-128 93.87A79.91 79.91 0 0 0 88 323v83h80v-83l128.88-94.45A79.89 79.89 0 0 0 331 163V80h-80z"/>
							</svg>
    </section>

    <footer class="poster__footer">
     <h1 class="poster__footer-title">Sparkasse</h1>
     <div class="poster__footer-logo">
      <svg xmlns="http://www.w3.org/2000/svg" width="32" height="40" viewBox="0 0 26 32.99" fill="#333"><title>logo</title><path d="M26 17v-2.67A3.33 3.33 0 0 0 22.67 11H4a4 4 0 0 0-4 4v10h20v2H.05v2.51A3.47 3.47 0 0 0 3.52 33H21a5 5 0 0 0 5-5v-9H6v-2h20zM13 8a4 4 0 1 0-4-4 4 4 0 0 0 4 4z"/></svg>
     </div>
    </footer>

   </div>
   <!-- .poster__content -->
  </div>
  <!-- .poster -->

 </section>
 <!-- .gallery__body -->

</main>
<!-- .gallery -->
<!-- Gallery -->
            
          
!
            
              /**
 * Mixins
 */
@mixin pos ($position, $top: auto, $right: auto, $bottom: auto, $left: auto) {
	position: $position;
	top: $top;
	right: $right;
	bottom: $bottom;
	left: $left;
}

@mixin center($width: null, $height: null) {
	position: absolute;
	top: 50%;
	left: 50%;
	@if not $width and not $height {
		transform: translate(-50%, -50%);
	}
	@else if $width and $height {
		width: $width;
		height: $height;
		margin: -($width / 2) #{0 0} -($height / 2);
	}
	@else if not $height {
		margin-left: -($width / 2);
		transform: translateY(-50%);
		width: $width;
	}
	@else {
		margin-top: -($height / 2);
		transform: translateX(-50%);
		height: $height;
	}
}

/**
 * Variables
 */
// Colors
$text-color: #222;
$off-white: #ECEBD9;
$orange: saturate(#E48C45, 10%);
$red: saturate(#C5575E, 10%);
$green: saturate(#7B8956, 10%);
$yellow: saturate(#F8D553, 10%);
$violet: saturate(#4F587B, 10%);
$primary-color: $violet;

// Animations
$timing: ease-in-out;
$duration: 8s;

/**
 * Animations
 */
@keyframes opaque {
	0% {
		opacity: 0;
	}
	50% {
		opacity: 1;
	}
	100% {
		opacity: 0;
	}
}

@keyframes rotate {
 0% {
  transform: rotate(0deg);
 }
 50% {
 	transform: rotate(180deg);
 }
 100% {
  transform: rotate(360deg);
 }
}

/**
 * Base
 */
*, *:after, *:before {
	box-sizing: border-box;
}

body {
	font-family: "Helvetica Neue", "Helvetica", sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
	font-weight: bold;
}

/**
 * Gallery
 */
.gallery {
	@include pos(absolute, 0, 0, 0, 0);
	z-index: 1;
	width: 100%;
	height: 100%;
	overflow: hidden;
	opacity: 1;
	transition: $duration opacity $timing;
	background: $primary-color;
	background: radial-gradient(
		ellipse at center,
		lighten($primary-color, 5%) 0%,
		$primary-color 100%
	);

	&.fadeOut {
		opacity: 0;
	}
}

.gallery__body {
	@include center();
	transform-origin: center center;
}

/**
 * Poster
 */
.poster {
  @include center();
  transform-origin: center center;
  display: inline-block;
  vertical-align: middle;

  &:before,
  &:after {
    z-index: -1;
    position: absolute;
    content: "";
    bottom: 15px;
    left: 8px;
    width: 50%;
    top: 80%;
    max-width: 300px;
    background: #777;
    box-shadow: 0 15px 10px rgba(#000,.5);
    transform: rotate(-3deg);
  }

  &:after {
    transform: rotate(3deg);
    right: 8px;
    left: auto;
  }
}

.poster__content {
	position: relative;
  width: 500px;
  height: 700px;
  overflow: hidden;
	background: $off-white;
	color: $text-color;
}

.poster__header {
	position: relative;
	width: 100%;
	overflow: hidden;
	top: 0;
	left: 0;
	width: 100%;
	padding: 0.75em;
}

.poster__title, .poster__subtitle {
	margin: 0;
	font-size: 2.2em;
	font-weight: 400;
}

.poster__title {
	float: left;
}

.poster__subtitle {
	float: right;
	text-align: right;
}

.poster__body {
	position: relative;
	margin: 0 auto;
	animation: $duration $timing infinite rotate;
}

.graphic__section {
	animation: $duration $timing infinite alternate opaque;
	opacity: 0;
}

.graphic__section--2 {
	animation-delay: $duration/6;
}

.graphic__section--3 {
	animation-delay: $duration/4;
}

.graphic__section--4 {
	animation-delay: $duration/2;
}

.graphic__section--5 {
	animation-delay: $duration/2;
}

.graphic__section--6 {
	animation-delay: $duration/4;
}

.graphic__section--7 {
	animation-delay: $duration/6;
}

.graphic__section--orange {
	fill: $orange;
}

.graphic__section--green {
	fill: $green;
}

.graphic__section--violet {
	fill: $violet;
}

.graphic__section--yellow {
	fill: $yellow;
}

.graphic__section--red {
	fill: $red;
}

.poster__footer {
	position: absolute;
	bottom: 0;
	left: 0;
	bottom: 0;
	width: 100%;
	padding: 0.75em;
}

.poster__footer-title {
	float: left;
	margin: 0;
	font-size: 2.2em;
	font-weight: 400;
}

.poster__footer-logo {
	float: right;
	margin-right: 1em;
}

            
          
!
            
              (function(window, document, undefined) {

    'use strict';


    /**
     * Selectors
     */
    var body = document.body,
        gallery = document.getElementById('js-gallery'),
        galleryWidth = gallery.offsetWidth,
        galleryHeight = gallery.offsetHeight,
        poster = document.getElementById('js-poster'),
        posterWidth = poster.offsetWidth,
        posterHeight = poster.offsetHeight,
        posterPadding = '50';


    /**
     * Prefixed requestAnimationFrame
     */
    var requestAnimationFrame = window.requestAnimationFrame
    || window.webkitRequestAnimationFrame
    || window.mozRequestAnimationFrame
    || window.msRequestAnimationFrame
    || function(callback) {
        return setTimeout(callback, 1000 / 60);
    };


    /**
     * Methods
     */
    var throttle = function(callback, limit) {
        var wait = false;
        return function() {
            if (!wait) {
                callback.call();
                wait = true;
                setTimeout(function() {
                    wait = false;
                }, limit);
            }
        };
    };

    var resizePoster = function() {

        // Define variable
        var scale;

        // Get values for poster dimensions
        scale = Math.min(
            galleryWidth / posterWidth,
            galleryHeight / posterHeight
        );


				// Scale Poster for larger viewports
				poster.style[Modernizr.prefixed('transform')] = 'translate(-50%, -50%) ' + 'scale(' + scale + ')';

        // Sync operation with browser
        requestAnimationFrame(resizePoster);
    };


    var onResize = throttle(function() {

        // Set Gallery width
        galleryWidth = gallery.offsetWidth - posterPadding;

        // Set Gallery height
        galleryHeight = gallery.offsetHeight - posterPadding;

        // Sync operation with browser
        requestAnimationFrame(resizePoster);

    }, 100);


    /**
     * Events/APIs/init
     */

    // Set Gallery width
    galleryWidth = gallery.offsetWidth - posterPadding;

    // Set Gallery height
    galleryHeight = gallery.offsetHeight - posterPadding;

    // Sync operation with browser
    requestAnimationFrame(resizePoster);

    // Listen for resize event
    window.addEventListener('resize', onResize, false);

})(window, document);

            
          
!
999px
Loading ..................

Console