Skip to content

Commit 5a075bb

Browse files
committed
feat: class Styler;to fix: About bottom figures, vert long tablet overflow
1 parent d0a72d5 commit 5a075bb

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

Classes/Styler.js

+7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ export class Styler {
55
return document.querySelectorAll(className);
66
}
77

8+
fillPicsByElData(className){ //заполняет массив объектами
9+
this.findPics(className)
10+
.forEach(el => {
11+
this.pics.push( this.findNGive(el) )
12+
})
13+
}
14+
815
calcStyles(elData1,elData2,screenWidthFresh = document.documentElement.clientWidth){
916
let wider,narrower,taller,lower;
1017
let sumOfWi = elData1.width + elData2.width;

Routes/About.js

+4-13
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,12 @@ export const About = {
5151
</div>`,
5252
data(){
5353
return{
54-
//ширина экрана - будем следить за ней через Watch
55-
screenWidth:document.documentElement.clientWidth,
54+
5655
}
5756
},
5857
mounted(){
59-
window.onload = ()=> {
60-
styler.findPics('.about-pic').forEach(el => {
61-
styler.pics.push(styler.findNGive(el))
62-
})
63-
console.log(styler.pics)
64-
58+
window.onresize = ()=> {
59+
console.log(document.documentElement.clientWidth)
6560
};
6661

6762
},
@@ -75,11 +70,7 @@ export const About = {
7570

7671
},
7772
watch:{
78-
screenWidth(){ //если ресайзнули окно - делать это:
79-
//styler.pics[0].el.style = 'width:300px'
80-
console.log('resize')
81-
//styler.calcStyles(styler.pics[0], styler.pics[1])
82-
}
73+
8374
}
8475

8576
}

0 commit comments

Comments
 (0)