|
@@ -4,6 +4,7 @@ const animations = require('./animations')
|
|
|
const { getAttrs, unit, transforms } = require('./util')
|
|
const { getAttrs, unit, transforms } = require('./util')
|
|
|
const WIDTH = 1920
|
|
const WIDTH = 1920
|
|
|
const HEIGHT = 1080
|
|
const HEIGHT = 1080
|
|
|
|
|
+
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
|
const resize = () => {
|
|
const resize = () => {
|
|
|
const wScale = window.innerWidth / WIDTH
|
|
const wScale = window.innerWidth / WIDTH
|
|
@@ -13,6 +14,17 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
}
|
|
}
|
|
|
window.addEventListener('resize', resize)
|
|
window.addEventListener('resize', resize)
|
|
|
resize()
|
|
resize()
|
|
|
|
|
+
|
|
|
|
|
+ Array.from(document.querySelectorAll('*'))
|
|
|
|
|
+ .flatMap(e => Array.from(e.attributes))
|
|
|
|
|
+ .filter(a => a.value && a.value.startsWith('~'))
|
|
|
|
|
+ .forEach(a => a.value = a.ownerElement.closest('[\\~]').attributes['~'].value + a.value.substr(1))
|
|
|
|
|
+ Array.from(document.querySelectorAll('[data-src]'))
|
|
|
|
|
+ .forEach(e => {
|
|
|
|
|
+ e.setAttribute('src', e.getAttribute('data-src'))
|
|
|
|
|
+ e.removeAttribute('data-src')
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
const scenes = Array.from(document.querySelectorAll('scene, .scene'))
|
|
const scenes = Array.from(document.querySelectorAll('scene, .scene'))
|
|
|
scenes.forEach(scene => {
|
|
scenes.forEach(scene => {
|
|
|
|
|
|
|
@@ -75,8 +87,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
getFrame(time)[transform.name] = value
|
|
getFrame(time)[transform.name] = value
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+ sprite.removeAttribute(attr.name)
|
|
|
}
|
|
}
|
|
|
- sprite.removeAttribute(attr.name)
|
|
|
|
|
})
|
|
})
|
|
|
// if (anim) {
|
|
// if (anim) {
|
|
|
// anime(Object.assign({
|
|
// anime(Object.assign({
|