Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ node_modules
package-lock.json

# build
main.js
# main.js
*.js.map

RESOURCES.md
130 changes: 130 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Chesser Custom – Version 0.2.1-custom

This is a customized fork of the Chesser plugin for Obsidian, focused on multi-device usage, persistent vault storage, and mobile UX improvements.

---

## Functional Improvements

### Vault-Based State Storage
- Replaces `localStorage` with `.ChesserStorage/` in the vault
- Uses Obsidian's adapter API for read/write
- Fully synced across devices (e.g., via Git or Obsidian Sync)
- Mobile-compatible (no localStorage issues on mobile)

### PGN Initialization Support
- Define a `pgn:` block inside the code block
- Automatically parses and normalizes the PGN
- Initializes the board accordingly
- Fallback to `fen:` if PGN is not present

````
```chesser
pgn: 1. e4 e6 2. d4 d5 3. Nc3 Bb4
```
````

### "Init" Button
- Adds a button to reset the board to the starting position (PGN/FEN)

### Reset Button Icon
- Updated the reset icon to `"home"` for clarity

### "Copy PGN" Button
- Added `Copy PGN` button in the chessboard toolbar.
- Allows users to copy the current game in PGN format to the clipboard.
- Returns `'1...'` if no moves have been played.

### Hide Free Move Option
- The "Enable Free Move?" toggle is hidden via CSS
- The functionality is still available internally

---

## Mobile Enhancements

### Responsive Chessboard
- The board scales with screen size (no horizontal scrolling)
- Maintains square aspect ratio via `::before` CSS trick

### Adaptive Toolbar
- Toolbar appears above the menu on mobile
- Improved button spacing for touch interaction

---

## How to Build & Install Chesser Custom

This guide explains how to clone, build, and install the plugin manually in Obsidian.

---

### 1. Prerequisites

- Install [Node.js (LTS version)](https://nodejs.org/)
- This also installs `npm` (Node Package Manager)
- To verify installation:
```bash
node -v
npm -v
```

---

### 2️. Clone the Repository

Open a terminal or Git Bash and run:

```bash
git clone https://github.com/123vincent/Chesser.git
cd Chesser
```

---

### 3️. Install Dependencies

Inside the project folder:

```bash
npm install
```

This will install all required packages from `package.json`.

---

### 4️. Build the Plugin

```bash
npm run build
```

This will generate the compiled plugin files:
- `main.js`
- `manifest.json`
- `styles.css`

You should now see these files in the project's `dist/` folder.

---

### 5️. Install the Plugin in Obsidian

1. Open your Obsidian vault folder
2. Go to: `.obsidian/plugins/`
3. Create a folder called `chesser-custom`
4. Copy these 3 files into that folder:
- `main.js`
- `manifest.json`
- `styles.css`
5. In Obsidian:
- Go to **Settings → Community Plugins**
- Click **Reload plugins** (or restart Obsidian)
- Enable **Chesser** (your custom version)

---

Your custom version of Chesser is now active — enjoy your synced, mobile-ready chess experience!

Built with ❤️ by [VincentB.](https://github.com/123vincent), based on the original plugin by [SilentVoid](https://github.com/SilentVoid13).
58 changes: 56 additions & 2 deletions assets/custom.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
.cg-wrap {
width: 400px;
height: 400px;
width: 100%;
max-width: 400px;
height: auto;
position: relative;
}

.cg-wrap::before {
content: "";
display: block;
padding-bottom: 100%; /* Perfect square */
}

.cg-wrap > * {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}

.chesser-container {
Expand All @@ -18,12 +34,20 @@
width: calc(100% - 424px);
}

.chesser-hide-setting {
display: none;
}

.chess-toolbar-container {
border-top: 1px solid var(--background-modifier-border);
margin-top: auto;
padding-top: 8px;
}

.chess-toolbar-container .view-action {
margin-right: 0.6em; /* espace entre boutons */
}

.chess-turn-text {
font-weight: 500;
margin: 8px 0;
Expand Down Expand Up @@ -69,3 +93,33 @@
margin-bottom: 12px;
width: 100%;
}

/* On small screens (iPhone portrait) */
@media (max-width: 768px) {
.chesser-container {
display: flex;
flex-direction: column;
height: auto;
}

.chess-menu-container {
display: flex;
flex-direction: column;
width: 100%;
margin-left: 0;
margin-top: 16px;
box-sizing: border-box;
}

.chess-toolbar-container {
order: -1; /* Move the toolbar to the top of the menu */
margin-bottom: 0.5em; /* space under the buttons */
}

.chess-toolbar-container .view-action {
margin-right: 12px;
padding-inline: 6px;
}
}
/* end of media */

Loading