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=Sacramento&display=swap" rel="stylesheet">
  <link href="https://fonts.googleapis.com/css2?family=Playfair+Display&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">Doughnuts Shop</h2>
      <p>Lorem ipsum dolor sit amet!</p>
    </div>
  </section>
  <section class="section section-2 js-section" data-section-name="section2">
    <div class="section-content">
      <div class="l-multicolumn l-3column">
				<section class="l-column">
					<header>
						<i class="fas fa-seedling" animation="fadeInUp"></i>
						<h3 class="section-item-title" animation="fadeInUp">Fresh</h3>
					</header>
          <img class="section-item-symbol" animation="fadeInUp" src="https://images.unsplash.com/flagged/photo-1561668038-2742fcef75d7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1500&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>
          
				</section>
				<section class="l-column">
					<header>
						<i class="fas fa-heart" animation="fadeInUp"></i>
						<h3 animation="fadeInUp">Local</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>
						<i class="fas fa-cookie-bite" animation="fadeInUp"></i>
						<h3 animation="fadeInUp">Artisan</h3>
					</header>
					
          <img class="section-item-symbol" animation="fadeInUp" src="https://images.unsplash.com/photo-1532635224-cf024e66d122?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><br>
				</section>
			</div>
    </div>
  </section>
  <section class="section section-3 js-section" data-section-name="section3">
    <div class="section-content" style="margin: 0; max-width: 250px;">
      <h2>About This Example</h2>
      <p >Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolor reprehenderit, labore nostrum hic. Natus hic corporis, delectus vero voluptatem maxime voluptate tempora expedita quo iure atque vitae deserunt culpa quibusdam!</p>
    </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 {
  max-width: 300px;
  margin: 0 auto;
  padding: 40px 60px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.5s ease 0.75s;
}
.section-item-symbol {
  height: 150px;
}

h2 {
  font-family: 'Sacramento', cursive;
  color: #6c3524;
  font-size: 50px;
  
}
.toph2{
  color: #fff;
  margin-top: 20vh;
}

h3 {
  font-family: 'Playfair Display', serif;
  color: #6c3524;/*文字色*/
}

p {
  letter-spacing: 1px;
  color: #fff;
}
.section-item-description{
  color: #232323;
  font-size: 14px;
}
.section-top {
  background-image: url('https://images.unsplash.com/photo-1516919549054-e08258825f80?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=60');
}

.section-2 {
  background-color: #92dddd;
}

.section-3 {
  background-image: url('https://images.unsplash.com/photo-1535568824865-a801351e8483?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=60');
}

i{
  font-size: 30px;
  text-align: center;
  color: #F1E3F3;
}

              
            
!

JS

              
                var $section = $('.js-section'); // 各スライド
var $pager = $('#js-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
// ------------------------------

// 現在のsectionにクラスを設定
function setCurrent(index = 0) {
  // 一旦、すべてのsectionのクラスをとる
  $section.removeClass('is-show');
  // 現在のsectionのみにクラスを付与
  $section.eq(index).addClass('is-show');
}

// ページャーに対応する順番にクラス名を付与
function pagerCurrent(index = 0) {
  var $li = $pager.find('li');
  $li.removeClass('is-current');
  $li.eq(index).addClass('is-current');
}

// ページャーの作成
function createPager() {
  $section.each(function(i, e){
    // ページ内リンク先の作成
    var sectionName = $(e).attr('data-section-name');
    // 最初のliにはクラスを付与
    var addClass = '';
    if (i === 0) {
        addClass = 'is-current';
    }
    // liのHTML作成
    var html = '';
    html += '<li class="' + addClass + '">';
    html += '<a href="#' + sectionName + '"></a>';
    html += '</li>';
    $pager.append(html);
  });
  
  pagerLink();
}

// ページャーでaタグをクリックされたらスクロールする
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