Skip to content

Commit

Permalink
chore: lint J folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Bas950 committed Jan 20, 2025
1 parent 1fabea4 commit f9e3f64
Show file tree
Hide file tree
Showing 100 changed files with 6,439 additions and 6,229 deletions.
66 changes: 33 additions & 33 deletions websites/J/JUKE/metadata.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"$schema": "https://schemas.premid.app/metadata/1.12",
"apiVersion": 1,
"author": {
"name": "QkeleQ10",
"id": "807917674477649943"
},
"contributors": [
{
"name": "STEPHAN",
"id": "183233556150091776"
}
],
"service": "JUKE",
"description": {
"en": "JUKE is a Dutch radio channel collection site. JUKE is a Talpa Network company.",
"nl": "JUKE is een verzamelingssite voor radiostations. JUKE is een merk van Talpa Network."
},
"url": "juke.nl",
"version": "2.0.18",
"logo": "https://cdn.rcd.gg/PreMiD/websites/J/JUKE/assets/logo.png",
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/J/JUKE/assets/thumbnail.png",
"color": "#38af85",
"category": "music",
"tags": [
"juke",
"talpa",
"radio",
"music",
"muziek",
"free",
"gratis"
]
}
"$schema": "https://schemas.premid.app/metadata/1.12",
"apiVersion": 1,
"author": {
"name": "QkeleQ10",
"id": "807917674477649943"
},
"contributors": [
{
"name": "STEPHAN",
"id": "183233556150091776"
}
],
"service": "JUKE",
"description": {
"en": "JUKE is a Dutch radio channel collection site. JUKE is a Talpa Network company.",
"nl": "JUKE is een verzamelingssite voor radiostations. JUKE is een merk van Talpa Network."
},
"url": "juke.nl",
"version": "2.0.18",
"logo": "https://cdn.rcd.gg/PreMiD/websites/J/JUKE/assets/logo.png",
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/J/JUKE/assets/thumbnail.png",
"color": "#38af85",
"category": "music",
"tags": [
"juke",
"talpa",
"radio",
"music",
"muziek",
"free",
"gratis"
]
}
99 changes: 52 additions & 47 deletions websites/J/JUKE/presence.ts
Original file line number Diff line number Diff line change
@@ -1,53 +1,58 @@
const presence = new Presence({
clientId: "811305223783448627",
});
clientId: '811305223783448627',
})

