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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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 id="main-stage"> <!-- START MAIN-STAGE -->
      <div class="conrner-nav"> <!-- START CORNER-NAV -->
        <div id="print" class="media-type">
          <a href="#">
            <div id="printLinkSpace"><span id="title-print" class="title-print"><h2>print</h2></span></div>
          </a>
          <img src="https://dummyimage.com/700x521/ffffff/ebebeb.gif" alt="Print Portfolio Samples">  
        </div>

        <div id="broadcast" class="media-type">
          <a href="#">
            <div id="broadcastLinkSpace">
              <span id="title-broadcast"><h2>video</h2></span>
            </div>
          </a>
          <img src="https://dummyimage.com/700x488/ffffff/ebebeb.gif" alt="Broadcast Portfolio Samples">  
        </div>

        <div id="outdoor" class="media-type">
          <a href="#">
            <div id="outdoorLinkSpace">
              <span id="title-outdoor"><h2>outdoor</h2></span>
            </div>
          </a>
          <img src="https://dummyimage.com/700x705/ffffff/ebebeb.gif" alt="Outdoor Portfolio Samples">
        </div>

        <div id="online" class="media-type">
          <a href="#">
            <div id="onlineLinkSpace">
              <span id="title-online"><h2>online</h2></span>
            </div>  
          </a>
          <img src="https://dummyimage.com/700x564/ffffff/ebebeb.gif" alt="Online Portfolio Samples">  
        </div>
      </div> <!-- END CORNER-NAV -->
    </div> <!-- END MAIN-STAGE -->
              
            
!

CSS

              
                /* *********************** */
/* ***** Main Styles ***** */
/* *********************** */


/* warm gray */
body {
  overflow: hidden;
  margin: 0;
  padding: 0;
  background-color: #afafaf; 
}

h2 {
  font-size: 2.5rem;
}

div {
  border: 1px solid red; 
}

span {
  border: 1px solid green; 
}

/* ********************************* */
/* ******** Section - Styles ******* */
/* ********************************* */
#main-stage {
  width: 100vw;
  height: 100vh; 
}

.conrner-nav {
  width: 100vw;
  height: 100vh; 
}

.media-type {
    position: fixed;
    display: inline-block; 
}

.media-type img {
  position: relative;
  display: inline-block;
  height: 100%; }

#print {
  position: absolute;
  visibility: hidden;
  overflow: hidden;
  background-color: #ffff;
  width: 700px;
  height: 521px;
  top: 50%;
  left: 50%;
  z-index: 2;
}

#printLinkSpace {
  position: absolute;
  overflow: hidden;
  width: 700px;
  height: 521px;
  bottom: 0;
  right: 0;
  z-index: 2;

}

#broadcast {
  position: absolute;
  visibility: hidden;
  overflow: hidden;
  background-color: #ffff;
  width: 700px;
  height: 488px;
  top: 50%;
  left: 150%;
  z-index: 2;
}

#broadcastLinkSpace {
  position: absolute;
  overflow: hidden;
  width: 700px;
  height: 488px;
  bottom: 0;
  left: 0;
  z-index: 2;

}

#outdoor {
  position: absolute;
  visibility: hidden;
  overflow: hidden;
  background-color: #ffff;
  width: 700px;
  height: 705px;
  top: 150%;
  left: 50%;
  z-index: 2;
}

#outdoorLinkSpace {
  position: absolute;
  overflow: hidden;
  width: 700px;
  height: 705px;
  top: 0;
  right: 0;
  z-index: 2;
}

#online {
  position: absolute;
  visibility: hidden;
  overflow: hidden;
  background-color: #ffff;
  width: 700px;
  height: 564px;
  top: 150%;
  left: 150%;
  z-index: 2;
}

#onlineLinkSpace {
  position: absolute;
  overflow: hidden;
  width: 700px;
  height: 564px;
  top: 0;
  left: 0;
  z-index: 2;
}

/* ********************************* */
#title-print {
  position: absolute;
  bottom: 0;
  right: 0;
  margin: 2%;
  z-index: 4; 
}


/* ********************************* */
#title-broadcast {
  position: absolute;
  bottom: 0;
  left: 0;
  margin: 2%;
  z-index: 4; 
}


