Jstris PC Mode Replay Viewer
A Web-based tool for reviewing Jstris PC Mode replay.
Demo: GitHub Page
As shown in the above image, there are 5 major regions in the viewer:
Replay Region This region shows the board, queue, and the falling piece before each piece placement.
Side Controls This region categories PCs in this run to a number from 1-7 as in the 70-piece loop theory, the current PC number in this replay, and the queue of Tetriminos that each PC starts with. You can click on a specific item to jump to that PC.
Bottom Controls This region contains the control buttons for the replay. The button functionalities and their default key bindings are (from left to right):
|Reset to the first PC
|Back to the previous PC
|Back to the last piece
|Place the next piece
|Forward to the first PC
You might have noticed the button in the bottom right corner. It is supposed to open up an options menu, but it has no functionality because I don’t know what should be in the options… If you have any idea, welcome to contribute to this project by opening an issue.
Page Number Controls This region contains number of pieces placed in this PC and the current PC Number. It also contains an input box that you can use to quickly jump to a specific PC.
Upload Region This region contains two buttons for uploading a replay to this viewer. For more specific instructions, please refer to the Upload Replay section.
There are two uploading methods:
Upload a replay code/url
- Open up a Jstris PC Mode replay, then either –
- Copy the replay link in the url bar. It should be in the format of
- Copy the replay code from the input box to the left of the Load button.
- In the viewer, click the Upload a Replay Code/Link button and paste the content you just copied into the input area, then click “Upload“.
- Wait a few seconds until the reponses are received from the API and parsed. The replay will then show up in the viewer.
There’s an issue with the api I use that the queue after certain number of pieces placed will not be shown. If you see error
Replay too long, please use the second method.
Upload a replay json
Since this method is simply more complicated, please use the other method above unless it is not possible (when Jstris server is down or the replay is too long).
- Install TamperMonkey from Chrome Store or Firefox Store. If you are using a different browser, go to https://tampermonkey.net/ to get the extension for your browser.
- Download and import this script into the TamperMonkey console (or create a new script and paste the code into it).
- Open a Jstris PC Mode replay, make sure the script is running by click the TamperMonkey icon
- Click the Load button, let the script run for a few seconds.
- After pieces appear in the replay, press down S key to download the json.
- In the viewer, click the upload a replay json button and select the file you just downloaded.
Please see the GitHub tutorial on forking and sending pull requests. (Have fun editing my tailwind classes!)
If you have any questions, please feel free to open an issue.
Run on your local machine
git clone [email protected]:smdbs-smdbs/jstris-pc-mode-replay-viewer.git
npm run dev
npm run build