Skip to content

Commit

Permalink
added slider
Browse files Browse the repository at this point in the history
  • Loading branch information
revengemiroz committed May 16, 2020
1 parent 21c9d0b commit 9682a3f
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 22 deletions.
Binary file added Slider1/design/desktop-preview.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 56 additions & 22 deletions Slider1/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,72 @@ newImg.onload = function () {
slider.src = this.src;
console.log(`width : ${this.width},height : ${this.height}`)

dimension(this.width, this.height)
dimension(this.width, this.height, 10, 5, 300, 600, 800)
}
newImg.src = `${imagePath[0]}`

imgId.innerText = '1'
let counter = 0;

function dimension(w, h) {
if (w == 4912 && h == 7360) {
container.style.width = `${w / 10}px`
container.style.height = `${h / 10}px`
if (window.screen.width < 500) {
if (w == 4912 && h == 7360) {
container.style.width = `${w / 12.6}px`
container.style.height = `${h / 10}px`
}

else if (w > 4800 && h > 3500) {
container.style.width = `${w / 15.5}px`
container.style.height = `${h / 11}px`
}

else if (w == 750 && h == 750) {
container.style.width = `${w - 370}px`
container.style.height = `${h - 150}px`
}

else if (w < 800 && w < 800) {
container.style.width = `${w - 270}px`
container.style.height = `${h - 200}px`
}

else if (w > 600 && w < 1200) {
container.style.width = `${w - 700}px`
container.style.height = `${h - 460}px`
}

else {
container.style.width = `${w - 850}px`
container.style.height = `${h - 1020}px`
}
}

else if (w > 4800 && h > 3500) {
container.style.width = `${w / 5}px`
container.style.height = `${h / 5}px`
}

else if (w < 800 && w < 800) {
container.style.width = `${w}px`
container.style.height = `${h}px`
}

else if (w > 600 && w < 1200) {
container.style.width = `${w - 300}px`
container.style.height = `${h - 300}px`
}

else {
container.style.width = `${w - 600}px`
container.style.height = `${h - 800}px`
if (w == 4912 && h == 7360) {
container.style.width = `${w / 10}px`
container.style.height = `${h / 10}px`
}

else if (w > 4800 && h > 3500) {
container.style.width = `${w / 5}px`
container.style.height = `${h / 5}px`
}

else if (w < 800 && w < 800) {
container.style.width = `${w}px`
container.style.height = `${h}px`
}

else if (w > 600 && w < 1200) {
container.style.width = `${w - 300}px`
container.style.height = `${h - 300}px`
}

else {
container.style.width = `${w - 600}px`
container.style.height = `${h - 800}px`
}
}

}

function inc(count) {
Expand Down

0 comments on commit 9682a3f

Please sign in to comment.