Skip to content

Commit

Permalink
Open wiki tab on middle-click on ghost name
Browse files Browse the repository at this point in the history
  • Loading branch information
Jobus0 committed Dec 28, 2024
1 parent 352f1d6 commit e28b8a7
Show file tree
Hide file tree
Showing 26 changed files with 38 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/ghosts/banshee.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 Banshee
h3(wiki="https://phasmophobia.fandom.com/wiki/Banshee") Banshee
img(src="ghost-icons/banshee.png")
ul
li A random player is picked as the *target*. It picks a new target if the current one dies or disconnects.
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/demon.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 Demon
h3(wiki="https://phasmophobia.fandom.com/wiki/Demon") Demon
img(src="ghost-icons/demon.png")
ul
li Hunt Initiation can happen at any average sanity. Even 100%.
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/deogen.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 Deogen
h3(wiki="https://phasmophobia.fandom.com/wiki/Deogen") Deogen
img(src="ghost-icons/deogen.png")
ul
li Average Sanity Hunt at 40%.
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/goryo.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 Goryo
h3(wiki="https://phasmophobia.fandom.com/wiki/Goryo") Goryo
img(src="ghost-icons/goryo.png")
ul
li D.O.T.S can only be seen through a video camera.
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/hantu.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 Hantu
h3(wiki="https://phasmophobia.fandom.com/wiki/Hantu") Hantu
img(src="ghost-icons/hantu.png")
ul
li When Hunting, living players can see freezing breath from the ghost if the breaker is off, even through a video camera.
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/jinn.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 Jinn
h3(wiki="https://phasmophobia.fandom.com/wiki/Jinn") Jinn
img(src="ghost-icons/jinn.png")
ul
li Hunting Speed increased by 50% if in line of sight and the player is over 3m away, while the breaker is ON.
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/mare.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 Mare
h3(wiki="https://phasmophobia.fandom.com/wiki/Mare") Mare
img(src="ghost-icons/mare.png")
ul
li Average Sanity Hunt threshold with lights ON is at 40% and 60% with lights OFF.
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/mimic.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 The Mimic
h3(wiki="https://phasmophobia.fandom.com/wiki/The_Mimic") The Mimic
img(src="ghost-icons/mimic.png")
ul
li Ghost Orbs will appear as a 4th piece of evidence.
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/moroi.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 Moroi
h3(wiki="https://phasmophobia.fandom.com/wiki/Moroi") Moroi
img(src="ghost-icons/moroi.png")
ul
li Hunting Speed is 10% slower above 45% average sanity, gradually increasing to 30% faster at 0% average sanity.
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/myling.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 Myling
h3(wiki="https://phasmophobia.fandom.com/wiki/Myling") Myling
img(src="ghost-icons/myling.png")
ul
li When Hunting, footsteps and ghost vocalisations can only be heard within 12m of the player (same distance as electronic interference).
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/obake.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 Obake
h3(wiki="https://phasmophobia.fandom.com/wiki/Obake") Obake
img(src="ghost-icons/obake.png")
ul
li When Hunting, will suddenly temporarily change into a different ghost's form. Not visible to dead players.
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/oni.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 Oni
h3(wiki="https://phasmophobia.fandom.com/wiki/Oni") Oni
img(src="ghost-icons/oni.png")
ul
li When Hunting, the ghost will flash visible for longer durations, making it easier to take a photo of.
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/onryo.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 Onryo
h3(wiki="https://phasmophobia.fandom.com/wiki/Onryo") Onryo
img(src="ghost-icons/onryo.png")
ul
li Hunt Initiation cannot occur when ghost is within 4m of a lit candle, a lighter, or a campfire.
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/phantom.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 Phantom
h3(wiki="https://phasmophobia.fandom.com/wiki/Phantom") Phantom
img(src="ghost-icons/phantom.png")
ul
li When Hunting, the ghost is invisible for twice as much of the time.
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/poltergeist.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 Poltergeist
h3(wiki="https://phasmophobia.fandom.com/wiki/Poltergeist") Poltergeist
img(src="ghost-icons/poltergeist.png")
ul
li When Hunting, will throw nearby objects twice as often.
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/raiju.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 Raiju
h3(wiki="https://phasmophobia.fandom.com/wiki/Raiju") Raiju
img(src="ghost-icons/raiju.png")
ul
li Hunting Speed increases by 50% when in range of any active electrical equipment.
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/revenant.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 Revenant
h3(wiki="https://phasmophobia.fandom.com/wiki/Revenant") Revenant
img(src="ghost-icons/revenant.png")
ul
li Hunting Speed instantly increases by 75% when chasing or moving towards a player's last known position whether detected by seeing or hearing the player, or sensing held active electronics.
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/shade.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 Shade
h3(wiki="https://phasmophobia.fandom.com/wiki/Shade") Shade
img(src="ghost-icons/shade.png")
ul
li Hunt Initiation cannot happen if a player is in the same room as the ghost.
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/spirit.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 Spirit
h3(wiki="https://phasmophobia.fandom.com/wiki/Spirit") Spirit
img(src="ghost-icons/spirit.png")
ul
li Incense Hunt Prevention is increased from 90 seconds to 180 seconds.
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/thaye.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 Thaye
h3(wiki="https://phasmophobia.fandom.com/wiki/Thaye") Thaye
img(src="ghost-icons/thaye.png")
ul
li Average Sanity Hunt starts at 75%. Decreases each time the ghost ages, stopping at 15%.
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/twins.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 The Twins
h3(wiki="https://phasmophobia.fandom.com/wiki/The_Twins") The Twins
img(src="ghost-icons/twins.png")
ul
li Hunt Initiation can occur where either twin is currently located. This includes the Summoning Circle.
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/wraith.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 Wraith
h3(wiki="https://phasmophobia.fandom.com/wiki/Wraith") Wraith
img(src="ghost-icons/wraith.png")
ul
li Will never step in a salt pile.
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/yokai.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 Yokai
h3(wiki="https://phasmophobia.fandom.com/wiki/Yokai") Yokai
img(src="ghost-icons/yokai.png")
ul
li When Hunting, it can only hear players or sense handheld active electronics that are within 2.5m away.
Expand Down
2 changes: 1 addition & 1 deletion src/ghosts/yurei.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../mixins/evidence.pug

