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. 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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <div id="loading">
	<img src="http://kurokoroll.com/images/loading.svg">
</div>
<div id="container">
	<div class="contentWrap" id="image1">
		<div class="content">
			<h1>nature</h1>
			<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla posuere magna mi, ut interdum mauris facilisis non. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur a dolor feugiat, pellentesque tellus sed, maximus massa. Nulla sagittis condimentum eros, eget ornare nulla scelerisque et.</p>
		</div>
	</div>
	<div class="contentWrap" id="image2">
		<div class="content">
			<h1>flower</h1>
			<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla posuere magna mi, ut interdum mauris facilisis non. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur a dolor feugiat, pellentesque tellus sed, maximus massa. Nulla sagittis condimentum eros, eget ornare nulla scelerisque et.</p>
		</div>
	</div>
	<div class="contentWrap" id="image3">
		<div class="content">
			<h1>tree</h1>
			<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla posuere magna mi, ut interdum mauris facilisis non. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur a dolor feugiat, pellentesque tellus sed, maximus massa. Nulla sagittis condimentum eros, eget ornare nulla scelerisque et.</p>
		</div>
	</div>
	<div class="contentWrap" id="image4">
		<div class="content">
			<h1>bird</h1>
			<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla posuere magna mi, ut interdum mauris facilisis non. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur a dolor feugiat, pellentesque tellus sed, maximus massa. Nulla sagittis condimentum eros, eget ornare nulla scelerisque et.</p>
		</div>
	</div>
	<div class="contentWrap" id="image5">
		<div class="content">
			<h1>sea</h1>
			<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla posuere magna mi, ut interdum mauris facilisis non. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur a dolor feugiat, pellentesque tellus sed, maximus massa. Nulla sagittis condimentum eros, eget ornare nulla scelerisque et.</p>
		</div>
	</div>
	<div class="contentWrap" id="image6">
		<div class="content">
			<h1>mountain</h1>
			<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla posuere magna mi, ut interdum mauris facilisis non. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur a dolor feugiat, pellentesque tellus sed, maximus massa. Nulla sagittis condimentum eros, eget ornare nulla scelerisque et.</p>
		</div>
	</div>
</div>
              
            
!

CSS

              
                body{
  line-height: 1.75;
}
#loading{
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,1);
  display: flex;
  justify-content: center;
  z-index: 10;
  transition: .3s;
  opacity: 1;
  text-align: center;
}
#container{
  width: 100vw;
}
.contentWrap{
  position: relative;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}
.content{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 62%;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 20px rgba(0,0,0,.8);
}
.content h1{
  font-family: Arial;
  font-size: 4rem;
  font-weight: bold;
  margin-bottom: 5vw;
}
#image1{
  background: url(http://kurokoroll.com/images/image1.jpg) center center;
  background-size: cover;
}
#image2{
  background: url(http://kurokoroll.com/images/image2.jpg) center center;
  background-size: cover;
}
#image3{
  background: url(http://kurokoroll.com/images/image3.jpg) center center;
  background-size: cover;
}
#image4{
  background: url(http://kurokoroll.com/images/image4.jpg) center center;
  background-size: cover;
}
#image5{
  background: url(http://kurokoroll.com/images/image5.jpg) center center;
  background-size: cover;
}
#image6{
  background: url(http://kurokoroll.com/images/image6.jpg) center center;
  background-size: cover;
}
              
            
!

JS

              
                (function() {
	let begin = new Date(); //開始時刻 タイムスタンプの取得
	const loadingCotent = document.getElementById('loading'); //ローディング要素の取得
	const loadingTime = 1000; // フェードインの時間

	document.addEventListener('DOMContentLoaded', function(){
		//フェードアウトの処理
		let id = setInterval(function() {
			let current = new Date() - begin; //beginから現在の時間
			if (current > loadingTime) { //フェードインの時間を超えたら要素を消す
				clearInterval(id);
				current = loadingTime; //今の時間とフェードインの時間の差をなくす
				loadingCotent.style.display = "none"; //要素を消す
			}
			loadingCotent.style.opacity = 1 - (current / loadingTime) ; //割合に応じて透過していく
		}, 10); //100分の1秒間隔で繰り返し実行
	});
})();
              
            
!
999px

Console