desck 0.4.2 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/desck.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- require("./server.cjs");
2
+ require(`${__dirname}/server.cjs`);
package/package.json CHANGED
@@ -1,25 +1,30 @@
1
1
  {
2
2
  "name": "desck",
3
- "version": "0.4.2",
3
+ "author": "Akos Plesznivy",
4
+ "version": "0.4.4",
4
5
  "description": "A card layout editor made for creating example images for our card games using the standard deck.",
5
6
  "main": "server.cjs",
6
7
  "scripts": {
7
8
  "test": "echo \"Error: no test specified\" && exit 1",
8
- "build": "npx elm make src/Main.elm --output=public/main.js --optimize && cp README.md public/",
9
- "prepare": "npm run build",
9
+ "build": "elm make src/Main.elm --output=public/main.js --optimize && cp README.md public/",
10
+ "prepack": "npm run build",
10
11
  "start": "node server.cjs"
11
12
  },
12
- "author": "Akos Plesznivy",
13
13
  "license": "ISC",
14
14
  "dependencies": {
15
15
  "express": "^4.21.1",
16
- "puppeteer": "^24.10.0",
17
- "socket.io": "^4.8.0"
16
+ "socket.io": "^4.8.0",
17
+ "elm": "^0.19.2-0",
18
+ "puppeteer": "^25.12.0"
18
19
  },
20
+ "files": [
21
+ "./public/",
22
+ "./src/",
23
+ "./server.cjs",
24
+ "./settings.json",
25
+ "./desck.cjs"
26
+ ],
19
27
  "bin": {
20
28
  "desck": "./desck.cjs"
21
- },
22
- "devDependencies": {
23
- "elm": "^0.19.2-0"
24
29
  }
25
30
  }
