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

              
                <main class="main-wrapper">
  <header class="header">
    <h1>Transitions Examples</h1>
  </header>
  <section class="transitions">
    <article class="transitions__translate">
      <h2>Translate</h2>
      <figure></figure>
    </article>
    <article class="transitions__rotate">
      <h2>Rotate</h2>
      <figure></figure>
    </article>
    <article class="transitions__scale">
      <h2>Scale</h2>
      <figure></figure>
    </article>
    <article class="transitions__skew">
      <h2>Skew</h2>
      <figure></figure>
    </article>
    <article class="transitions__matrix">
      <h2>Matrix</h2>
      <figure></figure>
    </article>
    <article class="transitions__backface">
      <h2>Backface Visibility</h2>
      <div class="card-wrapper">
        <figure class="card">
          <div class="front"></div>
          <div class="back"></div>
        </figure>
      </div>
    </article>
  </section>
</main>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

:root {
    --soft-white: #F4F9F9;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    font-size: 62.5%;
}
body {
    font-family: 'Roboto', sans-serif;
}
.main-wrapper {
    width: 100%;
    height: 100vh;
    display: grid;
    grid-template-rows: 60px 1fr;
    place-items: center;
    background-image: linear-gradient(15deg, #13547a 0%, #80d0c7 100%);
    background-repeat: no-repeat;
    color: var(--soft-white);
}
.header h1 {
    font-size: 2.8rem;
    line-height: 3rem;
}
.transitions {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template: repeat(2, 1fr) / repeat(3, 1fr);
}
.transitions > article {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: 1fr 3fr;
    place-items: center;
}
.transitions > article > h2 {
    font-size: 1.8rem;
    line-height: 2rem;
}
.transitions > article > figure {
    width: 150px;
    height: 150px;
    border-radius: 8px;
    transition: transform .3s linear;
    align-self: start;
}
.transitions__translate figure {
    background-image: linear-gradient(120deg, #f6d365 0%, #fda085 100%);
    background-repeat: no-repeat;
}
.transitions__translate figure:hover {
    transform: translate(60px, 40px);
}
.transitions__rotate figure {
    background-image: linear-gradient(45deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%);
    background-repeat: no-repeat;
}
.transitions__rotate figure:hover {
    transform: rotate(60deg);
}
.transitions__scale figure {
    background-image: linear-gradient(to right, #f78ca0 0%, #f9748f 19%, #fd868c 60%, #fe9a8b 100%);
    background-repeat: no-repeat;
}
.transitions__scale figure:hover {
    transform: scale(1.3);
}
.transitions__skew figure {
    background-image: linear-gradient(120deg, #f093fb 0%, #f5576c 100%);
    background-repeat: no-repeat;
}
.transitions__skew figure:hover {
    transform: skew(20deg, 10deg);
}
.transitions__matrix figure {
    background-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-repeat: no-repeat;
}
.transitions__matrix figure:hover {
    transform: matrix(1.09, 1.17, -0.35, 1.97, 200, -200);
}
.transitions__backface .card-wrapper {
    perspective: 1000px;
    align-self: start;
}
.transitions__backface .card-wrapper .card {
    width: 150px;
    height: 150px;
    position: relative;
    transition: transform .5s linear;
    transform-style: preserve-3d;
}
.transitions__backface .card-wrapper .card .front,
.transitions__backface .card-wrapper .card .back {
    width: 100%;
    height: 100%;
    position: absolute;
    border-radius: 8px;
}
.transitions__backface .card-wrapper .card .front {
    z-index: 2;
    background-image: linear-gradient(to right, #ff758c 0%, #ff7eb3 100%);
    background-repeat: no-repeat;
    backface-visibility: hidden;
}
.transitions__backface .card-wrapper .card .back {
    z-index: 1;
    background-image: linear-gradient(60deg, #29323c 0%, #485563 100%);
    background-repeat: no-repeat;
    transform: rotateY(180deg);
}
.transitions__backface .card-wrapper:hover .card {
    transform: rotateY(-180deg);
}
              
            
!

JS

              
                
              
            
!
999px

Console