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

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

              
                <head>
  <link href="https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&family=ZCOOL+XiaoWei&display=swap" rel="stylesheet">
  
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.css">
	<script src="https://kit.fontawesome.com/a076d05399.js"></script>
</head>

<div class="main">
  <section class="section section-top js-section" data-section-name="section1">
    <div class="section-content">
      <h2 class="toph2">红糖珍珠奶茶</h2>
      <p>蓬松的奶油包子</p>
    </div>
  </section>
  <section class="section section-2 js-section" data-section-name="section2">
    <div class="section-content">
      <h2>草莓和覆盆子</h2>
      <div class="l-multicolumn l-3column">
				<section class="l-column">
					<header>
						
						<h3 class="section-item-title" animation="fadeInUp">树莓</h3>
					</header>
          <img class="section-item-symbol" animation="fadeInUp" src="https://images.unsplash.com/photo-1593461802389-d57d73a36913?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=60">
					<p class="section-item-description" animation="fadeInUp">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><br>
          
				</section>
				<section class="l-column">
					<header>
						<br>
						<h3 animation="fadeInUp">草莓子</h3>
					</header>
          <img class="section-item-symbol" animation="fadeInUp" src="https://images.unsplash.com/photo-1519180392711-496e450edf6a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=60">
					<p class="section-item-description" animation="fadeInUp">Lorem ipsum turpis massa sed elementum tempus. Enim nec dui nunc mattis.</p><br>
        </section>
				<section class="l-column">
					<header>
						<br>
						<h3 animation="fadeInUp">浆果</h3>
					</header>
					
          <img class="section-item-symbol" animation="fadeInUp" src="https://images.unsplash.com/photo-1516659828014-fb21a5bd8ca3?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1250&q=80">
					<p class="section-item-description" animation="fadeInUp">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><br><br>
				</section>
			</div>
    </div>
  </section>
  <section class="section section-3 js-section" data-section-name="section3">
    <div class="section-content" >
      <div class="l-multicolumn l-2column">
				<section class="l-column">
					<header animation="fadeInUp">
						<h2>蜂蜜拿铁</h2>
						<h3 class="section-item-title">Product</h3>
					</header>
					<p class="section-item-description" animation="fadeInUp">他们所有的设备和仪器彷佛都是有生命的。Lorem ipsum dolor sit amet, 蓬松的奶油包子. 蓬松的奶油包子。他们所有的设备和仪器彷佛都是有生命的!
					</p>
				</section>
				<section class="l-column">
					<header></header>
						<img class="section-item-symbol-3" animation="fadeInDown" src="https://images.unsplash.com/photo-1471943311424-646960669fbc?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=60" alt="honey">
					
				</section>
				
			</div>
    </div>
  </section>
   <section class="section section-4 js-section" data-section-name="section4">
     <div class="section-content" >
      <div class="l-multicolumn l-2column">
				<section class="l-column">
					<header animation="fadeInUp">
						<h2>绿牡丹</h2>
						<h3 class="section-item-title">Looks like a cake!<br>but Don't eat peony</h3>
					</header>
					<p class="section-item-description" animation="fadeInUp">他们所有的设备和仪器彷佛都是有生命的。Lorem ipsum dolor sit amet, 蓬松的奶油包子. 蓬松的奶油包子。他们所有的设备和仪器彷佛都是有生命的!
					</p>
				</section>
				<section class="l-column">
					<header></header>
						<img class="section-item-symbol-3" animation="fadeInDown" src="https://images.unsplash.com/photo-1587055579750-4d1164707e1c?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=60" alt="peony">
					
				</section>
				
			</div>
    </div>
  </section>
     
   <section class="section section-5 js-section" data-section-name="section5">
     <div class="section-content" >
      <div class="l-multicolumn l-2column">
				<section class="l-column">
					<header animation="fadeInUp">
						<h2>杏子</h2>
						<h3 class="section-item-title">Almond</h3>
					</header>
					<p class="section-item-description" animation="fadeInUp">他们所有的设备和仪器彷佛都是有生命的。Lorem ipsum dolor sit amet, 蓬松的奶油包子. 蓬松的奶油包子。他们所有的设备和仪器彷佛都是有生命的!
					</p>
				</section>
				<section class="l-column">
					<header></header>
						<img class="section-item-symbol-3" animation="fadeInDown" src="https://images.unsplash.com/photo-1548907040-4baa42d10919?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=60" alt="almond">
					
				</section>
				
			</div>
    </div>
  </section>
  <ul class="pager" id="js-pager"></ul>
</div>
              
            
!

CSS

              
                .main {
  position: relative;
}

