Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <!-- 
  The original JS version is here, https://content.ameba.jp/blogoftheyear/2019/
  © CyberAgent, Inc

  Forked from https://codepen.io/herablog/pen/dygjeQE
-->

<div class="warning">
	<p>⚠️ Your browser does not support CSS Scroll-Driven Animations with <code>scroll-timeline</code>. Please use Chrome 115+ to check out this demo.</p>
</div>

<div class="header__title">
  <h1 class="header__logo">
    <img class="header__logoBalloon" src="https://content.ameba.jp/blogoftheyear/2019/logo-balloon.a5c92776.svg" alt="BLOG of the year 2019"><img class="header__logoAbemakun" src="https://content.ameba.jp/blogoftheyear/2019/logo-abemakun.4326b3ad.svg" alt="">      
  </h1>
</div>
<main>
  <section class="winner">
    <header>
      <img src="https://content.ameba.jp/blogoftheyear/2019/title-excellence.ad99c28c.svg" width="195" height="100" alt="優秀賞" />
    </header>
    <img class="photo" src="https://content.ameba.jp/blogoftheyear/2019/main-l.2decfb32.jpg" width="596" height="596" />
    <img class="photo" src="https://content.ameba.jp/blogoftheyear/2019/sub-l.bd653989.jpg" width="368" height="553" />
  </section>
</main>
<div class="point point-green"></div>
<div class="point point-gold"></div>
<div class="point point-circle"></div>
              
            
!

CSS

              
                body {
  background-color: #f7f7f8;
}

.header__title {
  height: 100vh;
  position: relative;
  
  & .header__logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    margin: 0;
    height: 100vh;
  
    & img {
      width: 266px;
    }
  }
}

.winner {
  padding: 0 16px;
  margin-bottom: 1000px;
  position: relative;
  
  & header {
    margin-bottom: 56px;
  }
  
  & .photo {
    border-radius: 30px;
    animation: reveal ease-out;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }
  
  & .photo:nth-of-type(2) {
    position: absolute;
    left: 45%;
    top: 70%;
  }
}

.point {
  z-index: -1;
  animation: move ease-in-out;
  animation-timeline: scroll(root block);
  
  &.point-green {
    width: 30px;
    height: 30px;
    background: green;
    position: fixed;
    top: 30%;
    left: 20%;
    border-radius: 50%;
  }
  
  &.point-gold {
    width: 35px;
    height: 35px;
    background: rgb(140,129,42);
    position: fixed;
    top: 40%;
    left: 85%;
    border-radius: 50%;
  }
  
  &.point-circle {
    width: 50px;
    height: 50px;
    border: 5px solid rgb(140,129,42);
    position: fixed;
    top: 70%;
    left: 10%;
    border-radius: 50%;
  }
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(48px); }
  50% { transform: translateY(0); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes move {
  from { transform: translateY(0); }
  to { transform: translateY(-5vh); }
}

/* Show warning for browsers without support */
.warning {
	border: 1px solid black;
	z-index: 9999;
	color: black;
	background: rgba(255 255 225 / 0.9);
	z-index: 1;

	position: fixed;
	bottom: 1em;
	left: 1em;
	right: 1em;
	text-align: center;
}

.warning p {
	margin: 1em 0;
}

/* Hide warning when native view-timeline support detected */
@supports (scroll-timeline: --works) {
	.warning {
		display: none;
	}
}

              
            
!

JS

              
                
              
            
!
999px

Console