h3 Yurei
h3(wiki="https://phasmophobia.fandom.com/wiki/Yurei") Yurei
img(src="ghost-icons/yurei.png")
ul
li Sanity Loss of 15% from fully closing a door near you.
Expand Down
21 changes: 14 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,17 +250,24 @@ evidenceButtons.forEach(button => button.addEventListener("contextmenu", functio
}));

const ghostHeaders = document.querySelectorAll<HTMLElement>(".ghost h3");
ghostHeaders.forEach(header => header.addEventListener("click", function () {
header.closest(".ghost")?.classList.toggle("manual-excluded");
updateGhosts();
ghostHeaders.forEach(header => header.addEventListener("mousedown", function (e) {
if (e.button === 0 || e.button === 2) { // left or right mouse
e.preventDefault();
header.closest(".ghost")?.classList.toggle("manual-excluded");
updateGhosts();
}
if (e.button === 1) { // middle mouse
e.preventDefault();
let wikiUrl = header.getAttribute("wiki");
if (wikiUrl != null)
window.open(wikiUrl);
}
}));

ghostHeaders.forEach(header => header.addEventListener("contextmenu", function (e) {
e.preventDefault();
header.closest(".ghost")?.classList.toggle("manual-excluded");
updateGhosts();
e.preventDefault(); // keep to disable context menu on right-click
}));

ghostHeaders.forEach(header => {
header.title = 'Click to exclude.';
header.title = 'Click to exclude.\nMiddle-click to open wiki.';
});
1 change: 0 additions & 1 deletion src/parcel-transformer-colorcodehtml.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export default new Transformer({
async function processHtml(html) {
return html
.replace(/\*(.*?)\*/g, '<b>$1</b>')
.replace(/_(.*?)_/g, '<i>$1</i>')
.replace(/\b(Interactions)\b/g, '<span class="interactions">$1</span>')
.replace(/\b(Sanity Loss)\b/g, '<span class="sanity-loss">$1</span>')
.replace(/\b(Ghost Events?)\b/g, '<span class="ghost-events">$1</span>')
Expand Down

0 comments on commit e28b8a7

Please sign in to comment.