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.


                <!-- -->
<!-- Line 24 的  offset 設定 : 元素離底部多少距離會再觸發下一個元素動畫。以box1 來說,往下滑時 box1 離網頁底部 120xp ,box2 就會被觸發滑入。 -->
<div class="container">
  <div class="box">0</div>
  <div class="box" data-aos="fade-right">1</div>
  <div class="box" data-aos="fade-left">2</div>
  <div class="box" data-aos="fade-right">3</div>
  <div class="box" data-aos="fade-left">4</div>
  <div class="box" data-aos="fade-right">5</div>
  <div class="box" data-aos="fade-left">6</div>



  max-width: 600px;
  margin: 0 auto;
  width: 200px;
  height: 200px;
  margin: 0 auto;
  background: #feda77;
  margin-bottom: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;


  // Global settings:
  disable: false, // accepts following values: 'phone', 'tablet', 'mobile', boolean, expression or function
  startEvent: 'DOMContentLoaded', // name of the event dispatched on the document, that AOS should initialize on
  initClassName: 'aos-init', // class applied after initialization
  animatedClassName: 'aos-animate', // class applied on animation
  useClassNames: false, // if true, will add content of `data-aos` as classes on scroll
  disableMutationObserver: false, // disables automatic mutations' detections (advanced)
  debounceDelay: 50, // the delay on debounce used while resizing window (advanced)
  throttleDelay: 99, // the delay on throttle used while scrolling the page (advanced)

  // Settings that can be overridden on per-element basis, by `data-aos-*` attributes:
  offset:120, // offset (in px) from the original trigger point
  delay: 0, // values from 0 to 3000, with step 50ms 延遲出現的時間(毫秒為單位)
  duration: 400, // values from 0 to 3000, with step 50ms
  easing: 'ease', // default easing for AOS animations
  once: false, // whether animation should happen only once - while scrolling down 只出現一次不要反覆出現
  mirror: false, // whether elements should animate out while scrolling past them
  anchorPlacement: 'top-bottom', // defines which position of the element regarding to window should trigger the animation