Code Monkey home page Code Monkey logo

parallax-scroll-web's Introduction

Parallax-scroll-web

程式簡介

簡述

  • 透過 HTML、CSS 實作 Parallax-Scrolling( 視差捲動 ) 的網頁背景

  • 實作方法主要有兩種:

    • " transform: translate3d 或 transform: translateY "

    • " perspective 搭配 transform: translateZ scale "

  • 兩種方法差別,此程式採用第二種方法實作:

    • 第一種方法以2D空間為基礎:滑鼠滾動時,不同圖層間會有不同的移動速度,達成3D的效果

    • 第二種方法以3D空間為基礎:建立真的3D空間,調整圖層間不同的深度,自然滾動時就會有視差

  • 第一種作法較為常見,但必須搭配 JavaScript;第二種可單純使用 HTML、CSS 完成

範例圖

image

Parallax-Scrolling( 視差捲動 )

  • 電腦圖學和網頁設計中使用的技術,原理是在 2D 場景中建立一個深度錯覺

  • 作法:將背景分為多個圖層,前面圖層的移動速度較快;後面圖層的移動速度較慢,以此達成深度錯覺

parallax-scroll-web's People

Contributors

mu-ping avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.