Fix linter issues

This commit is contained in:
pingumask 2023-05-09 17:43:00 +00:00
parent 3e859a8850
commit c721637d90
15 changed files with 168 additions and 64 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

@ -27,7 +27,7 @@ export default {
return {
gradients: [
["demon", "#ce0100", "#000"],
["townsfolk", "#1f65ff", "#000"],
["townsfolk", "#1f65ff", "#000"],
["minion", "#ff6900", "#000"],
["default", "#4E4E4E", "#000"]
]

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">
@ -141,18 +149,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">
@ -179,7 +200,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>
@ -318,9 +341,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

@ -45,28 +45,44 @@
<!-- Overlay icons -->
<div class="overlay">
<font-awesome-icon
v-if="!grimoire.isOrganVoteMode || !session.isSpectator || player.id==session.playerId"
v-if="
!grimoire.isOrganVoteMode ||
!session.isSpectator ||
player.id == session.playerId
"
icon="hand-paper"
class="vote"
:title="locale.player.handUp"
@click="vote()"
/>
<font-awesome-icon
v-if="grimoire.isOrganVoteMode && session.isSpectator && player.id!==session.playerId"
v-if="
grimoire.isOrganVoteMode &&
session.isSpectator &&
player.id !== session.playerId
"
icon="question"
class="vote"
:title="locale.player.handUp"
@click="vote()"
/>
<font-awesome-icon
v-if="!grimoire.isOrganVoteMode || !session.isSpectator || player.id==session.playerId"
v-if="
!grimoire.isOrganVoteMode ||
!session.isSpectator ||
player.id == session.playerId
"
icon="times"
class="vote"
:title="locale.player.handDown"
@click="vote()"
/>
<font-awesome-icon
v-if="grimoire.isOrganVoteMode && session.isSpectator && player.id!==session.playerId"
v-if="
grimoire.isOrganVoteMode &&
session.isSpectator &&
player.id !== session.playerId
"
icon="question"
class="vote"
:title="locale.player.handDown"
@ -140,11 +156,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" />
@ -591,7 +611,10 @@ export default {
#townsquare.vote .player.vote-lock:not(.vote-yes) .overlay svg.vote.fa-times,
#townsquare.vote .player.you.vote-yes .overlay svg.vote.fa-question,
#townsquare.vote .player.vote-lock.vote-yes .overlay svg.vote.fa-question,
#townsquare.vote .player.vote-lock:not(.vote-yes) .overlay svg.vote.fa-question {
#townsquare.vote
.player.vote-lock:not(.vote-yes)
.overlay
svg.vote.fa-question {
opacity: 1;
transform: scale(1);
}

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,12 +10,17 @@
<em>{{ nominee.name }}</em
>!
<br />
<em class="blue" v-if="!grimoire.isOrganVoteMode || nominee.role.team == 'traveler' || !session.isSpectator">
<em
class="blue"
v-if="
!grimoire.isOrganVoteMode ||
nominee.role.team == 'traveler' ||
!session.isSpectator
"
>
{{ voters.length }} {{ locale.vote.votes }}
</em>
<em class="blue" v-else>
? {{ locale.vote.votes }}
</em>
<em class="blue" v-else> ? {{ locale.vote.votes }} </em>
{{ locale.vote.inFavor }}
<em v-if="nominee.role.team !== 'traveler'">
({{ locale.vote.majorityIs }} {{ Math.ceil(alive / 2) }})
@ -58,7 +63,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"]),

View file

@ -73,12 +73,20 @@
<font-awesome-icon
:icon="[
'fas',
vote.votes == null ? 'minus-square' : ( vote.votes.length >= vote.majority ? 'check-square' : 'square' )
vote.votes == null
? 'minus-square'
: vote.votes.length >= vote.majority
? 'check-square'
: 'square'
]"
/>
</td>
<td>
{{ vote.votes == null ? locale.modal.voteHistory.hiddenVote : vote.votes.join(", ") }}
{{
vote.votes == null
? locale.modal.voteHistory.hiddenVote
: vote.votes.join(", ")
}}
</td>
</tr>
</tbody>

View file

@ -1,4 +1,4 @@
import gameInfo from '../index.js';
import gameInfo from "../index.js";
/**
* Handle a vote request.
@ -86,14 +86,18 @@ const mutations = {
timestamp: new Date(),
nominator: players[state.nomination[0]].name,
nominee: players[state.nomination[1]].name,
type: isExile ? "Exile" : ("Execution" + ((organGrinder && !state.isSpectator) ? "*" : "")),
type: isExile
? "Exile"
: "Execution" + (organGrinder && !state.isSpectator ? "*" : ""),
majority: Math.ceil(
players.filter(player => !player.isDead || isExile).length / 2
),
votes: organGrinder && state.isSpectator ? null :
players
.filter((player, index) => state.votes[index])
.map(({ name }) => name)
votes:
organGrinder && state.isSpectator
? null
: players
.filter((player, index) => state.votes[index])
.map(({ name }) => name)
});
},
clearVoteHistory(state) {

View file

@ -731,7 +731,7 @@ class LiveSession {
if (this._isSpectator) return;
this._send("isRinging", this._store.state.grimoire.isRinging);
}
/**
* Send the isOrganVoteMode status. ST only
*/