presence.on("UpdateData", async () => {
const presenceData: PresenceData = {
largeImageKey: "https://cdn.rcd.gg/PreMiD/websites/J/JUKE/assets/logo.png",
buttons: [{ label: "Radio luisteren", url: document.location.href }],
};
presence.on('UpdateData', async () => {
const presenceData: PresenceData = {
largeImageKey: 'https://cdn.rcd.gg/PreMiD/websites/J/JUKE/assets/logo.png',
buttons: [{ label: 'Radio luisteren', url: document.location.href }],
}

if (document.querySelector("span[class*=eC-title]")) {
presenceData.details = document
.querySelector("span[class*=eC-title]")
.textContent.replace("De ", "de ")
.replace("Het ", "het ")
.replace("&", "&");
if (document.querySelector("span[class*=eC-subtitle]")) {
presenceData.state = document
.querySelector("span[class*=eC-subtitle]")
.textContent.replace("De ", "de ")
.replace("Het ", "het ")
.replace("&", "&");
}
}
if (document.querySelector('span[class*=eC-title]')) {
presenceData.details = document
.querySelector('span[class*=eC-title]')
?.textContent
?.replace('De ', 'de ')
.replace('Het ', 'het ')
.replace('&', '&')
if (document.querySelector('span[class*=eC-subtitle]')) {
presenceData.state = document
.querySelector('span[class*=eC-subtitle]')
?.textContent
?.replace('De ', 'de ')
.replace('Het ', 'het ')
.replace('&', '&')
}
}

if (!presenceData.details) {
presenceData.details = "Bladert op JUKE.nl";
presenceData.state = `Pagina '${document.title
.replace(" |", "|")
.split("|")[0]
.replace(
"JUKE - Luister nu jouw favoriete radiozenders, non-stop muziek en podcasts!",
"Home"
)}'`;
}
if (!presenceData.details) {
presenceData.details = 'Bladert op JUKE.nl'
presenceData.state = `Pagina '${document.title
.replace(' |', '|')
.split('|')[0]
.replace(
'JUKE - Luister nu jouw favoriete radiozenders, non-stop muziek en podcasts!',
'Home',
)}'`
}

if (document.querySelector("rect")) {
presenceData.smallImageKey = Assets.Play;
presenceData.smallImageText = "Wordt afgespeeld";
presenceData.buttons = [
{ label: "Ook radio luisteren", url: document.location.href },
];
} else if (document.querySelector("[class*=spinner]")) {
presenceData.smallImageKey = Assets.Pause;
presenceData.smallImageText = "Wordt geladen";
} else if (document.querySelector("polygon")) {
presenceData.smallImageKey = Assets.Pause;
presenceData.smallImageText = "Gepauzeerd";
}
if (document.querySelector('rect')) {
presenceData.smallImageKey = Assets.Play
presenceData.smallImageText = 'Wordt afgespeeld'
presenceData.buttons = [
{ label: 'Ook radio luisteren', url: document.location.href },
]
}
else if (document.querySelector('[class*=spinner]')) {
presenceData.smallImageKey = Assets.Pause
presenceData.smallImageText = 'Wordt geladen'
}
else if (document.querySelector('polygon')) {
presenceData.smallImageKey = Assets.Pause
presenceData.smallImageText = 'Gepauzeerd'
}

if (presenceData.details) presence.setActivity(presenceData);
else presence.setActivity();
});
if (presenceData.details)
presence.setActivity(presenceData)
else presence.setActivity()
})
60 changes: 30 additions & 30 deletions websites/J/Jackbox/@types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
interface Game {
name: string;
logo: string;
getPresenceData: (
params: GameCallbackParams
) => Promise<PresenceData> | PresenceData;
name: string
logo: string
getPresenceData: (
params: GameCallbackParams
) => Promise<PresenceData> | PresenceData
}

interface GamePlayerState {
playerName?: string;
username?: string;
playerInfo?: {
username?: string;
};
state?: string;
status?: string;
kind?: string;
category?: string;
prompt?: {
text?: string;
html?: string;
};
entryId?: string;
choiceId?: string;
responseKey?: string;
placeholder?: string;
choiceType?: string;
classes?: string[];
[x: string]: unknown;
playerName?: string
username?: string
playerInfo?: {
username?: string
}
state?: string
status?: string
kind?: string
category?: string
prompt?: {
text?: string
html?: string
}
entryId?: string
choiceId?: string
responseKey?: string
placeholder?: string
choiceType?: string
classes?: string[]
[x: string]: unknown
}

interface GameInfoState {
name?: string;
name?: string
}

interface GameCallbackParams {
playerState: GamePlayerState;
infoState: GameInfoState;
tag: string;
presence: Presence;
playerState: GamePlayerState
infoState: GameInfoState
tag: string
presence: Presence
}
104 changes: 52 additions & 52 deletions websites/J/Jackbox/games/Party Pack 1/drawful.ts
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
export const name = "Drawful";
export const logo = "https://cdn.rcd.gg/PreMiD/websites/J/Jackbox/assets/0.png";
export const name = 'Drawful'
export const logo = 'https://cdn.rcd.gg/PreMiD/websites/J/Jackbox/assets/0.png'

