24 | {{^Key Combination}}
25 | Fill field shortcut in form `Ctrl Shift P` to format!
26 | {{/Key Combination}}
27 |
28 |
29 |
69 |
70 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # prty-shortcut cards - Simply pretty Anki cards for keyboard shortcuts
2 |
3 | [](https://github.com/ginger51011/prty-shortcut-cards/blob/main/LICENSE)
4 |
5 | `prty-shortcut` allows for quickly creating nice looking Anki cards for memorizing keyboard
6 | shortcuts for different software. Shortcuts are formatted automatically, so by entering `Ctrl K` and `I`,
7 | `prty-shortcut` will insert the format below!
8 |
9 | 
10 |
11 | ## Installation
12 |
13 | ### Using demo deck
14 |
15 | By installing the demo deck containing a few useful Firefox shortcuts, Anki will automatically
16 | import the `prty-shortcut` note type. Simply download [this file](./demo/prty_shortcut_cards_firefox_demo.apkg)
17 | and press Ctrl+Shift+I in Anki, import the file and _voilà_! The
18 | new card type will become available!
19 |
20 | ### Manually add the note type
21 |
22 | The note type can be also be manually created!
23 |
24 | 1. Create a new note type (Ctrl+Shift+N -> `Add`)
25 | 2. Select the new note type and click `Fields`
26 | 3. Make sure the note has the _exact_ following fields: `Software`, `Action`, `Key Combination` and `Extra Key Combination`. If you want to rename these, you have to change the front and back of the card.
27 | 4. Save when done and now press `Cards`
28 | 5. Copy [src/front.html](./src/front.html) into `Front Template`, [src/back.html](./src/back.html) into `Back Template` and [src/style.css](./src/style.css) into `Styles` and save
29 | 6. Done! You should now be able to create new notes of the `prty-shortcut` type!
30 |
31 | ## Usage
32 |
33 | I would recommend playing around with the notes to figure it out, but in essence `prty-shortcut` will automatically
34 | assume the formatting of your card. So, by entering _"Ctrl Shift P"_ in `Key Combination`, the card will be generated
35 | as "_Ctrl+Shift+P"_. The plusses inserted by `prty-shortcut` means that these buttons are to be pressed simultaneously.
36 |
37 | Some advanced shortcuts require two separate combinations. This is provided by `Extra Key Combination`, and will
38 | be formatted as `Shotcut Combination`. This field is not required, and will be ignored if empty.
39 |
40 | ### Using dark cards without night mode
41 |
42 | It is possible to change the CSS (styling, i.e. [this file](/src/style.css)) of the notes so that the dark cards can be
43 | used without night mode. To do this, simply edit the card in Anki:
44 |
45 | Ctrl+Shift+N, select `prty-shortcut` and click `Cards`), go to the `Styling` section and swap place of the following lines:
46 |
47 | ```css
48 | .card {
49 | ```
50 |
51 | and
52 |
53 | ```css
54 | .card.nightMode {
55 | ```
56 |
57 | Now you will have inversed it all! If you never want the light cards, simple remove everything related to
58 | `.card` , and remove `.nightMode` from the line containing `.card.nightMode`.
59 |
60 | ## Support
61 |
62 | If you like this deck and would like to support the creation of more like it, don't buy me a coffee. Donate your money to those who need it most.
63 | Personally I recommend [The GiveWell Maximum Impact Fund](https://www.givewell.org/maximum-impact-fund), where your money will make the biggest
64 | impact on someones life.
65 |
66 | If you instead want to help the development of Anki, consider supporting the developers of [Anki](https://github.com/ankitects/) and [AnkiDroid](https://opencollective.com/ankidroid).
67 |
68 | If you decide to support any of these causes, please contact me! It would make my day :)
69 |
70 | ## Development
71 |
72 | All card variants can be previewed using `examples/index.html`. Run a local webserver, using the same
73 | directory as this `README` as root, and click your way to `examples/index.html`. To do this using python, run
74 |
75 | ```
76 | python3 -m http.server 1337
77 | ```
78 |
79 | to run a server on http://127.0.0.1:1337
80 |
--------------------------------------------------------------------------------
/src/style.css:
--------------------------------------------------------------------------------
1 | /* See ginger51011/prty-shortcut-cards for full source */
2 |
3 | /* Colors based on Nord theme */
4 |
5 | .card {
6 | /* DISGUSTING light mode, ugh */
7 | --color: rgb(46, 52, 64);
8 | --text-shadow: var(--outer-border-color);
9 |
10 | --outer-border-color: rgb(216, 222, 233);
11 | --note-background: rgb(229, 233, 240);
12 | --divider-color: var(--outer-border-color);
13 |
14 | --title-background-color: rgb(235, 203, 139);
15 |
16 | --kbd-color: rgb(163, 190, 140);
17 | --kbd-background-color: rgb(59, 66, 82);
18 | --kbd-shadow: var(--outer-border-color);
19 |
20 | --code-color: rgb(135, 191, 207);
21 | --code-background-color: rgb(60, 67, 83);
22 | }
23 |
24 | .card.nightMode {
25 | /* Night mode represent */
26 | --color: rgb(236, 239, 244);
27 | --text-shadow: var(--outer-border-color);
28 |
29 | --outer-border-color: rgb(76, 86, 106);
30 | --note-background: rgb(46, 52, 64);
31 | --divider-color: var(--outer-border-color);
32 |
33 | --title-background-color: rgb(208, 135, 112);
34 |
35 | --kbd-color: rgb(163, 190, 140);
36 | --kbd-background-color: rgb(59, 66, 82);
37 | --kbd-shadow: var(--outer-border-color);
38 |
39 | --code-color: rgb(135, 191, 207);
40 | --code-background-color: rgb(60, 67, 83);
41 | }
42 |
43 | .note {
44 | /* Distances */
45 | --top-margin: 1.2em;
46 | --content-text-padding: 0.3em;
47 |
48 | /* Borders */
49 | --outer-border: 0.05em solid var(--outer-border-color);
50 |
51 | /* Sizes */
52 | --note-max-width: 40em;
53 | --line-height: 1.6;
54 |
55 | /* Fonts */
56 | --font-family: "Roboto", "Inter", "Rubik", "Avenir", "system-ui";
57 | --mono-font-family: "Roboto Mono", "Source Code Pro", "Ubuntu Mono", monospace;
58 |
59 | /* Text */
60 | color: var(--color);
61 | font-family: var(--font-family);
62 | font-size: 20px;
63 | text-align: center;
64 |
65 | border: var(--outer-border);
66 | border-radius: 4px;
67 |
68 | background-color: var(--note-background);
69 |
70 | line-height: var(--line-height);
71 |
72 | /* Margins and padding */
73 | padding: 0.4em;
74 | margin: 0 auto;
75 | margin-top: var(--top-margin) !important;
76 | max-width: var(--note-max-width);
77 |
78 | /* Flexbox */
79 | display: flex;
80 | flex-flow: column nowrap;
81 | justify-content: center;
82 | align-items: stretch;
83 | }
84 |
85 | code {
86 | padding: 2px 4px;
87 | color: var(--code-color);
88 | background-color: var(--code-background-color);
89 | border-radius: 3px;
90 | font-family: var(--mono-font-family);
91 | }
92 |
93 | /* #### FRONT #### */
94 | .title-container {
95 | margin-top: calc(-1 * var(--top-margin));
96 | }
97 |
98 | .title-text {
99 | /* Text */
100 | font-weight: bolder;
101 | font-family: var(--mono-font-family);
102 | text-align: center;
103 | font-size: 20px;
104 | text-shadow: 0.05em 0 var(--text-shadow);
105 | color: var(--color);
106 |
107 | /* Box */
108 | padding: .1em .7em;
109 | border: var(--outer-border);
110 | border-radius: 20px;
111 | background-color: var(--title-background-color);
112 |
113 | /* Placement */
114 | margin: 0 auto;
115 | }
116 |
117 | div.front-container {
118 | padding: var(--content-text-padding);
119 | margin: auto;
120 | }
121 |
122 | /* #### BACK #### */
123 | hr.card-divider {
124 | border: none;
125 | border-top: 2px dotted var(--divider-color);
126 | background-color: transparent;
127 | margin: 0.4em 0;
128 | }
129 |
130 | /* Container for shortcuts */
131 | .shortcut-container {
132 | /* Text */
133 | color: var(--kbd-color);
134 | font-size: 125%;
135 | text-align: center !important;
136 | text-shadow: var(--kbd-shadow);
137 | line-height: 2em;
138 |
139 | /* Placement */
140 | margin: auto;
141 | padding: var(--content-text-padding);
142 | }
143 |
144 | /* Keyboard keys */
145 | kbd {
146 | /* Text */
147 | font-family: var(--mono-font-family);
148 | text-shadow: none !important;
149 |
150 | /* Box */
151 | border: 1px solid var(--kbd-color);
152 | border-radius: 3pt;
153 | background-color: var(--kbd-background-color);
154 | box-shadow: 0 2px 3px var(--kbd-shadow);
155 |
156 | /* Placement */
157 | margin: .2em;
158 | padding: .1em .6em;
159 | }
--------------------------------------------------------------------------------
/examples/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |