Fixed Linter issues

This commit is contained in:
Pingumask 2023-05-09 16:34:51 +02:00
parent 1ddfe66024
commit 966f7416d7
11 changed files with 114 additions and 48 deletions

View file

@ -82,9 +82,7 @@ export default {
return this.grimoire.background || this.edition.background || "none";
},
backgroundColor: function() {
return this.grimoire.isStreamerMode
? "#00FF00"
: "transparent"
return this.grimoire.isStreamerMode ? "#00FF00" : "transparent";
}
},
data() {

View file

@ -36,10 +36,10 @@ div::before {
animation: forwards countdown calc(var(--timer) * 1s) linear;
}
div::after{
position:absolute;
div::after {
position: absolute;
inset: 0;
text-align:center;
text-align: center;
content: attr(data-text);
z-index: 2;
background: linear-gradient(
@ -57,8 +57,8 @@ div::after{
width: 100%;
}
100% {
width:0%;
display:none;
width: 0%;
display: none;
}
}
</style>

View file

@ -13,7 +13,11 @@
{{ locale.intro.footerEnd }}
</div>
</div>
<a class="redirect" v-if="language === 'zh-CN'" href="https://clocktower.gstonegames.com">
<a
class="redirect"
v-if="language === 'zh-CN'"
href="https://clocktower.gstonegames.com"
>
<img src="../assets/gstone.png" class="gstone" alt="" />
你想使用中文版魔典吗
</a>

View file

@ -49,13 +49,21 @@
<!-- Grimoire -->
<li class="headline">{{ locale.menu.grimoire.title }}</li>
<li @click="toggleGrimoire" v-if="players.length">
<template v-if="!grimoire.isPublic">{{ locale.menu.grimoire.hide }}</template>
<template v-if="grimoire.isPublic">{{ locale.menu.grimoire.show }}</template>
<template v-if="!grimoire.isPublic">{{
locale.menu.grimoire.hide
}}</template>
<template v-if="grimoire.isPublic">{{
locale.menu.grimoire.show
}}</template>
<em>[G]</em>
</li>
<li @click="toggleNight" v-if="!session.isSpectator">
<template v-if="!grimoire.isNight">{{ locale.menu.grimoire.nightSwitch }}</template>
<template v-if="grimoire.isNight">{{ locale.menu.grimoire.daySwitch }}</template>
<template v-if="!grimoire.isNight">{{
locale.menu.grimoire.nightSwitch
}}</template>
<template v-if="grimoire.isNight">{{
locale.menu.grimoire.daySwitch
}}</template>
<em>[S]</em>
</li>
<li @click="toggleRinging" v-if="!session.isSpectator">
@ -130,18 +138,31 @@
<template v-if="tab === 'session'">
<!-- Session -->
<li class="headline" v-if="session.sessionId">
{{ session.isSpectator ? locale.menu.session.title.player : locale.menu.session.title.host }}
{{
session.isSpectator
? locale.menu.session.title.player
: locale.menu.session.title.host
}}
</li>
<li class="headline" v-else>
{{ locale.menu.session.title.create }}
</li>
<template v-if="!session.sessionId">
<li @click="hostSession">{{ locale.menu.session.storyteller }}<em>[H]</em></li>
<li @click="joinSession">{{ locale.menu.session.player }}<em>[J]</em></li>
<li @click="hostSession">
{{ locale.menu.session.storyteller }}<em>[H]</em>
</li>
<li @click="joinSession">
{{ locale.menu.session.player }}<em>[J]</em>
</li>
</template>
<template v-else>
<li v-if="session.ping">
{{ locale.menu.session.delay }} {{ session.isSpectator ? locale.menu.session.host : locale.menu.session.players }}
{{ locale.menu.session.delay }}
{{
session.isSpectator
? locale.menu.session.host
: locale.menu.session.players
}}
<em>{{ session.ping }}ms</em>
</li>
<li @click="copySessionUrl">
@ -168,7 +189,9 @@
<template v-if="tab === 'players' && !session.isSpectator">
<!-- Users -->
<li class="headline">{{ locale.menu.players.title }}</li>
<li @click="addPlayer" v-if="players.length < 20">{{ locale.menu.players.add }}<em>[A]</em></li>
<li @click="addPlayer" v-if="players.length < 20">
{{ locale.menu.players.add }}<em>[A]</em>
</li>
<li @click="randomizeSeatings" v-if="players.length > 2">
{{ locale.menu.players.randomize }}
<em><font-awesome-icon icon="dice"/></em>
@ -307,9 +330,7 @@ export default {
},
joinSession() {
if (this.session.sessionId) return this.leaveSession();
let sessionId = prompt(
this.locale.prompt.joinSession
);
let sessionId = prompt(this.locale.prompt.joinSession);
if (sessionId.match(/^https?:\/\//i)) {
sessionId = sessionId.split("#").pop();
}

View file

@ -124,11 +124,15 @@
(session.isSpectator && player.id === session.playerId)
"
>
<font-awesome-icon icon="venus-mars" />{{ locale.player.changePronouns }}
<font-awesome-icon icon="venus-mars" />{{
locale.player.changePronouns
}}
</li>
<template v-if="!session.isSpectator">
<li @click="changeName">
<font-awesome-icon icon="user-edit" />{{ locale.player.changeName }}
<font-awesome-icon icon="user-edit" />{{
locale.player.changeName
}}
</li>
<li @click="movePlayer()" :class="{ disabled: session.lockedVote }">
<font-awesome-icon icon="redo-alt" />

View file

@ -82,18 +82,42 @@
</div>
</div>
<div class="button-group" v-if="session.nomination">
<div @click="setAccusationTimer()" class="button">{{ locale.townsquare.timer.accusation.button }}</div>
<div @click="setDefenseTimer()" class="button">{{ locale.townsquare.timer.defense.button }}</div>
<div @click="setDebateTimer()" class="button">{{ locale.townsquare.timer.debate.button }}</div>
<div @click="setAccusationTimer()" class="button">
{{ locale.townsquare.timer.accusation.button }}
</div>
<div @click="setDefenseTimer()" class="button">
{{ locale.townsquare.timer.defense.button }}
</div>
<div @click="setDebateTimer()" class="button">
{{ locale.townsquare.timer.debate.button }}
</div>
</div>
<div class="button-group" v-else>
<div @click="setDaytimeTimer()" class="button">{{ locale.townsquare.timer.daytime.button }}</div>
<div @click="setNominationTimer()" class="button">{{ locale.townsquare.timer.nominations.button }}</div>
<div @click="setDuskTimer()" class="button">{{ locale.townsquare.timer.dusk.button }}</div>
<div @click="setDaytimeTimer()" class="button">
{{ locale.townsquare.timer.daytime.button }}
</div>
<div @click="setNominationTimer()" class="button">
{{ locale.townsquare.timer.nominations.button }}
</div>
<div @click="setDuskTimer()" class="button">
{{ locale.townsquare.timer.dusk.button }}
</div>
</div>
<div class="button-group">
<div @click="toggleNight()" class="button" :class="{disabled: grimoire.isNight}"></div>
<div @click="toggleNight()" class="button" :class="{disabled: !grimoire.isNight}"></div>
<div
@click="toggleNight()"
class="button"
:class="{ disabled: grimoire.isNight }"
>
</div>
<div
@click="toggleNight()"
class="button"
:class="{ disabled: !grimoire.isNight }"
>
</div>
</div>
<div class="button-group">
<div @click="toggleRinging()" class="button">
@ -327,7 +351,10 @@ export default {
this.nominate = -1;
},
renameTimer() {
let newName = prompt(this.locale.townsquare.timer.prompt.name, this.timerName);
let newName = prompt(
this.locale.townsquare.timer.prompt.name,
this.timerName
);
if (newName === "") {
newName = this.locale.townsquare.timer.default.text;
}
@ -348,19 +375,26 @@ export default {
setAccusationTimer() {
this.timerDuration = 1;
let timerText = this.locale.townsquare.timer.accusation.text;
timerText = timerText.replace("$accusator", this.players[this.session.nomination[0]].name).replace("$accusee", this.players[this.session.nomination[1]].name);
timerText = timerText
.replace("$accusator", this.players[this.session.nomination[0]].name)
.replace("$accusee", this.players[this.session.nomination[1]].name);
this.timerName = timerText;
},
setDefenseTimer() {
this.timerDuration = 1;
let timerText = this.locale.townsquare.timer.defense.text;
timerText = timerText.replace("$accusee", this.players[this.session.nomination[1]].name).replace("$accusator", this.players[this.session.nomination[0]].name);
timerText = timerText
.replace("$accusee", this.players[this.session.nomination[1]].name)
.replace("$accusator", this.players[this.session.nomination[0]].name);
this.timerName = timerText;
},
setDebateTimer() {
this.timerDuration = 2;
let timerText = this.locale.townsquare.timer.debate.text;
timerText = timerText.replace("$accusee", this.players[this.session.nomination[1]].name);
timerText = timerText.replace(
"$accusee",
this.players[this.session.nomination[1]].name
);
this.timerName = timerText;
},
setTimer() {
@ -538,7 +572,7 @@ export default {
&.fabled {
top: 10px;
}
&.storytelling{
&.storytelling {
bottom: 10px;
left: auto;
right: 10px;

View file

@ -10,9 +10,7 @@
<em>{{ nominee.name }}</em
>!
<br />
<em class="blue">
{{ voters.length }} {{ locale.vote.votes }}
</em>
<em class="blue"> {{ voters.length }} {{ locale.vote.votes }} </em>
{{ locale.vote.inFavor }}
<em v-if="nominee.role.team !== 'traveler'">
({{ locale.vote.majorityIs }} {{ Math.ceil(alive / 2) }})
@ -55,7 +53,9 @@
</div>
<div class="button" @click="stop">{{ locale.vote.reset }}</div>
</template>
<div class="button demon" @click="finish">{{ locale.vote.close }}</div>
<div class="button demon" @click="finish">
{{ locale.vote.close }}
</div>
</div>
<div class="button-group mark" v-if="nominee.role.team !== 'traveler'">
<div

View file

@ -31,9 +31,9 @@
<div class="custom" v-else>
<h3>{{ locale.modal.edition.custom.title }}</h3>
{{ locale.modal.edition.custom.introStart }}
<a href="https://script.bloodontheclocktower.com/" target="_blank"
>{{ locale.modal.edition.custom.scriptTool }}</a
>
<a href="https://script.bloodontheclocktower.com/" target="_blank">{{
locale.modal.edition.custom.scriptTool
}}</a>
{{ locale.modal.edition.custom.introEnd }}.<br />
<br />
{{ locale.modal.edition.custom.instructionsStart }}
@ -42,7 +42,7 @@
target="_blank"
>{{ locale.modal.edition.custom.documentation }}n</a
>
{{ locale.modal.edition.custom.instructionsEnd }}<br/>
{{ locale.modal.edition.custom.instructionsEnd }}<br />
<b>{{ locale.modal.edition.custom.warning }}</b>
<h3>{{ locale.modal.edition.popularScripts }}</h3>
<ul class="scripts">

View file

@ -66,7 +66,7 @@ export default {
display: flex;
flex-direction: column;
max-height: 80vh;
width:90vw;
width: 90vw;
max-width: 1800px;
.editions &,

View file

@ -118,7 +118,8 @@ export default {
firstNight: 5,
team: "minion",
players: this.players.filter(p => p.role.team === "minion"),
firstNightReminder: this.locale.modal.nightOrder.minionInfoDescription
firstNightReminder: this.locale.modal.nightOrder
.minionInfoDescription
},
{
id: "evil",
@ -126,7 +127,8 @@ export default {
firstNight: 8,
team: "demon",
players: this.players.filter(p => p.role.team === "demon"),
firstNightReminder: this.locale.modal.nightOrder.demonInfoDescription
firstNightReminder: this.locale.modal.nightOrder
.demonInfoDescription
}
);
}

View file

@ -84,7 +84,10 @@ export default {
reminders.push({ role: "good", name: this.locale.modal.reminder.good });
reminders.push({ role: "evil", name: this.locale.modal.reminder.evil });
reminders.push({ role: "custom", name: this.locale.modal.reminder.custom });
reminders.push({
role: "custom",
name: this.locale.modal.reminder.custom
});
return reminders;
},
...mapState(["modals", "grimoire", "locale"]),