123

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <body>
	<div class="container">
		<h1>La perspective</h1>
			<div class="silver">
			</div>
			<div class="purple">
			</div>
		
	<h1>La translation</h1>
		<div class="bloc">
			<img src="http://lorempixel.com/400/200/sports/1" alt="image" class="blue"/>
		</div>
		<div class="bloc">
						<img src="http://lorempixel.com/400/200/sports/2" alt="image" class="red"/>
		</div>
		<h1>Modifier l'échelle</h1>
		<div class="bloc">
			<p>Suivant Z, rien ne change, si tu as la solution?</p>
			<img src="http://lorempixel.com/400/200/sports/3" alt="image" class="pink"/>
		</div>
		
		<h1>La rotation 3D</h1>
		<div class="bloc">
						<img src="http://lorempixel.com/400/200/sports/3" alt="image" class="orange"/>
		</div>
		<!-- Application des rotations 3D -->
				<h1>Application des rotations 3D</h1>
			<div class="container2">
        <div class="front">
          <img src="http://lorempixel.com/400/200/sports/2" alt="image" class="recto"/>
          <h2>Bodyboard</h2>
        </div>
				<div class="back">
          <p>Le bodyboard est parfois considéré comme le premier pas vers la pratique du surf. La plupart des gens prennent leur première vague en bodyboard lors de vacances exotiques, alors que les adeptes considèrent la discipline comme un sport à part entière, dans lequel les vagues servent de tremplin pour exécuter toutes sortes de figures. Vous voulez savoir comment faire du bodyboard ?</p>
        </div>

			</div>
	</div> <!-- /container -->
</body>
            
          
!
            
              .container{
	perspective:200px;
	perspective-origin:100px 200px;
	margin:50px auto;
}
.silver{
	background: silver;
	width:100px;
	height:100px;
}

.purple{
	background: purple;
	width:100px;
	height:100px;
}
.silver:hover{
	transform:translate3d(100px,50px,-100px)
}

.bloc{
	margin:20px auto;
}

.blue{
	border:blue 5px solid;
}

.blue:hover{
	transform: translate3d(100px, 100px, -100px);
}

.red{
	border:red solid 5px;
}

.red:hover{
	transform: translate3d(50px, 10px, 20px);
}


.pink{
	border: 5px solid pink;
}

.orange{
	border: 5px solid orange;

}

.pink:hover{
	transform: scale3d(1,1,2);

}

.orange:hover{

	transform:rotate3d(10, 20,30, 25deg);
}

/* Application des rotations 3D*/

.container2{
  perspective: 1200px;
  perspective-origin: top right;

  position: relative;

  background-color: #E53;
  height:300px;
  width:500px;
  border: solid 5px #5E5;
  border-radius:10px;

}

.front{
  width:400px;
  height:200px;

  z-index: 10;
  position:absolute;
  top: 10px;
  left: 50px;
  text-align: center;
  background-color: #5E5;
}

.front, .back, img{
  border-radius:10px;
}

.back{
  width:400px;
  height:200px;
  background-color: #0f6;

  position:absolute;
  top: 10px;
  left: 50px;
  z-index:5;

  transform:rotate3d(0,1,0,-180deg);
  text-align: justify;
}

p{
  margin:10px;
}

@keyframes rotation-front{

  from{
    /* Etat initial, pas de condition particulière*/
  }

  to{
    transform: rotate3d(0,1,0,180deg);
  }

}

@keyframes rotation-back{

  from{
    /* Etat initial, pas de condition particulière*/

  }

  to{
    transform: rotate3d(0,1,0,0deg);
  }

}
.front:hover{

  animation: rotation-front 2s; /* Appelle l'animation de la face avant*/
  animation-fill-mode:forwards; /* reste sur la dernière position */
  backface-visibility:hidden;/* Permet de masquer le h1 lorsque celui ci est retourné */

}

.front:hover + .back{
  animation: rotation-back 2s; /* Appelle l'animation de la face arrière*/
  animation-fill-mode:forwards;/* reste sur la dernière position */

}

            
          
!
999px
🕑 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.

Console