export function getPresenceData(): PresenceData {
const currentGamePage = document.querySelector<HTMLDivElement>(
".drawful-page:not(.pt-page-off)"
),
{ classList, id } = currentGamePage;
switch (true) {
case classList.contains("state-lobby"): {
return { state: "Waiting in lobby" };
}
case classList.contains("state-lyingdone"):
case classList.contains("state-nothing"):
case classList.contains("state-drawing-done"): {
return { state: "Waiting" };
}
case classList.contains("state-round"): {
return { state: currentGamePage.querySelector("span").textContent };
}
case classList.contains("state-drawing-sent"): {
return { state: "Waiting for other players to finish drawing" };
}
case classList.contains("state-enterlie"): {
return { state: "Entering a lie" };
}
case classList.contains("state-chooselie"): {
return { state: "Looking for the truth" };
}
case classList.contains("state-chooselikes"): {
return { state: "Liking lies" };
}
case classList.contains("state-liereceived"): {
return { state: "Waiting for other players to enter lies" };
}
case classList.contains("state-notchoosing"): {
return { state: "Waiting for other players to discover the truth" };
}
case classList.contains("state-draw"): {
return { state: "Drawing something" };
}
case classList.contains("state-audience-choose"): {
return { state: "Choosing a lie" };
}
case id === "state-ugc": {
return { state: "Creating a custom game" };
}
case classList.contains("state-audience"): {
return { state: "In the audience" };
}
default: {
return {};
}
}
const currentGamePage = document.querySelector<HTMLDivElement>(
'.drawful-page:not(.pt-page-off)',
)!
const { classList, id } = currentGamePage
switch (true) {
case classList.contains('state-lobby'): {
return { state: 'Waiting in lobby' }
}
case classList.contains('state-lyingdone'):
case classList.contains('state-nothing'):
case classList.contains('state-drawing-done'): {
return { state: 'Waiting' }
}
case classList.contains('state-round'): {
return { state: currentGamePage.querySelector('span')?.textContent }
}
case classList.contains('state-drawing-sent'): {
return { state: 'Waiting for other players to finish drawing' }
}
case classList.contains('state-enterlie'): {
return { state: 'Entering a lie' }
}
case classList.contains('state-chooselie'): {
return { state: 'Looking for the truth' }
}
case classList.contains('state-chooselikes'): {
return { state: 'Liking lies' }
}
case classList.contains('state-liereceived'): {
return { state: 'Waiting for other players to enter lies' }
}
case classList.contains('state-notchoosing'): {
return { state: 'Waiting for other players to discover the truth' }
}
case classList.contains('state-draw'): {
return { state: 'Drawing something' }
}
case classList.contains('state-audience-choose'): {
return { state: 'Choosing a lie' }
}
case id === 'state-ugc': {
return { state: 'Creating a custom game' }
}
case classList.contains('state-audience'): {
return { state: 'In the audience' }
}
default: {
return {}
}
}
}
12 changes: 6 additions & 6 deletions websites/J/Jackbox/games/Party Pack 1/drawful2.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {
logo as drawfulLogo,
getPresenceData as drawfulUpdateData,
} from "./drawful";
logo as drawfulLogo,
getPresenceData as drawfulUpdateData,
} from './drawful'

export const name = "Drawful 2";
export const logo = drawfulLogo;
export const name = 'Drawful 2'
export const logo = drawfulLogo

export const getPresenceData = drawfulUpdateData;
export const getPresenceData = drawfulUpdateData
12 changes: 6 additions & 6 deletions websites/J/Jackbox/games/Party Pack 1/drawful2international.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {
logo as drawfulLogo,
getPresenceData as drawfulUpdateData,
} from "./drawful";
logo as drawfulLogo,
getPresenceData as drawfulUpdateData,
} from './drawful'

export const name = "Drawful 2 International";
export const logo = drawfulLogo;
export const name = 'Drawful 2 International'
export const logo = drawfulLogo

export const getPresenceData = drawfulUpdateData;
export const getPresenceData = drawfulUpdateData
Loading

0 comments on commit f9e3f64

Please sign in to comment.