Repository: DenverCoder1/readme-typing-svg
Branch: main
Commit: fd5b760501f9
Files: 41
Total size: 118.2 KB
Directory structure:
gitextract_lm_lbad9/
├── .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
│ ├── prettier.yml
│ └── release.yml
├── .gitignore
├── .prettierignore
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── Procfile
├── README.md
├── app.json
├── composer.json
├── docs/
│ └── faq.md
├── src/
│ ├── controllers/
│ │ └── RendererController.php
│ ├── demo/
│ │ ├── css/
│ │ │ ├── loader.css
│ │ │ ├── style.css
│ │ │ └── toggle-dark.css
│ │ ├── index.php
│ │ └── js/
│ │ ├── script.js
│ │ └── toggle-dark.js
│ ├── enums/
│ │ └── ResponseEnum.php
│ ├── exceptions/
│ │ └── UnprocessableEntityException.php
│ ├── index.php
│ ├── interfaces/
│ │ └── IStatusException.php
│ ├── models/
│ │ ├── ErrorModel.php
│ │ ├── GoogleFontConverter.php
│ │ └── RendererModel.php
│ ├── templates/
│ │ ├── error.php
│ │ └── main.php
│ └── views/
│ ├── ErrorView.php
│ └── RendererView.php
└── tests/
├── OptionsTest.php
├── RendererTest.php
└── phpunit/
└── phpunit.xml
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
# Auto detect text files and perform LF normalization
* text=auto
================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms
github: [DenverCoder1]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: jlawrence
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
title: ""
labels: "bug"
assignees: ""
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
title: ""
labels: "enhancement"
assignees: ""
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
================================================
FILE: .github/ISSUE_TEMPLATE/question.md
================================================
---
name: Question
about: I have a question about this project
title: ""
labels: "question"
assignees: ""
---
**Description**
A brief description of the question or issue:
================================================
FILE: .github/dependabot.yml
================================================
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "composer" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
================================================
FILE: .github/pull_request_template.md
================================================
## Summary
## Type of change
- [ ] Bug fix (added a non-breaking change which fixes an issue)
- [ ] New feature (added a non-breaking change which adds functionality)
- [ ] Updated documentation (updated the readme, templates, or other repo files)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
## How Has This Been Tested?
- [ ] Ran tests with `composer test`
- [ ] Added or updated test cases to test new features
================================================
FILE: .github/workflows/phpunit-ci-coverage.yml
================================================
name: PHPUnit CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: php-actions/composer@9357db0fb3020086db5a9922354c8dc643927bcd
- name: PHPUnit Tests
uses: php-actions/phpunit@v4
with:
bootstrap: vendor/autoload.php
configuration: tests/phpunit/phpunit.xml
args: --testdox
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
USERNAME: DenverCoder1
================================================
FILE: .github/workflows/prettier.yml
================================================
name: Format with Prettier
on:
push:
branches:
- main
pull_request:
paths:
- ".github/workflows/prettier.yml"
- "**.php"
- "**.md"
- "**.js"
- "**.css"
jobs:
prettier:
runs-on: ubuntu-latest
steps:
- name: Checkout Pull Request
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Checkout Push
if: ${{ github.event_name != 'pull_request' }}
uses: actions/checkout@v3
- name: Install prettier and plugin-php
run: npm install --global prettier@2.8.1 @prettier/plugin-php@0.18.9
- name: Check formatting with Prettier
continue-on-error: true
run: composer format:check
- name: Prettify code
run: |
composer format
git diff
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
message: "style: Formatted code with Prettier"
default_author: github_actions
================================================
FILE: .github/workflows/release.yml
================================================
name: Releases
on:
workflow_dispatch:
jobs:
changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@v3.7.1
with:
github-token: ${{ secrets.CHANGELOG_RELEASE }}
version-file: './composer.json'
output-file: 'false'
- name: create release
uses: actions/create-release@v1
if: ${{ steps.changelog.outputs.skipped == 'false' }}
env:
GITHUB_TOKEN: ${{ secrets.CHANGELOG_RELEASE }}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
release_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
================================================
FILE: .gitignore
================================================
vendor/
.vscode/
.env
.idea
================================================
FILE: .prettierignore
================================================
vendor
*.min.js
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall
community
Examples of unacceptable behavior include:
- The use of sexualized language or imagery, and sexual attention or advances of
any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address,
without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
jonah@freshidea.com.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of
actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the
community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][mozilla coc].
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][faq]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[mozilla coc]: https://github.com/mozilla/diversity
[faq]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
================================================
FILE: CONTRIBUTING.md
================================================
## Contributing
Contributions are welcome! Feel free to open an issue or submit a pull request if you have a way to improve this project.
Make sure your request is meaningful and you have tested the app locally before submitting a pull request.
### Installing Requirements
#### Requirements
- [PHP 8.1+](https://www.apachefriends.org/index.html)
- [Composer](https://getcomposer.org)
#### Linux
```bash
sudo apt-get install php
sudo apt-get install php-curl
sudo apt-get install composer
```
#### macOS
Using [Homebrew](https://brew.sh):
```bash
brew install php
brew install composer
```
PHP on macOS typically includes the curl extension. If you need to enable it, ensure `php.ini` has `extension=curl` uncommented (run `php --ini` to find your config file).
#### Windows
Install PHP from [XAMPP](https://www.apachefriends.org/index.html) or [php.net](https://windows.php.net/download)
[▶ How to install and run PHP using XAMPP (Windows)](https://www.youtube.com/watch?v=K-qXW9ymeYQ)
[📥 Download Composer](https://getcomposer.org/download/)
### Clone the repository
```
git clone https://github.com/DenverCoder1/readme-typing-svg.git
cd readme-typing-svg
```
### Running the app locally
```bash
composer start
```
Open http://localhost:8000/ and add parameters to run the project locally.
### Running the tests
Before you can run tests, PHPUnit must be installed. You can install it using Composer by running the following command.
```bash
composer install
```
### Format and test the code
Run the following command to format the code with Prettier:
```
composer run format
```
Run the following command to check if your code is formatted properly:
```
composer run format:check
```
> **Note** You need to have [`prettier`](https://prettier.io/) and the [prettier-php plugin](https://github.com/prettier/plugin-php) installed globally in order to run this command.
Run the following command to run the PHPUnit test script which will verify that the tested functionality is still working.
```bash
composer test
```
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2021 Jonah Lawrence
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: Procfile
================================================
web: vendor/bin/heroku-php-apache2 src/
================================================
FILE: README.md
================================================
⌨️ Readme Typing SVG
## ⚡ Quick setup
1. Copy-paste the markdown below into your GitHub profile README
2. Replace the value after `?lines=` with your text. Separate lines of text with semicolons and use `+` or `%20` for spaces.
3. Adjust the width parameter (see below) to fit the full width of your text.
```md
[](https://git.io/typing-svg)
```
4. Star the repo 😄
## ⚙ Demo site
Here you can easily customize your Typing SVG with a live preview.
[](https://readme-typing-svg.demolab.com/demo/)
## 🚀 Example usage
Below are links to profiles where you can see Readme Typing SVGs in action!
[](https://github.com/DenverCoder1 "Jonah Lawrence on GitHub")
[](https://jini.rentalz.com/ "Jini by Rentalz.com")
[](https://github.com/warengonzaga "Waren Gonzaga on GitHub")
[](https://github.com/8BitJonny "8BitJonny on GitHub")
[](https://github.com/adityaraute "Aditya Raute on GitHub")
[](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/trumbitta "William J. Ghelfi on GitHub")
[](https://github.com/ManoBharathi93 "Mano Bharathi M on GitHub")
[](https://github.com/sudoshivam "Shivam Yadav on GitHub")
[](https://github.com/PROxZIMA "Pratik Pingale on GitHub")
[](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/thakurballary "Thakur Ballary on GitHub")
[](https://github.com/nicesapien "NiceSapien on GitHub")
[](https://github.com/manthanank "Manthan Ank on GitHub")
[](https://github.com/lertsoft "Ronny Coste on GitHub")
[](https://github.com/Vishal-beep136 "Vishal Beep on GitHub")
[](https://github.com/wiz64 "wiz64 on GitHub")
[](https://github.com/Aquarius-blake "Aquarian Blake on GitHub")
[](https://github.com/D3vil0p3r "D3vil0p3r on GitHub")
[](https://github.com/EliusHHimel "EliusHHimel on GitHub")
[](https://github.com/jcs090218 "jcs090218 on GitHub")
[](https://github.com/Rishabh2804 "Rishabh2804 on GitHub")
[](https://github.com/shalinibhatt "shalinibhatt on GitHub")
[](https://github.com/UlisesAlexanderAM "UlisesAlexanderAM on GitHub")
[](https://github.com/SpookyJelly "SpookyJelly 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")
[](https://github.com/Maagnitude "Maagnitude on GitHub")
[](https://github.com/cracker911181 "cracker911181 on GitHub")
[](https://github.com/quiet-node "quiet-node on GitHub")
[](https://github.com/kaustubh43 "kaustubh43 on GitHub")
[](https://github.com/kaisunoo "kaisunoo on GitHub")
[](https://github.com/meyer-pidiache "Meyer Pidiache on GitHub")
[](https://github.com/jeremiahseun "Jeremiah Erinola on GitHub")
[](https://github.com/creativepurus "Anand Purushottam 🇮🇳 on GitHub ☕")
[](https://github.com/Gchism94 "Greg Chism 🤘 on GitHub")
[](https://github.com/turbomaster95 "turbomaster95 🗿 🇮🇳 on GitHub ☕")
[](https://github.com/K1rsN7 "K1rsN7 on GitHub💪")
[](https://github.com/codesbyahsen "AHSEN ALEE on GitHub")
[](https://github.com/Freddywhest "Alfred Nti on GitHub")
[](https://github.com/Shiro-cha "Shiro Yukami on Github")
[](https://github.com/MohammedAbidNafi "Abid Nafi on Github")
[](https://github.com/Srijan-Baniyal "Srijan Baniyal on Github")
[](https://github.com/BrunoOliveiraS "Bruno Oliveira on Github")
[](https://github.com/zidk "Pablo Gonzalez on Github")
[](https://github.com/tshr-d-dragon "Tushar Patil on Github")
[](https://github.com/DeveshYadav13 "Devesh Yadav on Github")
[](https://github.com/HauseMasterZ "HauseMaster on Github")
[](https://github.com/hyskoniho "hyskoniho on Github")
[](https://github.com/elvisisvan "elvisisvan on Github")
[](https://github.com/Nquenan "Nquenan on Github")
[](https://github.com/akhilnev "Akhilesh Nevatia on Github")
[](https://github.com/mannysoft "Manny Isles on Github")
[](https://github.com/LinThitHtwe "LinThitHtwe on Github")
[](https://github.com/Elio-Aliaj "Elio-Aliaj on Github")
[](https://github.com/presentformyfriends "presentformyfriends on Github")
[](https://github.com/Ad7amstein "Ad7amstein on Github")
[](https://github.com/LakshmanKishore "LakshmanKishore on Github")
[](https://github.com/mateusadada "mateusadada on Github")
[](https://github.com/fasakinhenry "fasakinhenry on Github")
[](https://github.com/YousifAbozid "YousifAbozid on Github")
[](https://github.com/hheinsoee "hheinsoee on Github")
[](https://github.com/lucmsilva651 "lucmsilva651 on Github")
[](https://github.com/ashertenenbaum "ashertenenbaum on Github")
[](https://github.com/0dxplt "0dxplt on Github")
[](https://github.com/HerobrineTV "HerobrineTV on Github")
[](https://github.com/Borketh "Borketh on Github")
[](https://github.com/Callmeproteus "Callmeproteus on GitHub")
[](https://github.com/JotaP07 "JP on GitHub")
[](https://github.com/suzukimain "suzukimain on Github")
[](https://github.com/caesar013 "caesar013 on Github")
[](https://github.com/amir78729 "Amir on Github")
[](https://github.com/AJsuper007 "AJsuper007 on Github")
[](https://github.com/ABAN26 "ABAN26 on Github")
[](https://github.com/SohamMore100 "Soham More on GitHub")
[](https://github.com/Yobro7292 "Yogi Hariyani on GitHub")
[](https://github.com/Ninja1375 "Antônio Nascimento on GitHub")
[](https://github.com/TridentifyIshaan "Tridentify Ishaan on GitHub")
[](https://github.com/krimmyy "Eligijus Ciza on GitHub")
[](https://github.com/Ashish-CodeJourney "Ashish Vaghela on GitHub")
[](https://github.com/Snoopy1866 "Snoopy1866 on GitHub")
[](https://github.com/SarthakKrishak "Sarthak Krishak on GitHub")
[](https://github.com/AustinMusuya "Austin Musuya on GitHub")
[](https://github.com/EngineerRohit01 "Rohit on GitHub")
[](https://github.com/sandeep-Petwal "Sandeep Prasad on GitHub")
[](https://github.com/saadhusayn "Saad Hussain on Github")
[](https://github.com/Theglassofdata "Rahul Raj")
[](https://github.com/EchoSingh "Aditya Singh on Github")
[](https://github.com/Muhammad-Noraeii "Muhammad Noraeii on Github")
[](https://github.com/Harry-Skerritt "Harry-Skerritt on Github")
[](https://github.com/madhurimarawat "Madhurima Rawat on Github")
[](https://github.com/wfxey "wfxey on Github")
[](https://github.com/zhulixiao "Lixiao Zhu on Github")
[](https://github.com/AhmedNassar7 "Ahmed Nassar 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. |
| `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
If you can, it is preferable to host the files on your own server.
Doing this can lead to better uptime and more control over customization (you can modify the code for your usage).
You can deploy the PHP files on any website server with PHP installed or as a Heroku app.
### Step-by-step instructions for deploying to Heroku
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)
3. On the page that comes up, click **"Deploy App"** at the end of the form
4. Once the app is deployed, click **"Manage App"** to go to the dashboard
5. Scroll down to the **Domains** section in the settings to find the URL you will use in place of `readme-typing-svg.demolab.com`
## 🤗 Contributing
Contributions are welcome! Feel free to open an issue or submit a pull request if you have a way to improve this project.
Make sure your request is meaningful and you have tested the app locally before submitting a pull request.
Refer to [CONTRIBUTING.md](/CONTRIBUTING.md) for more details on contributing, installing requirements, and running the application.
## 🙋♂️ Support
💙 If you like this project, give it a ⭐ and share it with friends!
[☕ Buy me a coffee](https://ko-fi.com/jlawrence)
---
Made with ❤️ and PHP
This project uses [Twemoji](https://github.com/twitter/twemoji), published under the [CC-BY 4.0 License](https://creativecommons.org/licenses/by/4.0/)
================================================
FILE: app.json
================================================
{
"name": "Readme Typing SVG",
"description": "⚡ Dynamically generated, customizable SVG that gives the appearance of typing and deleting text. Typing SVGs can be used as a bio on your Github profile readme or repository.",
"repository": "https://github.com/DenverCoder1/readme-typing-svg/",
"keywords": ["github", "dynamic", "readme", "typing", "svg", "profile"],
"formation": {
"web": {
"quantity": 1,
"size": "basic"
}
}
}
================================================
FILE: composer.json
================================================
{
"name": "denvercoder1/readme-typing-svg",
"description": "⚡ Dynamically generated, customizable SVG that gives the appearance of typing and deleting text. Typing SVGs can be used as a bio on your Github profile readme or repository.",
"keywords": [
"github",
"dynamic",
"readme",
"typing",
"svg",
"profile"
],
"license": "MIT",
"version": "0.8.0",
"homepage": "https://github.com/DenverCoder1/readme-typing-svg/",
"autoload": {
"classmap": [
"src/models/",
"src/views/",
"src/controllers/",
"src/enums/",
"src/exceptions/",
"src/interfaces/"
]
},
"require": {
"php": "^8.1",
"vlucas/phpdotenv": "^5.3"
},
"require-dev": {
"phpunit/phpunit": "^11"
},
"scripts": {
"start": "php8 -S localhost:8000 -t src || php -S localhost:8000 -t src",
"test": "./vendor/bin/phpunit --testdox tests",
"format:check": "prettier --check *.md **/**/*.{php,md,js,css} --print-width 120",
"format": "prettier --write *.md **/**/*.{php,md,js,css} --print-width 120"
}
}
================================================
FILE: docs/faq.md
================================================
# FAQ
## How do I include Readme Typing SVG in my Readme?
Markdown files on GitHub support embedded images using Markdown or HTML. You can customize your SVG on the [demo site](https://readme-typing-svg.demolab.com/demo/) and use the image source in either of the following ways:
### Markdown
```md
[](https://git.io/typing-svg)
```
### HTML
```html
```
## The text is getting cut off at the end, how do I fix it?
The text rendered within the SVG can be any variable width, therefore you must specify the width manually to ensure the text will fit.
The `width` parameter in the URL should be increased such that the full width of the text is displayed properly.
```md
https://readme-typing-svg.demolab.com/?lines=Your+Long+Message+With+A+Long+Width&width=460
```
## How do I center the image on the page?
To center align images, you must use the HTML syntax and wrap it in an element with the HTML attribute `align="center"`.
```html
```
## How do I add multiple spaces in the middle of a line?
Similar to HTML, SVG/XML treats multiple consecutive spaces as a single space.
A workaround for adding extra spaces can be to use other whitespace characters (for example, you can copy-paste the en-space or other unusual spaces from https://qwerty.dev/whitespace). The alternate whitespace characters don't get ignored.
## How do I make different SVGs for dark mode and light mode?
As of May 2022, you can now [specify theme context](https://github.blog/changelog/2022-05-19-specify-theme-context-for-images-in-markdown-beta/) using the `` and `` elements as shown below. The dark mode version appears in the `srcset` of the `` tag and the light mode version appears in the `src` of the `` tag.
```html
```
## How do I create a Readme for my profile?
A profile readme appears on your profile page when you create a repository with the same name as your username and add a `README.md` file to it. For example, the repository for the user [`DenverCoder1`](https://github.com/DenverCoder1) is located at [`DenverCoder1/DenverCoder1`](https://github.com/DenverCoder1/DenverCoder1).
================================================
FILE: src/controllers/RendererController.php
================================================
$params
*/
private $params;
/**
* @var ResponseEnum $statusCode Response status code
*/
private ResponseEnum $statusCode = ResponseEnum::HTTP_OK;
/**
* Construct RendererController
*
* @param array $params request parameters
*/
public function __construct(array $params)
{
$this->params = $params;
// set up model and view
try {
// create renderer model
$this->model = new RendererModel(__DIR__ . "/../templates/main.php", $params);
// create renderer view
$this->view = new RendererView($this->model);
} catch (Exception $error) {
// create error rendering model
$this->model = new ErrorModel(__DIR__ . "/../templates/error.php", $error->getMessage());
// create error rendering view
$this->view = new ErrorView($this->model);
// set status code
$this->statusCode =
$error instanceof IStatusException ? $error->getStatus() : ResponseEnum::HTTP_INTERNAL_SERVER_ERROR;
}
}
/**
* Redirect to the demo site
*/
private function redirectToDemo(): void
{
header("Location: demo/");
exit();
}
/**
* Set content type for page output
*/
private function setContentType($type): void
{
header("Content-type: {$type}");
}
/**
* Set cache to refresh periodically
* This ensures any updates will roll out to all profiles
*/
private function setCacheRefreshDaily(): void
{
// set cache to refresh once per day
$timestamp = gmdate("D, d M Y 23:59:00") . " GMT";
header("Expires: $timestamp");
header("Last-Modified: $timestamp");
header("Pragma: no-cache");
header("Cache-Control: no-cache, must-revalidate");
}
/**
* Set output headers
*/
public function setHeaders(): void
{
// redirect to demo site if no text is given
if (!isset($this->params["lines"])) {
$this->redirectToDemo();
}
// set the content type header
$this->setContentType("image/svg+xml");
// set cache headers
$this->setCacheRefreshDaily();
// set status code
http_response_code($this->statusCode->value);
}
/**
* Get the rendered SVG
*
* @return string The SVG to output
*/
public function render(): string
{
return $this->view->render();
}
}
================================================
FILE: src/demo/css/loader.css
================================================
.loader,
.loader:before,
.loader:after {
display: none;
border-radius: 50%;
width: 2.5em;
height: 2.5em;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
-webkit-animation: load7 1.8s infinite ease-in-out;
animation: load7 1.8s infinite ease-in-out;
}
.loader {
color: var(--blue-light);
font-size: 10px;
margin: 0 0 38px 15px;
position: relative;
text-indent: -9999em;
-webkit-transform: translateY(-4px) translateZ(0) scale(0.5);
-ms-transform: translateY(-4px) translateZ(0) scale(0.5);
transform: translateY(-4px) translateZ(0) scale(0.5);
-webkit-animation-delay: -0.16s;
animation-delay: -0.16s;
}
.loader:before,
.loader:after {
content: "";
position: absolute;
top: 0;
}
.loader:before {
left: -3.5em;
-webkit-animation-delay: -0.32s;
animation-delay: -0.32s;
}
.loader:after {
left: 3.5em;
}
@-webkit-keyframes load7 {
0%,
80%,
100% {
box-shadow: 0 2.5em 0 -1.3em;
}
40% {
box-shadow: 0 2.5em 0 0;
}
}
@keyframes load7 {
0%,
80%,
100% {
box-shadow: 0 2.5em 0 -1.3em;
}
40% {
box-shadow: 0 2.5em 0 0;
}
}
.loading + .loader,
.loading + .loader:before,
.loading + .loader:after {
display: block;
}
.loading {
display: none;
}
================================================
FILE: src/demo/css/style.css
================================================
html {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
*,
*::before,
*::after {
-webkit-box-sizing: inherit;
-moz-box-sizing: inherit;
box-sizing: inherit;
}
:root {
--background: #eee;
--card-background: white;
--text: #1a1a1a;
--border: #ccc;
--stroke: #a9a9a9;
--blue-light: #2196f3;
--blue-dark: #1e88e5;
--button-outline: black;
--red: #ff6464;
--red-alt: #e45353;
}
[data-theme="dark"] {
--background: #090d13;
--card-background: #0d1117;
--text: #efefef;
--border: #2a2e34;
--stroke: #737373;
--blue-light: #1976d2;
--blue-dark: #1565c0;
--button-outline: black;
--red: #ff6464;
--red-alt: #e45353;
}
body {
background: var(--background);
font-family: "Open Sans", Roboto, Arial, sans-serif;
padding-top: 10px;
color: var(--text);
}
.github {
text-align: center;
margin-bottom: 12px;
}
.github span {
margin: 0 2px;
}
.container {
margin: auto;
max-width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.properties,
.output {
max-width: 550px;
margin: 10px;
background: var(--card-background);
padding: 25px;
padding-top: 0;
border: 1px solid var(--border);
border-radius: 6px;
}
@media only screen and (max-width: 1024px) {
.properties,
.output {
width: 100%;
}
}
h1 {
text-align: center;
}
h2 {
border-bottom: 1px solid var(--stroke);
}
:not(.btn):focus {
outline: var(--blue-light) auto 2px;
}
.btn {
max-width: 100%;
background-color: var(--blue-light);
color: white;
padding: 10px 20px;
border: none;
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);
transition: 0.2s ease-in-out;
}
.btn:focus {
outline: var(--button-outline) auto 2px;
}
.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);
}
.btn:disabled {
opacity: 0.8;
box-shadow: none;
cursor: not-allowed;
}
.parameters {
margin: auto;
display: grid;
align-items: center;
justify-content: start;
text-align: left;
grid-gap: 8px;
}
.two-columns {
grid-template-columns: auto 1fr;
}
.three-columns {
grid-template-columns: auto 1fr auto;
}
.parameters .btn {
margin-top: 8px;
}
.parameters input[type="text"],
.parameters input[type="number"],
.parameters input.jscolor,
.parameters select {
padding: 10px 14px;
display: inline-block;
border: 1px solid var(--border);
border-radius: 6px;
box-sizing: border-box;
font-family: inherit;
background: var(--card-background);
width: 100%;
min-width: 70px;
color: inherit;
}
.param.inline {
max-width: 54px;
padding: 10px 6px !important;
}
.parameters input.jscolor {
font-size: 12px;
max-width: 218px;
}
@media only screen and (max-width: 1024px) {
.parameters input.jscolor {
max-width: none;
}
}
.parameters select {
-webkit-appearance: none;
-moz-appearance: none;
background-image: url("data:image/svg+xml;utf8,");
background-repeat: no-repeat;
background-position-x: 100%;
background-position-y: 5px;
}
[data-theme="dark"] .parameters select {
background-image: url("data:image/svg+xml;utf8,");
}
span[title="required"] {
color: var(--red);
}
input:invalid {
outline: 2px var(--red) auto;
}
input:focus:invalid {
outline: none;
box-shadow: 0 0 0 1px var(--blue-light), 0 0 0 3px var(--red);
}
.delete-line.btn {
margin: 0;
background: inherit;
color: inherit;
font-size: 22px;
padding: 0;
height: 40px;
width: 40px;
background: var(--card-background);
color: var(--red-alt);
box-shadow: none;
}
.delete-line.btn:not(:disabled):hover {
box-shadow: 0 1px 3px rgb(0 0 0 / 12%), 0 1px 2px rgb(0 0 0 / 24%);
background: #e4535314;
}
.delete-line.btn:disabled {
color: var(--stroke);
}
.add-line.btn {
width: 100px;
font-size: 1em;
padding: 6px 0;
margin-top: 0.8em;
}
.output img {
max-width: 100%;
}
.output img.outlined {
border: 1px dashed var(--red);
border-radius: 2px;
}
.output .code-container {
background: var(--border);
border-radius: 6px;
padding: 12px 16px;
word-break: break-all;
}
.output .btn {
margin-top: 16px;
}
label.show-border {
display: block;
margin-top: 8px;
}
.label-group {
display: flex;
gap: 0.5rem;
}
a.icon {
color: var(--blue-light);
}
.top-bottom-split {
display: flex;
flex-direction: column;
justify-content: space-between;
}
/* tooltips */
.tooltip {
display: inline-flex;
justify-content: center;
align-items: center;
}
/* tooltip bubble */
.tooltip:before {
content: attr(title);
position: absolute;
transform: translateY(-2.45rem);
height: auto;
width: auto;
background: #4a4a4afa;
border-radius: 4px;
color: white;
line-height: 30px;
font-size: 1em;
padding: 0 12px;
pointer-events: none;
opacity: 0;
}
/* tooltip bottom triangle */
.tooltip:after {
content: "";
position: absolute;
transform: translateY(-1.35rem);
border-style: solid;
border-color: #4a4a4afa transparent transparent transparent;
pointer-events: none;
opacity: 0;
}
/* show tooltip on hover */
.tooltip[title]:hover:before,
.tooltip[title]:hover:after,
.tooltip:disabled:hover:before,
.tooltip:disabled:hover:after {
transition: 0.2s ease-in opacity;
opacity: 1;
}
.tooltip:disabled:before {
content: "You must first input valid text.";
}
/* link underline effect */
a.underline-hover {
position: relative;
text-decoration: none;
color: var(--text);
margin-top: 2em;
display: inline-flex;
align-items: center;
gap: 0.25em;
}
.underline-hover::before {
content: "";
position: absolute;
bottom: 0;
right: 0;
width: 0;
height: 1px;
background-color: var(--blue-light);
transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
@media (hover: hover) and (pointer: fine) {
.underline-hover:hover::before {
left: 0;
right: auto;
width: 100%;
}
}
================================================
FILE: src/demo/css/toggle-dark.css
================================================
a.darkmode {
position: fixed;
top: 2em;
right: 2em;
color: var(--text);
background: var(--background);
height: 3em;
width: 3em;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
border: 2px solid var(--border);
box-shadow: 0 0 3px rgb(0 0 0 / 12%), 0 1px 2px rgb(0 0 0 / 24%);
transition: 0.2s ease-in box-shadow;
}
a.darkmode .icon-moon,
a.darkmode .icon-sun {
position: absolute;
width: 1.25em;
height: 1.25em;
}
a.darkmode .icon-moon svg,
a.darkmode .icon-sun svg {
width: 100%;
height: 100%;
}
a.darkmode .icon-moon {
display: block;
}
a.darkmode .icon-sun {
display: none;
}
[data-theme="dark"] a.darkmode .icon-moon {
display: none;
}
[data-theme="dark"] a.darkmode .icon-sun {
display: block;
}
a.darkmode:hover {
box-shadow: 0 0 6px rgb(0 0 0 / 16%), 0 3px 6px rgb(0 0 0 / 23%);
}
@media only screen and (max-width: 600px) {
a.darkmode {
top: unset;
bottom: 1em;
right: 1em;
}
}
================================================
FILE: src/demo/index.php
================================================
Readme Typing SVG - Demo Site
>