diff --git a/src/components/FileSelector/LocalFileSelector.jsx b/src/components/FileSelector/LocalFileSelector.jsx index b1a73ad..f62f9cf 100644 --- a/src/components/FileSelector/LocalFileSelector.jsx +++ b/src/components/FileSelector/LocalFileSelector.jsx @@ -1,6 +1,6 @@ import { h } from 'preact' -export default function ({ theme, setLocation, buildLink }) { +export default function LocalFileSelector ({ theme, setLocation, buildLink }) { const fileInputHandler = ({ target }) => { const file = target.files[0] const url = `${URL.createObjectURL(file)}#${file.name}` diff --git a/src/components/FileSelector/TargetURLSelector.jsx b/src/components/FileSelector/TargetURLSelector.jsx index c79fb36..990983e 100644 --- a/src/components/FileSelector/TargetURLSelector.jsx +++ b/src/components/FileSelector/TargetURLSelector.jsx @@ -1,6 +1,6 @@ import { h } from 'preact' -export default function ({ theme, setLocation, buildLink }) { +export default function TargetURLSelector ({ theme, setLocation, buildLink }) { const urlRE = /^(http|https):\/\/[^ "]+$/ const onKeyPress = ({ keyCode, target }) => { diff --git a/src/components/GameEntry/GameEntry.jsx b/src/components/GameEntry/GameEntry.jsx index ace8504..7a638c1 100644 --- a/src/components/GameEntry/GameEntry.jsx +++ b/src/components/GameEntry/GameEntry.jsx @@ -2,22 +2,24 @@ import { h } from 'preact' import { Link } from 'wouter-preact' import { - buildPlayLinkHref + buildPlayLinkHref, } from '~/src/utils/utils.routing' -export default ({ name, ifdb, url }) => ( -
-

{name}

- - IFDB page - - | - - Play - -
-) +export default function GameEntry ({ name, ifdb, url }) { + return ( +
+

{name}

+ + IFDB page + + | + + Play + +
+ ) +} diff --git a/src/components/Player/GridBuffer.jsx b/src/components/Player/GridBuffer.jsx index f29256e..2b677dc 100644 --- a/src/components/Player/GridBuffer.jsx +++ b/src/components/Player/GridBuffer.jsx @@ -3,7 +3,7 @@ import { useEffect, useState } from 'preact/hooks' import TextMessage from './TextMessage' -export default function ({ inbox, currentWindow }) { +export default function GridBuffer ({ inbox, currentWindow }) { const [prevMessages, setPrevMessages] = useState([]) const [messages, setMessages] = useState([]) @@ -14,7 +14,7 @@ export default function ({ inbox, currentWindow }) { const currentInbox = currentInboxObj?.lines ?? [] - const newOrPrev = (cur, prev) => i => { + const newOrPrev = (cur, prev) => (i) => { const byId = (list, i) => list.find(({ line }) => line === i) @@ -31,23 +31,23 @@ export default function ({ inbox, currentWindow }) { const rawMessagesContent = rawMessages - .map(x => x.content) + .map((x) => x.content) .map(([x]) => x) .map(({ text }) => text) - .map(text => text.trim()) + .map((text) => text.trim()) const isEmpty = rawMessagesContent - .map(text => text.length) - .every(l => l === 0) + .map((text) => text.length) + .every((l) => l === 0) const messages = rawMessagesContent - .map(text => + .map((text) => text.replace(' ', ' / ')) - .map(text => ({ + .map((text) => ({ style: 'grid', - text + text, })) setMessages(isEmpty ? [] : messages) @@ -56,7 +56,7 @@ export default function ({ inbox, currentWindow }) { return (
- {messages.map(TextMessage)} + {messages.map(TextMessage)}
) } diff --git a/src/components/Player/InputBox.jsx b/src/components/Player/InputBox.jsx index a9eaa9a..0d7ab86 100644 --- a/src/components/Player/InputBox.jsx +++ b/src/components/Player/InputBox.jsx @@ -33,11 +33,11 @@ const keyNames = { } /* eslint-enable */ -export default function ({ +export default function InputBox ({ inputType, windows, currentWindowId, - sendMessage + sendMessage, }) { const [targetWindow, setTargetWindow] = useState(null) const [inputText, setInputText] = useState('') @@ -56,7 +56,7 @@ export default function ({ id === currentWindowId)) }, [currentWindowId, windows]) - const send = message => { + const send = (message) => { sendMessage( message, inputType, @@ -65,12 +65,12 @@ export default function ({ setInputText('') } - const charHandler = event => + const charHandler = (event) => (event.keyCode === 229 ? charHandlerMobile : charHandlerDefault)(event) - const charHandlerDefault = event => { + const charHandlerDefault = (event) => { event.preventDefault() const key = @@ -80,8 +80,8 @@ export default function ({ send(key) } - const charHandlerMobile = event => - setTimeout(_ => { + const charHandlerMobile = (event) => + setTimeout(() => { send(event.target.value.slice(-1).toUpperCase()) setInputText('') }) @@ -96,7 +96,7 @@ export default function ({ if (keyCode === keyCodes.KEY_UP) { setInputText(lastInput) - setTimeout(_ => { + setTimeout(() => { const end = lastInput.length inputEl.current.setSelectionRange(end, end) }, 0) @@ -113,16 +113,16 @@ export default function ({ autocorrect: 'off', spellcheck: 'false', placeholder: 'Press any key here', - onKeyDown: charHandler + onKeyDown: charHandler, }, line: { placeholder: ' > ', onKeyDown: lineArrowHandler, - onKeyPress: lineHandler - } + onKeyPress: lineHandler, + }, } - const enterFullscreen = _ => + const enterFullscreen = () => document.documentElement.requestFullscreen() return ( diff --git a/src/components/Player/Player.jsx b/src/components/Player/Player.jsx index 3c57cc6..76bc21a 100644 --- a/src/components/Player/Player.jsx +++ b/src/components/Player/Player.jsx @@ -15,7 +15,7 @@ import './player.css' const INITIAL_STATUS = { stage: 'loading', - details: ['Preparing'] + details: ['Preparing'], } const runMachine = ({ engine: Engine, file, handlers }) => { @@ -28,8 +28,8 @@ const runMachine = ({ engine: Engine, file, handlers }) => { return { sendFn, instance: vm } } -export default function ({ - vmParts: { file, engine }, singleWindow +export default function Player ({ + vmParts: { file, engine }, singleWindow, }) { const [status, setStatus] = useState(INITIAL_STATUS) @@ -50,28 +50,28 @@ export default function ({ setWindows, setCurrentWindowId, setInputType, - setInbox - }) + setInbox, + }), }) setVm(vm) }, [file, engine]) useEffect(() => { - setSendMessage(_ => vm + setSendMessage(() => vm ? vm.sendFn : null) }, [vm]) - const textWindow = inbox => currentWindow => { + const textWindow = (inbox) => (currentWindow) => { const props = { inbox, - currentWindow + currentWindow, } return ({ buffer: , - grid: + grid: , })[currentWindow.type] } @@ -82,18 +82,18 @@ export default function ({ ? () : (
{ - windows - .sort(byTop) - .filter(singleWindow - ? ({ id }) => id === currentWindowId - : _ => true) - .map(textWindow(inbox))} + windows + .sort(byTop) + .filter(singleWindow + ? ({ id }) => id === currentWindowId + : () => true) + .map(textWindow(inbox))}
) } diff --git a/src/components/Player/Status.jsx b/src/components/Player/Status.jsx index 4d86900..7f01aaf 100644 --- a/src/components/Player/Status.jsx +++ b/src/components/Player/Status.jsx @@ -1,12 +1,12 @@ import { h } from 'preact' import { Link } from 'wouter-preact' -const fail = details => ( +const fail = (details) => (

Error

- {details.map(x => (

{x}

))} + {details.map((x) => (

{x}

))}
Home @@ -21,9 +21,9 @@ const fail = details => (
) -const loading = details => ( +const loading = (details) => (
- {details.map(x => (
{x}
))} + {details.map((x) => (
{x}
))}
) diff --git a/src/components/Player/TextBuffer.jsx b/src/components/Player/TextBuffer.jsx index 4d4976b..9de6074 100644 --- a/src/components/Player/TextBuffer.jsx +++ b/src/components/Player/TextBuffer.jsx @@ -3,10 +3,10 @@ import { useEffect, useRef, useState } from 'preact/hooks' import TextMessage from './TextMessage' -const isFakeStatus = w => +const isFakeStatus = (w) => w.height < 5 -const trimInputPrompt = messages => +const trimInputPrompt = (messages) => messages.length < 1 ? messages : messages.slice(-1)[0].text === '>' @@ -21,7 +21,7 @@ const parseInbox = (inbox, currentWindow) => { if (!currentInbox) { return { clear: false, - incoming: [] + incoming: [], } } @@ -45,11 +45,11 @@ const parseInbox = (inbox, currentWindow) => { incoming, clear: isFakeStatus(currentWindow) ? true - : currentInbox.clear + : currentInbox.clear, } } -export default function ({ inbox, currentWindow }) { +export default function TextBuffer ({ inbox, currentWindow }) { const [messages, setMessages] = useState([]) const textBufferEl = useRef(null) @@ -57,7 +57,7 @@ export default function ({ inbox, currentWindow }) { const { incoming, clear } = parseInbox(inbox, currentWindow) - setMessages(messages => clear + setMessages((messages) => clear ? incoming : messages.concat(incoming)) @@ -85,7 +85,7 @@ export default function ({ inbox, currentWindow }) { tabindex='0' ref={textBufferEl} className={classes}> - {messages.map(TextMessage)} + {messages.map(TextMessage)} ) } diff --git a/src/components/Player/TextMessage.jsx b/src/components/Player/TextMessage.jsx index a89ea48..e97e6a7 100644 --- a/src/components/Player/TextMessage.jsx +++ b/src/components/Player/TextMessage.jsx @@ -1,6 +1,6 @@ import { h } from 'preact' -export default function ({ style, text }) { +export default function TextMessage ({ style, text }) { const defaultContent = ( {text} @@ -11,6 +11,6 @@ export default function ({ style, text }) { input: (> {text}), subheader: ({text}), emphasized: ({text}), - endOfLine: (
) + endOfLine: (
), })[style] || defaultContent } diff --git a/src/components/Player/UrlPlayer.jsx b/src/components/Player/UrlPlayer.jsx index b2a21fa..2a5c940 100644 --- a/src/components/Player/UrlPlayer.jsx +++ b/src/components/Player/UrlPlayer.jsx @@ -8,16 +8,16 @@ import Status from './Status' const INITIAL_STATUS = { stage: 'loading', - details: ['Loading'] + details: ['Loading'], } const prepareVM = ({ url, setStatus, setParts }) => { - const st = (stage, details) => args => { + const st = (stage, details) => (args) => { setStatus({ stage, details: [details] }) return args } - const cleanUrl = url => + const cleanUrl = (url) => url.startsWith('blob:') ? url.replace(/#(.*)$/g, '') : url @@ -27,21 +27,21 @@ const prepareVM = ({ url, setStatus, setParts }) => { .then(cleanUrl) .then(fetch) .then(st('loading', 'Processing file')) - .then(response => response.arrayBuffer()) - .then(arrayBuffer => new Uint8Array(arrayBuffer)) + .then((response) => response.arrayBuffer()) + .then((arrayBuffer) => new Uint8Array(arrayBuffer)) .then(st('loading', 'Downloading engine')) - .then(file => setParts({ + .then((file) => setParts({ file, - engine: engineByFilename(url) + engine: engineByFilename(url), })) .then(st('loading', 'Running')) - .catch(e => { + .catch((e) => { console.error(e) setStatus({ stage: 'fail', details: [e.message, url] }) }) } -export default function ({ url, singleWindow }) { +export default function UrlPlayer ({ url, singleWindow }) { const [status, setStatus] = useState(INITIAL_STATUS) const [vmParts, setParts] = useState(null) @@ -54,8 +54,8 @@ export default function ({ url, singleWindow }) { return vmParts ? () + vmParts, + singleWindow, + }} />) : () } diff --git a/src/components/Player/common/engines.js b/src/components/Player/common/engines.js index bb713f5..2bfacce 100644 --- a/src/components/Player/common/engines.js +++ b/src/components/Player/common/engines.js @@ -7,27 +7,27 @@ const formats = [ { id: 'bocfel', extensions: /z([3458]|blorb)$/, - engine: bocfel + engine: bocfel, }, { id: 'git', extensions: /(gblorb|ulx)$/, - engine: git + engine: git, }, { id: 'hugo', extensions: /hex$/, - engine: hugo + engine: hugo, }, { id: 'tads', extensions: /(gam|t3)$/, - engine: tads - } + engine: tads, + }, ] -export const engineByFilename = filename => { - const format = formats.find(x => +export const engineByFilename = (filename) => { + const format = formats.find((x) => x.extensions.test(filename)) if (format) { diff --git a/src/components/Player/playerHandlers.js b/src/components/Player/playerHandlers.js index e7d88cd..1357688 100644 --- a/src/components/Player/playerHandlers.js +++ b/src/components/Player/playerHandlers.js @@ -1,6 +1,6 @@ import { compressToUTF16 as encode, - decompressFromUTF16 as decode + decompressFromUTF16 as decode, } from 'lz-string' export const Handlers = ({ @@ -8,33 +8,33 @@ export const Handlers = ({ setWindows, setCurrentWindowId, setInputType, - setInbox + setInbox, }) => ({ - onInit: _ => { + onInit: () => { setStatus({ stage: 'ready' }) }, /* */ - onUpdateWindows: windows => { + onUpdateWindows: (windows) => { setWindows(windows) }, - onUpdateInputs: data => { + onUpdateInputs: (data) => { if (data.length === 0) return null const { type, id } = data[0] setCurrentWindowId(id) setInputType(type) }, - onUpdateContent: inbox => { + onUpdateContent: (inbox) => { setInbox(inbox) }, - onDisable: _ => { + onDisable: () => { setInputType(null) }, /* */ onFileNameRequest: (tosave, usage, _, setFileName) => { setFileName({ usage, - filename: prompt('Enter the filename') + filename: prompt('Enter the filename'), }) }, onFileRead: ({ filename }) => { @@ -45,7 +45,7 @@ export const Handlers = ({ localStorage.setItem(`fake-fs/${filename}`, encode(content)) }, /* */ - onExit: _ => { + onExit: () => { setInputType(null) - } + }, }) diff --git a/src/components/ThemeSelector/ThemeSelector.jsx b/src/components/ThemeSelector/ThemeSelector.jsx index dc507bc..dfd84b8 100644 --- a/src/components/ThemeSelector/ThemeSelector.jsx +++ b/src/components/ThemeSelector/ThemeSelector.jsx @@ -1,11 +1,11 @@ import { h } from 'preact' -export default function ({ themeEngine }) { - const options = themeEngine.themes.map(theme => ( +export default function ThemeSelector ({ themeEngine }) { + const options = themeEngine.themes.map((theme) => ( )) return ( diff --git a/src/index.js b/src/index.js index 8e50529..58b24c6 100644 --- a/src/index.js +++ b/src/index.js @@ -3,10 +3,10 @@ import { Route, Router, Switch } from 'wouter-preact' import { useHashLocation, - extractView + extractView, } from '~/src/utils/utils.routing' import { - useThemeEngine + useThemeEngine, } from '~/src/themes/themes' import HomeView from '~/src/views/HomeView/HomeView' @@ -21,12 +21,14 @@ function App () { const themeEngine = useThemeEngine() const [location] = useHashLocation() - const playerView = (themeEngine, singleWindow) => params => - () + const playerView = (themeEngine, singleWindow) => + function view (params) { + return () + } return ( @@ -38,7 +40,7 @@ function App () { diff --git a/src/themes/themes.js b/src/themes/themes.js index 38aca14..3957028 100644 --- a/src/themes/themes.js +++ b/src/themes/themes.js @@ -13,7 +13,7 @@ const themes = [ 'redrum', 'toxin', 'valve', - 'wasp' + 'wasp', ] const LS_THEME_KEY = 'elseifplayer/theme' @@ -24,7 +24,7 @@ const getSavedTheme = () => { return savedTheme || DEFAULT_THEME } -const assertTheme = theme => +const assertTheme = (theme) => themes.includes(theme) ? theme : getSavedTheme() @@ -33,7 +33,7 @@ export const useThemeEngine = (initialTheme = getSavedTheme()) => { const [currentTheme, setCurrentTheme] = useState(initialTheme) - const setTheme = theme => { + const setTheme = (theme) => { const newTheme = assertTheme(theme) setCurrentTheme(newTheme) diff --git a/src/utils/utils.routing.js b/src/utils/utils.routing.js index 973ef87..4a91bbf 100644 --- a/src/utils/utils.routing.js +++ b/src/utils/utils.routing.js @@ -1,5 +1,5 @@ import { - useState, useEffect, useCallback + useState, useEffect, useCallback, } from 'preact/hooks' export const useHashLocation = () => { @@ -16,7 +16,7 @@ export const useHashLocation = () => { return () => window.removeEventListener('hashchange', handler) }, []) - const navigate = useCallback(to => + const navigate = useCallback((to) => (window.location.hash = to.replace('#/', '')), []) return [loc, navigate] } @@ -24,7 +24,7 @@ export const useHashLocation = () => { export const buildPlayLinkHref = ({ url }) => `/#/play/${encodeURIComponent(url)}` -export const extractView = location => { +export const extractView = (location) => { const currentView = location.split('/').filter(Boolean)[0] return currentView || '' } diff --git a/src/views/GamesView/GamesView.jsx b/src/views/GamesView/GamesView.jsx index 89ede6c..55ec4a0 100644 --- a/src/views/GamesView/GamesView.jsx +++ b/src/views/GamesView/GamesView.jsx @@ -11,10 +11,10 @@ import './GamesView.css' const tutorialGame = { name: 'The Dreamhold', ifdb: 'https://ifdb.org/viewgame?id=3myqnrs64nbtwdaz', - url: 'https://mirror.ifarchive.org/if-archive/games/zcode/dreamhold.z8' + url: 'https://mirror.ifarchive.org/if-archive/games/zcode/dreamhold.z8', } -export default function () { +export default function GamesView () { return (
@@ -46,7 +46,7 @@ export default function () {
@@ -73,10 +73,10 @@ export default function () {

    - {top2019.map(game => ( + {top2019.map((game) => (
  1. ))} diff --git a/src/views/GamesView/top2019.js b/src/views/GamesView/top2019.js index ade3d26..8893588 100644 --- a/src/views/GamesView/top2019.js +++ b/src/views/GamesView/top2019.js @@ -3,18 +3,18 @@ export default [ /* Check with cheap-glk */ 'Counterfeit Monkey', 'https://ifdb.org/viewgame?id=aearuuxv83plclpl', - 'https://mirror.ifarchive.org/if-archive/games/glulx/CounterfeitMonkey.gblorb' + 'https://mirror.ifarchive.org/if-archive/games/glulx/CounterfeitMonkey.gblorb', ], [ 'Lost Pig', 'https://ifdb.org/viewgame?id=mohwfk47yjzii14w', - 'https://mirror.ifarchive.org/if-archive/games/zcode/LostPig.z8' + 'https://mirror.ifarchive.org/if-archive/games/zcode/LostPig.z8', ], [ /* Works. Check inputs */ 'Anchorhead', 'https://ifdb.org/viewgame?id=op0uw1gn1tjqmjt7', - 'https://ifarchive.org/if-archive/games/zcode/anchor.z8' + 'https://ifarchive.org/if-archive/games/zcode/anchor.z8', ], /* [ '80 DAYS', @@ -24,18 +24,18 @@ export default [ [ 'Galatea', 'https://ifdb.org/viewgame?id=urxrv27t7qtu52lb', - 'https://mirror.ifarchive.org/if-archive/games/zcode/Galatea.zblorb' + 'https://mirror.ifarchive.org/if-archive/games/zcode/Galatea.zblorb', ], [ /* Works. Check inputs */ 'Photopia', 'https://ifdb.org/viewgame?id=ju778uv5xaswnlpl', - 'https://mirror.ifarchive.org/if-archive/games/zcode/photopia.z5' + 'https://mirror.ifarchive.org/if-archive/games/zcode/photopia.z5', ], [ 'Spider and Web', 'https://ifdb.org/viewgame?id=2xyccw3pe0uovfad', - 'https://mirror.ifarchive.org/if-archive/games/zcode/Tangle.z5' + 'https://mirror.ifarchive.org/if-archive/games/zcode/Tangle.z5', ], /* [ 'Trinity', @@ -60,12 +60,12 @@ export default [ [ 'Slouching Towards Bedlam', 'https://ifdb.org/viewgame?id=032krqe6bjn5au78', - 'https://mirror.ifarchive.org/if-archive/games/competition2003/zcode/slouch/slouch.z5' + 'https://mirror.ifarchive.org/if-archive/games/competition2003/zcode/slouch/slouch.z5', ], [ 'Curses!', 'https://ifdb.org/viewgame?id=plvzam05bmz3enh8', - 'https://mirror.ifarchive.org/if-archive/games/zcode/curses.z5' + 'https://mirror.ifarchive.org/if-archive/games/zcode/curses.z5', ], /* [ 'howling dogs', @@ -75,12 +75,12 @@ export default [ [ 'Violet', 'https://ifdb.org/viewgame?id=4glrrfh7wrp9zz7b', - 'https://mirror.ifarchive.org/if-archive/games/zcode/Violet.zblorb' + 'https://mirror.ifarchive.org/if-archive/games/zcode/Violet.zblorb', ], [ 'The Wizard Sniffer', 'https://ifdb.org/viewgame?id=uq18rw9gt8j58da', - 'https://ifarchive.org/if-archive/games/competition2017/The%20Wizard%20Sniffer/The_Wizard_Sniffer.gblorb' + 'https://ifarchive.org/if-archive/games/competition2017/The%20Wizard%20Sniffer/The_Wizard_Sniffer.gblorb', ], /* [ 'Eat Me', @@ -100,12 +100,12 @@ export default [ [ 'Shade', 'https://ifdb.org/viewgame?id=hsfc7fnl40k4a30q', - 'https://mirror.ifarchive.org/if-archive/games/zcode/shade.z5' + 'https://mirror.ifarchive.org/if-archive/games/zcode/shade.z5', ], [ 'Vespers', 'https://ifdb.org/viewgame?id=6dj2vguyiagrhvc2', - 'https://mirror.ifarchive.org/if-archive/games/zcode/vespers.z8' + 'https://mirror.ifarchive.org/if-archive/games/zcode/vespers.z8', ], /* [ 'Will Not Let Me Go', @@ -135,7 +135,7 @@ export default [ [ 'Savoir-Faire', 'https://ifdb.org/viewgame?id=p0cizeb3kiwzlm2p', - 'https://mirror.ifarchive.org/if-archive/games/zcode/Savoir-Faire.zblorb' + 'https://mirror.ifarchive.org/if-archive/games/zcode/Savoir-Faire.zblorb', ], /* [ 'With Those We Love Alive', @@ -145,7 +145,7 @@ export default [ [ 'Aisle', 'https://ifdb.org/viewgame?id=j49crlvd62mhwuzu', - 'https://mirror.ifarchive.org/if-archive/games/zcode/Aisle.z5' + 'https://mirror.ifarchive.org/if-archive/games/zcode/Aisle.z5', ], /* [ 'Blue Lacuna', @@ -155,7 +155,7 @@ export default [ [ 'Gun Mute', 'https://ifdb.org/viewgame?id=xwedbibfksczn7eq', - 'https://mirror.ifarchive.org/if-archive/games/tads/GunMute.t3' + 'https://mirror.ifarchive.org/if-archive/games/tads/GunMute.t3', ], /* [ 'The King of Shreds and Patches', @@ -180,7 +180,7 @@ export default [ [ 'A Beauty Cold and Austere', 'https://ifdb.org/viewgame?id=y9y7jozi0l76bb82', - 'https://ifarchive.org/if-archive/games/competition2017/A%20Beauty%20Cold%20and%20Austere/A_Beauty_Cold_and_Austere.gblorb' + 'https://ifarchive.org/if-archive/games/competition2017/A%20Beauty%20Cold%20and%20Austere/A_Beauty_Cold_and_Austere.gblorb', ], /* [ 'Cactus Blue Motel', @@ -190,7 +190,7 @@ export default [ [ 'Coloratura', 'https://ifdb.org/viewgame?id=g0fl99ovcrq2sqzk', - 'https://mirror.ifarchive.org/if-archive/games/competition2013/glulx/coloratura/Coloratura.gblorb' + 'https://mirror.ifarchive.org/if-archive/games/competition2013/glulx/coloratura/Coloratura.gblorb', ], /* [ 'Harmonia', @@ -200,12 +200,12 @@ export default [ [ 'Lime Ergot', 'https://ifdb.org/viewgame?id=b8mb4fcwmf1hrxl', - 'https://mirror.ifarchive.org/if-archive/games/glulx/Lime_Ergot.gblorb' + 'https://mirror.ifarchive.org/if-archive/games/glulx/Lime_Ergot.gblorb', ], [ 'Rameses', 'https://ifdb.org/viewgame?id=0stz0hr7a98bp9mp', - 'https://mirror.ifarchive.org/if-archive/games/zcode/rameses.zblorb' + 'https://mirror.ifarchive.org/if-archive/games/zcode/rameses.zblorb', ], /* [ 'Spellbreaker', @@ -220,7 +220,7 @@ export default [ [ 'The Wand', 'https://ifdb.org/viewgame?id=2jil5vbxmbv8riv1', - 'https://ifarchive.org/if-archive/games/glulx/Wand.ulx' + 'https://ifarchive.org/if-archive/games/glulx/Wand.ulx', ], /* [ 'Zork I', @@ -230,17 +230,17 @@ export default [ [ '1893: A World\'s Fair Mystery', 'https://ifdb.org/viewgame?id=00e0t7swrris5pg6', - 'https://mirror.ifarchive.org/if-archive/games/tads/1893.gam' + 'https://mirror.ifarchive.org/if-archive/games/tads/1893.gam', ], [ 'Adventure', 'https://ifdb.org/viewgame?id=fft6pu91j85y4acv', - 'https://mirror.ifarchive.org/if-archive/games/zcode/Advent.z5' + 'https://mirror.ifarchive.org/if-archive/games/zcode/Advent.z5', ], [ 'Alias \'The Magpie\'', 'https://ifdb.org/viewgame?id=yspn49v69hzc8rtb', - 'https://ifarchive.org/if-archive/games/competition2018/Alias%20The%20Magpie/Alias%20%27The%20Magpie%27.gblorb' + 'https://ifarchive.org/if-archive/games/competition2018/Alias%20The%20Magpie/Alias%20%27The%20Magpie%27.gblorb', ], /* [ 'De Baron', @@ -255,22 +255,22 @@ export default [ [ 'Cragne Manor', 'https://ifdb.org/viewgame?id=4x7nltu8p851tn4x', - 'https://mirror.ifarchive.org/if-archive/games/glulx/cragne.gblorb' + 'https://mirror.ifarchive.org/if-archive/games/glulx/cragne.gblorb', ], [ 'The Edifice', 'https://ifdb.org/viewgame?id=4tb9soabrb4apqzd', - 'https://mirror.ifarchive.org/if-archive/games/zcode/edifice.z5' + 'https://mirror.ifarchive.org/if-archive/games/zcode/edifice.z5', ], [ 'Endless, Nameless', 'https://ifdb.org/viewgame?id=7vtm1rq16hh3xch', - 'https://ifarchive.org/if-archive/games/zcode/nameless.z8' + 'https://ifarchive.org/if-archive/games/zcode/nameless.z8', ], [ 'Everybody Dies', 'https://ifdb.org/viewgame?id=lyblvftb8xtlo0a1', - 'https://mirror.ifarchive.org/if-archive/games/competition2008/glulx/everybodydies/EverybodyDies.gblorb' + 'https://mirror.ifarchive.org/if-archive/games/competition2008/glulx/everybodydies/EverybodyDies.gblorb', ], /* [ 'Fallen London', @@ -280,12 +280,12 @@ export default [ [ 'Foo Foo', 'https://ifdb.org/viewgame?id=ec6x9y8qcmsrxob9', - 'https://ifarchive.org/if-archive/games/springthing/2016/FooFoo.gblorb' + 'https://ifarchive.org/if-archive/games/springthing/2016/FooFoo.gblorb', ], [ 'The Gostak', 'https://ifdb.org/viewgame?id=w5s3sv43s3p98v45', - 'https://mirror.ifarchive.org/if-archive/games/zcode/gostak.z5' + 'https://mirror.ifarchive.org/if-archive/games/zcode/gostak.z5', ], /* [ 'The Hitchhiker\'s Guide to the Galaxy', @@ -305,27 +305,27 @@ export default [ [ 'Inside the Facility', 'https://ifdb.org/viewgame?id=stsdri5zh7a4i5my', - 'https://ifarchive.org/if-archive/games/competition2016/Inside%20the%20Facility/Facility.z8' + 'https://ifarchive.org/if-archive/games/competition2016/Inside%20the%20Facility/Facility.z8', ], [ 'Junior Arithmancer', 'https://ifdb.org/viewgame?id=pw1rbjt1t4n4n87s', - 'https://ifarchive.org/if-archive/games/competition2018/Junior%20Arithmancer/Junior_Arithmancer.gblorb' + 'https://ifarchive.org/if-archive/games/competition2018/Junior%20Arithmancer/Junior_Arithmancer.gblorb', ], [ 'Make It Good', 'https://ifdb.org/viewgame?id=jdrbw1htq4ah8q57', - 'https://mirror.ifarchive.org/if-archive/games/zcode/MakeItGood.zblorb' + 'https://mirror.ifarchive.org/if-archive/games/zcode/MakeItGood.zblorb', ], [ 'Sub Rosa', 'https://ifdb.org/viewgame?id=73nvz9yui87ub3sd', - 'https://mirror.ifarchive.org/if-archive/games/glulx/Sub_Rosa.gblorb' + 'https://mirror.ifarchive.org/if-archive/games/glulx/Sub_Rosa.gblorb', ], [ 'Suveh Nux', 'https://ifdb.org/viewgame?id=xkai23ry99qdxce3', - 'https://mirror.ifarchive.org/if-archive/games/zcode/suvehnux.z5' + 'https://mirror.ifarchive.org/if-archive/games/zcode/suvehnux.z5', ], /* [ 'their angelical understanding', @@ -340,6 +340,6 @@ export default [ [ 'Varicella', 'https://ifdb.org/viewgame?id=ywwlr3tpxnktjasd', - 'https://mirror.ifarchive.org/if-archive/games/zcode/vgame.z8' - ] + 'https://mirror.ifarchive.org/if-archive/games/zcode/vgame.z8', + ], ].map(([name, ifdb, url]) => ({ name, ifdb, url })) diff --git a/src/views/HomeView/HomeView.jsx b/src/views/HomeView/HomeView.jsx index 6842182..8630447 100644 --- a/src/views/HomeView/HomeView.jsx +++ b/src/views/HomeView/HomeView.jsx @@ -3,7 +3,7 @@ import { Link } from 'wouter-preact' import { useHashLocation, - buildPlayLinkHref + buildPlayLinkHref, } from '~/src/utils/utils.routing' import LocalFileSelector from @@ -15,7 +15,7 @@ import ThemeSelector from import './HomeView.css' -export default function ({ themeEngine }) { +export default function HomeView ({ themeEngine }) { const setLocation = useHashLocation()[1] return ( @@ -46,7 +46,7 @@ export default function ({ themeEngine }) {

    @@ -97,7 +97,7 @@ export default function ({ themeEngine }) {

    @@ -108,7 +108,7 @@ export default function ({ themeEngine }) {

    diff --git a/src/views/NotFoundView.jsx b/src/views/NotFoundView.jsx index 107c4a0..878959c 100644 --- a/src/views/NotFoundView.jsx +++ b/src/views/NotFoundView.jsx @@ -1,8 +1,8 @@ import { h } from 'preact' import { Link } from 'wouter-preact' -export default () => ( -
    +export default function NotFoundView () { + return

    404 @@ -23,4 +23,4 @@ export default () => (

    -) +} diff --git a/src/views/PlayerView/PlayerView.jsx b/src/views/PlayerView/PlayerView.jsx index 3dc6d5e..bc62d06 100644 --- a/src/views/PlayerView/PlayerView.jsx +++ b/src/views/PlayerView/PlayerView.jsx @@ -5,10 +5,10 @@ import UrlPlayer from '~/src/components/Player/UrlPlayer' import './PlayerView.css' -const decode = encodedUrl => decodeURIComponent(encodedUrl) +const decode = (encodedUrl) => decodeURIComponent(encodedUrl) -export default function ({ - setTheme, theme, encodedUrl, singleWindow +export default function PlayerView ({ + setTheme, theme, encodedUrl, singleWindow, }) { useEffect(() => setTheme(theme), [setTheme, theme]) @@ -22,7 +22,7 @@ export default function ({
    )