{
"name": "workspace",
"version": "1.0.0",
"scripts": {
"build": "gulp"
},
"dependencies": {
"gsap": "^3.9.1"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^13.1.3",
"gulp": "^4.0.2",
"rollup": "^2.70.0"
}
}
const { series } = require('gulp');
const rollup = require('rollup');
const { nodeResolve } = require('@rollup/plugin-node-resolve');
const build = async (done) => {
const bundle = await rollup.rollup({
input: './src/index.js',
plugins: [nodeResolve()]
});
await bundle.write({
dir: './dist',
format: 'umd',
sourcemap: true
});
done();
};
exports.build = build;
exports.default = series(build);
import gsap from 'gsap';
import ScrollTrigger from 'gsap/ScrollTrigger';
gsap.registerPlugin(ScrollTrigger);
document.head.querySelector('meta[name$=":image"]')
document.head.querySelector('[itemprop="image"]')
window.addEventListener('click', (event) => {
if (event.target.closest('GAME_CLOSE_BUTTON_SELECTOR')) {
createGame();
}
});
absolute
. Размеры - object-fit
.
id
в свою вёрстку:2. Добавляете
id
в элементы своей коллекции:3. Добавляете обработку события клика: