Skip to content

Commit

Permalink
Update to Dawn 9.0.0 (#2531)
Browse files Browse the repository at this point in the history
9.0.0 Update
  • Loading branch information
Roi-Arthur authored Apr 14, 2023
1 parent bf9813b commit 262e4e3
Show file tree
Hide file tree
Showing 176 changed files with 8,158 additions and 3,413 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ jobs:
name: Lighthouse
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Lighthouse
uses: shopify/lighthouse-ci-action@v1
uses: shopify/lighthouse-ci-action@v1.1.1
with:
store: ${{ secrets.SHOP_STORE_OS2 }}
password: ${{ secrets.SHOP_PASSWORD_OS2 }}
access_token: ${{ secrets.SHOP_ACCESS_TOKEN }}
product_handle: puppy
collection_handle: all
lhci_github_app_token: ${{ secrets.LHCI_GITHUB_TOKEN }}
pull_theme: ${{ secrets.SHOP_PULL_THEME }}
theme-check:
name: Theme Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Theme Check
uses: shopify/theme-check-action@v1
with:
Expand Down
12 changes: 12 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"printWidth": 120,
"singleQuote": true,
"overrides": [
{
"files": "*.liquid",
"options": {
"singleQuote": false
}
}
]
}
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"recommendations": ["shopify.theme-check-vscode"]
"recommendations": ["shopify.theme-check-vscode", "esbenp.prettier-vscode"]
}
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"editor.formatOnSave": false,
"[javascript]": {
"editor.formatOnSave": true
},
"[css]": {
"editor.formatOnSave": true
},
"[liquid]": {
"editor.formatOnSave": true
}
}
28 changes: 28 additions & 0 deletions assets/animations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const SCROLL_ANIMATION_TRIGGER_CLASSNAME = 'scroll-trigger';
const SCROLL_ANIMATION_ACTIVE_CLASSNAME = 'scroll-trigger--active';

function onIntersection(elements, observer) {
elements.forEach((element, index) => {
if (element.isIntersecting) {
const elementTarget = element.target;
elementTarget.classList.add(SCROLL_ANIMATION_ACTIVE_CLASSNAME);
if (elementTarget.hasAttribute('data-cascade'))
elementTarget.setAttribute('style', `--animation-order: ${index};`);
observer.unobserve(elementTarget);
}
});
}

function initializeScrollAnimationTrigger(rootEl = document) {
const animationTriggerElements = Array.from(rootEl.getElementsByClassName(SCROLL_ANIMATION_TRIGGER_CLASSNAME));
if (animationTriggerElements.length === 0) return;

const observer = new IntersectionObserver(onIntersection, {
threshold: 0.1,
});
animationTriggerElements.forEach((element) => observer.observe(element));
}

window.addEventListener('DOMContentLoaded', () => initializeScrollAnimationTrigger());

document.addEventListener('shopify:section:load', (event) => initializeScrollAnimationTrigger(event.target));
Loading

0 comments on commit 262e4e3

Please sign in to comment.