diff --git a/.eslintrc.js b/.eslintrc.js index 1736bef..a31438b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,26 +1,46 @@ module.exports = { - env: { - browser: true, - es2021: true + 'env': { + 'browser': true, + 'es2021': true }, - extends: [ - 'standard', - 'standard-preact' + 'extends': [ + 'eslint:recommended', + 'preact', ], - overrides: [ + 'overrides': [ { - files: ['*.jsx', '*.js'] - } + files: ['*.js', '*.jsx'], + }, ], - parserOptions: { - ecmaVersion: 12, - sourceType: 'module' + 'parserOptions': { + 'ecmaVersion': 'latest', + 'sourceType': 'module' }, - rules: { - }, - settings: { - react: { - version: 'latest' - } + 'rules': { + 'jest/no-deprecated-functions': 0, + + 'arrow-parens': ['error', 'always'], + 'comma-dangle': ['error', 'always-multiline'], + + 'indent': [ + 'error', + 2 + ], + 'linebreak-style': [ + 'error', + 'unix' + ], + 'object-curly-spacing': [ + 'error', + 'always' + ], + 'quotes': [ + 'error', + 'single' + ], + 'semi': [ + 'error', + 'never' + ], } } diff --git a/.gitignore b/.gitignore index 11f90a4..f0a8aba 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ node_modules/ dist/ -.cache/ +.parcel-cache/ diff --git a/.parcelrc b/.parcelrc new file mode 100644 index 0000000..1f3df89 --- /dev/null +++ b/.parcelrc @@ -0,0 +1,4 @@ +{ + "extends": ["@parcel/config-default"], + "reporters": ["...", "parcel-reporter-static-files-copy"] +} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..32d8aa2 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,28 @@ +# 0.2.0 + +## Breaking Changes + +- Changed direct links format +- Changed savefiles format + +## Changes + +- Added over 150 new interface themes +- Added themes preview page +- Implemented smooth scrolling when a new message appears +- Added an in-game menu +- Improved mobile user experience +- Upgraded Emglken to version 0.5.2 +- Upgraded cheap-glkote to version 0.5.1 +- Added support for ADRIFT 4 +- Fixed broken links +- Enhanced error handling +- Refactored styles for improved code structure + +# 0.1.0 + +- Added support for multiple output buffers + +# 0.0.0 + +- Initial release diff --git a/README.md b/README.md index b32f86c..5c5711c 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,65 @@ -# ifplayer +# ElseIFPlayer -Interactive Fiction player for the web. -Powered by [cheap-glkote](https://github.com/He4eT/cheap-glkote) and [Emglken](https://github.com/curiousdannii/emglken). +ElseIFPlayer is an interactive fiction player for the web. +It's powered by [cheap-glkote](https://github.com/He4eT/cheap-glkote) and [Emglken](https://github.com/curiousdannii/emglken). -To see a live demo, check out [https://he4et.github.io/ifplayer/](https://he4et.github.io/ifplayer/). +Player available here: [https://he4et.github.io/elseifplayer/](https://he4et.github.io/elseifplayer/). + +## Getting Started + +- Ensure that you have Node.js and NPM installed on your system. +- Install the required packages by running the command `npm install` in your project directory. +- Launch the local development server using `npm run dev`. + +## Build + +To create a production build, use the following command: +``` +npm run build +``` + +- If you intend to host the player on `https://your.domain/`, use: + ``` + npm run build / + ``` +- For hosting it in a specific directory like `https://your.domain/some-directory/`, use: + ``` + npm run build /some-directory + ``` + +The finalized production bundle will be generated and stored in the `/docs` directory. ## Direct links -You can provide the direct link to your game: +You can provide a direct link to a specific game using the following URL format: +``` +/#///[theme]/ +``` -`/#/play/encodedURL/[theme]/` -- `encodedURL` - storyfile location encoded with `encodeURIComponent`; -- `theme` - [UI theme](https://github.com/He4eT/ifplayer/blob/master/src/themes/themes.js), optional; +- `mode` specifies the player interface mode: + - `play`: the default multi-window mode + - `focus`: the single-window mode without additional windows, such as the status bar +- `encodedURL` represents the location of the storyfile encoded with `encodeURIComponent`. +- `theme` is optional and allows you to choose a specific UI theme. -### Examples -- [Play "Lost Pig" with default or last used theme](https://he4et.github.io/ifplayer/#/play/https%3A%2F%2Fmirror.ifarchive.org%2Fif-archive%2Fgames%2Fzcode%2FLostPig.z8/); -- [Play "Lost Pig" with Nord theme](https://he4et.github.io/ifplayer/#/play/https%3A%2F%2Fmirror.ifarchive.org%2Fif-archive%2Fgames%2Fzcode%2FLostPig.z8/nord/); +### CORS + +If the player and your storyfile are located on different domains, +you need to use appropriate [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings. + +If you cannot modify the server settings, you can use the [Parchment Proxy](https://iplayif.com/proxy/) as an alternative. + +### Direct Link Examples + +- [Play "Lost Pig" with default or last used theme](https://he4et.github.io/elseifplayer/#/play/https%3A%2F%2Fmirror.ifarchive.org%2Fif-archive%2Fgames%2Fzcode%2FLostPig.z8/) +- [Play "Lost Pig" without statusbar with default or last used theme](https://he4et.github.io/elseifplayer/#/focus/https%3A%2F%2Fmirror.ifarchive.org%2Fif-archive%2Fgames%2Fzcode%2FLostPig.z8/) +- [Play "Lost Pig" with Nord theme](https://he4et.github.io/elseifplayer/#/play/https%3A%2F%2Fmirror.ifarchive.org%2Fif-archive%2Fgames%2Fzcode%2FLostPig.z8/nord/) +- [Play "Lost Pig" without statusbar with Dim theme](https://he4et.github.io/elseifplayer/#/focus/https%3A%2F%2Fmirror.ifarchive.org%2Fif-archive%2Fgames%2Fzcode%2FLostPig.z8/dim/) +- [Play "Lost Pig" loaded with Parchment Proxy](https://he4et.github.io/elseifplayer/#/play/https%3A%2F%2Fiplayif.com%2Fproxy%2F%3Furl%3Dhttps%3A%2F%2Fifarchive.org%2Fif-archive%2Fgames%2Fzcode%2FLostPig.z8) + +## License + +ElseIFPlayer is distributed under the MIT License. +However, please remember to respect the licenses of the interpreters +listed on the +[Emglken page](https://github.com/curiousdannii/emglken#included-projects). diff --git a/gh.release.sh b/gh.release.sh index e17ab7a..f827697 100755 --- a/gh.release.sh +++ b/gh.release.sh @@ -2,7 +2,7 @@ CURRENT_TIMESTAMP=`date +"%Y-%m-%d-%H%M%S"` -GH_REPO_NAME='ifplayer' +GH_REPO_NAME='elseifplayer' RELEASE_BRANCH='release' BUILD_DIR='docs' diff --git a/index.html b/index.html index ea48db3..e6068e0 100644 --- a/index.html +++ b/index.html @@ -4,33 +4,25 @@ + content="width=device-width, initial-scale=1.0, interactive-widget=resizes-content"> - IFPlayer + ElseIFPlayer + content="Interactive Fiction player for the web"> -
+
-
-
-
-
Loading
-
-
-
- -
- - +