.pager {
  position: fixed;
  top: 50%;
  left: 0;
  /*right: 0;*/
  transform: translateY(-50%);
  padding: 0;
}
.pager li {
  display: block;
  margin: 20px;
}
.pager li a {
  display: block;
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
}
.pager .is-current a {
  background: #e95388;
}

/* section */
.section {
  width: 100%;
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.section.is-show .section-content {
  opacity: 1;
}
.invisible {
	visibility: hidden;
}
.section-content {
  margin: 0 auto;
  padding: 40px 60px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.5s ease 0.75s;
}
.section-item-symbol {
  height: 150px;
}
.section-item-symbol-3 {
  height: 300px;
}

.l-2column {
	padding: inherit;
  display: flex;
  flex-direction: row;
  
}
.l-2column > .l-column {
	padding: 0 50px;
}
@media(max-width: 800px){
  .section-content {
    padding: 20px;
  }
  .l-2column > .l-column {
	padding: 10px;
}
.section-item-symbol-3{
    padding-top: 50px;
  }
}

h2 {
  font-family: 'Ma Shan Zheng', cursive;
  color: #F1E3F3;
  font-size: 50px;
  
}
.toph2{
  color: #fff;
  margin-top: 20vh;
}

h3 {
  font-family: 'ZCOOL XiaoWei', serif;
  color: #ffe4c4;/*文字色*/
}

p {
  letter-spacing: 1px;
  color: #fff;
  font-family: 'ZCOOL XiaoWei', serif;
}
.section-item-description{
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
  color: #eee;
  font-size: 14px;
}
.section-top {
  background-color: rgb(70,66,69);
}

.section-2 {
  background-color: rgb(173,50,43);
}

.section-3 {
  background-color: rgb(200,112,70);
}
.section-4{
  background-color: rgb(85,113,73);
}
.section-5{
  background-color: rgb(73,52,61);
}
i{
  font-size: 30px;
  text-align: center;
  color: #F1E3F3;
}

              
            
!

JS

              
                var $section = $('.js-section'); // slides
var $pager = $('#js-pager'); // pager

// scrollifyのオプション設定
var option = {
  section : '.js-section',
  easing: "swing",
  scrollSpeed: 600,
  scrollbars: true,
  before:function(index, section) {
    setCurrent(index); // 現在のsectionにクラスを設定
    pagerCurrent(index); // ページャーに対応する順番にクラス名を付与
  },
  afterRender:function() {
    createPager(); // ページャーの作成
    setCurrent(); // 現在のsectionにクラスを設定
  }
};

$(function() {
  $.scrollify(option); // scrollifyの実行
});



// ==============================
// functions
// ------------------------------

// set a class to the current section
function setCurrent(index = 0) {
  // remove all classes
  $section.removeClass('is-show');
  // add a class to current class only
  $section.eq(index).addClass('is-show');
}

// add class to each index
function pagerCurrent(index = 0) {
  var $li = $pager.find('li');
  $li.removeClass('is-current');
  $li.eq(index).addClass('is-current');
}

// create pager
function createPager() {
  $section.each(function(i, e){
    // create link in pages
    var sectionName = $(e).attr('data-section-name');
    // add class to the first li
    var addClass = '';
    if (i === 0) {
        addClass = 'is-current';
    }
    // create HTML of li
    var html = '';
    html += '<li class="' + addClass + '">';
    html += '<a href="#' + sectionName + '"></a>';
    html += '</li>';
    $pager.append(html);
  });
  
  pagerLink();
}

// scroll when tag 'a' of the pager was clicked
function pagerLink () {
  $pager.find('a').on('click', function() {
    $.scrollify.move($(this).attr("href"));
  });
}

//2用:アニメーション属性を持つ要素を非表示、animated属性を追加
$('*[animation]').addClass('invisible animated');

$(window).scroll(function () {
	$('*[animation]').each(function () {
    //アニメーションをさせる要素の上の位置
		var imgPos = $(this).offset().top;
    //ウインドウ上部の位置
		var scroll = $(window).scrollTop();
    //アニメーションを発火させる位置
		var position = imgPos - window.innerHeight + window.innerHeight / 5;

    //animation属性に記載されたアニメーション名を取得
    if (this.hasAttribute('animation')) {
        var animation = this.getAttribute('animation');
    }
    //発火位置まで来たら要素を表示し、アニメーションをclass名に追加
    if (scroll > position) {
			$(this).removeClass('invisible').addClass(animation);
		}
    //ページのトップまでスクロールしたら要素を非表示(リセット)
		if (scroll < 10) {
			$(this).removeClass(animation).addClass('invisible');
		}
	});
});
              
            
!
999px

Console