add webpack

This commit is contained in:
grinikita
2025-03-22 13:14:06 +03:00
parent 0f2c268452
commit 1597b52310
13 changed files with 2313 additions and 12 deletions
+34
View File
@@ -0,0 +1,34 @@
const name = 'File'
import { name as name2 } from './index2.js'
console.log('From index.js log name', name2)
const btnLeft = document.querySelector('.top-nft .btn-left')
const btnRight = document.querySelector('.top-nft .btn-right')
const container = document.querySelector('.nft-card-container')
let containerOffset = 0;
const moveContainer = (offset) => {
const containerWidth = container.scrollWidth
const newOffset = containerOffset + offset
const minOffset = (containerWidth - document.body.clientWidth) * -1
const maxOffset = 0;
containerOffset = Math.min(Math.max(minOffset, newOffset), maxOffset);
container.style.transform = `translateX(${containerOffset}px)`
btnLeft.disabled = containerOffset >= maxOffset ? true : null;
btnRight.disabled = containerOffset <= minOffset;
}
moveContainer(0)
btnLeft.addEventListener('click', () => {
moveContainer(285)
})
btnRight.addEventListener('click', () => {
moveContainer(-285)
})