@@ -0,0 +1,176 @@
1
+ # Desck
2
+
3
+ A card layout editor made for creating example images for card games using the standard deck.
4
+
5
+ [live demo](https://unlessgames.gitlab.io/desck)
6
+
7
+ If you enjoy this tool, consider [donating♥](https://ko-fi.com/unlessgames)!
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npm install
13
+ ```
14
+
15
+ ## Build
16
+
17
+ ```bash
18
+ elm make src/Main.elm --output=public/main.js --optimize
19
+ npm link
20
+ ```
21
+
22
+ ## Run
23
+
24
+ ```bash
25
+ desck
26
+ ```
27
+
28
+ ## Help
29
+
30
+ There are four main layers in Desck
31
+
32
+ * `Zones ⌧` where you can have rectangles with optional text labels for showing discard piles and other areas of your layout
33
+ * `Cards 🂠` to contain all the cards in examples
34
+ * `Arrows ↣` can have arrows pointing from cards to other cards or zones to illustrate things that can be played and so on
35
+ * `Stamps ✪` are colored circles with a symbol or text inside, useful for referencing from rulebooks for example
36
+
37
+ ### Cards
38
+
39
+ * Select cards by clicking them or dragging a selection box around them
40
+ * Add cards to the selection by holding down `Ctrl` while clicking on a new card
41
+ * `Click+Drag` selected cards to move them
42
+ * `Alt+Drag` rotate card freely
43
+ * `Alt-click` on a card to rotate sideways
44
+ * `Right-click` to flip between back and front
45
+ * `Alt+Right-click` to toggle highlighting the card
46
+
47
+ #### Spawning
48
+
49
+ At the bottom, you can type in what card(s) you want into the first input field and spawn them by pressing enter
50
+ * Specify cards via `rank + suit` syntax
51
+ - `3s` is the 3 of Spades
52
+ - `ac` is the Ace of Clubs
53
+ - `0h` is the 10 of Hearts
54
+ - `jd` is the Jack of Diamonds
55
+ - `q` will spawn all 4 Queens
56
+ - `s` will spawn all Spades
57
+ - `xr` is the red Joker (black is `xb`)
58
+ - spawn multiple cards by separating with space like `as 2d 3c 4h`
59
+
60
+ #### Modification
61
+
62
+ You can change the rank and suit of selected cards by rewriting their codes at the bottom and pressing `Enter`. For example, if you select the Ace of Spades, `as` will appear in the bottom, if you change it to `2s` and press the `Enter` key, the card will change to the Two of Spades.
63
+
64
+ #### Ordering
65
+
66
+ * Toggle between `move to top` and `keep order` behaviours, the former will bring whatever card you pick up to the top
67
+
68
+ #### Spread
69
+
70
+ If you have multiple cards selected you can automatically spread them using different methods and spread amount.
71
+ * Select multiple cards
72
+ * Choose a spread type via the `🠚 🠛 ➘ ⇉ ⇊ 🂠 ⌓` buttons
73
+ * Adjust the spread amount at the end to customize the spread like how far cards should be offset or how many columns to use
74
+ * Hover the spread type buttons to see their names
75
+
76
+ #### Shuffle
77
+ * Click `shuffle` to randomly swap cards inside a selection
78
+
79
+ ### Zones
80
+
81
+ * Lock the zones layer by pressing `⌧`, when locked, you will not be able to accidently interact with already created zones
82
+ * `Right-click+Drag` to select a rectangle as a new zone
83
+ * `Alt+Drag` on the background also works
84
+ * Click on existing zones to edit their values
85
+ * Change label, fill color, border stroke width, font size, border dashes and so on
86
+ * You can pick transparent in color pickers (empty shape) to create text labels without background or border
87
+
88
+ ### Arrows
89
+
90
+ * `Right-click+Drag` from a card or a zone to start an arrow
91
+ * Let go of the drag over another card or zone
92
+ * An arrow will be created pointing from the first shape to the second
93
+ * `Shift+Drag` also works
94
+ * Click on an existing arrow to change it's color and other settings
95
+
96
+ ### Stamps
97
+
98
+ Similar to spawning cards, you can use the second input field at the bottom to spawn a stamp with some text inside, you can select spawned stamps to change their content, the stamp menu has some useful unicode symbols for quick addition but you can use any UTF-8 character you want
99
+
100
+ ### Removal
101
+
102
+ * Select the shapes you want to remove and click `Remove`
103
+ * `Shift+Right-click` will also work
104
+ * Press `↺` to `Undo` your last change
105
+
106
+
107
+ ### Palette
108
+
109
+ * In the `◍ Settings` menu you can modify the color palette used for everything
110
+ * Pick a built-in theme
111
+ * Slect colors to configure
112
+ * The changes apply to any existing element
113
+
114
+
115
+ ### Viewport
116
+
117
+ Set the position and size of the viewport. The coordinates are in "card space", a size of 3x2 will mean that the view will spawn 3 times the width of cards and 2 times their height.
118
+ * Scroll to zoom in and out
119
+ * `Middle-click+Drag` to `Pan` around
120
+
121
+
122
+ ### Files
123
+
124
+ You can export three different formats from Desck:
125
+ * `⤓ SVG` - will download the image as scalable vector graphics
126
+ * `⤓ PNG` - will render a `.png` image with a size corresponding to the number you've set next to this button. The value sets the height of a card in pixels. This lets you maintain the same card size regardless of the zoom of your project.
127
+ * `⤓ JSON` - will export a `.json` file that contains the project's data without the visuals
128
+ * `load` - can import a `.json` file to continue working on a previous project
129
+
130
+ There are a few other buttons in the top left corner
131
+ * `save` will store your current project in your browser's cache (make sure to export files to avoid losing progress when you clear your browser history)
132
+ * `clone` will start a new project based on the current one, you will be prompted to give it a new name
133
+
134
+ > If you download the [Desck source](https://gitlab.com/unlessgames/desck) you can run the project locally using `node`, in this case Desck will be able to save and load files from it's export folder instead of having to rely on browser cache. If you are comfortable with git and using node and npm, this is the intended way of working with Desck. The online version is mainly for trying the program out.
135
+
136
+ ## Automated Exporting
137
+
138
+ When running locally via the node server, you can batch convert all your project files into `.svg` or `.png` images at once and save into the `exports` folder inside the project (useful for updating a rulebook on a git repo with continuous integration enabled [link to our rulebook needed](TODO implement build in deck))
139
+ * `desck <SOURCE_FOLDER> <OUTPUT_FOLDER> --export --svg` - exports all files as `.svg`
140
+ * `desck <SOURCE_FOLDER> <OUTPUT_FOLDER> --export --svg` - exports all files as `.png` (resolution will be decided based on the project file's settings)
141
+
142
+ <!-- ### Title -->
143
+
144
+ <!-- * Click `🖹` -->
145
+ <!-- * Add a short description to the exported SVG -->
146
+ <!-- * This text will be written to the `title` attribute and can be used to render a description (or just keep as a hover tooltip) -->
147
+
148
+ <!-- ## Extending -->
149
+
150
+ <!-- While this isn't well supported yet, you could replace the set that makes up the deck by supplying your own CardModel type and graphics and exposing a handful of functions (see `Deck.elm` and `DeckView.elm` for the built-in standard deck) -->
151
+
152
+ <!-- Currently, these are the things that are expected to exist -->
153
+
154
+ <!-- * `type CardModel` - represents a single card, for example `type CardModel = Int` would represent cards that only have an integer property -->
155
+ <!-- * `modelAsShort : CardModel -> String` - used for spawning and modifying selected cards -->
156
+ <!-- * `parseCards : String -> List CardModel` - used for parsing the spawn query and modifications, if the conversion fails an empty list is expected, this is a list instead of a `Maybe CardModel` - so that shorthands for sets (like `j` for all `Jacks`) is possible when spawning -->
157
+ <!-- * `encodeModel : CardModel -> Json.Encode.Value` - used to serialize cards when saving as JSON -->
158
+ <!-- * `modelDecoder : Json.Decode.Decoder CardModel` - used to decode a saved project -->
159
+ <!-- * `modelUsing : CardModel -> List String` - returns a list of symbol ids that the card is using to filter out unneeded symbols from the svg export -->
160
+ <!-- * `defaulModel : CardModel` - a default card -->
161
+
162
+ <!-- And a few more that are used to show the cards, these should return `Svg` elements -->
163
+
164
+ <!-- * `backface : CardModel -> Svg msg` - shows the back-side of a card -->
165
+ <!-- * `frontface : CardModel -> Svg msg` - shows the front-side of a card -->
166
+ <!-- * `corderRadius : String` - sets the corner radius of every card shown (for example `"8"`) -->
167
+ <!-- * `includes : List (Svg msg)` - this is added to the main SVG element before anything else, useful for reusable `def` symbols -->
168
+
169
+ ## Acknowledments
170
+
171
+ * images for royal cards and the card font were converted from [Total Nonsense - Open Source Vector Playing Cards](https://totalnonsense.com/open-source-vector-playing-cards/) licensed under [LGPL-3.0](https://www.gnu.org/licenses/lgpl-3.0.html)
172
+ * suit symbols were designed by Petra Hahn
173
+
174
+ ## Support
175
+
176
+ If you enjoy this tool, consider [donating♥](https://ko-fi.com/unlessgames)!
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file