Pen Settings



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


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


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.


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.


                <div class="example">
  <h1 class="title">아래로 스크롤 <span class="arrow">👇</span></h1>
  <div class="box"></div>
  <div class="box"></div>
  <div class="box"></div>
  <div class="box"></div>
  <div class="box"></div>


                .example {
  padding-top: 800px;
  padding-bottom: 300px;
  width: 100%;
  position: relative;

.title {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);

.arrow {
  display: inline-block;
  animation: bounce 1s infinite ease;

.box {
  margin: 0 auto 200px auto;
  width: 100px;
  height: 100px;
  border-radius: 5px;
  background: red;
} {
  background: #00FA9A;
  animation: shake 0.5s;
  animation-iteration-count: infinite;

@keyframes shake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-1deg); }
  20% { transform: translate(-3px, 0px) rotate(1deg); }
  30% { transform: translate(3px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(-3px, 1px) rotate(0deg); }
  70% { transform: translate(3px, 1px) rotate(-1deg); }
  80% { transform: translate(-1px, -1px) rotate(1deg); }
  90% { transform: translate(1px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }


                // 해당 요소가 viewport 내에 있는지 확인
// 참고:
function checkViewport(el) {
  let box = el.getBoundingClientRect();
  return ( >= 0 &&
      box.left >= 0 &&
      box.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
      box.right <= (window.innerWidth || document.documentElement.clientWidth)

// scroll 이벤트를 추가하고, 해당 element에 callback 함수를 등록 
const addScrollEvent = (elList) => {
  document.addEventListener('scroll', () => {
  	elList.forEach(el => {
    	if (checkViewport(el)) {
      } else {

// 동작시킬 elements리스트에 스크롤 이벤트 등록
const boxList = document.querySelectorAll('.box');