top: 0px; right: 308.418px; bottom: 274px; left: 308.418px;
// объект с местами за столом
seats: [
{
rotate: 180,
top: {type: 'none', value: 0},
right: {type: 'horizontal', value: 0},
bottom: {type: '-vertical', value: 0},
left: {type: 'horizontal', value: 0}
},
{
rotate: -90,
top: {type: 'none', value: 0},
right: {type: 'none', value: 0},
bottom: {type: 'none', value: 0},
left: {type: '-horizontal', value: 0}
},
{
rotate: 0,
top: {type: '-vertical', value: 0},
right: {type: 'horizontal', value: 0},
bottom: {type: 'none', value: 0},
left: {type: 'horizontal', value: 0}
},
{
rotate: 90,
top: {type: 'none', value: 0},
right: {type: '-horizontal', value: 0},
bottom: {type: 'none', value: 0},
left: {type: 'none', value: 0}
},
],
//метод просчета для блоков:
resize: function (event) {
this.$store.commit('sizetable');
var width = this.$store.state.width,
height = this.$store.state.height,
hypotenuse,
indentation,
angle,
vertical,
horizontal,
hypotenuse = Math.sqrt(Math.pow(this.$store.state.width, 2) + +Math.pow(this.$store.state.height, 2));
angle = height / width;
indentation = hypotenuse / 4;
vertical = indentation * Math.sin((this.toDegrees(angle) * Math.PI / 180.0));
horizontal = indentation * Math.sin(Math.sin((90 - this.toDegrees(angle)) * Math.PI / 180.0));
console.log(horizontal, vertical);
let self = this;
$.each(this.seats, function (i, j) {
var s = i
$.each(j, function (k, n) {
switch (n.type) {
case 'vertical':
self.seats[s][k]['value'] = vertical;
break;
case 'horizontal':
self.seats[s][k]['value'] = horizontal;
break;
case '-vertical':
self.seats[s][k]['value'] = height/2;
break;
case '-horizontal':
self.seats[s][k]['value'] = width - horizontal;
break;
}
})
});
},