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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.


Designed by Peter Nowell @pnowelldesign for a tutorial in Net Magazine's summer 2015 issue. 


<a class="attachments-button" href="http://pnowell.com/s/Animating-Icon-Project-Files.zip">
  <svg class="attachments-icon" xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60" version="1.1">
    <title>attachments icon</title>
    <g class="document-container">
      <path id="document-background" d="M28.32 9.286L46.32 9.286 58.32 21.286 58.32 48.286 28.32 48.286 28.32 9.286Z" stroke="#FFFFFF" stroke-width="4" fill="#FFFFFF" />
      <path id="document-paper" d="M28.32 9.286L46.32 9.286 58.32 21.286 58.32 48.286 28.32 48.286 28.32 9.286Z" stroke="#4F92F0" fill="#FFFFFF" />
      <g class="document-lines" fill="#4F92F0">
        <rect id="text-line-5" x="33.82" y="39.786" width="6" height="1"/>
        <rect id="text-line-4" x="33.82" y="36.786" width="19" height="1"/>
        <rect id="text-line-3" x="33.82" y="33.786" width="16" height="1"/>
        <rect id="text-line-2" x="33.82" y="30.786" width="19" height="1"/>
        <rect id="text-line-1" x="33.82" y="27.786" width="16" height="1"/>
      <path id="paper-fold" d="M58.32 21.286L46.32 21.286 46.32 9.286" stroke="#4F92F0" fill="none"/>

    <g class="photo-2-container" fill="#FFFFFF">
      <rect id="photo-2-background" stroke="#FFFFFF" stroke-width="4" x="9.667" y="10.506" width="19" height="25" />
      <rect id="photo-2-border" stroke="#4F92F0" x="9.667" y="10.506" width="19" height="25" />

    <g class="photo-1-container" fill="#FFFFFF">
      <rect id="photo-1-background" stroke="#FFFFFF" stroke-width="4" x="2.569" y="34.297" width="25" height="19" />
      <rect id="photo-1-border" stroke="#4F92F0" x="2.602" y="34.208" width="25" height="19" />

  <span>Download Project Files</span>

<div class="zoom-button">Zoom</div>
              .attachments-icon {
  transition: all .4s ease;

/* Initial State */
.attachments-icon .document-container {
  transform-origin: 43.32px 28.79px;
  /* transform-origin: center center;
      Use Pixels instead for Firefox Bug */
  transform: translate(0,0) rotate(12deg);
  transition: all .4s ease;
.attachments-icon .photo-1-container {
  transform-origin: 15.1px 43.71px;
  transform: translate(0,0) rotate(-11deg);
  transition: all .4s ease;
.attachments-icon .photo-2-container {
  transform-origin: 19.17px 23.01px;
  transform: translate(0,0) rotate(-3deg);
  transition: all .4s ease;

/* Hover State */
.attachments-button:hover .document-container {
  transform: translate(-7.46px,1.56px) rotate(22deg);
.attachments-button:hover .photo-1-container {
  transform: translate(5.18px,-4.3px) rotate(-16deg);
.attachments-button:hover .photo-2-container {
  transform: translate(6.71px,5.16px) rotate(4deg);

/* Other Styling */
.attachments-button {
  width: 270px;
  height: 60px;
  padding: 12px 0;
  position: absolute;
  top: 50vh;
  left: 50vw;
  background: white;
  border-top: 1px solid #F0F0F0;
  border-bottom: 1px solid #F0F0F0;
  transform: translate(-50%,-50%) scale(1);
  transition: all .5s ease;
.attachments-button span {
  display: block;
  float: right;
  font-family: "Avenir", Arial, sans-serif;
  font-weight: 300;
  font-size: 19px;
  line-height: 65px;
  color: #5C6374;
.attachments-button:hover span {
  color: #4B89E2;
.attachments-button.zoom {
  transform: translate(-50%,-50%) scale(2);
.zoom-button {
  width: 84px;
  height: 36px;
  position: absolute;
  top: 80vh;
  left: 50vw;
  transform: translate(-50%,-50%);
  border-radius: 4px;
  font-family: "Avenir", Arial, sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 37px;
  text-align: center;
  color: #D8D8D8;
  background: white;
  border: 1px solid #D8D8D8;
  cursor: pointer;
.zoom-button:hover {
  border-color: #B3B3B3;
  color: #B3B3B3;
.attachments-button, .zoom-button {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
              function zoom() {

$('.zoom-button').click( zoom );
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................