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


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.


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.


                <div class="top">0</div>

<div class="character"></div>
<div class="road">
	<div class="container road1">START</div>
	<div class="container road2">RUN</div>
	<div class="container road3">RUN</div>
	<div class="container road4">RUN</div>
	<div class="container road5">RUN</div>
	<div class="container road6">RUN</div>
	<div class="container road7">RUN</div>
	<div class="container road8">RUN</div>
	<div class="container road9">RUN</div>
	<div class="container road10">RUN</div>


                * {margin:0; padding:0;}
li {list-style: none;}
a {text-decoration: none;}

.top {position:fixed; left: 10px; top: 10px; background:rgba(0,0,0,0.5); z-index:99999; padding:20px; color: #fff; }

.character {
	width:155px; height: 176px;
	background-image: url(;
	position: fixed; left: 50%; margin-left: -78px; bottom:0; z-index:10;
.character.left {
	background-image: url(;
	background-position: 0px;

.character.walking {
	animation: walk 0.6s steps(10,start) infinite;
@keyframes walk {
	from {background-position: 0px 0px}
	to {background-position: 1550px 0px}

.road {overflow: hidden; position: fixed; height: 100vh; width: 15000px; }
.road > div {width: 1500px;}
.container { float: left; height: 100vh; line-height: 100vh; text-align: center; width: 1500px; position: relative; font-size: 70px; color:#fff; }
.road1 {background-color: #00a79d; }
.road2 {background-color: #00a79d; }
.road3 {background-color: #00a79d; }
.road4 {background-color: #00a79d; }
.road5 {background-color: #00a79d; }
.road6 {background-color: #00a79d; }
.road7 {background-color: #00a79d; }
.road8 {background-color: #00a79d; }
.road9 {background-color: #00a79d; }
.road10 {background-color: #00a79d; }


                var lastScrollTop = 0;								//마지막 상태의 스크롤 변수에 할당
var roadLength = $(".road").width();	//전체 가로 값 : 15000px

	var wWidth = $(window).width();			//현재 화면의 가로 값
	var wHeight = $(window).height();		//현재 화면의 세로 값
	var scrollTop = $(window).scrollTop(); 		//현재 화면의 스크롤 값
	var dHeight = $("body").height() - wHeight;		//전체 세로 값 - 현재 화면의 세로 값
	var wRoad = roadLength - wWidth;							//전체 가로 값 - 현재 화면의 가로 값
	var step = wRoad/dHeight;											// 전체 가로 값 / 전체 세로 값
	var goLeft = scrollTop * step;		
	$(".road").css({ "transform":"translateX(-"+ goLeft +"px)" });
	$.data(this, "scrollCheck", setTimeout(function(){
	if(scrollTop > lastScrollTop){
	}else {
	lastScrollTop = scrollTop;
  if(scrollTop = 100){

		if(e.which == 39){
			var scrollTop = $(document).scrollTop();
		if(e.which == 37){
			var scrollTop = $(document).scrollTop();