This is an editor and viewer for Portable Tak Notation (PTN). It aims to be...
- Useful for transcription of live games, even on a phone.
- Intuitive, with a minimal UI that is enjoyable to use.
- Responsive, with a fluid design that works as well on a phone as it does in full-screen on a desktop.
- Quasar: https://quasar.dev/quasar-cli/installation
- Firebase: https://firebase.google.com/docs/emulator-suite/install_and_configure
yarn
pushd functions && npm install && popd
yarn dev
yarn emulate
yarn lint
yarn build
PTN Ninja can send and receive messages with its opening or parent window using Window.postMessage()
. These messages are objects containing an action
, as well as a value
where applicable.
For example:
{
action: "SET_UI",
value: {
showRoads: true
}
}
- Set the game title
- Set one or more UI parameters
- Toggle the specified UI parameter
- Replace the current game with the provided PTN
- Delete the ply specified by ID
- Execute a single ply specified as a string in PTN (e.g.
Sb4
)
- Insert a series of
plies
specified as strings in PTN (e.g.['d5', 'e4']
, ord5 e4
) and go backwardprev
plies. If a line number is specified in place of the first ply, following plies will be inserted at that location. If the second ply is a NOP, following plies will begin with Player 2.
- Delete the specified branch
- Navigate to the specified ply
- Begin stepping through plies from current position
- Stop stepping through plies
- Toggle between PLAY and PAUSE
- Navigate backward
- Navigate forward
- Navigate to the beginning
- Navigate to the end
- Undo
- Redo
- Promote a branch specified by its name
- Swap a branch with its main line, specified by branch name
- Rename a branch
- Toggle evaluation notation on the current ply
- Replace the specified comment
- Add a comment to the specified ply, or the current ply if not specified
- Add the comments to the specified plies
- Remove the specified comment
- Remove non-active branches
- Remove plies, preserving the board state
- Remove all plies preceding the current ply
- Abort any in-progress piece movement interaction
- Issue a notification
- Issue an error notification
- Issue a success notification
- Issue a warning notification
- Issue a hint notification
- Rotate the board 180 degrees
- Rotate the board left 90 degrees
- Rotate the board right 90 degrees
- Flip the board horizontally
- Flip the board vertically
- Reset any board transformation
- Apply the specified board transformation
[int a, int b]
wherea
is the number of clockwise rotations [0, 3], andb
is the number of horizontal flips [0, 1].
- Highlight the squares specified as an array of string coordinates (e.g. 'a1'). If no squares are provided, the most recent ply is highlighted.
- Show the specified evaluation score on the board.
PTN Ninja uses lz-string to encode PTN and some other parameters for use in the URL. However, it will also do its best to read these parameters when passed as plaintext.
The structure of the URL is as follows:
https://ptn.ninja/<PTN>&<param1>=<value1>&<param2>=<value2>[...]
To get a shortened URL, send a POST request to https://url.ptn.ninja/short
with request body { ptn, params (optional) }
where ptn
is a string, and params
is an optional object containing any of the parameters below. If the request is valid, you'll receive the complete shortenend URL as plain text in response. If the URL is not accessed within 30 days, it will be deleted.
- Title of the game
- Index of the current ply
- Ending with
!
meansplyIsDone == true
- Name of the current branch
- ID or JSON of the theme to be used
- Show axis labels
- Show flat counts
- Show stack counts
- Show turn indicator
- Show square highlights
- Steps per minute to be used for playback
- Show all branches
- Show playback controls
- Show the current move
- Show the PTN panel
- Show road connections
- Show the playback scrubber
- Show the Notes panel
- Show unplayed pieces
© 2022 Craig Laparo
This work is licensed under a GNU AGPLv3 License.