From e6351a5486e3e3092965cc479368d55829c706be Mon Sep 17 00:00:00 2001
From: Caesar Augustus
Date: Sat, 27 Jan 2024 22:28:42 -0300
Subject: [PATCH 1/2] Adds right-to-left script option.
Implements right-to-left script (rtl) functionality to Typing SVG, meaning the animation will start from the right if true. Useful for languages such as Arabic, Hebrew, Urdu, or simply for style.
---
README.md | 45 ++++++++++++++++++------------------
src/demo/index.php | 6 +++++
src/models/RendererModel.php | 5 ++++
src/templates/main.php | 35 ++++++++++++++++++----------
src/views/RendererView.php | 1 +
5 files changed, 58 insertions(+), 34 deletions(-)
diff --git a/README.md b/README.md
index 1d9e92c7..424e8807 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,5 @@
+
⌨️ Readme Typing SVG
@@ -31,7 +32,7 @@
Here you can easily customize your Typing SVG with a live preview.
-
+[https://readme-typing-svg.demolab.com/demo/](https://readme-typing-svg.demolab.com/demo/)
[](https://readme-typing-svg.demolab.com/demo/)
@@ -47,7 +48,6 @@ Below are links to profiles where you can see Readme Typing SVGs in action!
[](https://github.com/ShivaSankeerth "Shiva Sankeerth Reddy on GitHub")
[](https://github.com/Tarun-Kamboj "Tarun Kamboj on GitHub")
[](https://github.com/tavignesh "T.A.Vignesh on GitHub")
-[](https://github.com/angelofallars "Angelo Fallaria on GitHub")
[](https://github.com/trumbitta "William J. Ghelfi on GitHub")
[](https://github.com/ManoBharathi93 "Mano Bharathi M on GitHub")
[](https://github.com/sudoshivam "Shivam Yadav on GitHub")
@@ -55,7 +55,6 @@ Below are links to profiles where you can see Readme Typing SVGs in action!
[](https://github.com/VydrOz "Vydr'Oz on GitHub")
[](https://github.com/Carol42 "Caroline Heloíse on GitHub")
[](https://github.com/PriyanshK09 "PriyanshK09 on GitHub")
-[](https://github.com/BenjaminMichaelis "BenjaminMichaelis on GitHub")
[](https://github.com/thakurballary "Thakur Ballary on GitHub")
[](https://github.com/nicesapien "NiceSapien on GitHub")
[](https://github.com/manthanank "Manthan Ank on GitHub")
@@ -71,7 +70,6 @@ Below are links to profiles where you can see Readme Typing SVGs in action!
[](https://github.com/UlisesAlexanderAM "UlisesAlexanderAM on GitHub")
[](https://github.com/SpookyJelly "SpookyJelly on GitHub")
[](https://github.com/cfcife "cfcife on GitHub")
-[](https://github.com/majidtdeni666 "majidtdeni666 on GitHub")
[](https://github.com/galexy727 "GalexY727 on GitHub")
[](https://github.com/HectorSaldes "HectorSaldes on GitHub")
[](https://github.com/Ash-codes18 "Ash-codes18 on GitHub")
@@ -109,27 +107,29 @@ Below are links to profiles where you can see Readme Typing SVGs in action!
[](https://github.com/presentformyfriends "presentformyfriends on Github")
[](https://github.com/Ad7amstein "Ad7amstein on Github")
[](https://github.com/LakshmanKishore "LakshmanKishore on Github")
+[](https://github.com/WicCaesar "WicCaesar on Github")
Feel free to [open a PR](https://github.com/DenverCoder1/readme-typing-svg/issues/21#issue-870549556) and add yours!
## 🔧 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. |
+| 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` |
+| `rtl` | `true` to use right-to-left script (Arabic, Hebrew…) (default: `false`) | 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. |
## 📤 Deploying it on your own
@@ -141,7 +141,7 @@ You can deploy the PHP files on any website server with PHP installed or as a He
### Step-by-step instructions for deploying to Heroku
-1. Sign in to **Heroku** or create a new account at
+1. Sign in to **Heroku** or create a new account at [https://heroku.com](https://heroku.com)
2. Click the "Deploy to Heroku" button below
[](https://heroku.com/deploy?template=https://github.com/DenverCoder1/readme-typing-svg/tree/main)
@@ -163,6 +163,7 @@ Refer to [CONTRIBUTING.md](/CONTRIBUTING.md) for more details on contributing, i
💙 If you like this project, give it a ⭐ and share it with friends!
+
@@ -177,7 +178,7 @@ Made with ❤️ and PHP
-
+````
diff --git a/src/demo/index.php b/src/demo/index.php
index 5c9184ca..83ad7335 100644
--- a/src/demo/index.php
+++ b/src/demo/index.php
@@ -94,6 +94,12 @@ function gtag() {
+
+
+
@@ -32,7 +31,7 @@
Here you can easily customize your Typing SVG with a live preview.
-[https://readme-typing-svg.demolab.com/demo/](https://readme-typing-svg.demolab.com/demo/)
+
[](https://readme-typing-svg.demolab.com/demo/)
@@ -113,23 +112,23 @@ 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` |
-| `rtl` | `true` to use right-to-left script (Arabic, Hebrew…) (default: `false`) | 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. |
+| 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` |
+| `rtl` | `true` to use right-to-left script (Arabic, Hebrew…) (default: `false`) | 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. |
## 📤 Deploying it on your own
@@ -141,7 +140,7 @@ You can deploy the PHP files on any website server with PHP installed or as a He
### Step-by-step instructions for deploying to Heroku
-1. Sign in to **Heroku** or create a new account at [https://heroku.com](https://heroku.com)
+1. Sign in to **Heroku** or create a new account at
2. Click the "Deploy to Heroku" button below
[](https://heroku.com/deploy?template=https://github.com/DenverCoder1/readme-typing-svg/tree/main)
@@ -163,7 +162,6 @@ Refer to [CONTRIBUTING.md](/CONTRIBUTING.md) for more details on contributing, i
💙 If you like this project, give it a ⭐ and share it with friends!
-