diff --git a/README.md b/README.md index f273f6ba..873c84f4 100644 --- a/README.md +++ b/README.md @@ -144,23 +144,24 @@ Feel free to [open a PR](https://github.com/DenverCoder1/readme-typing-svg/issue ## 🔧 Options -| Parameter | Details | Type | Example | -| :-------------: | :-------------------------------------------------------------------------: | :-----: | :---------------------------------------------------------------------------------------------------------------: | -| `lines` | Text to display with lines separated by `;` and `+` for spaces | string | `First+line;Second+line;Third+line` | -| `height` | Height of the output SVG in pixels (default: `50`) | integer | Any positive number | -| `width` | Width of the output SVG in pixels (default: `400`) | integer | Any positive number | -| `size` | Font size in pixels (default: `20`) | integer | Any positive number | -| `font` | Font family (default: `monospace`) | string | Any font from Google Fonts | -| `color` | Color of the text (default: `36BCF7`) | string | Hex code without # (eg. `F724A9`) | -| `background` | Background color of the text (default: `00000000`) | string | Hex code without # (eg. `FEFF4C`) | -| `center` | `true` to center text or `false` for left aligned (default: `false`) | boolean | `true` or `false` | -| `vCenter` | `true` to center vertically or `false`(default) to align above the center | boolean | `true` or `false` | -| `multiline` | `true` to wrap lines or `false` to retype on one line (default: `false`) | boolean | `true` or `false` | -| `duration` | Duration of the printing of a single line in milliseconds (default: `5000`) | integer | Any positive number | -| `pause` | Duration of the pause between lines in milliseconds (default: `0`) | integer | Any non-negative number | -| `repeat` | `true` to loop around to the first line after the last (default: `true`) | boolean | `true` or `false` | -| `separator` | Separator used between lines in the lines parameter (default: `;`) | string | `;`, `;;`, `/`, etc. | -| `letterSpacing` | Letter spacing (default: `normal`) | string | Any css values for the [letter-spacing](https://developer.mozilla.org/en-US/docs/Web/CSS/letter-spacing) property | +| Parameter | Details | Type | Example | +| :-------------: | :---------------------------------------------------------------------------------: | :-----: | :---------------------------------------------------------------------------------------------------------------: | +| `lines` | Text to display with lines separated by `;` and `+` for spaces | string | `First+line;Second+line;Third+line` | +| `height` | Height of the output SVG in pixels (default: `50`) | integer | Any positive number | +| `width` | Width of the output SVG in pixels (default: `400`) | integer | Any positive number | +| `size` | Font size in pixels (default: `20`) | integer | Any positive number | +| `font` | Font family (default: `monospace`) | string | Any font from Google Fonts | +| `color` | Color of the text (default: `36BCF7`) | string | Hex code without # (eg. `F724A9`) | +| `background` | Background color of the text (default: `00000000`) | string | Hex code without # (eg. `FEFF4C`) | +| `center` | `true` to center text or `false` for left aligned (default: `false`) | boolean | `true` or `false` | +| `vCenter` | `true` to center vertically or `false`(default) to align above the center | boolean | `true` or `false` | +| `multiline` | `true` to wrap lines or `false` to retype on one line (default: `false`) | boolean | `true` or `false` | +| `duration` | Duration of the printing of a single line in milliseconds (default: `5000`) | integer | Any positive number | +| `pause` | Duration of the pause between lines in milliseconds (default: `0`) | integer | Any non-negative number | +| `repeat` | `true` to loop around to the first line after the last (default: `true`) | boolean | `true` or `false` | +| `groups` | Group lines so each group types sequentially then clears together. Sizes must sum to the number of non-empty lines (default: `none`) | string | `2,1` (first 2 lines as group 1, next 1 as group 2) | +| `separator` | Separator used between lines in the lines parameter (default: `;`) | string | `;`, `;;`, `/`, etc. | +| `letterSpacing` | Letter spacing (default: `normal`) | string | Any css values for the [letter-spacing](https://developer.mozilla.org/en-US/docs/Web/CSS/letter-spacing) property | ## 📤 Deploying it on your own diff --git a/src/demo/css/style.css b/src/demo/css/style.css index bde0a621..9754a91b 100644 --- a/src/demo/css/style.css +++ b/src/demo/css/style.css @@ -101,7 +101,9 @@ h2 { border-radius: 6px; cursor: pointer; font-family: inherit; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); + box-shadow: + 0 1px 3px rgba(0, 0, 0, 0.12), + 0 1px 2px rgba(0, 0, 0, 0.24); transition: 0.2s ease-in-out; } @@ -111,7 +113,9 @@ h2 { .btn:not(:disabled):hover { background-color: var(--blue-dark); - box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); + box-shadow: + 0 3px 6px rgba(0, 0, 0, 0.16), + 0 3px 6px rgba(0, 0, 0, 0.23); } .btn:disabled { @@ -196,7 +200,9 @@ input:invalid { input:focus:invalid { outline: none; - box-shadow: 0 0 0 1px var(--blue-light), 0 0 0 3px var(--red); + box-shadow: + 0 0 0 1px var(--blue-light), + 0 0 0 3px var(--red); } .delete-line.btn { @@ -213,7 +219,9 @@ input:focus:invalid { } .delete-line.btn:not(:disabled):hover { - box-shadow: 0 1px 3px rgb(0 0 0 / 12%), 0 1px 2px rgb(0 0 0 / 24%); + box-shadow: + 0 1px 3px rgb(0 0 0 / 12%), + 0 1px 2px rgb(0 0 0 / 24%); background: #e4535314; } @@ -221,6 +229,75 @@ input:focus:invalid { color: var(--stroke); } +.group-divider { + grid-column: 1 / -1; + /* display:none gives a true zero grid footprint (no row, no surrounding gap); + opacity/height would still reserve space and leave large gaps between lines. */ + display: none; + align-items: center; + gap: 6px; + height: 18px; + cursor: pointer; + user-select: none; + opacity: 0.4; + /* Reset: divider is a real