Не могу понять , как правильно мне передать значение переменной window2 в spawntwo
new Vue({
el: '#app',
data() {
return {
play: false,
active: {'1':0,'2':0,'3':0},
prepare: false,
spawns: {
window2: true,
window3: false
},
spawnone: true,
spawntwo: true,
spawnthri: false,
}
},
methods: {
onSelectone(windowID) {
if (this.spawnone !== true) {
return false
}
console.log(windowID)
this.active[windowID] = true
setTimeout(() => this.prepare = true, 6000)
setTimeout(() => this.$emit("play", windowID), 8000)
},
onSelecttwo(windowID) {
if (this.spawntwo !== true) {
return false
}
console.log(windowID)
this.active[windowID] = true
setTimeout(() => this.prepare = true, 6000)
setTimeout(() => this.$emit("play", windowID), 8000)
},
onSelectthri(windowID) {
if (this.spawnthri !== true) {
return false
}
console.log(windowID)
this.active[windowID] = true
setTimeout(() => this.prepare = true, 6000)
setTimeout(() => this.$emit("play", windowID), 8000)
}
}
});
.Window-1 {
height: 100vh;
top: 0;
bottom: 0;
left: 0;
z-index: 0;
}
.Window-1:before {
background: url("/img/window-1-bg.png") no-repeat center center;
background-size: cover;
}
.Window-1:not(.active):hover:after {
background: rgba(0, 44, 202, 0.2);
}
.Window-2 {
height: 50vh;
top: 0;
right: 0;
z-index: 1;
}
.Window-2:before {
background: url("/img/window-2-bg.png") no-repeat center center;
background-size: cover;
}
.Window-2:not(.active):not(.gray):hover:after {
background: rgba(174, 0, 31, 0.2);
}
.Window-3 {
height: 50vh;
bottom: 0;
right: 0;
z-index: 2;
}
.Window-3:before {
background: url("/img/window-3-bg.png") no-repeat center center;
background-size: cover;
}
.Window-3:not(.active):not(.gray):hover:after {
background: rgba(177, 128, 0, 0.2);
}
.window {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
width: 50%;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
overflow: hidden;
position: fixed;
-webkit-transition: width .3s, height .3s;
transition: width .3s, height .3s;
}
.window.active {
width: 100%;
height: 100vh !important;
z-index: 3 !important;
}
.window:before, .window:after {
content: "";
display: block;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 0;
}
.window:before {
-webkit-transform: scale(1.1);
transform: scale(1.1);
-webkit-transition: -webkit-transform .3s;
transition: -webkit-transform .3s;
transition: transform .3s;
transition: transform .3s, -webkit-transform .3s;
}
.window.gray:before {
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
}
.window:not(.active):not(.gray):hover:before {
-webkit-transform: scale(1);
transform: scale(1);
}
.window:after {
background: rgba(0, 0, 0, 0.2);
z-index: 1;
-webkit-transition: background-color .3s, opacity 1.3s;
transition: background-color .3s, opacity 1.3s;
-webkit-transition-delay: 0s, .7s;
transition-delay: 0s, .7s;
}
.window > .wrap {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 3;
}
.window > .wrap > .title {
color: #fff;
font-family: FuturaMediumC, sans-serif;
font-weight: 500;
font-size: 6.66667vh;
line-height: 80%;
text-align: center;
position: relative;
z-index: 2;
-webkit-transform: scale(1);
transform: scale(1);
-webkit-transition: opacity .3s, -webkit-transform .3s;
transition: opacity .3s, -webkit-transform .3s;
transition: transform .3s, opacity .3s;
transition: transform .3s, opacity .3s, -webkit-transform .3s;
}
.window > .wrap > .title.title-2 {
font-family: FuturaBookC, sans-serif;
font-weight: normal;
font-size: 3.33333vh;
line-height: 3.7963vh;
}
.window > .wrap:hover > .title {
-webkit-transform: scale(1.15);
transform: scale(1.15);
}
.window > .wrap > .hr {
display: block;
width: 65%;
height: 0.18519vh;
background: #FFFFFF;
margin-top: 4.25926vh;
margin-bottom: 3.33333vh;
position: relative;
z-index: 2;
-webkit-transition: opacity .3s;
transition: opacity .3s;
}
.window > .wrap-lock {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
position: absolute;
z-index: 3;
}
.window > .wrap-lock > .icon {
display: block;
width: 9.25926vh;
height: 9.25926vh;
background: url("/img/spawn-lock-icon.png") no-repeat center center;
background-size: 9.25926vh 9.25926vh;
}
.window > .wrap-lock > .title {
color: #fff;
font-family: FuturaBookC, sans-serif;
font-weight: normal;
font-size: 3.88889vh;
line-height: 4.44444vh;
margin-left: 2.59259vh;
}
.window.Window-2 > .wrap > .title, .window.Window-3 > .wrap > .title {
font-size: 5.55556vh;
}
.window.Window-2 > .wrap > .title.title-2, .window.Window-3 > .wrap > .title.title-2 {
font-size: 2.77778vh;
line-height: 3.14815vh;
}
.window.Window-2 > .wrap > .hr, .window.Window-3 > .wrap > .hr {
margin-top: 2.22222vh;
margin-bottom: 2.40741vh;
}
.window.active > .wrap > .title,
.window.active > .wrap > .hr, .window.active:after {
opacity: 0;
}
.window > .loading-screen {
display: block;
opacity: 0;
background-color: rgba(0, 0, 0, 0);
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 0;
-webkit-transition: opacity .7s, background-color 2.4s;
transition: opacity .7s, background-color 2.4s;
-webkit-transition-delay: 1.6s, 3.2s;
transition-delay: 1.6s, 3.2s;
}
.window > .loading-screen > .logo {
display: block;
width: 32.40741vh;
height: 12.96296vh;
background: url("/img/logo.png") no-repeat center center;
background-size: 32.40741vh 12.96296vh;
position: absolute;
bottom: 5vh;
left: 7.31481vh;
}
.window > .loading-screen > .text {
color: #fff;
font-family: Montserrat-SemiBold, sans-serif;
font-weight: 600;
font-size: 4.44444vh;
line-height: 5.46296vh;
text-shadow: 0 0.18519vh 1.48148vh rgba(0, 0, 0, 0.25);
position: absolute;
right: 8.42593vh;
bottom: 9.90741vh;
}
.window > .loading-screen > .logo,
.window > .loading-screen > .text {
opacity: 1;
-webkit-transition: opacity 1s;
transition: opacity 1s;
}
.window.active > .loading-screen {
opacity: 1;
background-color: black;
z-index: 4;
}
.window.prepare > .loading-screen > .logo,
.window.prepare > .loading-screen > .text {
opacity: 0;
}
@font-face {
font-family: FuturaMediumC;
src: url("/fonts/FuturaMediumC.ttf");
}
@font-face {
font-family: FuturaBookC;
src: url("/fonts/FuturaBookC.ttf");
}
@font-face {
font-family: Montserrat-SemiBold;
src: url("/fonts/Montserrat-SemiBold.ttf");
}
#app {
opacity: 1;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
-webkit-transition: opacity 1s;
transition: opacity 1s;
}
#app.play {
opacity: 0;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="app" :class="{play:play}">
<div :class="['Window-1 window', {active:active[1], prepare:prepare}]" @click="onSelectone(1)">
<div class="wrap">
<div class="title">Появиться на точке<br> последнего выхода</div>
<div class="hr"></div>
<div class="title title-2">Вы не потеряете ничего</div>
</div>
<div class="loading-screen">
<div class="logo"> </div>
<div class="text">Загрузка...</div>
</div>
</div>
<div :class="['Window-2 window', {gray:!spawns.window2, active:active[2], prepare:prepare}]" @click="onSelecttwo(2)">
<div v-if="spawns.window2" class="wrap">
<div class="title">Появиться в своём доме</div>
<div class="hr"> </div>
<div class="title title-2">Содержимое инвентаря будет сброшено (кроме одежды)</div>
</div>
<div v-else class="wrap-lock">
<div class="icon"> </div>
<div class="title">Для разблокировки возможности появления<br> в доме необходимо его купить</div>
</div>
<div class="loading-screen">
<div class="logo"> </div>
<div class="text">Загрузка...</div>
</div>
</div>
<div :class="['Window-3 window', {gray:!spawns.window3, active:active[3], prepare:prepare}]" @click="onSelectthri(3)" >
<div v-if="spawns.window3" class="wrap">
<div class="title">Появиться на территории фракции</div>
<div class="hr"></div>
<div class="title title-2">Содержимое инвентаря будет сброшено (кроме одежды)</div>
</div>
<div v-else="" class="wrap-lock">
<div class="icon"> </div>
<div class="title">Для разблокировки возможности появления<br> в фракции необходимо в неё вступить</div>
</div>
<div class="loading-screen">
<div class="logo"> </div>
<div class="text">Загрузка...</div>
</div>
</div>
</div>
Ответы (1 шт):
Автор решения: Дмитрий
→ Ссылка
`onSelectone(windowID) { if (this.spawns.window2 !== true) { return false }
onSelectone(windowID) {
if (this.spawns.window2 !== true) {
return false
}
`