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

              
                <div class="wrap">
	<div class="top">
		<h1>ScrollMagic Demo</h1>
		<p>스크롤매직 라이브러리 데모입니다.<br/><a href="http://scrollmagic.io/examples/" target="_blank">여기</a>에서 더 많은 예시를 확인할 수 있습니다.</p>
	</div>
	<div class="main">
		<div class="textWrap">
		<h2>What a wonderful!</h2>
			<p class="text">Dolore occaecat cupidatat nostrud voluptate officia anim culpa minim in eiusmod eiusmod in. Esse magna excepteur est eiusmod excepteur laborum amet esse sint sit velit cupidatat excepteur. Aliquip magna dolore quis in tempor ipsum. Ad nostrud cupidatat ut do exercitation nulla ipsum culpa. Dolor laboris sunt voluptate nostrud. Cupidatat non sint est proident pariatur nulla. Aliqua reprehenderit ad do in ut deserunt sit.</p>
<p class="text">Amet aliquip incididunt exercitation et consequat sint laborum nulla. Excepteur qui ut cillum eu quis irure elit proident deserunt eiusmod consectetur. Amet occaecat et ex in dolore velit esse occaecat fugiat id et.</p>
		</div>
		<div class="iconWrap">
		<div class="spacer"></div>
		<div class="trigger" id="trigger1">Trigger (1)</div>
		<div class="icon-back">
			<p id="animate1" class="icon">♥︎</p>
		</div>
		<div class="trigger" id="trigger2">Trigger (2)</div>
		<div class="icon-back">
			<p id="animate2" class="icon">★</p>
		</div>
		<div class="trigger" id="trigger3">Trigger (3)</div>
		<div class="icon-back">
			<p id="animate3" class="icon">✿</p>
		</div>
	</div>
	<div class="footer"><a href="https://nykim.work">nykim.work</a></div>
		<div class="fixed">
			<p class="info1">one</p>
			<p class="info2">two</p>
			<p class="info3">three</p>
		</div>
</div>
              
            
!

CSS

              
                * {
	margin: 0;
	padding: 0;
	font-family: monospace;
}

body {

	background-color: #f8f8f8;
}

.top {
	padding: 120px 50px;
	border-bottom: 1px solid #e0e0e0;
	background-color: #fff;
	
	h1 {
		font-size: 70px;
	}
	
	p {
		margin-top: 8px;
		font-size: 15px;
		line-height: 140%;
	}
}

.main {
	margin-top: 120px;
	
	h2 {
		font-size: 30px;
		margin-bottom: 20px;
		letter-spacing: 2px;
	}
	
	.textWrap {
		padding-bottom: 30px;
		border-bottom: 1px solid #aaa;
	padding: 0 50px;
	}
	
	.spacer {
		height: 150px;
	}
	
	.text {
		font-size: 14px;
		margin-bottom: 10px;
		line-height: 140%;
		
	}
	
	.iconWrap {
		// display: flex;
		// flex-wrap: wrap;
	}
	
	.icon-back {
		width: 70%;
		height: 300px;
		border: 1px solid #999;
		background: #fff;
		margin: 40px auto 70px;
		display: flex;
		justify-content: center;
		align-items: center;
	}
	
	.icon {
		font-size: 45px;
		color: #dddddd;
	}
}

.trigger {
	width: auto;
	height: auto;
	font-weight: bold;
	margin-left: 50px;
	margin-right: 50px;
	font-size: 20px;
	background-color: #e0e0e0;
}

.footer {
	margin-top: 240px;
	padding: 0 50px;
	height: 40px;
	background-color: #222;
	
	a {
		display: block;
		line-height: 40px;
		font-family: monospace;
		letter-spacing: 1px;
		text-align: right;
		color: #fff;
	}
}

.fixed {
	position: fixed;
	top: 0;
	left: 0;
	background: #fff;
	border: 1px solid #aaa;
	padding: 20px;
	box-shadow: 3px 4px 12px -3px #aaa;
	
	.active {
		color: red;
		font-weight: bold;
		font-size: 20px;
	}
}

// .scene-1-active {
// 	background-color: #a9e7e0;
// }


// .scene-2-active {
// 	background-color: #f4e98b;
// }


// .scene-3-active {
// 	background-color: #a699bc;
// }
              
            
!

JS

              
                (function () {

  var controller = new ScrollMagic.Controller({globalSceneOptions: {duration: 436}});

  var tween1 = TweenMax.to('#animate1', 0.3, {
    color: "#60c5ba",
    scale: 4,
		y: 10,
    rotation: 360
  });
	
  var tween2 = TweenMax.to('#animate2', 0.3, {
    color: "#ffc952",
    scale: 4,
		y: 10,
    rotation: 360
  });
	
  var tween3 = TweenMax.to('#animate3', 0.3, {
    color: "#6a60a9",
    scale: 4,
		y: 10,
    rotation: 360
  });

  var scene1 = new ScrollMagic.Scene({
      triggerElement: "#trigger1"
		
    })
  	.setClassToggle('.info1', 'active')
    .setTween(tween1)
    .addTo(controller)
    .addIndicators({
      name: "1"
   });
	
	
  var scene2 = new ScrollMagic.Scene({
      triggerElement: "#trigger2"
    })
  	.setClassToggle('.info2', 'active')
    .setTween(tween2)
    .addTo(controller)
    .addIndicators({
      name: "2"
   });

  var scene3 = new ScrollMagic.Scene({
      triggerElement: "#trigger3"
    })
  	.setClassToggle('.info3', 'active')
    .setTween(tween3)
    .addTo(controller)
    .addIndicators({
      name: "3"
   });

}())
              
            
!
999px

Console