1 Commit

Autore SHA1 Messaggio Data
  Adrien 8b42c890db test screen orientations 3 anni fa
2 ha cambiato i file con 30 aggiunte e 21 eliminazioni
  1. +4
    -1
      build/service-worker-prod.js
  2. +26
    -20
      src/components/Battleground.vue

+ 4
- 1
build/service-worker-prod.js Vedi File

@@ -12,10 +12,13 @@
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
) )
); );
var isLocalIp = window.location.hostname.match(
/^192\.168(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){2}$/
)


window.addEventListener('load', function() { window.addEventListener('load', function() {
if ('serviceWorker' in navigator && if ('serviceWorker' in navigator &&
(window.location.protocol === 'https:' || isLocalhost)) {
(window.location.protocol === 'https:' || isLocalhost || isLocalIp)) {
navigator.serviceWorker.register('service-worker.js') navigator.serviceWorker.register('service-worker.js')
.then(function(registration) { .then(function(registration) {
// updatefound is fired if service-worker.js changes. // updatefound is fired if service-worker.js changes.


+ 26
- 20
src/components/Battleground.vue Vedi File

@@ -1,16 +1,14 @@
<template> <template>
<div class="battleground" v-if="battleground"> <div class="battleground" v-if="battleground">
<div class="battleground-background" :style="backgroundCss"/> <div class="battleground-background" :style="backgroundCss"/>
<div class="battleground-content">
<div id="objectives" class="objectives">
<div class="objectives-row" v-for="objectiveRow in battleground.objectives">
<template v-for="objective in objectiveRow">
<Objective :objective="objective"></Objective>
</template>
</div>
<div class="battleground-objectives">
<div class="battleground-objectives-row" v-for="objectiveRow in battleground.objectives">
<template v-for="objective in objectiveRow">
<Objective :objective="objective"></Objective>
</template>
</div> </div>
<router-link to="/battlegrounds">Back to selector</router-link>
</div> </div>
<router-link to="/battlegrounds">Back to selector</router-link>
</div> </div>
</template> </template>


@@ -18,7 +16,7 @@
$border-style: 1px solid $blizzard-font-color $border-style: 1px solid $blizzard-font-color


.battleground .battleground
&-background, &-content
&-background, &-objectives
height: 100vh height: 100vh
width: 100vw width: 100vw


@@ -29,18 +27,18 @@
filter: blur(2px) brightness(70%) filter: blur(2px) brightness(70%)
z-index: -10 z-index: -10


.objectives
display: flex
flex-direction: column
height: 100%

&-row
&-objectives
display: flex display: flex
justify-content: space-between
flex-grow: 1
&:first-child
border-top: $border-style
border-bottom: $border-style
flex-direction: column

&-row
display: flex
justify-content: space-between
flex-grow: 1
&:first-child
border-top: $border-style
border-bottom: $border-style

.objective .objective
&:first-child &:first-child
border-left: $border-style border-left: $border-style
@@ -76,6 +74,14 @@
this.battlegroundId = to.params.battlegroundId this.battlegroundId = to.params.battlegroundId
} }
}, },
mounted: function () {
console.log('Mounted : lock landscape orientation')
screen.orientation.lock('landscape')
},
destroyed: function () {
console.log('Destroyed : unlock orientation')
screen.orientation.unlock()
},
components: { components: {
Timer, Timer,
Objective Objective


Caricamento…
Annulla
Salva