/* ********************************* */
#title-outdoor {
  position: absolute;
  top: 0;
  right: 0;
  margin: 2%;
  z-index: 4; 
}


/* ********************************* */
#title-online {
  position: absolute;
  top: 0;
  left: 0;
  margin: 2%;
  z-index: 4; 
}

              
            
!

JS

              
                // Custom Javascript


/* ******* GreenSock GSAP Animation ******* */
/* START Onload and on Resize Function */ // $(window).on('load resize', function () {
var tl = new TimelineMax().reverse();
var tlPrint = new TimelineMax().reverse();
var tlBroadcast = new TimelineMax().reverse();
var tlOutdoor = new TimelineMax().reverse();
var tlOnline = new TimelineMax().reverse();

var vw = $(window).width();
var vh = $(window).height();

var print = $("#print");
var broadcast = $("#broadcast");
var outdoor = $("#outdoor");
var online = $("#online");


var printLinkSpace = $("#printLinkSpace");
var broadcastLinkSpace = $("#broadcastLinkSpace");
var outdoorLinkSpace = $("#outdoorLinkSpace");
var onlineLinkSpace = $("#onlineLinkSpace");

var titlePrint = $('#title-print');
var titleBroadcast = $('#title-broadcast');
var titleOutdoor = $('#title-outdoor');
var titleOnline = $('#title-online');

var baseWprint = 700;
var baseHprint = 521;

var baseWbroadcast = 700;
var baseHbroadcast = 488;

var baseWoutdoor = 700;
var baseHoutdoor = 705;

var baseWonline = 700;
var baseHonline = 564;

// var space = 200;
var space = Math.min(vw * .35, vh * .35);
var ratio = 1;
 

// Add a media query

var mediaQuerySmall = window.matchMedia("(max-height: 200px)");
    if (mediaQuerySmall.matches) {      
      configScale = .22
    };

var mediaQueryMedium = window.matchMedia("(min-height: 201px) and (max-height: 400px)");
    if (mediaQueryMedium.matches) {      
      configScale = 0.45
    };

var mediaQueryLarge = window.matchMedia("(min-height: 401px) and (max-height: 50000px)");
    if (mediaQueryLarge.matches) {      
      configScale = 0.40
    };

TweenLite.set(print, {
  xPercent: -50,
  yPercent: -50,
  rotation: 15,
  scale: configScale
});

TweenLite.set(broadcast, {
  xPercent: -50,
  yPercent: -50,
  rotation: -15,
  scale: configScale
});

TweenLite.set(outdoor, {
  xPercent: -50,
  yPercent: -50,
  rotation: -15,
  scale: configScale
});

TweenLite.set(online, {
  xPercent: -50,
  yPercent: -50,
  rotation: 15,
  scale: configScale
});


resize();


print.click(function() {
  tlPrint.play();
});

broadcast.click(function() {
  tlBroadcast.play();
});

outdoor.click(function() {
  tlOutdoor.play();
});

online.click(function() {
  tlOnline.play();
});


$(window).resize(resize);

TweenLite.set(print, { autoAlpha: 1 });
TweenLite.set(broadcast, { autoAlpha: 1 });
TweenLite.set(outdoor, { autoAlpha: 1 });
TweenLite.set(online, { autoAlpha: 1 });

function resize() {
  
  vw = $(window).width();
  vh = $(window).height();
  
  var r1print = (vw - space) / baseWprint;
  var r2print = (vh - space) / baseHprint;
  
  var r1broadcast = (vw - space) / baseWbroadcast;
  var r2broadcast = (vh - space) / baseHbroadcast;

  var r1outdoor = (vw - space) / baseWoutdoor;
  var r2outdoor = (vh - space) / baseHoutdoor;

  var r1online = (vw - space) / baseWonline;
  var r2online = (vh - space) / baseHonline; 


  ratioPrint = Math.min(r1print, r2print);

  ratioBroadcast = Math.min(r1broadcast, r2broadcast);

  ratioOutdoor = Math.min(r1outdoor, r2outdoor);

  ratioOnline = Math.min(r1online, r2online);
   

  var progressPrint = tlPrint.progress();
  var reversedPrint = tlPrint.reversed();
  tlPrint.seek(0).clear();
  buildTimelinePrint(progressPrint, reversedPrint);

  var progressBroadcast = tlBroadcast.progress();
  var reversedBroadcast = tlBroadcast.reversed();
  tlBroadcast.seek(0).clear();
  buildTimelineBroadcast(progressBroadcast, reversedBroadcast);

  var progressOutdoor = tlOutdoor.progress();
  var reversedOutdoor = tlOutdoor.reversed();
  tlOutdoor.seek(0).clear();
  buildTimelineOutdoor(progressOutdoor, reversedOutdoor);

  var progressOnline = tlOnline.progress();
  var reversedOnline = tlOnline.reversed();
  tlOnline.seek(0).clear();
  buildTimelineOnline(progressOnline, reversedOnline);
}

