├── .gitattributes
├── .github
├── FUNDING.yml
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── feature_request.md
│ └── question.md
├── dependabot.yml
├── pull_request_template.md
└── workflows
│ ├── phpunit-ci-coverage.yml
│ └── release.yml
├── .gitignore
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── Procfile
├── README.md
├── app.json
├── composer.json
├── composer.lock
├── src
├── controllers
│ └── RendererController.php
├── demo
│ ├── css
│ │ ├── loader.css
│ │ ├── style.css
│ │ └── toggle-dark.css
│ ├── favicon.png
│ ├── index.php
│ └── js
│ │ ├── jscolor.min.js
│ │ ├── script.js
│ │ └── toggle-dark.js
├── index.php
├── models
│ ├── DatabaseConnection.php
│ ├── ErrorModel.php
│ ├── GoogleFontConverter.php
│ └── RendererModel.php
├── templates
│ ├── error.php
│ └── main.php
└── views
│ ├── ErrorView.php
│ └── RendererView.php
└── tests
├── OptionsTest.php
├── RendererTest.php
├── phpunit
└── phpunit.xml
└── svg
├── test_fonts.svg
├── test_missing_lines.svg
├── test_multiline.svg
├── test_normal.svg
└── test_normal_vertical_alignment.svg
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: [DenverCoder1]
4 | patreon: # Replace with a single Patreon username
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: jlawrence
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
13 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: 'bug'
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - OS: [e.g. iOS]
28 | - Browser [e.g. chrome, safari]
29 | - Version [e.g. 22]
30 |
31 | **Smartphone (please complete the following information):**
32 | - Device: [e.g. iPhone6]
33 | - OS: [e.g. iOS8.1]
34 | - Browser [e.g. stock browser, safari]
35 | - Version [e.g. 22]
36 |
37 | **Additional context**
38 | Add any other context about the problem here.
39 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: 'enhancement'
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/question.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Question
3 | about: I have a question about this project
4 | title: ''
5 | labels: 'question'
6 | assignees: ''
7 |
8 | ---
9 |
10 |
11 | **Description**
12 |
13 | A brief description of the question or issue:
14 |
15 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # To get started with Dependabot version updates, you'll need to specify which
2 | # package ecosystems to update and where the package manifests are located.
3 | # Please see the documentation for all configuration options:
4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5 |
6 | version: 2
7 | updates:
8 | - package-ecosystem: "composer" # See documentation for possible values
9 | directory: "/" # Location of package manifests
10 | schedule:
11 | interval: "daily"
12 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | ## Description
2 |
3 |
4 |
5 | Fixes #
6 |
7 | ### Type of change
8 |
9 |
10 |
11 | - [ ] Bug fix (added a non-breaking change which fixes an issue)
12 | - [ ] New feature (added a non-breaking change which adds functionality)
13 | - [ ] Updated documentation (updated the readme, templates, or other repo files)
14 | - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
15 |
16 | ## How Has This Been Tested?
17 |
18 |
19 |
20 | - [ ] Ran tests with `composer test`
21 | - [ ] Added or updated test cases to test new features
22 |
23 | ## Checklist:
24 |
25 | - [ ] I have checked to make sure no other pull requests are open for this issue
26 | - [ ] The code is properly formatted and is consistent with the existing code style
27 | - [ ] I have commented my code, particularly in hard-to-understand areas
28 | - [ ] I have made corresponding changes to the documentation
29 | - [ ] My changes generate no new warnings
30 |
31 | ## Screenshots
32 |
33 |
34 |
--------------------------------------------------------------------------------
/.github/workflows/phpunit-ci-coverage.yml:
--------------------------------------------------------------------------------
1 | name: PHPUnit CI
2 |
3 | on:
4 | workflow_dispatch:
5 | pull_request:
6 | push:
7 | branches:
8 | - main
9 |
10 | jobs:
11 | build-test:
12 | runs-on: ubuntu-latest
13 | steps:
14 | - uses: actions/checkout@v2
15 | - uses: php-actions/composer@v5
16 | - name: PHPUnit Tests
17 | uses: php-actions/phpunit@v2
18 | with:
19 | bootstrap: vendor/autoload.php
20 | configuration: tests/phpunit/phpunit.xml
21 | args: --testdox
22 | env:
23 | TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 | USERNAME: DenverCoder1
25 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Releases
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 |
8 | jobs:
9 | changelog:
10 | runs-on: ubuntu-latest
11 |
12 | steps:
13 | - uses: actions/checkout@v2
14 |
15 | - name: conventional Changelog Action
16 | id: changelog
17 | uses: TriPSs/conventional-changelog-action@v3.7.1
18 | with:
19 | github-token: ${{ secrets.CHANGELOG_RELEASE }}
20 | version-file: './composer.json'
21 | output-file: 'false'
22 |
23 | - name: create release
24 | uses: actions/create-release@v1
25 | if: ${{ steps.changelog.outputs.skipped == 'false' }}
26 | env:
27 | GITHUB_TOKEN: ${{ secrets.CHANGELOG_RELEASE }}
28 | with:
29 | tag_name: ${{ steps.changelog.outputs.tag }}
30 | release_name: ${{ steps.changelog.outputs.tag }}
31 | body: ${{ steps.changelog.outputs.clean_changelog }}
32 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | vendor/
2 | .vscode/
3 | .env
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | We as members, contributors, and leaders pledge to make participation in our
6 | community a harassment-free experience for everyone, regardless of age, body
7 | size, visible or invisible disability, ethnicity, sex characteristics, gender
8 | identity and expression, level of experience, education, socio-economic status,
9 | nationality, personal appearance, race, caste, color, religion, or sexual
10 | identity and orientation.
11 |
12 | We pledge to act and interact in ways that contribute to an open, welcoming,
13 | diverse, inclusive, and healthy community.
14 |
15 | ## Our Standards
16 |
17 | Examples of behavior that contributes to a positive environment for our
18 | community include:
19 |
20 | * Demonstrating empathy and kindness toward other people
21 | * Being respectful of differing opinions, viewpoints, and experiences
22 | * Giving and gracefully accepting constructive feedback
23 | * Accepting responsibility and apologizing to those affected by our mistakes,
24 | and learning from the experience
25 | * Focusing on what is best not just for us as individuals, but for the overall
26 | community
27 |
28 | Examples of unacceptable behavior include:
29 |
30 | * The use of sexualized language or imagery, and sexual attention or advances of
31 | any kind
32 | * Trolling, insulting or derogatory comments, and personal or political attacks
33 | * Public or private harassment
34 | * Publishing others' private information, such as a physical or email address,
35 | without their explicit permission
36 | * Other conduct which could reasonably be considered inappropriate in a
37 | professional setting
38 |
39 | ## Enforcement Responsibilities
40 |
41 | Community leaders are responsible for clarifying and enforcing our standards of
42 | acceptable behavior and will take appropriate and fair corrective action in
43 | response to any behavior that they deem inappropriate, threatening, offensive,
44 | or harmful.
45 |
46 | Community leaders have the right and responsibility to remove, edit, or reject
47 | comments, commits, code, wiki edits, issues, and other contributions that are
48 | not aligned to this Code of Conduct, and will communicate reasons for moderation
49 | decisions when appropriate.
50 |
51 | ## Scope
52 |
53 | This Code of Conduct applies within all community spaces, and also applies when
54 | an individual is officially representing the community in public spaces.
55 | Examples of representing our community include using an official e-mail address,
56 | posting via an official social media account, or acting as an appointed
57 | representative at an online or offline event.
58 |
59 | ## Enforcement
60 |
61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
62 | reported to the community leaders responsible for enforcement at
63 | jonah@freshidea.com.
64 | All complaints will be reviewed and investigated promptly and fairly.
65 |
66 | All community leaders are obligated to respect the privacy and security of the
67 | reporter of any incident.
68 |
69 | ## Enforcement Guidelines
70 |
71 | Community leaders will follow these Community Impact Guidelines in determining
72 | the consequences for any action they deem in violation of this Code of Conduct:
73 |
74 | ### 1. Correction
75 |
76 | **Community Impact**: Use of inappropriate language or other behavior deemed
77 | unprofessional or unwelcome in the community.
78 |
79 | **Consequence**: A private, written warning from community leaders, providing
80 | clarity around the nature of the violation and an explanation of why the
81 | behavior was inappropriate. A public apology may be requested.
82 |
83 | ### 2. Warning
84 |
85 | **Community Impact**: A violation through a single incident or series of
86 | actions.
87 |
88 | **Consequence**: A warning with consequences for continued behavior. No
89 | interaction with the people involved, including unsolicited interaction with
90 | those enforcing the Code of Conduct, for a specified period of time. This
91 | includes avoiding interactions in community spaces as well as external channels
92 | like social media. Violating these terms may lead to a temporary or permanent
93 | ban.
94 |
95 | ### 3. Temporary Ban
96 |
97 | **Community Impact**: A serious violation of community standards, including
98 | sustained inappropriate behavior.
99 |
100 | **Consequence**: A temporary ban from any sort of interaction or public
101 | communication with the community for a specified period of time. No public or
102 | private interaction with the people involved, including unsolicited interaction
103 | with those enforcing the Code of Conduct, is allowed during this period.
104 | Violating these terms may lead to a permanent ban.
105 |
106 | ### 4. Permanent Ban
107 |
108 | **Community Impact**: Demonstrating a pattern of violation of community
109 | standards, including sustained inappropriate behavior, harassment of an
110 | individual, or aggression toward or disparagement of classes of individuals.
111 |
112 | **Consequence**: A permanent ban from any sort of public interaction within the
113 | community.
114 |
115 | ## Attribution
116 |
117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118 | version 2.1, available at
119 | [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120 |
121 | Community Impact Guidelines were inspired by
122 | [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123 |
124 | For answers to common questions about this code of conduct, see the FAQ at
125 | [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126 | [https://www.contributor-covenant.org/translations][translations].
127 |
128 | [homepage]: https://www.contributor-covenant.org
129 | [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130 | [Mozilla CoC]: https://github.com/mozilla/diversity
131 | [FAQ]: https://www.contributor-covenant.org/faq
132 | [translations]: https://www.contributor-covenant.org/translations
133 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | ## Contributing
2 |
3 | Contributions are welcome! Feel free to open an issue or submit a pull request if you have a way to improve this project.
4 |
5 | Make sure your request is meaningful and you have tested the app locally before submitting a pull request.
6 |
7 | ### Installing Requirements
8 |
9 | #### Requirements
10 |
11 | * [PHP 7.4+](https://www.apachefriends.org/index.html)
12 | * [Composer](https://getcomposer.org)
13 |
14 | #### Linux
15 |
16 | ```bash
17 | sudo apt-get install php
18 | sudo apt-get install php-curl
19 | sudo apt-get install composer
20 | ```
21 |
22 | #### Windows
23 |
24 | Install PHP from [XAMPP](https://www.apachefriends.org/index.html) or [php.net](https://windows.php.net/download)
25 |
26 | [▶ How to install and run PHP using XAMPP (Windows)](https://www.youtube.com/watch?v=K-qXW9ymeYQ)
27 |
28 | [📥 Download Composer](https://getcomposer.org/download/)
29 |
30 | ### Clone the repository
31 |
32 | ```
33 | git clone https://github.com/DenverCoder1/readme-typing-svg.git
34 | cd readme-typing-svg
35 | ```
36 |
37 | ### Running the app locally
38 |
39 | ```bash
40 | composer start
41 | ```
42 |
43 | Open http://localhost:8000/ and add parameters to run the project locally.
44 |
45 | ### Running the tests
46 |
47 | Before you can run tests, PHPUnit must be installed. You can install it using Composer by running the following command.
48 |
49 | ```bash
50 | composer install
51 | ```
52 |
53 | Run the following command to run the PHPUnit test script which will verify that the tested functionality is still working.
54 |
55 | ```bash
56 | composer test
57 | ```
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Jonah Lawrence
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Procfile:
--------------------------------------------------------------------------------
1 | web: vendor/bin/heroku-php-apache2 src/
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 | ## ⚡ Quick setup
19 |
20 | 1. Copy-paste the markdown below into your GitHub profile README
21 | 2. Replace the value after `?lines=` with your text. Separate lines of text with semicolons and use `+` or `%20` for spaces.
22 | 3. (Optional) Adjust the width parameter (see below) to fit the full width of your text.
23 |
24 | ```md
25 | [](https://git.io/typing-svg)
26 | ```
27 |
28 | ## ⚙ Demo site
29 |
30 | Here you can easily customize your Typing SVG with a live preview.
31 |
32 |
33 |
34 | [](https://readme-typing-svg.herokuapp.com/demo/)
35 |
36 | ## 🚀 Example usage
37 |
38 | Below are links to profiles where you can see Readme Typing SVGs in action!
39 |
40 | [](https://github.com/DenverCoder1)
41 | [](https://github.com/warengonzaga)
42 | [](https://github.com/Evavic44)
43 | [](https://github.com/8BitJonny)
44 | [](https://github.com/krishdevdb)
45 | [](https://github.com/adityaraute)
46 | [](https://github.com/ShivaSankeerth)
47 | [](://github.com/Tarun-Kamboj)
48 | [](https://github.com/tavignesh)
49 | [](https://github.com/angelofallars)
50 | [](https://github.com/trumbitta)
51 | [](https://github.com/sudoshivam)
52 | [](https://github.com/R055A)
53 | [](https://github.com/Krishnapro)
54 | [](https://github.com/PROxZIMA)
55 | [](https://github.com/VydrOz)
56 | [](https://github.com/Carol42)
57 | [](https://github.com/BenjaminMichaelis)
58 | [](https://github.com/thakurballary)
59 | [](https://github.com/ossamamehmood)
60 | [](https://github.com/betty2310)
61 | [](https://github.com/nicesapien)
62 | [](https://github.com/lmfao-jude)
63 | [](https://github.com/manthanank)
64 | [](https://github.com/lertsoft)
65 | [](https://github.com/Vishal-beep136)
66 | [](https://github.com/raihankhan)
67 |
68 | Feel free to [open a PR](https://github.com/DenverCoder1/readme-typing-svg/issues/21#issue-870549556) and add yours!
69 |
70 | ## 🔧 Options
71 |
72 | | Parameter | Details | Type | Example |
73 | | :----------: | :-------------------------------------------------------------------------: | :-----: | :---------------------------------: |
74 | | `lines` | Text to display with lines separated by `;` and `+` for spaces | string | `First+line;Second+line;Third+line` |
75 | | `height` | Height of the output SVG in pixels (default: `50`) | integer | Any positive number |
76 | | `width` | Width of the output SVG in pixels (default: `400`) | integer | Any positive number |
77 | | `size` | Font size in pixels (default: `20`) | integer | Any positive number |
78 | | `font` | Font family (default: `monospace`) | string | Any font from Google Fonts |
79 | | `color` | Color of the text (default: `36BCF7`) | string | Hex code without # (eg. `F724A9`) |
80 | | `background` | Background color of the text (default: `00000000`) | string | Hex code without # (eg. `FEFF4C`) |
81 | | `center` | `true` to center text or `false` for left aligned (default: `false`) | boolean | `true` or `false` |
82 | | `vCenter` | `true` to center vertically or `false`(default) to align above the center | boolean | `true` or `false` |
83 | | `multiline` | `true` to wrap lines or `false` to retype on one line (default: `false`) | boolean | `true` or `false` |
84 | | `duration` | Duration of the printing of a single line in milliseconds (default: `5000`) | integer | Any positive number |
85 |
86 | ## 📤 Deploying it on your own
87 |
88 | If you can, it is preferable to host the files on your own server.
89 |
90 | Doing this can lead to better uptime and more control over customization (you can modify the code for your usage).
91 |
92 | You can deploy the PHP files on any website server with PHP installed or as a Heroku app.
93 |
94 | ### Step-by-step instructions for deploying to Heroku
95 |
96 | 1. Sign in to **Heroku** or create a new account at
97 | 2. Click the "Deploy to Heroku" button below
98 |
99 | [](https://heroku.com/deploy?template=https://github.com/DenverCoder1/readme-typing-svg/tree/main)
100 |
101 | 3. On the page that comes up, click **"Deploy App"** at the end of the form
102 | 4. Once the app is deployed, click **"Manage App"** to go to the dashboard
103 | 5. Scroll down to the **Domains** section in the settings to find the URL you will use in place of `readme-typing-svg.herokuapp.com`
104 | 6. [Optional] To use Google fonts or other custom fonts, you will need to configure the database. The login credentials for the database can be found by clicking the PostgreSQL add-on and going to Settings. The following is the definition for the `fonts` table that needs to be created.
105 |
106 | ```sql
107 | CREATE TABLE fonts (
108 | "family" varchar(50) NOT NULL,
109 | css varchar(1200000) NOT NULL,
110 | fetch_date date NOT NULL,
111 | CONSTRAINT fonts_pkey PRIMARY KEY (family)
112 | );
113 | ```
114 |
115 | ## 🤗 Contributing
116 |
117 | Contributions are welcome! Feel free to open an issue or submit a pull request if you have a way to improve this project.
118 |
119 | Make sure your request is meaningful and you have tested the app locally before submitting a pull request.
120 |
121 | ### Installing requirements
122 |
123 | #### Requirements
124 |
125 | - [PHP 7](https://www.apachefriends.org/index.html)
126 | - [Composer](https://getcomposer.org)
127 |
128 | #### Linux
129 |
130 | ```bash
131 | sudo apt-get install php
132 | sudo apt-get install php-curl
133 | sudo apt-get install composer
134 | ```
135 |
136 | #### Windows
137 |
138 | Install PHP from [XAMPP](https://www.apachefriends.org/index.html) or [php.net](https://windows.php.net/download)
139 |
140 | [▶ How to install and run PHP using XAMPP (Windows)](https://www.youtube.com/watch?v=K-qXW9ymeYQ)
141 |
142 | [📥 Download Composer](https://getcomposer.org/download/)
143 |
144 | ### Clone the repository
145 |
146 | ```bash
147 | git clone https://github.com/DenverCoder1/readme-typing-svg.git
148 | cd readme-typing-svg
149 | ```
150 |
151 | ### Running the app locally
152 |
153 | ```bash
154 | composer start
155 | ```
156 |
157 | Open and add parameters to run the project locally.
158 |
159 | ### Running the tests
160 |
161 | Before you can run tests, PHPUnit must be installed. You can install it using Composer by running the following command.
162 |
163 | ```bash
164 | composer install
165 | ```
166 |
167 | Run the following command to run the PHPUnit test script which will verify that the tested functionality is still working.
168 |
169 | ```bash
170 | composer test
171 | ```
172 |
173 | ## 🙋♂️ Support
174 |
175 | 💙 If you like this project, give it a ⭐ and share it with friends!
176 |
177 |
178 |