/*
// Add a listener 
mediaQuerySmall.addListener(buildTimeline);
mediaQuerySmall2.addListener(buildTimeline);
mediaQueryMedium.addListener(buildTimeline);

buildTimeline(mediaQuerySmall);
buildTimeline(mediaQuerySmall2);
buildTimeline(mediaQueryMedium);
*/

/********* 01 Function Print ************/

function buildTimelinePrint(progressPrint, reversedPrint) {
  var x = -vw / 2;
  var y = -vh / 2;
  
  //Print Path Values - Center Image on Screen
  var valuesPrint = [
    { x: x, y: y },
    { x: x, y: 0 },
    { x: 0, y: 0 }
  ];

  var bezierPrint = {
    values: valuesPrint,
    type: "quadratic"
  };

           //Print Sub Path Values - to move other Nav Corners off screen 
            var valuesPrintSubPath = [
              { x: x, y: y },
              { x: x*-.5, y: y*-.5 },
              { x: x*-1, y: y*-1 }
            ];

            var bezierPrintSubPath = {
              values: valuesPrintSubPath,
              type: "quadratic"
            };


  TweenLite.set(print, {
    width:  baseWprint * ratioPrint,
    height: baseHprint * ratioPrint,
    x: x,
    y: y
  });


  tlPrint.to(print, 1, { bezier: bezierPrint, scale: 1, rotation: 0, force3D: true }, 0)
         .to(printLinkSpace, .25, { opacity:0, display:"none" }, 0)
         .to(broadcast, 1, { bezier: bezierPrintSubPath, scale: .25, rotation: 0, opacity:0, display:"none", force3D: true }, 0)  
         .to(outdoor, 1, { bezier: bezierPrintSubPath, scale: .25, rotation: 0, opacity:0, display:"none", force3D: true }, 0)
         .to(online, 1, { bezier: bezierPrintSubPath, scale: .25, rotation: 0, opacity:0, display:"none", force3D: true }, 0)
         .progress(progressPrint || 0)
         .reversed(reversedPrint || false); 
}



/********* 02 Function Broadcast ************/

function buildTimelineBroadcast(progressBroadcast, reversedBroadcast) {
  var x = -vw / 2;
  var y = -vh / 2;
  

  //Broadcast Path Values - Center Image on Screen
  var valuesBroadcast = [
    { x: x, y: y },
    { x: x, y: 0 },
    { x: x*2, y: 0 }
  ];

  var bezierBroadcast = {
    values: valuesBroadcast,
    type: "quadratic"
  };

           //Broadcast Sub Path Values - to move other Nav Corners off screen 
            var valuesBroadcastSubPath = [
              { x: x, y: y },
              { x: x*1.5, y: 0 },
              { x: x*2, y: y*-1 }
            ];

            var bezierBroadcastSubPath = {
              values: valuesBroadcastSubPath,
              type: "quadratic"
            };


  TweenLite.set(broadcast, {
    width:  baseWbroadcast * ratioBroadcast,
    height: baseHbroadcast * ratioBroadcast,
    x: x,
    y: y
  });


  tlBroadcast.to(print, 1, { bezier: bezierBroadcastSubPath, scale: .25, rotation: 0, opacity:0, display:"none", force3D: true }, 0)
             .to(broadcast, 1, { bezier: bezierBroadcast, scale: 1, rotation: 0, force3D: true }, 0)
             .to(broadcastLinkSpace, .25, { opacity:0, display:"none" }, 0)  
             .to(outdoor, 1, { bezier: bezierBroadcastSubPath, scale: .25, rotation: 0, opacity:0, display:"none", force3D: true }, 0)
             .to(online, 1, { bezier: bezierBroadcastSubPath, scale: .25, rotation: 0, opacity:0, display:"none", force3D: true }, 0)
             .progress(progressBroadcast || 0)
             .reversed(reversedBroadcast || false);

}



/********* 03 Function Outdoor ************/

function buildTimelineOutdoor(progressOutdoor, reversedOutdoor) {
  var x = -vw / 2;
  var y = -vh / 2;
  

  //Outdoor Path Values - Center Image on Screen
  var valuesOutdoor = [
    { x: x, y: y },
    { x: x*.75, y: y },
    { x: 0, y: y*2 }
  ];

  var bezierOutdoor = {
    values: valuesOutdoor,
    type: "quadratic"
  };

           //Outdoor Sub Path Values - to move other Nav Corners off screen 
            var valuesOutdoorSubPath = [
              { x: x, y: y },
              { x: x*-.5, y: y*1 },
              { x: x*-1, y: y*2 }
            ];

            var bezierOutdoorSubPath = {
              values: valuesOutdoorSubPath,
              type: "quadratic"
            };


  TweenLite.set(outdoor, {
    width:  baseWoutdoor * ratioOutdoor,
    height: baseHoutdoor * ratioOutdoor,
    x: x,
    y: y
  });


  tlOutdoor.to(print, 1, { bezier: bezierOutdoorSubPath, scale: .25, rotation: 0, opacity:0, display:"none", force3D: true }, 0)
             .to(broadcast, 1, { bezier: bezierOutdoorSubPath, scale: .25, rotation: 0, opacity:0, display:"none", force3D: true }, 0)  
             .to(outdoor, 1, { bezier: bezierOutdoor, scale: 1, rotation: 0, force3D: true }, 0)
             .to(outdoorLinkSpace, .25, { opacity:0, display:"none" }, 0)
             .to(online, 1, { bezier: bezierOutdoorSubPath, scale: .25, rotation: 0, opacity:0, display:"none", force3D: true }, 0)
             .progress(progressOutdoor || 0)
             .reversed(reversedOutdoor || false); 

}


/********* 04 Function Online ************/

function buildTimelineOnline(progressOnline, reversedOnline) {
  var x = -vw / 2;
  var y = -vh / 2;
  

  //Online Path Values - Center Image on Screen
  var valuesOnline = [
    { x: x, y: y },
    { x: x*1.75, y: y },
    { x: x*2, y: y*2 }
  ];

  var bezierOnline = {
    values: valuesOnline,
    type: "quadratic"
  };

           //Online Sub Path Values - to move other Nav Corners off screen 
            var valuesOnlineSubPath = [
              { x: x, y: y },
              { x: x*1.5, y: y*1 },
              { x: x*2, y: y*2 }
            ];

            var bezierOnlineSubPath = {
              values: valuesOnlineSubPath,
              type: "quadratic"
            };


  TweenLite.set(online, {
    width:  baseWonline * ratioOnline,
    height: baseHonline * ratioOnline,
    x: x,
    y: y
  }); 

  tlOnline.to(print, 1, { bezier: bezierOnlineSubPath, scale: .25, rotation: 0, opacity:0, display:"none", force3D: true, }, 0)
             .to(broadcast, 1, { bezier: bezierOnlineSubPath, scale: .25, rotation: 0, opacity:0, display:"none", force3D: true }, 0)  
             .to(outdoor, 1, { bezier: bezierOnlineSubPath, scale: .25, rotation: 0, opacity:0, display:"none", force3D: true }, 0)
             .to(online, 1, { bezier: bezierOnline, scale: 1, rotation: 0, force3D: true }, 0)
             .to(onlineLinkSpace, .25, { opacity:0, display:"none" }, 0)
             .progress(progressOnline || 0)
             .reversed(reversedOnline || false); 
}
// }).resize(); /* END Onload and on Resize Function */ 






              
            
!
999px

Console