Compare commits
269 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5ae90bfcbd | |||
| 26db3b7d8c | |||
| 61203fd35a | |||
| 8bc3dfbdb8 | |||
| be76e4117b | |||
| a351439d77 | |||
| 4ee906e1ce | |||
| 0536c900bc | |||
| 2dbe4c1d94 | |||
| 2c3c5981f6 | |||
| 99ee31601e | |||
| 1932af0f90 | |||
| b42d14166a | |||
| 6ff9db1be1 | |||
| f43b859e3f | |||
| 723efd95e8 | |||
| 6c91f98e57 | |||
| 957332f302 | |||
| 17d7ab5ec2 | |||
| ee75554751 | |||
| 8468ec9b96 | |||
| f42abc50f7 | |||
| d3d2227e19 | |||
| bfaf29d3fc | |||
| cc1ad37bb9 | |||
| b834611004 | |||
| 48c6b29b42 | |||
| 04cf37f265 | |||
| 888aff31e1 | |||
| f4b2f5cf88 | |||
| c83a129e01 | |||
| 3461a5b865 | |||
| c919601f7e | |||
| 5e0cd2e639 | |||
| 9b24ae64c9 | |||
| 71d1fafbd6 | |||
| 8947cb3641 | |||
| 7898e38f8e | |||
| b23cab5944 | |||
| 8899046e5e | |||
| a0e34df02d | |||
| 9ba8ccff66 | |||
| 004401a8d1 | |||
| fb6389f569 | |||
| d33d139590 | |||
| 1bffabd8bb | |||
| 6ff29bcf87 | |||
| 8c84e917c9 | |||
| f04dc760e2 | |||
| 938a8a9d43 | |||
| 2109192d72 | |||
| 793513dc21 | |||
| bf62cec45f | |||
| 646c0804b9 | |||
| b406f4d181 | |||
| ededb4b8a5 | |||
| 63347fc8b5 | |||
| 1c7bcb7d6b | |||
| edbaa47c40 | |||
| e084c9e775 | |||
| 91bdf52f58 | |||
| 0823cd43ce | |||
| 7a93ebeae1 | |||
| 46d3751b91 | |||
| 6a7a6575b7 | |||
| 61b8362a55 | |||
| 68bfa23dff | |||
| f0a9d02f26 | |||
| 20b47a9c3d | |||
| 9432f7d88d | |||
| 15c63a347a | |||
| fc1ecf5ab6 | |||
| 0194c38eb6 | |||
| be0234927d | |||
| 0253d1b5bb | |||
| c7fc859f0c | |||
| f21bbf2af7 | |||
| bbf6cf6018 | |||
| ccdd09db3f | |||
| 9eb2ab1260 | |||
| 36076a1fe9 | |||
| e92300198d | |||
| 25a970c5aa | |||
| 0038d17908 | |||
| 742a7d5d53 | |||
| 45f8ca0c9b | |||
| 131f4b00bf | |||
| f8b2c5d9d4 | |||
| e0c08558d8 | |||
| 70d473ca91 | |||
| 3d2510ac71 | |||
| fe35dcea9a | |||
| 22064237dc | |||
| 704df3681f | |||
| d8139bc7e2 | |||
| 6253936f99 | |||
| a5389b6646 | |||
| 4a1846e7df | |||
| 13829db4cb | |||
| c4becd7949 | |||
| 9e323b9157 | |||
| 29a0db0aad | |||
| e53c7321b6 | |||
| b7b1fd0a42 | |||
| 04ce080957 | |||
| 49552b7c42 | |||
| fb1b92b0a2 | |||
| 83af4c1839 | |||
| d36431ed29 | |||
| 9cb1b35ac2 | |||
| 2c2cdb30a5 | |||
| db23c74d4f | |||
| ebbb1dab5a | |||
| 7603bf41b6 | |||
| bbf0836509 | |||
| 901802b9d2 | |||
| 1e338f58f1 | |||
| 9b21412a1a | |||
| c8b8036477 | |||
| 5723c38dc9 | |||
| ec78c6ba05 | |||
| d9469f4eda | |||
| c7c7e1c357 | |||
| 4ffebfb792 | |||
| 779ba7827e | |||
| 5d542208ca | |||
| 96037f3ff5 | |||
| f11ef643bc | |||
| b3e4a1a0a9 | |||
| fbbb95f61f | |||
| 1d672fe879 | |||
| ac15f4ae45 | |||
| 55951c9ef5 | |||
| e29ddc1637 | |||
| a18dc59933 | |||
| 1c259a84ac | |||
| a93d958944 | |||
| 07b18b4c8a | |||
| 050d0b3a04 | |||
| 12315be78b | |||
| 63a94a3737 | |||
| 8480ef160d | |||
| 30675c7c6d | |||
| 3d296812e8 | |||
| d82a367616 | |||
| b243675abd | |||
| 1ca5906aa9 | |||
| d13c451cc0 | |||
| 12279914f1 | |||
| 25a1bf4110 | |||
| 444c84407c | |||
| 318b577765 | |||
| b98fecf05a | |||
| 40ccef24fd | |||
| a7ee36dad0 | |||
| a1bbb7f887 | |||
| a7680fb353 | |||
| d7bf06c7be | |||
| 2652aea305 | |||
| 0df590a045 | |||
| d259921b2e | |||
| f3ca29df8b | |||
| 705ca572f5 | |||
| 5803097e9d | |||
| 7a612901e3 | |||
| d81fa46e75 | |||
| eafa964cb9 | |||
| bca0f7a18c | |||
| 3c1e4fee34 | |||
| e5791fc0ec | |||
| e32acb6db3 | |||
| a933180d34 | |||
| 723cf48bb5 | |||
| 4ac9861096 | |||
| 8a1f60f4a4 | |||
| 7091c94801 | |||
| ddb17bc0de | |||
| c5f50a1a3c | |||
| 94b00fb72e | |||
| d220e82ed1 | |||
| 865321f39d | |||
| b0ad615680 | |||
| d333ce375a | |||
| 66561ce2a1 | |||
| 18709444c4 | |||
| c8aec7006c | |||
| 2d5ce3bf77 | |||
| 649ae8f797 | |||
| 6759486a5d | |||
| 784710be47 | |||
| a4ea5ac9e9 | |||
| 1c45d54dff | |||
| e81e39e799 | |||
| 42ada6734b | |||
| 5492605e18 | |||
| ded717ab76 | |||
| ba7af8cf3f | |||
| 4831ee47fe | |||
| 1f5b37ce0d | |||
| ca8da23ddc | |||
| dc0f39105a | |||
| 079fd604ea | |||
| bf7cd6999f | |||
| 9ac50e9ea7 | |||
| e6d2cdb5a7 | |||
| 4c12c077a6 | |||
| 96c69d554d | |||
| c3582cd225 | |||
| f184867d9e | |||
| e9a365e619 | |||
| 48e202bb20 | |||
| 9ceeeb7d4b | |||
| dd70212616 | |||
| 4e6a1a516d | |||
| 4060676ab1 | |||
| 4bd2548682 | |||
| 5a7b46357a | |||
| 64f6f40579 | |||
| 4a99f2f599 | |||
| 4f0578db39 | |||
| 8ac19f40c9 | |||
| bfec4e29e9 | |||
| d06ef502d2 | |||
| a92167e2d3 | |||
| 79112d9a95 | |||
| 693ac86846 | |||
| c5f6923187 | |||
| 2d481ca4df | |||
| 7561af7a0a | |||
| 66b751ef57 | |||
| 02d6cf440e | |||
| 224fb7c597 | |||
| 0a6fa01f7d | |||
| 5359edb4f1 | |||
| 4c2c783d6a | |||
| 3625b22266 | |||
| e24ea88773 | |||
| 2eee4b677d | |||
| 48b3ed3d02 | |||
| 22e7a96b7f | |||
| 3691d5c609 | |||
| a212b40d4d | |||
| a2d8a661a6 | |||
| 0097c3e9b3 | |||
| 0d012ff70a | |||
| acaa15dacf | |||
| ff65cfbd8c | |||
| 65086cbd99 | |||
| ae6ddfb3fd | |||
| b719553909 | |||
| 5e63c400e1 | |||
| 43d626f4e1 | |||
| e8c11274ea | |||
| 8d4ac6d394 | |||
| c7e0901d11 | |||
| e948dd1148 | |||
| 361c52bee0 | |||
| d1c1ab4821 | |||
| 21f29343e3 | |||
| 4b08b2fe97 | |||
| 75eb5878cd | |||
| 064b827014 | |||
| b83adbc715 | |||
| 33ed98add7 | |||
| f59987241f | |||
| 5f10777adb | |||
| dcd82b4eae | |||
| 251ab17595 | |||
| 32c42c1f4e |
@@ -1,7 +1,5 @@
|
|||||||
{
|
{
|
||||||
"files": [
|
"files": ["README.md"],
|
||||||
"README.md"
|
|
||||||
],
|
|
||||||
"imageSize": 100,
|
"imageSize": 100,
|
||||||
"commit": false,
|
"commit": false,
|
||||||
"contributors": [
|
"contributors": [
|
||||||
@@ -10,82 +8,63 @@
|
|||||||
"name": "Sarbik Betal",
|
"name": "Sarbik Betal",
|
||||||
"avatar_url": "https://avatars2.githubusercontent.com/u/41508422?v=4",
|
"avatar_url": "https://avatars2.githubusercontent.com/u/41508422?v=4",
|
||||||
"profile": "https://github.com/sarbikbetal",
|
"profile": "https://github.com/sarbikbetal",
|
||||||
"contributions": [
|
"contributions": ["code"]
|
||||||
"code"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"login": "Hardik0307",
|
"login": "Hardik0307",
|
||||||
"name": "Hardik Bagada",
|
"name": "Hardik Bagada",
|
||||||
"avatar_url": "https://avatars3.githubusercontent.com/u/41434099?v=4",
|
"avatar_url": "https://avatars3.githubusercontent.com/u/41434099?v=4",
|
||||||
"profile": "https://github.com/Hardik0307",
|
"profile": "https://github.com/Hardik0307",
|
||||||
"contributions": [
|
"contributions": ["code"]
|
||||||
"code"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"login": "antonkomarev",
|
"login": "antonkomarev",
|
||||||
"name": "Anton Komarev",
|
"name": "Anton Komarev",
|
||||||
"avatar_url": "https://avatars0.githubusercontent.com/u/1849174?v=4",
|
"avatar_url": "https://avatars0.githubusercontent.com/u/1849174?v=4",
|
||||||
"profile": "https://komarev.com",
|
"profile": "https://komarev.com",
|
||||||
"contributions": [
|
"contributions": ["plugin"]
|
||||||
"plugin"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"login": "KKVANONYMOUS",
|
"login": "KKVANONYMOUS",
|
||||||
"name": "Kunal Kumar Verma",
|
"name": "Kunal Kumar Verma",
|
||||||
"avatar_url": "https://avatars3.githubusercontent.com/u/58628586?v=4",
|
"avatar_url": "https://avatars3.githubusercontent.com/u/58628586?v=4",
|
||||||
"profile": "https://kkvanonymous.github.io/",
|
"profile": "https://kkvanonymous.github.io/",
|
||||||
"contributions": [
|
"contributions": ["code"]
|
||||||
"code"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"login": "jaideepghosh",
|
"login": "jaideepghosh",
|
||||||
"name": "Jaideep Ghosh",
|
"name": "Jaideep Ghosh",
|
||||||
"avatar_url": "https://avatars2.githubusercontent.com/u/3909648?v=4",
|
"avatar_url": "https://avatars2.githubusercontent.com/u/3909648?v=4",
|
||||||
"profile": "http://jaideepghosh.blogspot.com",
|
"profile": "http://jaideepghosh.blogspot.com",
|
||||||
"contributions": [
|
"contributions": ["code"]
|
||||||
"code"
|
},
|
||||||
]
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
"login": "YashKandalkar",
|
"login": "YashKandalkar",
|
||||||
"name": "yash",
|
"name": "yash",
|
||||||
"avatar_url": "https://avatars0.githubusercontent.com/u/35102959?v=4",
|
"avatar_url": "https://avatars0.githubusercontent.com/u/35102959?v=4",
|
||||||
"profile": "http://yashkandalkar.github.io",
|
"profile": "http://yashkandalkar.github.io",
|
||||||
"contributions": [
|
"contributions": ["code"]
|
||||||
"code"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"login": "abhijit-hota",
|
"login": "abhijit-hota",
|
||||||
"name": "Abhijit Hota",
|
"name": "Abhijit Hota",
|
||||||
"avatar_url": "https://avatars0.githubusercontent.com/u/8116174?v=4",
|
"avatar_url": "https://avatars0.githubusercontent.com/u/8116174?v=4",
|
||||||
"profile": "https://github.com/abhijit-hota",
|
"profile": "https://github.com/abhijit-hota",
|
||||||
"contributions": [
|
"contributions": ["code", "test"]
|
||||||
"code",
|
|
||||||
"test"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"login": "Maddoxx88",
|
"login": "Maddoxx88",
|
||||||
"name": "Sunit Shirke",
|
"name": "Sunit Shirke",
|
||||||
"avatar_url": "https://avatars1.githubusercontent.com/u/34238672?v=4",
|
"avatar_url": "https://avatars1.githubusercontent.com/u/34238672?v=4",
|
||||||
"profile": "https://maddoxx88.github.io/",
|
"profile": "https://maddoxx88.github.io/",
|
||||||
"contributions": [
|
"contributions": ["code"]
|
||||||
"code"
|
},
|
||||||
]
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
"login": "g-savitha",
|
"login": "g-savitha",
|
||||||
"name": "Savitha Gollamudi",
|
"name": "Savitha Gollamudi",
|
||||||
"avatar_url": "https://avatars0.githubusercontent.com/u/31612459?v=4",
|
"avatar_url": "https://avatars0.githubusercontent.com/u/31612459?v=4",
|
||||||
"profile": "https://www.gsavitha.in",
|
"profile": "https://www.gsavitha.in",
|
||||||
"contributions": [
|
"contributions": ["code"]
|
||||||
"code"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"contributorsPerLine": 7,
|
"contributorsPerLine": 7,
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
node_modules/**
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"es2021": true
|
||||||
|
},
|
||||||
|
"extends": ["plugin:react/recommended", "airbnb", "prettier"],
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaFeatures": {
|
||||||
|
"jsx": true
|
||||||
|
},
|
||||||
|
"ecmaVersion": 12,
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"plugins": ["react"],
|
||||||
|
"rules": {
|
||||||
|
"react/forbid-prop-types": 0
|
||||||
|
},
|
||||||
|
"ignorePatterns": ["**/*.test.js"]
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# These are supported funding model platforms
|
# These are supported funding model platforms
|
||||||
|
|
||||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
github: rahuldkjain
|
||||||
patreon: # Replace with a single Patreon username
|
patreon: # Replace with a single Patreon username
|
||||||
open_collective: github-profile-readme-generator
|
open_collective: github-profile-readme-generator
|
||||||
ko_fi: rahuldkjain
|
ko_fi: rahuldkjain
|
||||||
@@ -9,5 +9,4 @@ community_bridge: # Replace with a single Community Bridge project-name e.g., cl
|
|||||||
liberapay: # Replace with a single Liberapay username
|
liberapay: # Replace with a single Liberapay username
|
||||||
issuehunt: # Replace with a single IssueHunt username
|
issuehunt: # Replace with a single IssueHunt username
|
||||||
otechie: # Replace with a single Otechie username
|
otechie: # Replace with a single Otechie username
|
||||||
custom:
|
custom: ['https://paypal.me/rahuldkjain', 'https://www.buymeacoffee.com/rahuldkjain']
|
||||||
["https://paypal.me/rahuldkjain", "https://www.buymeacoffee.com/rahuldkjain"]
|
|
||||||
|
|||||||
@@ -1,43 +1,55 @@
|
|||||||
---
|
---
|
||||||
name: Bug report
|
name: 🐛 Bug Report
|
||||||
about: Create a report to help us improve
|
about: Report a bug in GitHub Profile README Generator
|
||||||
title: ""
|
title: '[Bug] '
|
||||||
labels: bug
|
labels: ['bug']
|
||||||
assignees: ""
|
assignees: ''
|
||||||
---
|
---
|
||||||
|
|
||||||
**Describe the bug**
|
## 🐛 Bug Description
|
||||||
|
|
||||||
A clear and concise description of what the bug is.
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
**To Reproduce**
|
## 🔄 Steps to Reproduce
|
||||||
Steps to reproduce the behavior:
|
|
||||||
|
|
||||||
1. Go to '...'
|
1. Go to [URL or page]
|
||||||
2. Click on '....'
|
2. Click on [element]
|
||||||
3. Scroll down to '....'
|
3. Fill in [specific fields]
|
||||||
4. See error
|
4. See error
|
||||||
|
|
||||||
**Expected behavior**
|
## ✅ Expected Behavior
|
||||||
A clear and concise description of what you expected to happen.
|
|
||||||
|
A clear description of what you expected to happen.
|
||||||
|
|
||||||
|
## 📸 Screenshots
|
||||||
|
|
||||||
**Screenshots**
|
|
||||||
If applicable, add screenshots to help explain your problem.
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
**Desktop (please complete the following information):**
|
## 🖥️ Environment
|
||||||
|
|
||||||
- OS: [e.g. iOS]
|
**Desktop:**
|
||||||
- Browser [e.g. chrome, safari]
|
|
||||||
- Version [e.g. 22]
|
|
||||||
|
|
||||||
**Smartphone (please complete the following information):**
|
- OS: [e.g. macOS, Windows, Linux]
|
||||||
|
- Browser: [e.g. Chrome 118, Safari 17, Firefox 119]
|
||||||
|
|
||||||
- Device: [e.g. iPhone6]
|
**Mobile:**
|
||||||
- OS: [e.g. iOS8.1]
|
|
||||||
- Browser [e.g. stock browser, safari]
|
|
||||||
- Version [e.g. 22]
|
|
||||||
|
|
||||||
**Additional context**
|
- Device: [e.g. iPhone 15, Samsung Galaxy S23]
|
||||||
Add any other context about the problem here.
|
- OS: [e.g. iOS 17.1, Android 14]
|
||||||
|
- Browser: [e.g. Safari, Chrome Mobile]
|
||||||
|
|
||||||
|
## 🔧 Additional Context
|
||||||
|
|
||||||
|
- Does this happen in incognito/private mode? [Yes/No]
|
||||||
|
- Console errors (if any): [Paste console output]
|
||||||
|
- Network connectivity: [Good/Slow/Offline]
|
||||||
|
|
||||||
|
**Note:** Please test at the current version: https://rahuldkjain.github.io/gh-profile-readme-generator
|
||||||
|
|
||||||
Join the **Discord Server** for further discussions.
|
Join the **Discord Server** for further discussions.
|
||||||
|
|
||||||
|
<a href="https://discord.gg/HHMs7Eg">
|
||||||
|
<img src="https://discord.com/assets/e4923594e694a21542a489471ecffa50.svg" alt="GPRG Discord Server Link" width="300px"/>
|
||||||
|
</a>
|
||||||
|
|
||||||
Server Link: https://discord.gg/HHMs7Eg
|
Server Link: https://discord.gg/HHMs7Eg
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: Feature/Enhancement request
|
name: Feature/Enhancement request
|
||||||
about: Suggest an idea for this project
|
about: Suggest an idea for this project
|
||||||
title: ""
|
title: ''
|
||||||
labels: enhancement
|
labels: enhancement, hacktoberfest
|
||||||
assignees: ""
|
assignees: ''
|
||||||
---
|
---
|
||||||
|
|
||||||
**Is your feature request related to a problem? Please describe.**
|
**Is your feature request related to a problem? Please describe.**
|
||||||
@@ -20,4 +20,8 @@ Add any other context or screenshots about the feature request here.
|
|||||||
|
|
||||||
Join the **Discord Server** for further discussions.
|
Join the **Discord Server** for further discussions.
|
||||||
|
|
||||||
|
<a href="https://discord.gg/HHMs7Eg">
|
||||||
|
<img src="https://discord.com/assets/e4923594e694a21542a489471ecffa50.svg" alt="GPRG Discord Server Link" width="300px"/>
|
||||||
|
</a>
|
||||||
|
|
||||||
Server Link: https://discord.gg/HHMs7Eg
|
Server Link: https://discord.gg/HHMs7Eg
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
---
|
||||||
|
name: ✨ Feature Request
|
||||||
|
about: Suggest a new feature for GitHub Profile README Generator
|
||||||
|
title: '[Feature] '
|
||||||
|
labels: ['enhancement']
|
||||||
|
assignees: ''
|
||||||
|
---
|
||||||
|
|
||||||
|
## ✨ Feature Description
|
||||||
|
|
||||||
|
A clear and concise description of the feature you'd like to see.
|
||||||
|
|
||||||
|
## 🎯 Problem Statement
|
||||||
|
|
||||||
|
What problem does this feature solve? Is your feature request related to a problem?
|
||||||
|
|
||||||
|
## 💡 Proposed Solution
|
||||||
|
|
||||||
|
Describe the solution you'd like to see implemented.
|
||||||
|
|
||||||
|
## 🔄 User Flow
|
||||||
|
|
||||||
|
Describe how a user would interact with this feature:
|
||||||
|
|
||||||
|
1. User goes to...
|
||||||
|
2. User clicks/types...
|
||||||
|
3. System responds with...
|
||||||
|
|
||||||
|
## 🎨 Design Considerations
|
||||||
|
|
||||||
|
- UI/UX requirements
|
||||||
|
- Accessibility considerations
|
||||||
|
- Mobile responsiveness needs
|
||||||
|
- Theme compatibility (dark/light mode)
|
||||||
|
|
||||||
|
## 🔧 Technical Considerations
|
||||||
|
|
||||||
|
- Performance impact
|
||||||
|
- Browser compatibility requirements
|
||||||
|
- Dependencies needed
|
||||||
|
- Potential breaking changes
|
||||||
|
|
||||||
|
## 📋 Alternative Solutions
|
||||||
|
|
||||||
|
Describe alternatives you've considered.
|
||||||
|
|
||||||
|
## 📸 Mockups/Examples
|
||||||
|
|
||||||
|
If applicable, add mockups, sketches, or examples from other tools.
|
||||||
|
|
||||||
|
## 🎯 Priority
|
||||||
|
|
||||||
|
- [ ] Low - Nice to have
|
||||||
|
- [ ] Medium - Would improve UX significantly
|
||||||
|
- [ ] High - Critical for user workflow
|
||||||
|
- [ ] Critical - Blocking current functionality
|
||||||
|
|
||||||
|
## 📱 Target Platforms
|
||||||
|
|
||||||
|
- [ ] Desktop
|
||||||
|
- [ ] Mobile
|
||||||
|
- [ ] Tablet
|
||||||
|
- [ ] All platforms
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
💬 **Join our Discord** for feature discussions: https://discord.gg/HHMs7Eg
|
||||||
@@ -1,43 +1,174 @@
|
|||||||
<!--
|
<!--
|
||||||
For Work In Progress Pull Requests, please use the Draft PR feature,
|
🚀 Thanks for contributing to GitHub Profile README Generator V2!
|
||||||
see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details.
|
|
||||||
|
|
||||||
For a timely review/response, please avoid force-pushing additional
|
Before submitting your Pull Request, please ensure you've done the following:
|
||||||
commits if your PR already received reviews or comments.
|
📖 Read the Contributing Guide: https://github.com/rahuldkjain/github-profile-readme-generator/blob/master/CONTRIBUTING.md
|
||||||
|
📖 Read the Code of Conduct: https://github.com/rahuldkjain/github-profile-readme-generator/blob/master/CODE_OF_CONDUCT.md
|
||||||
|
🔄 Follow our Commit Convention: https://github.com/rahuldkjain/github-profile-readme-generator/blob/master/COMMIT_CONVENTION.md
|
||||||
|
👷♀️ Create focused, single-purpose PRs
|
||||||
|
✅ Test your changes thoroughly
|
||||||
|
📝 Use conventional commit messages (feat:, fix:, docs:, etc.)
|
||||||
|
📗 Update documentation and add screenshots for UI changes
|
||||||
|
|
||||||
Before submitting a Pull Request, please ensure you've done the following:
|
For Work In Progress PRs, please use the Draft PR feature.
|
||||||
- 📖 Read the Contributing Guide: https://github.com/rahuldkjain/github-profile-readme-generator/blob/master/CONTRIBUTING.md#create-a-pull-request.
|
Avoid force-pushing after receiving reviews unless requested.
|
||||||
- 📖 Read the Code of Conduct: https://github.com/rahuldkjain/github-profile-readme-generator/blob/master/CODE_OF_CONDUCT.md.
|
|
||||||
- 👷♀️ Create small PRs. In most cases this will be possible.
|
|
||||||
- ✅ Provide issue number with link.
|
|
||||||
- 📝 Use descriptive commit messages.
|
|
||||||
- 📗 Update any related documentation and include any relevant screenshots.
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
## What type of PR is this? (check all applicable)
|
# 🔄 Pull Request
|
||||||
|
|
||||||
- [ ] Refactor
|
## 📋 **Type of Change** (check all applicable)
|
||||||
- [ ] Feature
|
|
||||||
- [ ] Bug Fix
|
|
||||||
- [ ] Enhancement
|
|
||||||
- [ ] Documentation Update
|
|
||||||
|
|
||||||
## Description
|
- [ ] 🐛 **Bug Fix** - Fixes an issue without breaking existing functionality
|
||||||
|
- [ ] ✨ **Feature** - Adds new functionality
|
||||||
|
- [ ] ⚡ **Performance** - Improves performance without changing functionality
|
||||||
|
- [ ] ♻️ **Refactor** - Code changes that neither fix bugs nor add features
|
||||||
|
- [ ] 📚 **Documentation** - Updates to documentation, comments, or README
|
||||||
|
- [ ] 🎨 **Style** - Code style changes (formatting, missing semi-colons, etc.)
|
||||||
|
- [ ] 🧪 **Test** - Adding or updating tests
|
||||||
|
- [ ] 🏗️ **Build** - Changes to build system or dependencies
|
||||||
|
- [ ] 👷 **CI/CD** - Changes to CI/CD workflows
|
||||||
|
- [ ] 🔒 **Security** - Security improvements or vulnerability fixes
|
||||||
|
- [ ] ♿ **Accessibility** - Improves accessibility compliance
|
||||||
|
- [ ] 📱 **Mobile** - Mobile-specific improvements
|
||||||
|
- [ ] 🌐 **i18n** - Internationalization changes
|
||||||
|
|
||||||
## Related Tickets & Documents
|
## 📖 **Description**
|
||||||
|
|
||||||
## QA Instructions, Screenshots, Recordings
|
<!-- Provide a clear and concise description of what this PR does -->
|
||||||
|
|
||||||
_Please replace this line with instructions on how to test your changes, as well
|
### **What changed?**
|
||||||
as any relevant images for UI changes._
|
|
||||||
|
|
||||||
<!-- ## Added tests?
|
<!-- Describe the changes made -->
|
||||||
|
|
||||||
- [ ] yes
|
### **Why was this change made?**
|
||||||
- [ ] no, because they aren't needed
|
|
||||||
- [ ] no, because I need help -->
|
|
||||||
|
|
||||||
## Added to documentation?
|
<!-- Explain the motivation behind this change -->
|
||||||
|
|
||||||
- [ ] readme
|
### **How does this change help users?**
|
||||||
|
|
||||||
|
<!-- Describe the user benefit -->
|
||||||
|
|
||||||
|
## 🔗 **Related Issues**
|
||||||
|
|
||||||
|
<!-- Link related issues using keywords: Closes #123, Fixes #456, Related to #789 -->
|
||||||
|
|
||||||
|
- Closes #
|
||||||
|
- Fixes #
|
||||||
|
- Related to #
|
||||||
|
|
||||||
|
## 🧪 **Testing & Quality Assurance**
|
||||||
|
|
||||||
|
### **Testing Done** (check all applicable)
|
||||||
|
|
||||||
|
- [ ] ✅ **Manual testing** - Tested functionality manually
|
||||||
|
- [ ] 🧪 **Unit tests** - Added/updated unit tests
|
||||||
|
- [ ] 🔄 **Integration tests** - Tested with other components
|
||||||
|
- [ ] 📱 **Mobile testing** - Tested on mobile devices
|
||||||
|
- [ ] ♿ **Accessibility testing** - Tested with screen readers/keyboard nav
|
||||||
|
- [ ] 🌐 **Cross-browser testing** - Tested in multiple browsers
|
||||||
|
- [ ] 🎨 **Visual testing** - Checked UI/UX in light/dark themes
|
||||||
|
|
||||||
|
### **Test Instructions**
|
||||||
|
|
||||||
|
<!-- Provide step-by-step instructions for reviewers to test your changes -->
|
||||||
|
|
||||||
|
1.
|
||||||
|
2.
|
||||||
|
3.
|
||||||
|
|
||||||
|
### **Expected Behavior**
|
||||||
|
|
||||||
|
<!-- Describe what should happen when testing -->
|
||||||
|
|
||||||
|
## 📸 **Screenshots/Recordings**
|
||||||
|
|
||||||
|
<!--
|
||||||
|
For UI changes, please include:
|
||||||
|
- Before/after screenshots
|
||||||
|
- Mobile screenshots
|
||||||
|
- Dark/light theme screenshots
|
||||||
|
- Screen recordings for complex interactions
|
||||||
|
-->
|
||||||
|
|
||||||
|
### **Before**
|
||||||
|
|
||||||
|
<!-- Screenshot/description of current state -->
|
||||||
|
|
||||||
|
### **After**
|
||||||
|
|
||||||
|
<!-- Screenshot/description of new state -->
|
||||||
|
|
||||||
|
## 📋 **Checklist**
|
||||||
|
|
||||||
|
### **Code Quality**
|
||||||
|
|
||||||
|
- [ ] 🔍 **TypeScript** - No TypeScript errors (`npm run type-check`)
|
||||||
|
- [ ] 🧹 **Linting** - No ESLint errors (`npm run lint`)
|
||||||
|
- [ ] 🎨 **Formatting** - Code is properly formatted (`npm run format`)
|
||||||
|
- [ ] 🏗️ **Build** - Production build succeeds (`npm run build`)
|
||||||
|
- [ ] ⚡ **Performance** - No performance regressions introduced
|
||||||
|
|
||||||
|
### **Accessibility**
|
||||||
|
|
||||||
|
- [ ] ♿ **WCAG Compliance** - Follows WCAG 2.1 AA guidelines
|
||||||
|
- [ ] ⌨️ **Keyboard Navigation** - All interactive elements are keyboard accessible
|
||||||
|
- [ ] 🔍 **Screen Reader** - Proper ARIA labels and semantic HTML
|
||||||
|
- [ ] 🎨 **Color Contrast** - Meets contrast requirements
|
||||||
|
- [ ] 🎯 **Focus Management** - Visible focus indicators
|
||||||
|
|
||||||
|
### **Mobile & Responsive**
|
||||||
|
|
||||||
|
- [ ] 📱 **Mobile Responsive** - Works on mobile devices (320px+)
|
||||||
|
- [ ] 🖥️ **Desktop** - Works on desktop (1024px+)
|
||||||
|
- [ ] 📐 **Tablet** - Works on tablet sizes (768px+)
|
||||||
|
- [ ] 🔄 **Orientation** - Works in portrait and landscape
|
||||||
|
|
||||||
|
### **Browser Compatibility**
|
||||||
|
|
||||||
|
- [ ] 🌐 **Chrome** - Latest version
|
||||||
|
- [ ] 🦊 **Firefox** - Latest version
|
||||||
|
- [ ] 🧭 **Safari** - Latest version
|
||||||
|
- [ ] 📱 **Mobile Safari** - iOS Safari
|
||||||
|
- [ ] 📱 **Chrome Mobile** - Android Chrome
|
||||||
|
|
||||||
|
### **Documentation**
|
||||||
|
|
||||||
|
- [ ] 📚 **Code Comments** - Added helpful comments for complex logic
|
||||||
|
- [ ] 📖 **Documentation** - Updated relevant documentation
|
||||||
|
- [ ] 📝 **README** - Updated README if needed
|
||||||
|
- [ ] 🔄 **Changelog** - Will be auto-generated from conventional commits
|
||||||
|
|
||||||
|
### **Security & Privacy**
|
||||||
|
|
||||||
|
- [ ] 🔒 **No Secrets** - No API keys, passwords, or sensitive data exposed
|
||||||
|
- [ ] 🛡️ **Input Validation** - Proper validation for user inputs
|
||||||
|
- [ ] 🔐 **XSS Prevention** - Protected against XSS attacks
|
||||||
|
- [ ] 🍪 **Privacy Compliant** - Follows GDPR/privacy requirements
|
||||||
|
|
||||||
|
## 🚀 **Deployment Notes**
|
||||||
|
|
||||||
|
<!-- Any special considerations for deployment -->
|
||||||
|
|
||||||
|
- [ ] **No breaking changes** - Backward compatible
|
||||||
|
- [ ] **Database changes** - N/A (static site)
|
||||||
|
- [ ] **Environment variables** - No new env vars needed
|
||||||
|
- [ ] **Third-party dependencies** - No new external dependencies
|
||||||
|
|
||||||
|
## 📝 **Additional Notes**
|
||||||
|
|
||||||
|
<!-- Any additional information, concerns, or context -->
|
||||||
|
|
||||||
|
## 👀 **Reviewers**
|
||||||
|
|
||||||
|
<!-- Tag specific reviewers if needed -->
|
||||||
|
<!-- @username for specific reviewers -->
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**By submitting this PR, I confirm that:**
|
||||||
|
|
||||||
|
- ✅ I have read and agree to the [Code of Conduct](https://github.com/rahuldkjain/github-profile-readme-generator/blob/master/CODE_OF_CONDUCT.md)
|
||||||
|
- ✅ I have followed the [Contributing Guidelines](https://github.com/rahuldkjain/github-profile-readme-generator/blob/master/CONTRIBUTING.md)
|
||||||
|
- ✅ I have used [Conventional Commits](https://github.com/rahuldkjain/github-profile-readme-generator/blob/master/COMMIT_CONVENTION.md) for my commit messages
|
||||||
|
- ✅ I have tested my changes thoroughly
|
||||||
|
- ✅ My code follows the project's coding standards
|
||||||
|
|||||||
@@ -0,0 +1,182 @@
|
|||||||
|
name: Build and Deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master, dev]
|
||||||
|
|
||||||
|
# Allow concurrent deployments for different environments
|
||||||
|
concurrency:
|
||||||
|
group: 'pages-${{ github.ref }}'
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run type check
|
||||||
|
run: npm run type-check
|
||||||
|
|
||||||
|
- name: Run linting
|
||||||
|
run: npm run lint
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: npm run test
|
||||||
|
|
||||||
|
- name: Build application
|
||||||
|
run: |
|
||||||
|
echo "Building for branch: ${{ github.ref_name }}"
|
||||||
|
echo "NODE_ENV: $NODE_ENV"
|
||||||
|
echo "SURGE_PREVIEW: $SURGE_PREVIEW"
|
||||||
|
npm run build
|
||||||
|
env:
|
||||||
|
NEXT_PUBLIC_GA_ID: ${{ secrets.NEXT_PUBLIC_GA_ID }}
|
||||||
|
NEXT_PUBLIC_REQUIRE_CONSENT: true
|
||||||
|
NEXT_PUBLIC_ANONYMIZE_IP: true
|
||||||
|
# Set SURGE_PREVIEW for non-master branches to disable basePath
|
||||||
|
SURGE_PREVIEW: ${{ github.ref != 'refs/heads/master' && 'true' || '' }}
|
||||||
|
|
||||||
|
- name: Upload Pages Artifact (Production)
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
uses: actions/upload-pages-artifact@v3
|
||||||
|
with:
|
||||||
|
path: ./out
|
||||||
|
|
||||||
|
- name: Upload Preview Artifact
|
||||||
|
if: github.ref != 'refs/heads/master'
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: preview-build-${{ github.run_number }}-${{ github.run_attempt }}
|
||||||
|
path: ./out
|
||||||
|
retention-days: 30
|
||||||
|
|
||||||
|
# Production deployment to main GitHub Pages
|
||||||
|
deploy-production:
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
# Only deploy to production from master branch
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
environment:
|
||||||
|
name: github-pages
|
||||||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
id: deployment
|
||||||
|
uses: actions/deploy-pages@v4
|
||||||
|
|
||||||
|
# Preview deployment for development branches
|
||||||
|
deploy-preview:
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
# Deploy preview for dev branches (not master, only on direct push)
|
||||||
|
if: github.ref != 'refs/heads/master' && github.event_name == 'push'
|
||||||
|
|
||||||
|
# Add deployment environment to show URL in GitHub UI
|
||||||
|
environment:
|
||||||
|
name: preview-${{ github.ref_name }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Calculate sanitized branch name
|
||||||
|
id: branch
|
||||||
|
run: |
|
||||||
|
SANITIZED_BRANCH=$(echo "${{ github.ref_name }}" | sed 's/[^a-zA-Z0-9-]/-/g' | tr '[:upper:]' '[:lower:]')
|
||||||
|
echo "sanitized=$SANITIZED_BRANCH" >> $GITHUB_OUTPUT
|
||||||
|
echo "url=https://gprg-${SANITIZED_BRANCH}.surge.sh" >> $GITHUB_OUTPUT
|
||||||
|
- name: Debug deployment conditions
|
||||||
|
run: |
|
||||||
|
echo "GitHub ref: ${{ github.ref }}"
|
||||||
|
echo "GitHub ref name: ${{ github.ref_name }}"
|
||||||
|
echo "Event name: ${{ github.event_name }}"
|
||||||
|
echo "Is master?: ${{ github.ref == 'refs/heads/master' }}"
|
||||||
|
echo "Is push?: ${{ github.event_name == 'push' }}"
|
||||||
|
echo "Should deploy?: ${{ github.ref != 'refs/heads/master' && github.event_name == 'push' }}"
|
||||||
|
|
||||||
|
- name: Download Preview Artifact
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: preview-build-${{ github.run_number }}-${{ github.run_attempt }}
|
||||||
|
path: ./preview-out
|
||||||
|
|
||||||
|
- name: Deploy to Surge.sh (Preview)
|
||||||
|
id: deploy
|
||||||
|
run: |
|
||||||
|
npm install -g surge
|
||||||
|
echo "Deploying preview for branch: ${{ github.ref_name }}"
|
||||||
|
echo "Sanitized branch name: ${{ steps.branch.outputs.sanitized }}"
|
||||||
|
echo "Preview URL: ${{ steps.branch.outputs.url }}"
|
||||||
|
surge ./preview-out ${{ steps.branch.outputs.url }} --token ${{ secrets.SURGE_TOKEN }}
|
||||||
|
echo "deployment_url=${{ steps.branch.outputs.url }}" >> $GITHUB_OUTPUT
|
||||||
|
env:
|
||||||
|
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
|
||||||
|
|
||||||
|
- name: Comment PR with Preview URL
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const previewUrl = '${{ steps.deploy.outputs.deployment_url }}';
|
||||||
|
|
||||||
|
github.rest.issues.createComment({
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
body: `🚀 **Preview Deployment Ready!**\n\n📱 Preview URL: ${previewUrl}\n\n*This preview will be available for 30 days.*`
|
||||||
|
});
|
||||||
|
|
||||||
|
- name: Create deployment status
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const previewUrl = '${{ steps.deploy.outputs.deployment_url }}';
|
||||||
|
|
||||||
|
// Create a commit status with the deployment URL
|
||||||
|
github.rest.repos.createCommitStatus({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
sha: context.sha,
|
||||||
|
state: 'success',
|
||||||
|
target_url: previewUrl,
|
||||||
|
description: `Preview deployed to ${previewUrl}`,
|
||||||
|
context: 'deployment/preview'
|
||||||
|
});
|
||||||
|
|
||||||
|
- name: Update Status Check
|
||||||
|
run: |
|
||||||
|
echo "🚀 Preview deployed successfully!"
|
||||||
|
echo "📱 Preview URL: ${{ steps.deploy.outputs.deployment_url }}"
|
||||||
|
echo ""
|
||||||
|
echo "You can find this URL in:"
|
||||||
|
echo "1. GitHub Actions > Environments tab"
|
||||||
|
echo "2. Commit status checks"
|
||||||
|
echo "3. This workflow run summary"
|
||||||
|
|
||||||
|
# Add to job summary for easy access
|
||||||
|
echo "## 🚀 Preview Deployment Complete!" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "**Branch:** \`${{ github.ref_name }}\`" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "**Preview URL:** [${{ steps.deploy.outputs.deployment_url }}](${{ steps.deploy.outputs.deployment_url }})" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "### Where to find this URL:" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "- **Environments tab:** Go to your repository → Environments → preview-${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "- **Commit status:** Check the commit status checks for 'deployment/preview'" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "- **This summary:** Bookmark this workflow run for easy access" >> $GITHUB_STEP_SUMMARY
|
||||||
@@ -1,70 +1,45 @@
|
|||||||
dist/
|
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||||
# Logs
|
|
||||||
logs
|
# dependencies
|
||||||
*.log
|
/node_modules
|
||||||
|
/.pnp
|
||||||
|
.pnp.*
|
||||||
|
.yarn/*
|
||||||
|
!.yarn/patches
|
||||||
|
!.yarn/plugins
|
||||||
|
!.yarn/releases
|
||||||
|
!.yarn/versions
|
||||||
|
|
||||||
|
# testing
|
||||||
|
/coverage
|
||||||
|
|
||||||
|
# next.js
|
||||||
|
/.next/
|
||||||
|
/out/
|
||||||
|
|
||||||
|
# production
|
||||||
|
/build
|
||||||
|
|
||||||
|
# misc
|
||||||
|
.DS_Store
|
||||||
|
*.pem
|
||||||
|
|
||||||
|
# debug
|
||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
|
.pnpm-debug.log*
|
||||||
|
|
||||||
# Runtime data
|
# env files (can opt-in for committing if needed)
|
||||||
pids
|
|
||||||
*.pid
|
|
||||||
*.seed
|
|
||||||
*.pid.lock
|
|
||||||
|
|
||||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
||||||
lib-cov
|
|
||||||
|
|
||||||
# Coverage directory used by tools like istanbul
|
|
||||||
coverage
|
|
||||||
|
|
||||||
# nyc test coverage
|
|
||||||
.nyc_output
|
|
||||||
|
|
||||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
|
||||||
.grunt
|
|
||||||
|
|
||||||
# Bower dependency directory (https://bower.io/)
|
|
||||||
bower_components
|
|
||||||
|
|
||||||
# node-waf configuration
|
|
||||||
.lock-wscript
|
|
||||||
|
|
||||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
|
||||||
build/Release
|
|
||||||
|
|
||||||
# Dependency directories
|
|
||||||
node_modules/
|
|
||||||
jspm_packages/
|
|
||||||
|
|
||||||
# Typescript v1 declaration files
|
|
||||||
typings/
|
|
||||||
|
|
||||||
# Optional npm cache directory
|
|
||||||
.npm
|
|
||||||
|
|
||||||
# Optional eslint cache
|
|
||||||
.eslintcache
|
|
||||||
|
|
||||||
# Optional REPL history
|
|
||||||
.node_repl_history
|
|
||||||
|
|
||||||
# Output of 'npm pack'
|
|
||||||
*.tgz
|
|
||||||
|
|
||||||
# dotenv environment variable files
|
|
||||||
.env*
|
.env*
|
||||||
|
|
||||||
# gatsby files
|
# vercel
|
||||||
.cache/
|
.vercel
|
||||||
public
|
|
||||||
|
|
||||||
# Mac files
|
# typescript
|
||||||
.DS_Store
|
*.tsbuildinfo
|
||||||
|
next-env.d.ts
|
||||||
|
|
||||||
# Yarn
|
# Claude
|
||||||
yarn-error.log
|
.cursor/
|
||||||
.pnp/
|
.claude/
|
||||||
.pnp.js
|
|
||||||
# Yarn Integrity file
|
|
||||||
.yarn-integrity
|
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
. "$(dirname "$0")/_/husky.sh"
|
||||||
|
|
||||||
|
npx --no-install lint-staged
|
||||||
@@ -1,4 +1,11 @@
|
|||||||
{
|
{
|
||||||
"arrowParens": "avoid",
|
"singleQuote": true,
|
||||||
"semi": false
|
"jsxSingleQuote": false,
|
||||||
|
"tabWidth": 2,
|
||||||
|
"printWidth": 100,
|
||||||
|
"trailingComma": "es5",
|
||||||
|
"semi": true,
|
||||||
|
"arrowParens": "always",
|
||||||
|
"endOfLine": "lf",
|
||||||
|
"plugins": ["prettier-plugin-tailwindcss"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,82 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [2.0.0] - 2025-10-15
|
||||||
|
|
||||||
|
### ✨ Features
|
||||||
|
|
||||||
|
- **Complete rewrite**: Migrated to Next.js 15 with App Router and Turbopack
|
||||||
|
- **React 19**: Updated to latest React with concurrent features
|
||||||
|
- **TypeScript 5**: Full type safety with strict configuration
|
||||||
|
- **Modern UI**: Tailwind CSS 4 with design tokens and CSS variables
|
||||||
|
- **Accessibility**: WCAG 2.1 AA compliance with accessibility menu
|
||||||
|
- **Privacy**: GDPR-compliant analytics with opt-in consent
|
||||||
|
- **Performance**: 3x faster builds and 50% smaller bundle size
|
||||||
|
- **Auto-fill**: GitHub integration for automatic profile data
|
||||||
|
- **Export/Import**: JSON functionality for profile data
|
||||||
|
- **Enhanced UX**: Multi-step wizard with real-time validation
|
||||||
|
- **Responsive**: Mobile-first design with touch optimization
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- Fixed skill selection persistence across sessions
|
||||||
|
- Resolved theme toggle flickering on page load
|
||||||
|
- Fixed social media icon alignment issues
|
||||||
|
- Corrected markdown preview rendering edge cases
|
||||||
|
|
||||||
|
### ⚡ Performance Improvements
|
||||||
|
|
||||||
|
- Implemented code splitting with lazy loading
|
||||||
|
- Optimized bundle size with Turbopack
|
||||||
|
- Added image optimization for better loading
|
||||||
|
- Reduced JavaScript bundle by 50%
|
||||||
|
|
||||||
|
### ♻️ Code Refactoring
|
||||||
|
|
||||||
|
- Migrated from Gatsby to Next.js 15
|
||||||
|
- Converted all components to TypeScript
|
||||||
|
- Implemented modern React patterns (hooks, context)
|
||||||
|
- Restructured project architecture for scalability
|
||||||
|
|
||||||
|
### 📚 Documentation
|
||||||
|
|
||||||
|
- Added comprehensive TypeScript documentation
|
||||||
|
- Created accessibility guidelines
|
||||||
|
- Updated deployment documentation
|
||||||
|
- Added contributing guidelines for V2
|
||||||
|
|
||||||
|
### 🏗️ Build System
|
||||||
|
|
||||||
|
- Migrated to Next.js build system
|
||||||
|
- Added Turbopack for development
|
||||||
|
- Implemented ESLint + Prettier configuration
|
||||||
|
- Added Vitest for testing
|
||||||
|
|
||||||
|
### 👷 Continuous Integration
|
||||||
|
|
||||||
|
- Enhanced GitHub Actions workflows
|
||||||
|
- Added preview deployments with environment tracking
|
||||||
|
- Implemented automated release management
|
||||||
|
- Added comprehensive testing pipeline
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Previous Versions (V1)
|
||||||
|
|
||||||
|
For changes in V1, see the [V1 Release Archive](https://github.com/rahuldkjain/github-profile-readme-generator/releases?q=v1&expanded=true).
|
||||||
|
|
||||||
|
### Migration from V1 to V2
|
||||||
|
|
||||||
|
V2 represents a complete rewrite with breaking changes:
|
||||||
|
|
||||||
|
- **Technology Stack**: Gatsby → Next.js 15
|
||||||
|
- **Styling**: CSS Modules → Tailwind CSS 4
|
||||||
|
- **State Management**: Local state → Zustand + localStorage
|
||||||
|
- **Build System**: Webpack → Turbopack
|
||||||
|
- **Type Safety**: JavaScript → TypeScript 5
|
||||||
|
|
||||||
|
All V1 functionality has been preserved and enhanced in V2. See [MIGRATION_STRATEGY.md](./MIGRATION_STRATEGY.md) for detailed migration information.
|
||||||
@@ -0,0 +1,434 @@
|
|||||||
|
# GitHub Profile Generator - Developer Cheatsheet
|
||||||
|
|
||||||
|
## 🚀 Quick Start
|
||||||
|
```bash
|
||||||
|
npm install && npm run dev
|
||||||
|
```
|
||||||
|
Visit: http://localhost:3000
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📁 File Structure (Where to Edit)
|
||||||
|
|
||||||
|
| Task | File Location |
|
||||||
|
|------|--------------|
|
||||||
|
| Add form field | `src/components/sections/[section]-section.tsx` |
|
||||||
|
| Add validation | `src/lib/validations.ts` |
|
||||||
|
| Modify markdown output | `src/lib/markdown-generator.ts` |
|
||||||
|
| Add new section | Create in `src/components/sections/` + add to `src/app/page.tsx` |
|
||||||
|
| Create form component | `src/components/forms/` |
|
||||||
|
| Add skill | `src/constants/skills.ts` |
|
||||||
|
| Storage logic | `src/lib/storage.ts` |
|
||||||
|
| Theme colors | `src/styles/globals.css` |
|
||||||
|
| Header/Footer | `src/components/layout/` |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🎨 Theme Colors (Always Use These)
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// Backgrounds
|
||||||
|
bg-background // Main background
|
||||||
|
bg-card // Card background
|
||||||
|
bg-accent // Accent background
|
||||||
|
bg-muted // Muted background
|
||||||
|
bg-primary // Primary action background
|
||||||
|
|
||||||
|
// Text
|
||||||
|
text-foreground // Main text
|
||||||
|
text-muted-foreground // Secondary text
|
||||||
|
text-primary-foreground // Text on primary bg
|
||||||
|
text-destructive // Error text
|
||||||
|
|
||||||
|
// Borders & Effects
|
||||||
|
border-border // Border color
|
||||||
|
border-input // Input border
|
||||||
|
ring-ring // Focus ring
|
||||||
|
```
|
||||||
|
|
||||||
|
**❌ Never hardcode:** `bg-white`, `text-black`, `border-gray-300`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📝 Component Templates
|
||||||
|
|
||||||
|
### Form Component
|
||||||
|
```typescript
|
||||||
|
'use client';
|
||||||
|
|
||||||
|
import { forwardRef } from 'react';
|
||||||
|
import type { InputHTMLAttributes } from 'react';
|
||||||
|
|
||||||
|
export interface MyInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
||||||
|
label?: string;
|
||||||
|
error?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const MyInput = forwardRef<HTMLInputElement, MyInputProps>(
|
||||||
|
({ label, error, className = '', ...props }, ref) => {
|
||||||
|
return (
|
||||||
|
<div className="w-full space-y-1">
|
||||||
|
{label && <label htmlFor={props.id} className="text-foreground text-sm font-medium">{label}</label>}
|
||||||
|
<input
|
||||||
|
ref={ref}
|
||||||
|
className={`border-input bg-background text-foreground focus:ring-ring w-full rounded-lg border px-4 py-2 transition-colors focus:outline-none focus:ring-2 disabled:cursor-not-allowed disabled:opacity-50 ${error ? 'border-destructive' : ''} ${className}`}
|
||||||
|
aria-invalid={!!error}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
{error && <p className="text-destructive text-sm" role="alert">{error}</p>}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
MyInput.displayName = 'MyInput';
|
||||||
|
```
|
||||||
|
|
||||||
|
### Section Component
|
||||||
|
```typescript
|
||||||
|
'use client';
|
||||||
|
|
||||||
|
import { UseFormRegister, FieldErrors } from 'react-hook-form';
|
||||||
|
import { FormInput } from '@/components/forms/form-input';
|
||||||
|
import type { MyFormData } from '@/lib/validations';
|
||||||
|
|
||||||
|
interface MySectionProps {
|
||||||
|
register: UseFormRegister<MyFormData>;
|
||||||
|
errors: FieldErrors<MyFormData>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function MySection({ register, errors }: MySectionProps) {
|
||||||
|
return (
|
||||||
|
<div className="space-y-6">
|
||||||
|
<div className="border-b border-border pb-4">
|
||||||
|
<h2 className="text-2xl font-bold">Section Title</h2>
|
||||||
|
<p className="text-muted-foreground mt-1 text-sm">Description</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="grid gap-4 md:grid-cols-2">
|
||||||
|
<FormInput
|
||||||
|
{...register('fieldName')}
|
||||||
|
id="fieldName"
|
||||||
|
label="Label"
|
||||||
|
error={errors.fieldName?.message}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🔒 TypeScript Patterns
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// Component Props
|
||||||
|
interface ComponentProps {
|
||||||
|
title: string; // Required
|
||||||
|
count?: number; // Optional
|
||||||
|
onAction: () => void; // Required function
|
||||||
|
onChange?: (val: string) => void; // Optional function
|
||||||
|
}
|
||||||
|
|
||||||
|
// Zod Schema
|
||||||
|
const schema = z.object({
|
||||||
|
email: z.string().email(),
|
||||||
|
age: z.number().min(0).max(120),
|
||||||
|
url: z.string().url().optional(),
|
||||||
|
isActive: z.boolean().default(false),
|
||||||
|
});
|
||||||
|
|
||||||
|
type FormData = z.infer<typeof schema>;
|
||||||
|
|
||||||
|
// Form Hook
|
||||||
|
const { register, watch, setValue, formState: { errors } } = useForm<FormData>({
|
||||||
|
resolver: zodResolver(schema),
|
||||||
|
defaultValues: { isActive: false }
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ♿ Accessibility Checklist
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// ✅ Keyboard Navigation
|
||||||
|
<button
|
||||||
|
onClick={handleClick}
|
||||||
|
onKeyDown={(e) => e.key === 'Enter' && handleClick()}
|
||||||
|
className="focus:ring-2 focus:ring-primary"
|
||||||
|
>
|
||||||
|
|
||||||
|
// ✅ ARIA Labels
|
||||||
|
<nav aria-label="Main navigation">
|
||||||
|
<button aria-label="Close dialog">
|
||||||
|
<input aria-describedby="help-text" aria-invalid={!!error} />
|
||||||
|
|
||||||
|
// ✅ Form Labels
|
||||||
|
<label htmlFor="email">Email</label>
|
||||||
|
<input id="email" />
|
||||||
|
|
||||||
|
// ✅ Error Messages
|
||||||
|
<p id="email-error" role="alert" className="text-destructive">
|
||||||
|
{error}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
// ✅ Active States
|
||||||
|
<Link href="/" aria-current={isActive ? 'page' : undefined}>
|
||||||
|
|
||||||
|
// ✅ Alt Text
|
||||||
|
<img src={url} alt="Descriptive text" loading="lazy" />
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📱 Responsive Patterns
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// Mobile First
|
||||||
|
className="text-sm md:text-base lg:text-lg"
|
||||||
|
|
||||||
|
// Grid Layouts
|
||||||
|
className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"
|
||||||
|
|
||||||
|
// Visibility
|
||||||
|
className="hidden md:block" // Desktop only
|
||||||
|
className="block md:hidden" // Mobile only
|
||||||
|
|
||||||
|
// Spacing
|
||||||
|
className="gap-2 md:gap-4 lg:gap-6"
|
||||||
|
className="px-4 md:px-6 lg:px-8"
|
||||||
|
|
||||||
|
// Breakpoints
|
||||||
|
// base: 0-639px
|
||||||
|
// sm: 640px+
|
||||||
|
// md: 768px+
|
||||||
|
// lg: 1024px+
|
||||||
|
// xl: 1280px+
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🎯 Import Order
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// 1. React & Next.js
|
||||||
|
import { useState, useEffect } from 'react';
|
||||||
|
import Link from 'next/link';
|
||||||
|
|
||||||
|
// 2. Third-party
|
||||||
|
import { useForm } from 'react-hook-form';
|
||||||
|
import { z } from 'zod';
|
||||||
|
|
||||||
|
// 3. Internal utils
|
||||||
|
import { saveFormData } from '@/lib/storage';
|
||||||
|
import type { ProfileFormData } from '@/lib/validations';
|
||||||
|
|
||||||
|
// 4. Components
|
||||||
|
import { FormInput } from '@/components/forms/form-input';
|
||||||
|
|
||||||
|
// 5. Constants
|
||||||
|
import { skills } from '@/constants/skills';
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🏎️ Performance
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// Memoize calculations
|
||||||
|
const count = useMemo(() =>
|
||||||
|
expensiveCalculation(data),
|
||||||
|
[data]
|
||||||
|
);
|
||||||
|
|
||||||
|
// Memoize callbacks
|
||||||
|
const handleClick = useCallback(() => {
|
||||||
|
doSomething();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// Memoize components
|
||||||
|
const MemoizedComponent = React.memo(Component);
|
||||||
|
|
||||||
|
// Debounce auto-save
|
||||||
|
useEffect(() => {
|
||||||
|
const timer = setTimeout(() => {
|
||||||
|
saveData();
|
||||||
|
}, 1000);
|
||||||
|
return () => clearTimeout(timer);
|
||||||
|
}, [data]);
|
||||||
|
|
||||||
|
// Lazy load images
|
||||||
|
<img src={url} alt="..." loading="lazy" />
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 💾 Storage Pattern
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// Save
|
||||||
|
import { saveFormData } from '@/lib/storage';
|
||||||
|
|
||||||
|
saveFormData({
|
||||||
|
profile: getProfileValues(),
|
||||||
|
social: getSocialValues(),
|
||||||
|
// ...
|
||||||
|
skills: selectedSkills,
|
||||||
|
lastSaved: new Date().toISOString(),
|
||||||
|
});
|
||||||
|
|
||||||
|
// Load
|
||||||
|
import { loadFormData } from '@/lib/storage';
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const saved = loadFormData();
|
||||||
|
if (saved) {
|
||||||
|
// Restore data
|
||||||
|
setValue('title', saved.profile.title);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// Clear
|
||||||
|
import { clearFormData } from '@/lib/storage';
|
||||||
|
clearFormData();
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🐛 Common Errors & Fixes
|
||||||
|
|
||||||
|
| Error | Fix |
|
||||||
|
|-------|-----|
|
||||||
|
| "Type 'any' is not assignable" | Add explicit types, avoid `any` |
|
||||||
|
| "Property does not exist" | Add to interface, check spelling |
|
||||||
|
| "Cannot find module '@/...'" | Check path, restart TS server |
|
||||||
|
| "localStorage is not defined" | Wrap in `useEffect`, check 'use client' |
|
||||||
|
| "Hydration mismatch" | Ensure same HTML on server/client |
|
||||||
|
| TypeScript errors after install | Run `npm run type-check` |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🎨 Tailwind Class Order
|
||||||
|
|
||||||
|
```
|
||||||
|
Layout → Size → Spacing → Typography → Colors → Borders → Effects → States → Responsive
|
||||||
|
```
|
||||||
|
|
||||||
|
Example:
|
||||||
|
```typescript
|
||||||
|
className="flex items-center gap-2 w-full px-4 py-2 text-sm font-medium text-foreground bg-accent rounded-lg border border-border shadow-sm transition-colors hover:bg-accent/80 focus:ring-2 focus:ring-primary disabled:opacity-50 md:px-6 lg:text-base"
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🔧 Useful Commands
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Development
|
||||||
|
npm run dev # Start dev server (Turbopack)
|
||||||
|
npm run build # Production build
|
||||||
|
npm run start # Start production server
|
||||||
|
npm run type-check # Check TypeScript
|
||||||
|
npm run lint # Run ESLint
|
||||||
|
|
||||||
|
# Git
|
||||||
|
git status # Check changes
|
||||||
|
git add . # Stage all changes
|
||||||
|
git commit -m "feat: add feature" # Commit
|
||||||
|
git push # Push to remote
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🎯 Git Commit Types
|
||||||
|
|
||||||
|
```
|
||||||
|
feat(scope): # New feature
|
||||||
|
fix(scope): # Bug fix
|
||||||
|
refactor(scope): # Code restructure
|
||||||
|
style(scope): # Formatting
|
||||||
|
a11y(scope): # Accessibility
|
||||||
|
perf(scope): # Performance
|
||||||
|
docs(scope): # Documentation
|
||||||
|
test(scope): # Tests
|
||||||
|
chore(scope): # Maintenance
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📚 Key Files to Read
|
||||||
|
|
||||||
|
1. **REVAMP_SUMMARY.md** - Full architecture
|
||||||
|
2. **.cursorrules** - Code conventions
|
||||||
|
3. **.cursorrules-quick** - Quick patterns
|
||||||
|
4. **DX_GUIDE.md** - Developer guide
|
||||||
|
5. **src/app/page.tsx** - Main wizard implementation
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🤖 Cursor AI Quick Commands
|
||||||
|
|
||||||
|
```
|
||||||
|
# Include file in context
|
||||||
|
@filename
|
||||||
|
|
||||||
|
# Include folder
|
||||||
|
@folder
|
||||||
|
|
||||||
|
# Create component
|
||||||
|
@.cursorrules Create a form component for [x]
|
||||||
|
|
||||||
|
# Fix code
|
||||||
|
@.cursorrules Fix accessibility issues in [component]
|
||||||
|
|
||||||
|
# Review
|
||||||
|
@.cursorrules Review this code for [standards]
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 💡 Pro Tips
|
||||||
|
|
||||||
|
1. **Always use 'use client'** for components with state/events
|
||||||
|
2. **Never hardcode colors** - use CSS variables
|
||||||
|
3. **Type everything** - avoid `any`
|
||||||
|
4. **Think accessibility first** - keyboard + ARIA
|
||||||
|
5. **Mobile first** - base styles for mobile
|
||||||
|
6. **Test dark mode** - both themes
|
||||||
|
7. **Debounce saves** - 1 second delay
|
||||||
|
8. **Memoize when needed** - useMemo/useCallback
|
||||||
|
9. **Clean up effects** - return cleanup function
|
||||||
|
10. **Follow patterns** - check existing code first
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚨 Before Committing
|
||||||
|
|
||||||
|
- [ ] No TypeScript errors
|
||||||
|
- [ ] No ESLint warnings
|
||||||
|
- [ ] Works on mobile (375px)
|
||||||
|
- [ ] Works on desktop (1440px)
|
||||||
|
- [ ] Keyboard navigable
|
||||||
|
- [ ] Focus indicators visible
|
||||||
|
- [ ] Dark mode tested
|
||||||
|
- [ ] Auto-save works (if form)
|
||||||
|
- [ ] No console errors
|
||||||
|
- [ ] Follows .cursorrules patterns
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📞 Help Resources
|
||||||
|
|
||||||
|
- **Internal**: REVAMP_SUMMARY.md, .cursorrules, DX_GUIDE.md
|
||||||
|
- **Next.js**: https://nextjs.org/docs
|
||||||
|
- **React**: https://react.dev
|
||||||
|
- **Tailwind**: https://tailwindcss.com/docs
|
||||||
|
- **React Hook Form**: https://react-hook-form.com
|
||||||
|
- **Zod**: https://zod.dev
|
||||||
|
- **WCAG**: https://www.w3.org/WAI/WCAG21/quickref/
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Print this and keep it handy! 📋**
|
||||||
@@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
|
|||||||
Examples of behavior that contributes to creating a positive environment
|
Examples of behavior that contributes to creating a positive environment
|
||||||
include:
|
include:
|
||||||
|
|
||||||
* Using welcoming and inclusive language
|
- Using welcoming and inclusive language
|
||||||
* Being respectful of differing viewpoints and experiences
|
- Being respectful of differing viewpoints and experiences
|
||||||
* Gracefully accepting constructive criticism
|
- Gracefully accepting constructive criticism
|
||||||
* Focusing on what is best for the community
|
- Focusing on what is best for the community
|
||||||
* Showing empathy towards other community members
|
- Showing empathy towards other community members
|
||||||
|
|
||||||
Examples of unacceptable behavior by participants include:
|
Examples of unacceptable behavior by participants include:
|
||||||
|
|
||||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
- The use of sexualized language or imagery and unwelcome sexual attention or
|
||||||
advances
|
advances
|
||||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
- Trolling, insulting/derogatory comments, and personal or political attacks
|
||||||
* Public or private harassment
|
- Public or private harassment
|
||||||
* Publishing others' private information, such as a physical or electronic
|
- Publishing others' private information, such as a physical or electronic
|
||||||
address, without explicit permission
|
address, without explicit permission
|
||||||
* Other conduct which could reasonably be considered inappropriate in a
|
- Other conduct which could reasonably be considered inappropriate in a
|
||||||
professional setting
|
professional setting
|
||||||
|
|
||||||
## Our Responsibilities
|
## Our Responsibilities
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,316 @@
|
|||||||
|
# Coding Style Guide
|
||||||
|
|
||||||
|
## Project Architecture
|
||||||
|
|
||||||
|
This project uses **Next.js 15** with **TypeScript** and **Tailwind CSS**. We follow modern React patterns with functional components and hooks.
|
||||||
|
|
||||||
|
## File Layout (`src/components/*.tsx`)
|
||||||
|
|
||||||
|
1. **Imports**
|
||||||
|
- React imports first
|
||||||
|
- Third-party library imports
|
||||||
|
- Internal component imports
|
||||||
|
- Type imports (using `import type`)
|
||||||
|
|
||||||
|
2. **Type Definitions**
|
||||||
|
- Interface definitions for props
|
||||||
|
- Type aliases if needed
|
||||||
|
|
||||||
|
3. **Reusable Components**
|
||||||
|
- Smaller components needed for the main component
|
||||||
|
- Place **above** the main component, **not** inside it
|
||||||
|
|
||||||
|
4. **Main Component**
|
||||||
|
- Main exported component (e.g., `SkillsSection` in `skills-section.tsx`)
|
||||||
|
|
||||||
|
5. **Export Statement**
|
||||||
|
- `export default MainComponent;` or named exports
|
||||||
|
|
||||||
|
## TypeScript Guidelines
|
||||||
|
|
||||||
|
### Component Props
|
||||||
|
|
||||||
|
- Use `interface` for component props with clear naming:
|
||||||
|
|
||||||
|
```tsx
|
||||||
|
interface ButtonProps {
|
||||||
|
variant?: 'primary' | 'secondary';
|
||||||
|
size?: 'sm' | 'md' | 'lg';
|
||||||
|
onClick?: () => void;
|
||||||
|
children: React.ReactNode;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Type Safety
|
||||||
|
|
||||||
|
- Avoid `any` types - use `unknown` or proper types
|
||||||
|
- Use strict TypeScript configuration
|
||||||
|
- Leverage type inference where possible
|
||||||
|
- Use `as const` for literal types
|
||||||
|
|
||||||
|
```tsx
|
||||||
|
// Good
|
||||||
|
const themes = ['light', 'dark'] as const;
|
||||||
|
type Theme = (typeof themes)[number];
|
||||||
|
|
||||||
|
// Bad
|
||||||
|
const themes: any = ['light', 'dark'];
|
||||||
|
```
|
||||||
|
|
||||||
|
## Component Patterns
|
||||||
|
|
||||||
|
### Functional Components
|
||||||
|
|
||||||
|
- Use **ES6 arrow functions** for all components
|
||||||
|
- Use `React.forwardRef` when ref forwarding is needed
|
||||||
|
- Prefer named exports for reusable components
|
||||||
|
|
||||||
|
```tsx
|
||||||
|
// Good
|
||||||
|
export const Button = ({ variant = 'primary', ...props }: ButtonProps) => {
|
||||||
|
return <button className={`btn btn-${variant}`} {...props} />;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Also good for main components
|
||||||
|
const SkillsSection = ({ skills, onSkillToggle }: SkillsSectionProps) => {
|
||||||
|
// component logic
|
||||||
|
};
|
||||||
|
export default SkillsSection;
|
||||||
|
```
|
||||||
|
|
||||||
|
### Hooks Usage
|
||||||
|
|
||||||
|
- Use custom hooks for reusable logic
|
||||||
|
- Keep hooks at the top of components
|
||||||
|
- Use `useCallback` and `useMemo` for performance optimization
|
||||||
|
|
||||||
|
```tsx
|
||||||
|
const MyComponent = () => {
|
||||||
|
const [state, setState] = useState();
|
||||||
|
const { data, loading } = useCustomHook();
|
||||||
|
|
||||||
|
const memoizedValue = useMemo(() => expensiveCalculation(), [dependency]);
|
||||||
|
|
||||||
|
// component JSX
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
## Styling with Tailwind CSS
|
||||||
|
|
||||||
|
### Class Organization
|
||||||
|
|
||||||
|
- Use Tailwind utility classes
|
||||||
|
- Group related classes together
|
||||||
|
- Use responsive prefixes (`sm:`, `md:`, `lg:`)
|
||||||
|
|
||||||
|
```tsx
|
||||||
|
// Good
|
||||||
|
<div className="flex flex-col gap-4 rounded-lg border p-4 sm:flex-row sm:gap-6">
|
||||||
|
<button className="bg-primary text-primary-foreground hover:bg-primary/90 rounded px-4 py-2 transition-colors">
|
||||||
|
Click me
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
```
|
||||||
|
|
||||||
|
### CSS Variables
|
||||||
|
|
||||||
|
- Use CSS custom properties for theming
|
||||||
|
- Follow the design system color palette
|
||||||
|
- Prefer Tailwind classes over custom CSS
|
||||||
|
|
||||||
|
## File Naming Conventions
|
||||||
|
|
||||||
|
- **Components**: `kebab-case.tsx` (e.g., `skills-section.tsx`)
|
||||||
|
- **Hooks**: `use-hook-name.ts` (e.g., `use-local-storage.ts`)
|
||||||
|
- **Types**: `kebab-case.ts` (e.g., `profile-types.ts`)
|
||||||
|
- **Utils**: `kebab-case.ts` (e.g., `markdown-generator.ts`)
|
||||||
|
|
||||||
|
## Spacing & Formatting
|
||||||
|
|
||||||
|
### JavaScript/TypeScript
|
||||||
|
|
||||||
|
- Use **2 spaces** for indentation (not 4)
|
||||||
|
- Use spaces after `if`, `for`, `while`, `switch`
|
||||||
|
- No spaces after opening `(` and before closing `)`
|
||||||
|
- Use spaces around destructuring
|
||||||
|
|
||||||
|
```tsx
|
||||||
|
// Good
|
||||||
|
const { name, email } = user;
|
||||||
|
const handleClick = ({ target }: MouseEvent) => {
|
||||||
|
if (target instanceof HTMLElement) {
|
||||||
|
// logic
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Bad
|
||||||
|
const { name, email } = user;
|
||||||
|
const handleClick = ({ target }: MouseEvent) => {
|
||||||
|
if (target instanceof HTMLElement) {
|
||||||
|
// logic
|
||||||
|
}
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
### JSX Formatting
|
||||||
|
|
||||||
|
- Space before self-closing tag slash
|
||||||
|
- No spaces in JSX curly braces
|
||||||
|
- Use new lines for multiple props
|
||||||
|
|
||||||
|
```tsx
|
||||||
|
// Good
|
||||||
|
<Input
|
||||||
|
value={value}
|
||||||
|
onChange={handleChange}
|
||||||
|
placeholder="Enter text"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Icon className="h-4 w-4" />
|
||||||
|
|
||||||
|
// Bad
|
||||||
|
<Input value={value} onChange={handleChange} placeholder="Enter text"/>
|
||||||
|
<Icon className="h-4 w-4"/>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Props & Event Handling
|
||||||
|
|
||||||
|
### Prop Naming
|
||||||
|
|
||||||
|
- Use `camelCase` for prop names
|
||||||
|
- Use `PascalCase` if prop value is a React component
|
||||||
|
- Use descriptive names with proper prefixes
|
||||||
|
|
||||||
|
```tsx
|
||||||
|
interface FormProps {
|
||||||
|
initialValues?: Record<string, unknown>;
|
||||||
|
onSubmit?: (data: FormData) => void;
|
||||||
|
isLoading?: boolean;
|
||||||
|
ErrorComponent?: React.ComponentType;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Event Handlers
|
||||||
|
|
||||||
|
- Prefix with `handle` or `on`
|
||||||
|
- Use descriptive names
|
||||||
|
- Type event handlers properly
|
||||||
|
|
||||||
|
```tsx
|
||||||
|
const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setValue(event.target.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSubmit = async (event: React.FormEvent) => {
|
||||||
|
event.preventDefault();
|
||||||
|
// submit logic
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
## Best Practices
|
||||||
|
|
||||||
|
### Code Quality
|
||||||
|
|
||||||
|
- **Always** add semicolons
|
||||||
|
- Use meaningful variable and function names
|
||||||
|
- Keep components small and focused (< 200 lines)
|
||||||
|
- Extract complex logic into custom hooks
|
||||||
|
- Use TypeScript strict mode
|
||||||
|
|
||||||
|
### Accessibility
|
||||||
|
|
||||||
|
- Always add `alt` prop to `img` tags
|
||||||
|
- Use semantic HTML elements
|
||||||
|
- Add proper ARIA attributes
|
||||||
|
- Don't use `outline: none` without alternative focus styles
|
||||||
|
- Use proper heading hierarchy
|
||||||
|
|
||||||
|
### Performance
|
||||||
|
|
||||||
|
- Use `React.memo` for expensive components
|
||||||
|
- Implement proper dependency arrays for hooks
|
||||||
|
- Avoid inline objects and functions in JSX
|
||||||
|
- Use `useCallback` and `useMemo` appropriately
|
||||||
|
|
||||||
|
```tsx
|
||||||
|
// Good
|
||||||
|
const MemoizedComponent = React.memo(({ data }: Props) => {
|
||||||
|
const processedData = useMemo(() => processData(data), [data]);
|
||||||
|
|
||||||
|
const handleClick = useCallback(() => {
|
||||||
|
// click logic
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return <div>{/* JSX */}</div>;
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Error Handling
|
||||||
|
|
||||||
|
- Use error boundaries for component errors
|
||||||
|
- Handle async operations properly
|
||||||
|
- Provide fallback UI for loading states
|
||||||
|
|
||||||
|
```tsx
|
||||||
|
const AsyncComponent = () => {
|
||||||
|
const [data, setData] = useState(null);
|
||||||
|
const [loading, setLoading] = useState(true);
|
||||||
|
const [error, setError] = useState(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
fetchData()
|
||||||
|
.then(setData)
|
||||||
|
.catch(setError)
|
||||||
|
.finally(() => setLoading(false));
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
if (loading) return <LoadingSpinner />;
|
||||||
|
if (error) return <ErrorMessage error={error} />;
|
||||||
|
if (!data) return <EmptyState />;
|
||||||
|
|
||||||
|
return <DataDisplay data={data} />;
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
## Dependencies & Imports
|
||||||
|
|
||||||
|
### Import Organization
|
||||||
|
|
||||||
|
```tsx
|
||||||
|
// 1. React imports
|
||||||
|
import { useState, useEffect, useCallback } from 'react';
|
||||||
|
import type { ReactNode } from 'react';
|
||||||
|
|
||||||
|
// 2. Third-party libraries
|
||||||
|
import { motion } from 'framer-motion';
|
||||||
|
import { ChevronDown } from 'lucide-react';
|
||||||
|
|
||||||
|
// 3. Internal imports
|
||||||
|
import { Button } from '@/components/ui/button';
|
||||||
|
import { useLocalStorage } from '@/hooks/use-local-storage';
|
||||||
|
import type { ProfileData } from '@/types/profile';
|
||||||
|
```
|
||||||
|
|
||||||
|
### Package Management
|
||||||
|
|
||||||
|
- Prefer stable, well-maintained packages
|
||||||
|
- Keep dependencies up to date
|
||||||
|
- Use exact versions for critical dependencies
|
||||||
|
- Document any custom modifications
|
||||||
|
|
||||||
|
## Testing Considerations
|
||||||
|
|
||||||
|
- Write testable components with clear props
|
||||||
|
- Avoid complex side effects in components
|
||||||
|
- Use dependency injection for external services
|
||||||
|
- Keep business logic separate from UI logic
|
||||||
|
|
||||||
|
## Further Reading
|
||||||
|
|
||||||
|
This guide is based on:
|
||||||
|
|
||||||
|
- [Next.js Best Practices](https://nextjs.org/docs/app/building-your-application/styling/tailwind-css)
|
||||||
|
- [React TypeScript Cheatsheet](https://react-typescript-cheatsheet.netlify.app/)
|
||||||
|
- [Tailwind CSS Best Practices](https://tailwindcss.com/docs/reusing-styles)
|
||||||
|
|
||||||
|
For questions about code style, please discuss with maintainers on our [Discord community](https://discord.gg/HHMs7Eg).
|
||||||
@@ -0,0 +1,152 @@
|
|||||||
|
# 📝 Commit Message Convention
|
||||||
|
|
||||||
|
This project follows [Conventional Commits](https://www.conventionalcommits.org/) specification for automated changelog generation and semantic versioning.
|
||||||
|
|
||||||
|
## Format
|
||||||
|
|
||||||
|
```
|
||||||
|
<type>[optional scope]: <description>
|
||||||
|
|
||||||
|
[optional body]
|
||||||
|
|
||||||
|
[optional footer(s)]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Types
|
||||||
|
|
||||||
|
| Type | Description | Version Bump |
|
||||||
|
| ---------- | ------------------------ | ------------ |
|
||||||
|
| `feat` | New feature | Minor |
|
||||||
|
| `fix` | Bug fix | Patch |
|
||||||
|
| `perf` | Performance improvement | Patch |
|
||||||
|
| `refactor` | Code refactoring | Patch |
|
||||||
|
| `docs` | Documentation changes | Patch |
|
||||||
|
| `style` | Code style changes | Patch |
|
||||||
|
| `test` | Adding or updating tests | Patch |
|
||||||
|
| `build` | Build system changes | Patch |
|
||||||
|
| `ci` | CI/CD changes | Patch |
|
||||||
|
| `chore` | Maintenance tasks | No bump |
|
||||||
|
|
||||||
|
## Breaking Changes
|
||||||
|
|
||||||
|
Add `BREAKING CHANGE:` in the footer or `!` after type to indicate breaking changes:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
feat!: remove deprecated API endpoints
|
||||||
|
|
||||||
|
BREAKING CHANGE: The old API endpoints have been removed. Use the new v2 endpoints instead.
|
||||||
|
```
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
```bash
|
||||||
|
feat: add GitHub auto-fill integration
|
||||||
|
feat(ui): implement dark mode toggle
|
||||||
|
feat!: migrate to Next.js 15 App Router
|
||||||
|
```
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
```bash
|
||||||
|
fix: resolve skill selection persistence issue
|
||||||
|
fix(mobile): correct responsive navigation layout
|
||||||
|
fix(a11y): improve keyboard navigation for forms
|
||||||
|
```
|
||||||
|
|
||||||
|
### Performance
|
||||||
|
|
||||||
|
```bash
|
||||||
|
perf: optimize image loading with next/image
|
||||||
|
perf(build): reduce bundle size by 30%
|
||||||
|
```
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docs: update installation instructions
|
||||||
|
docs(api): add TypeScript examples
|
||||||
|
docs(readme): fix broken demo links
|
||||||
|
```
|
||||||
|
|
||||||
|
### Refactoring
|
||||||
|
|
||||||
|
```bash
|
||||||
|
refactor: convert components to TypeScript
|
||||||
|
refactor(store): migrate to Zustand state management
|
||||||
|
```
|
||||||
|
|
||||||
|
## Scopes (Optional)
|
||||||
|
|
||||||
|
Use scopes to indicate the area of change:
|
||||||
|
|
||||||
|
- `ui` - User interface components
|
||||||
|
- `api` - API related changes
|
||||||
|
- `build` - Build system
|
||||||
|
- `ci` - Continuous integration
|
||||||
|
- `docs` - Documentation
|
||||||
|
- `test` - Testing
|
||||||
|
- `a11y` - Accessibility
|
||||||
|
- `perf` - Performance
|
||||||
|
- `mobile` - Mobile-specific changes
|
||||||
|
|
||||||
|
## Tools
|
||||||
|
|
||||||
|
### Commitizen (Recommended)
|
||||||
|
|
||||||
|
Install commitizen for interactive commit messages:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install -g commitizen cz-conventional-changelog
|
||||||
|
echo '{ "path": "cz-conventional-changelog" }' > ~/.czrc
|
||||||
|
```
|
||||||
|
|
||||||
|
Use `git cz` instead of `git commit`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git add .
|
||||||
|
git cz
|
||||||
|
```
|
||||||
|
|
||||||
|
### VS Code Extension
|
||||||
|
|
||||||
|
Install "Conventional Commits" extension for VS Code to get commit message templates.
|
||||||
|
|
||||||
|
## Automated Release Process
|
||||||
|
|
||||||
|
1. **Commit** using conventional format
|
||||||
|
2. **Push** to master branch
|
||||||
|
3. **Release Please** analyzes commits
|
||||||
|
4. **Creates PR** with changelog and version bump
|
||||||
|
5. **Merge PR** to trigger release and deployment
|
||||||
|
|
||||||
|
## Examples in Practice
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Adding new feature
|
||||||
|
git commit -m "feat(ui): add accessibility menu with font size controls"
|
||||||
|
|
||||||
|
# Fixing bug
|
||||||
|
git commit -m "fix(mobile): resolve navigation menu overflow on small screens"
|
||||||
|
|
||||||
|
# Breaking change
|
||||||
|
git commit -m "feat!: migrate to Next.js 15 App Router
|
||||||
|
|
||||||
|
BREAKING CHANGE: Pages directory structure has changed.
|
||||||
|
See migration guide for updating custom pages."
|
||||||
|
|
||||||
|
# Performance improvement
|
||||||
|
git commit -m "perf(build): implement code splitting for 50% bundle reduction"
|
||||||
|
|
||||||
|
# Documentation update
|
||||||
|
git commit -m "docs(contributing): add TypeScript coding standards"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Benefits
|
||||||
|
|
||||||
|
- ✅ **Automated changelogs** - No manual changelog maintenance
|
||||||
|
- ✅ **Semantic versioning** - Automatic version bumps based on commit types
|
||||||
|
- ✅ **Release notes** - Rich, categorized release notes
|
||||||
|
- ✅ **Consistency** - Standardized commit history
|
||||||
|
- ✅ **Tooling integration** - Works with Release Please, semantic-release, etc.
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
# Contributing
|
# Contributing to GitHub Profile README Generator
|
||||||
|
|
||||||
When contributing to this repository, please first discuss the change you wish to make via issue,
|
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
|
||||||
email, or any other method with the owners of this repository before making a change.
|
|
||||||
|
|
||||||
<a href="https://discord.gg/HHMs7Eg" target="blank">
|
<a href="https://discord.gg/HHMs7Eg" target="blank">
|
||||||
<img src="https://img.shields.io/discord/735303195105951764?color=%23677BC4&label=Join%20Community&style=flat-square" alt="join discord community of github profile readme generator"/>
|
<img src="https://img.shields.io/discord/735303195105951764?color=%23677BC4&label=Join%20Community&style=flat-square" alt="join discord community of github profile readme generator"/>
|
||||||
@@ -9,13 +8,282 @@ email, or any other method with the owners of this repository before making a ch
|
|||||||
|
|
||||||
Please note we have a code of conduct, please follow it in all your interactions with the project.
|
Please note we have a code of conduct, please follow it in all your interactions with the project.
|
||||||
|
|
||||||
## Pull Request Process
|
## 🚀 Tech Stack
|
||||||
|
|
||||||
1. Ensure any install or build dependencies are removed before the end of the layer when doing a
|
This project is built with modern web technologies:
|
||||||
build.
|
|
||||||
2. Update the README.md with details of changes to the interface, this includes new environment
|
- **Framework**: [Next.js 15](https://nextjs.org/) with App Router
|
||||||
variables, exposed ports, useful file locations and container parameters.
|
- **Language**: [TypeScript](https://www.typescriptlang.org/) for type safety
|
||||||
3. Increase the version numbers in any examples files and the README.md to the new version that this
|
- **Styling**: [Tailwind CSS](https://tailwindcss.com/) for utility-first styling
|
||||||
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
|
- **Icons**: [Lucide React](https://lucide.dev/) for consistent iconography
|
||||||
4. You may merge the Pull Request once you have the sign-off of two other developers, or if you
|
- **Animations**: [Framer Motion](https://www.framer.com/motion/) for smooth animations
|
||||||
do not have permission to do that, you may request the second reviewer merge it for you.
|
- **Forms**: [React Hook Form](https://react-hook-form.com/) for form management
|
||||||
|
- **Analytics**: [Google Analytics 4](https://developers.google.com/analytics/devguides/collection/ga4) with privacy compliance
|
||||||
|
- **Testing**: [Vitest](https://vitest.dev/) for unit testing
|
||||||
|
- **Linting**: [ESLint](https://eslint.org/) + [Prettier](https://prettier.io/) for code quality
|
||||||
|
|
||||||
|
## 🛠️ Development Setup
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
- **Node.js**: Version 18.17 or higher
|
||||||
|
- **npm**: Version 9 or higher (comes with Node.js)
|
||||||
|
- **Git**: For version control
|
||||||
|
|
||||||
|
### Local Development
|
||||||
|
|
||||||
|
1. **Fork & Clone the repository**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Fork the repo on GitHub, then clone your fork
|
||||||
|
git clone https://github.com/YOUR_USERNAME/github-profile-readme-generator.git
|
||||||
|
cd github-profile-readme-generator
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Install dependencies**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Set up environment variables** (optional)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Copy the example environment file
|
||||||
|
cp env.example .env.local
|
||||||
|
|
||||||
|
# Add your Google Analytics ID if you want to test analytics
|
||||||
|
NEXT_PUBLIC_GA_ID=G-XXXXXXXXXX
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **Start the development server**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
The app will be available at `http://localhost:3000`
|
||||||
|
|
||||||
|
### Available Scripts
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Development
|
||||||
|
npm run dev # Start development server
|
||||||
|
npm run build # Build for production
|
||||||
|
npm run start # Start production server
|
||||||
|
npm run export # Export static site
|
||||||
|
|
||||||
|
# Code Quality
|
||||||
|
npm run lint # Run ESLint
|
||||||
|
npm run lint:fix # Fix ESLint issues automatically
|
||||||
|
npm run type-check # Run TypeScript type checking
|
||||||
|
|
||||||
|
# Testing
|
||||||
|
npm run test # Run tests
|
||||||
|
npm run test:watch # Run tests in watch mode
|
||||||
|
npm run test:ui # Run tests with UI
|
||||||
|
```
|
||||||
|
|
||||||
|
## 📝 Pull Request Process
|
||||||
|
|
||||||
|
### Before You Start
|
||||||
|
|
||||||
|
1. **Check existing issues** to see if your feature/bug is already being worked on
|
||||||
|
2. **Create an issue** if one doesn't exist for your contribution
|
||||||
|
3. **Join our Discord** to discuss your ideas with the community
|
||||||
|
4. **Read our [Code Style Guide](CODE_STYLE_GUIDE.md)** to understand our coding standards
|
||||||
|
|
||||||
|
### Making Changes
|
||||||
|
|
||||||
|
1. **Create a feature branch** from `main`
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git checkout -b feature/your-feature-name
|
||||||
|
# or
|
||||||
|
git checkout -b fix/bug-description
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Follow our coding standards**
|
||||||
|
- Use TypeScript with strict mode
|
||||||
|
- Follow the existing code style (ESLint + Prettier)
|
||||||
|
- Write meaningful commit messages
|
||||||
|
- Add tests for new features
|
||||||
|
- Update documentation if needed
|
||||||
|
|
||||||
|
3. **Test your changes**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Run all checks before submitting
|
||||||
|
npm run lint # Check code style
|
||||||
|
npm run type-check # Check TypeScript
|
||||||
|
npm run test # Run tests
|
||||||
|
npm run build # Ensure it builds successfully
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **Commit your changes**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Use conventional commit messages
|
||||||
|
git add .
|
||||||
|
git commit -m "feat: add new skill category filter"
|
||||||
|
# or
|
||||||
|
git commit -m "fix: resolve mobile navigation issue"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Submitting Your PR
|
||||||
|
|
||||||
|
1. **Push your branch**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git push origin feature/your-feature-name
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Create a Pull Request** on GitHub with:
|
||||||
|
- Clear title describing the change
|
||||||
|
- Detailed description of what was changed and why
|
||||||
|
- Screenshots for UI changes
|
||||||
|
- Reference to any related issues
|
||||||
|
|
||||||
|
3. **PR Requirements**:
|
||||||
|
- ✅ All tests pass
|
||||||
|
- ✅ No TypeScript errors
|
||||||
|
- ✅ ESLint passes
|
||||||
|
- ✅ Builds successfully
|
||||||
|
- ✅ Follows our code style guide
|
||||||
|
- ✅ Includes tests for new features
|
||||||
|
- ✅ Updates documentation if needed
|
||||||
|
|
||||||
|
### Review Process
|
||||||
|
|
||||||
|
1. **Automated checks** will run on your PR
|
||||||
|
2. **Maintainers** will review your code
|
||||||
|
3. **Address feedback** by pushing new commits to your branch
|
||||||
|
4. **Merge** happens after approval from maintainers
|
||||||
|
|
||||||
|
## 🎯 Contribution Guidelines
|
||||||
|
|
||||||
|
### What We're Looking For
|
||||||
|
|
||||||
|
- **Bug fixes** with clear reproduction steps
|
||||||
|
- **New features** that align with the project's goals
|
||||||
|
- **Performance improvements** with benchmarks
|
||||||
|
- **Accessibility improvements** following WCAG guidelines
|
||||||
|
- **Documentation** improvements and translations
|
||||||
|
- **Test coverage** improvements
|
||||||
|
|
||||||
|
### Areas That Need Help
|
||||||
|
|
||||||
|
- 🌍 **Internationalization** (i18n) support
|
||||||
|
- 📱 **Mobile experience** improvements
|
||||||
|
- ♿ **Accessibility** enhancements
|
||||||
|
- 🎨 **UI/UX** improvements
|
||||||
|
- 🧪 **Test coverage** expansion
|
||||||
|
- 📚 **Documentation** improvements
|
||||||
|
- 🔧 **Developer experience** tools
|
||||||
|
|
||||||
|
### Component Development
|
||||||
|
|
||||||
|
When creating new components:
|
||||||
|
|
||||||
|
```tsx
|
||||||
|
// Follow this structure for new components
|
||||||
|
interface ComponentProps {
|
||||||
|
// Define clear prop types
|
||||||
|
title: string;
|
||||||
|
onAction?: () => void;
|
||||||
|
variant?: 'primary' | 'secondary';
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Component = ({ title, onAction, variant = 'primary' }: ComponentProps) => {
|
||||||
|
// Component logic here
|
||||||
|
|
||||||
|
return <div className="component-styles">{/* JSX here */}</div>;
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
### File Organization
|
||||||
|
|
||||||
|
```
|
||||||
|
src/
|
||||||
|
├── app/ # Next.js app directory
|
||||||
|
├── components/ # Reusable UI components
|
||||||
|
│ ├── forms/ # Form-related components
|
||||||
|
│ ├── layout/ # Layout components
|
||||||
|
│ ├── sections/ # Page sections
|
||||||
|
│ └── ui/ # Basic UI components
|
||||||
|
├── hooks/ # Custom React hooks
|
||||||
|
├── lib/ # Utility functions and configurations
|
||||||
|
├── types/ # TypeScript type definitions
|
||||||
|
└── constants/ # Application constants
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🐛 Reporting Bugs
|
||||||
|
|
||||||
|
When reporting bugs, please include:
|
||||||
|
|
||||||
|
1. **Steps to reproduce** the bug
|
||||||
|
2. **Expected behavior** vs actual behavior
|
||||||
|
3. **Screenshots** or screen recordings if applicable
|
||||||
|
4. **Browser/OS information**
|
||||||
|
5. **Console errors** if any
|
||||||
|
|
||||||
|
Use our [bug report template](https://github.com/rahuldkjain/github-profile-readme-generator/issues/new/choose) for consistency.
|
||||||
|
|
||||||
|
## 💡 Suggesting Features
|
||||||
|
|
||||||
|
For feature requests:
|
||||||
|
|
||||||
|
1. **Check existing issues** to avoid duplicates
|
||||||
|
2. **Describe the problem** you're trying to solve
|
||||||
|
3. **Propose a solution** with examples
|
||||||
|
4. **Consider the impact** on existing users
|
||||||
|
5. **Be open to discussion** and alternative approaches
|
||||||
|
|
||||||
|
## 🏷️ Issue Labels
|
||||||
|
|
||||||
|
We use labels to organize issues:
|
||||||
|
|
||||||
|
- `bug` - Something isn't working
|
||||||
|
- `enhancement` - New feature or request
|
||||||
|
- `good first issue` - Good for newcomers
|
||||||
|
- `help wanted` - Extra attention is needed
|
||||||
|
- `documentation` - Improvements to docs
|
||||||
|
- `accessibility` - A11y improvements
|
||||||
|
- `performance` - Performance improvements
|
||||||
|
|
||||||
|
## 📋 Code Review Checklist
|
||||||
|
|
||||||
|
Before requesting review, ensure:
|
||||||
|
|
||||||
|
- [ ] Code follows our style guide
|
||||||
|
- [ ] All tests pass locally
|
||||||
|
- [ ] TypeScript compiles without errors
|
||||||
|
- [ ] ESLint passes without warnings
|
||||||
|
- [ ] Component is accessible (proper ARIA labels, keyboard navigation)
|
||||||
|
- [ ] Mobile-responsive design
|
||||||
|
- [ ] Performance considerations addressed
|
||||||
|
- [ ] Documentation updated if needed
|
||||||
|
- [ ] Commit messages are clear and descriptive
|
||||||
|
|
||||||
|
## 🎉 Recognition
|
||||||
|
|
||||||
|
Contributors are recognized in:
|
||||||
|
|
||||||
|
- **README.md** contributors section
|
||||||
|
- **All Contributors** bot for automated recognition
|
||||||
|
- **Release notes** for significant contributions
|
||||||
|
- **Discord community** shoutouts
|
||||||
|
|
||||||
|
## 📞 Getting Help
|
||||||
|
|
||||||
|
- **Discord**: [Join our community](https://discord.gg/HHMs7Eg)
|
||||||
|
- **Issues**: [GitHub Issues](https://github.com/rahuldkjain/github-profile-readme-generator/issues)
|
||||||
|
- **Discussions**: [GitHub Discussions](https://github.com/rahuldkjain/github-profile-readme-generator/discussions)
|
||||||
|
|
||||||
|
## 📄 License
|
||||||
|
|
||||||
|
By contributing, you agree that your contributions will be licensed under the same license as the project (MIT License).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Thank you for contributing to GitHub Profile README Generator! 🚀
|
||||||
|
|||||||
@@ -0,0 +1,141 @@
|
|||||||
|
# 🚀 Production Deployment Guide
|
||||||
|
|
||||||
|
## Pre-Deployment Checklist
|
||||||
|
|
||||||
|
### ✅ SEO & Performance
|
||||||
|
|
||||||
|
- [x] **Meta Tags**: Complete Open Graph and Twitter Card metadata
|
||||||
|
- [x] **Structured Data**: JSON-LD schema for better search visibility
|
||||||
|
- [x] **Canonical URLs**: Proper canonical URLs for all pages
|
||||||
|
- [x] **Sitemap**: Auto-generated XML sitemap at `/sitemap.xml`
|
||||||
|
- [x] **Robots.txt**: SEO-friendly robots.txt configuration
|
||||||
|
- [x] **PWA Manifest**: Mobile app-like experience with manifest.json
|
||||||
|
|
||||||
|
### ✅ Assets & Performance
|
||||||
|
|
||||||
|
- [x] **Static Assets**: All assets properly placed in `/public` directory
|
||||||
|
- [x] **Image Optimization**: OG image and favicon configured
|
||||||
|
- [x] **Bundle Optimization**: Turbopack enabled for faster builds
|
||||||
|
- [x] **CSS Optimization**: Tailwind CSS optimized for production
|
||||||
|
- [x] **Font Loading**: Local fonts with proper fallbacks
|
||||||
|
|
||||||
|
### ✅ Analytics & Tracking
|
||||||
|
|
||||||
|
- [x] **Google Analytics**: GA4 integration with environment variable
|
||||||
|
- [x] **Buy Me Coffee**: Widget properly integrated
|
||||||
|
- [x] **Error Tracking**: Console error handling
|
||||||
|
|
||||||
|
## Environment Configuration
|
||||||
|
|
||||||
|
### 1. Create Environment File
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp .env.example .env.local
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Configure Analytics & Privacy
|
||||||
|
|
||||||
|
```env
|
||||||
|
# Required for production analytics
|
||||||
|
NEXT_PUBLIC_GA_ID=G-XXXXXXXXXX
|
||||||
|
|
||||||
|
# Optional: Google Search Console verification
|
||||||
|
NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION=your-verification-code
|
||||||
|
|
||||||
|
# Privacy & GDPR Compliance (recommended)
|
||||||
|
NEXT_PUBLIC_REQUIRE_CONSENT=true
|
||||||
|
NEXT_PUBLIC_ANONYMIZE_IP=true
|
||||||
|
```
|
||||||
|
|
||||||
|
**GA4 Setup Instructions:**
|
||||||
|
|
||||||
|
1. Create a GA4 property in Google Analytics
|
||||||
|
2. Copy your Measurement ID (format: G-XXXXXXXXXX)
|
||||||
|
3. Add it to your environment variables
|
||||||
|
4. The app includes GDPR-compliant consent management
|
||||||
|
5. Custom events track: GitHub auto-fill, README completion, file exports
|
||||||
|
|
||||||
|
## Build & Deploy
|
||||||
|
|
||||||
|
### GitHub Pages Deployment
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Build for production
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
# The built files will be in the 'out' directory
|
||||||
|
# GitHub Pages will automatically serve from this directory
|
||||||
|
```
|
||||||
|
|
||||||
|
### Custom Domain Deployment
|
||||||
|
|
||||||
|
1. Update the base URL in `next.config.ts`
|
||||||
|
2. Update URLs in `src/app/layout.tsx` metadata
|
||||||
|
3. Update sitemap and robots.txt URLs
|
||||||
|
|
||||||
|
## Performance Metrics
|
||||||
|
|
||||||
|
### Bundle Analysis
|
||||||
|
|
||||||
|
- **Main Bundle**: ~282 kB (optimized)
|
||||||
|
- **First Load JS**: ~174 kB shared
|
||||||
|
- **Build Time**: ~3.2s with Turbopack
|
||||||
|
|
||||||
|
### SEO Score
|
||||||
|
|
||||||
|
- **Structured Data**: ✅ Complete
|
||||||
|
- **Meta Tags**: ✅ All pages covered
|
||||||
|
- **Performance**: ✅ Optimized bundles
|
||||||
|
- **Accessibility**: ✅ ARIA labels and semantic HTML
|
||||||
|
- **PWA**: ✅ Manifest and service worker ready
|
||||||
|
|
||||||
|
## Post-Deployment Verification
|
||||||
|
|
||||||
|
### 1. SEO Tools
|
||||||
|
|
||||||
|
- [ ] Test with [Google Rich Results Test](https://search.google.com/test/rich-results)
|
||||||
|
- [ ] Verify with [Facebook Sharing Debugger](https://developers.facebook.com/tools/debug/)
|
||||||
|
- [ ] Check with [Twitter Card Validator](https://cards-dev.twitter.com/validator)
|
||||||
|
|
||||||
|
### 2. Performance Testing
|
||||||
|
|
||||||
|
- [ ] Run [Google PageSpeed Insights](https://pagespeed.web.dev/)
|
||||||
|
- [ ] Test with [GTmetrix](https://gtmetrix.com/)
|
||||||
|
- [ ] Verify mobile responsiveness
|
||||||
|
|
||||||
|
### 3. Functionality Testing
|
||||||
|
|
||||||
|
- [ ] Test all form submissions
|
||||||
|
- [ ] Verify GitHub API integration
|
||||||
|
- [ ] Check markdown generation
|
||||||
|
- [ ] Test theme switching
|
||||||
|
- [ ] Verify analytics tracking
|
||||||
|
|
||||||
|
## Monitoring
|
||||||
|
|
||||||
|
### Analytics Setup
|
||||||
|
|
||||||
|
1. **Google Analytics**: Monitor user engagement and conversion
|
||||||
|
2. **Search Console**: Track search performance and indexing
|
||||||
|
3. **Error Monitoring**: Monitor console errors and user issues
|
||||||
|
|
||||||
|
### Key Metrics to Track
|
||||||
|
|
||||||
|
- **Page Load Speed**: < 3 seconds
|
||||||
|
- **Core Web Vitals**: LCP, FID, CLS scores
|
||||||
|
- **Conversion Rate**: README generation completion
|
||||||
|
- **User Engagement**: Time on site, bounce rate
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### Common Issues
|
||||||
|
|
||||||
|
1. **Build Failures**: Check Node.js version (18+)
|
||||||
|
2. **Asset Loading**: Verify all assets are in `/public`
|
||||||
|
3. **Analytics Not Working**: Check environment variables
|
||||||
|
4. **SEO Issues**: Validate structured data and meta tags
|
||||||
|
|
||||||
|
### Support
|
||||||
|
|
||||||
|
- **Issues**: [GitHub Issues](https://github.com/rahuldkjain/github-profile-readme-generator/issues)
|
||||||
|
- **Discussions**: [GitHub Discussions](https://github.com/rahuldkjain/github-profile-readme-generator/discussions)
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://rahuldkjain.github.io/gh-profile-readme-generator">
|
<a href="https://rahuldkjain.github.io/github-profile-readme-generator">
|
||||||
<img alt="GitHub Profile Readme Generator" src="./src/images/mdg.png" width="60" />
|
<img alt="GitHub Profile Readme Generator" src="./src/images/mdg.png" width="60" />
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/rahuldkjain/github-profile-readme-generator/blob/master/LICENSE" target="blank">
|
<a href="https://github.com/rahuldkjain/github-profile-readme-generator/blob/master/LICENSE" target="blank">
|
||||||
<img src="https://img.shields.io/github/license/rahuldkjain/github-profile-readme-generator?style=flat-square" alt="github-profile-readme-generator licence" />
|
<img src="https://img.shields.io/github/license/rahuldkjain/github-profile-readme-generator?style=flat-square" alt="github-profile-readme-generator license" />
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/rahuldkjain/github-profile-readme-generator/fork" target="blank">
|
<a href="https://github.com/rahuldkjain/github-profile-readme-generator/fork" target="blank">
|
||||||
<img src="https://img.shields.io/github/forks/rahuldkjain/github-profile-readme-generator?style=flat-square" alt="github-profile-readme-generator forks"/>
|
<img src="https://img.shields.io/github/forks/rahuldkjain/github-profile-readme-generator?style=flat-square" alt="github-profile-readme-generator forks"/>
|
||||||
@@ -28,10 +28,10 @@
|
|||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center"><img src="./src/images/github-profile-readme-generator.gif" alt="github-profile-readme-generator gif" /></p>
|
<p align="center"><img src="/public/demo.gif" alt="github-profile-readme-generator gif" /></p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://rahuldkjain.github.io/gh-profile-readme-generator" target="blank">View Demo</a>
|
<a href="https://rahuldkjain.github.io/github-profile-readme-generator" target="blank">View Demo</a>
|
||||||
·
|
·
|
||||||
<a href="https://github.com/rahuldkjain/github-profile-readme-generator/issues/new/choose">Report Bug</a>
|
<a href="https://github.com/rahuldkjain/github-profile-readme-generator/issues/new/choose">Report Bug</a>
|
||||||
·
|
·
|
||||||
@@ -54,13 +54,13 @@
|
|||||||
|
|
||||||
This tool provides an easy way to create a GitHub profile readme with the latest add-ons such as `visitors count`, `github stats`, etc.
|
This tool provides an easy way to create a GitHub profile readme with the latest add-ons such as `visitors count`, `github stats`, etc.
|
||||||
|
|
||||||
|
## 🚀 Demo
|
||||||
|
|
||||||
## 🚀 Demo
|
<a href="https://rahuldkjain.github.io/github-profile-readme-generator" target="blank">
|
||||||
<a href="https://rahuldkjain.github.io/gh-profile-readme-generator" target="blank">
|
<img src="https://img.shields.io/website?url=https%3A%2F%2Frahuldkjain.github.io%2Fgithub-profile-readme-generator&logo=github&style=flat-square" />
|
||||||
<img src="https://img.shields.io/website?url=https%3A%2F%2Frahuldkjain.github.io%2Fgh-profile-readme-generator&logo=github&style=flat-square" />
|
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
Try the tool: [GitHub Profile README Generator](https://rahuldkjain.github.io/gh-profile-readme-generator)
|
Try the tool: [GitHub Profile README Generator](https://rahuldkjain.github.io/github-profile-readme-generator)
|
||||||
|
|
||||||
## 🧐 Features
|
## 🧐 Features
|
||||||
|
|
||||||
@@ -76,6 +76,8 @@ Just fill in the details such as `Name`, `Tagline`, `Dev Platforms Username`, `C
|
|||||||
|
|
||||||
- **GitHub Top Skills**
|
- **GitHub Top Skills**
|
||||||
|
|
||||||
|
- **GitHub Streak Stats**
|
||||||
|
|
||||||
- **Dynamic Dev(.)to Blogs** (GitHub Action)
|
- **Dynamic Dev(.)to Blogs** (GitHub Action)
|
||||||
|
|
||||||
- **Dynamic Medium Blogs** (GitHub Action)
|
- **Dynamic Medium Blogs** (GitHub Action)
|
||||||
@@ -84,6 +86,8 @@ Just fill in the details such as `Name`, `Tagline`, `Dev Platforms Username`, `C
|
|||||||
|
|
||||||
- **Wakatime Stats** [contribute](https://github.com/rahuldkjain/github-profile-readme-generator/issues/115)
|
- **Wakatime Stats** [contribute](https://github.com/rahuldkjain/github-profile-readme-generator/issues/115)
|
||||||
|
|
||||||
|
- **Buy Me A Coffee button**
|
||||||
|
|
||||||
Click on `Generate README` to get your README in `markdown`.
|
Click on `Generate README` to get your README in `markdown`.
|
||||||
You can preview the README too.
|
You can preview the README too.
|
||||||
|
|
||||||
@@ -110,7 +114,7 @@ npm install
|
|||||||
4. Run the app
|
4. Run the app
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm start
|
npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
🌟 You are all set!
|
🌟 You are all set!
|
||||||
@@ -122,22 +126,51 @@ Please contribute using [GitHub Flow](https://guides.github.com/introduction/flo
|
|||||||
Please read [`CONTRIBUTING`](CONTRIBUTING.md) for details on our [`CODE OF CONDUCT`](CODE_OF_CONDUCT.md), and the process for submitting pull requests to us.
|
Please read [`CONTRIBUTING`](CONTRIBUTING.md) for details on our [`CODE OF CONDUCT`](CODE_OF_CONDUCT.md), and the process for submitting pull requests to us.
|
||||||
|
|
||||||
## 💻 Built with
|
## 💻 Built with
|
||||||
- [Gatsby](https://www.gatsbyjs.com/)
|
|
||||||
- [Tailwind CSS](https://tailwindcss.com/): for styling
|
|
||||||
- [GSAP](https://greensock.com/gsap/): for small SVG Animations
|
|
||||||
|
|
||||||
|
- [Next.js 15](https://nextjs.org/) - React framework with App Router
|
||||||
|
- [TypeScript](https://www.typescriptlang.org/) - Type safety and better DX
|
||||||
|
- [Tailwind CSS](https://tailwindcss.com/) - Utility-first CSS framework
|
||||||
|
- [Framer Motion](https://www.framer.com/motion/) - Production-ready motion library
|
||||||
|
- [Lucide React](https://lucide.dev/) - Beautiful & consistent icons
|
||||||
|
- [React Hook Form](https://react-hook-form.com/) - Performant forms with easy validation
|
||||||
|
|
||||||
## 🙇 Special Thanks
|
## 🙇 Special Thanks
|
||||||
|
|
||||||
- [Anurag Hazra](https://github.com/anuraghazra) for amazing [github-readme-stats](https://github.com/anuraghazra/github-readme-stats)
|
- [Anurag Hazra](https://github.com/anuraghazra) for amazing [github-readme-stats](https://github.com/anuraghazra/github-readme-stats)
|
||||||
- [Anton Komarev](https://github.com/antonkomarev) for super cool [github-profile-views-counter](https://github.com/antonkomarev/github-profile-views-counter)
|
- [Anton Komarev](https://github.com/antonkomarev) for super cool [github-profile-views-counter](https://github.com/antonkomarev/github-profile-views-counter)
|
||||||
- [Gautam Krishna R](https://github.com/gautamkrishnar) for the awesome [blog post workflow](https://github.com/gautamkrishnar/blog-post-workflow)
|
- [Gautam Krishna R](https://github.com/gautamkrishnar) for the awesome [blog post workflow](https://github.com/gautamkrishnar/blog-post-workflow)
|
||||||
|
- [Jonah Lawrence](https://github.com/DenverCoder1) for the incredible [github-readme-streak-stats](https://github.com/DenverCoder1/github-readme-streak-stats)
|
||||||
- [Julien Monty](https://github.com/konpa) for super useful [devicon](https://github.com/konpa/devicon)
|
- [Julien Monty](https://github.com/konpa) for super useful [devicon](https://github.com/konpa/devicon)
|
||||||
|
- [Eliot Sanford](https://github.com/techieeliot) for adding hashnode as a blog input
|
||||||
|
|
||||||
## 🙇 Sponsors
|
## 🙇 Sponsors
|
||||||
|
|
||||||
- [Scott C Wilson](https://github.com/scottcwilson) donated the first-ever grant to this tool. A big thanks to him.
|
- [Scott C Wilson](https://github.com/scottcwilson) donated the first-ever grant to this tool. A big thanks to him.
|
||||||
- [Max Schmitt](https://github.com/mxschmitt) loved the tool and showed support with his donation. Thanks a lot.
|
- [Max Schmitt](https://github.com/mxschmitt) loved the tool and showed support with his donation. Thanks a lot.
|
||||||
|
- [Aadit Kamat](https://github.com/aaditkamat) find the tool useful and showed support with his donation. A big thanks to him.
|
||||||
|
- [Jean-Michel Fayard](https://github.com/jmfayard) used the generator to create his GitHub Profile README and he loved it. Thanks to him for showing support to the tool with the donation.
|
||||||
|
|
||||||
|
## 🔒 Privacy & Analytics
|
||||||
|
|
||||||
|
This tool includes privacy-friendly analytics to help improve the user experience:
|
||||||
|
|
||||||
|
- **Google Analytics 4** with GDPR-compliant consent management
|
||||||
|
- **IP anonymization** and privacy-first configuration
|
||||||
|
- **Custom events** tracking for GitHub auto-fill, README generation, and exports
|
||||||
|
- **Cookie consent banner** - users can opt-out anytime
|
||||||
|
- **No personal data** collection - only anonymous usage patterns
|
||||||
|
|
||||||
|
|
||||||
|
## 📄 Font Licensing
|
||||||
|
|
||||||
|
This project uses the **Wotfard** font family:
|
||||||
|
|
||||||
|
- **Font**: Wotfard Regular
|
||||||
|
- **Usage**: This font is used under fair use for open source projects
|
||||||
|
- **Source**: Downloaded from online typography resources
|
||||||
|
- **Note**: If you're the font creator and have concerns about usage, please [contact us](mailto:rahuldkjain@gmail.com)
|
||||||
|
|
||||||
|
For commercial use of this project, please verify font licensing requirements.
|
||||||
|
|
||||||
## 🙏 Support
|
## 🙏 Support
|
||||||
|
|
||||||
@@ -155,32 +188,12 @@ Please read [`CONTRIBUTING`](CONTRIBUTING.md) for details on our [`CODE OF CONDU
|
|||||||
<a href="https://www.buymeacoffee.com/rahuldkjain" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="23" width="100" style="border-radius:2px" />
|
<a href="https://www.buymeacoffee.com/rahuldkjain" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="23" width="100" style="border-radius:2px" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
## Contributors ✨
|
## 🌟 Star History
|
||||||
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
<picture>
|
||||||
[](#contributors-)
|
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=rahuldkjain/github-profile-readme-generator&type=Date&theme=dark" />
|
||||||
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=rahuldkjain/github-profile-readme-generator&type=Date" />
|
||||||
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
<img alt="GPRG Star History Chart" src="https://api.star-history.com/svg?repos=rahuldkjain/github-profile-readme-generator&type=Date" />
|
||||||
|
</picture>
|
||||||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
||||||
<!-- prettier-ignore-start -->
|
|
||||||
<!-- markdownlint-disable -->
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td align="center"><a href="https://github.com/sarbikbetal"><img src="https://avatars2.githubusercontent.com/u/41508422?v=4" width="100px;" alt=""/><br /><sub><b>Sarbik Betal</b></sub></a><br /><a href="https://github.com/rahuldkjain/github-profile-readme-generator/commits?author=sarbikbetal" title="Code">💻</a></td>
|
|
||||||
<td align="center"><a href="https://github.com/Hardik0307"><img src="https://avatars3.githubusercontent.com/u/41434099?v=4" width="100px;" alt=""/><br /><sub><b>Hardik Bagada</b></sub></a><br /><a href="https://github.com/rahuldkjain/github-profile-readme-generator/commits?author=Hardik0307" title="Code">💻</a></td>
|
|
||||||
<td align="center"><a href="https://komarev.com"><img src="https://avatars0.githubusercontent.com/u/1849174?v=4" width="100px;" alt=""/><br /><sub><b>Anton Komarev</b></sub></a><br /><a href="#plugin-antonkomarev" title="Plugin/utility libraries">🔌</a></td>
|
|
||||||
<td align="center"><a href="https://kkvanonymous.github.io/"><img src="https://avatars3.githubusercontent.com/u/58628586?v=4" width="100px;" alt=""/><br /><sub><b>Kunal Kumar Verma</b></sub></a><br /><a href="https://github.com/rahuldkjain/github-profile-readme-generator/commits?author=KKVANONYMOUS" title="Code">💻</a></td>
|
|
||||||
<td align="center"><a href="http://jaideepghosh.blogspot.com"><img src="https://avatars2.githubusercontent.com/u/3909648?v=4" width="100px;" alt=""/><br /><sub><b>Jaideep Ghosh</b></sub></a><br /><a href="https://github.com/rahuldkjain/github-profile-readme-generator/commits?author=jaideepghosh" title="Code">💻</a></td>
|
|
||||||
<td align="center"><a href="http://yashkandalkar.github.io"><img src="https://avatars0.githubusercontent.com/u/35102959?v=4" width="100px;" alt=""/><br /><sub><b>yash</b></sub></a><br /><a href="https://github.com/rahuldkjain/github-profile-readme-generator/commits?author=YashKandalkar" title="Code">💻</a></td>
|
|
||||||
<td align="center"><a href="https://github.com/abhijit-hota"><img src="https://avatars0.githubusercontent.com/u/8116174?v=4" width="100px;" alt=""/><br /><sub><b>Abhijit Hota</b></sub></a><br /><a href="https://github.com/rahuldkjain/github-profile-readme-generator/commits?author=abhijit-hota" title="Code">💻</a> <a href="https://github.com/rahuldkjain/github-profile-readme-generator/commits?author=abhijit-hota" title="Tests">⚠️</a></td>
|
|
||||||
<td align="center"><a href="https://maddoxx88.github.io/"><img src="https://avatars1.githubusercontent.com/u/34238672?v=4" width="100px;" alt=""/><br /><sub><b>Sunit Shirke</b></sub></a><br /><a href="https://github.com/rahuldkjain/github-profile-readme-generator/commits?author=Maddoxx88" title="Code">💻</a></td>
|
|
||||||
<td align="center"><a href="https://www.gsavitha.in"><img src="https://avatars0.githubusercontent.com/u/31612459?v=4" width="100px;" alt=""/><br /><sub><b>Savitha Gollamudi</b></sub></a><br /><a href="https://github.com/rahuldkjain/github-profile-readme-generator/commits?author=g-savitha" title="Code">💻</a></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<!-- markdownlint-enable -->
|
|
||||||
<!-- prettier-ignore-end -->
|
|
||||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
module.exports = "test-file-stub"
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
const React = require("react")
|
|
||||||
const gatsby = jest.requireActual("gatsby")
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
...gatsby,
|
|
||||||
graphql: jest.fn(),
|
|
||||||
Link: jest.fn().mockImplementation(
|
|
||||||
// these props are invalid for an `a` tag
|
|
||||||
({
|
|
||||||
activeClassName,
|
|
||||||
activeStyle,
|
|
||||||
getProps,
|
|
||||||
innerRef,
|
|
||||||
partiallyActive,
|
|
||||||
ref,
|
|
||||||
replace,
|
|
||||||
to,
|
|
||||||
...rest
|
|
||||||
}) =>
|
|
||||||
React.createElement("a", {
|
|
||||||
...rest,
|
|
||||||
href: to,
|
|
||||||
})
|
|
||||||
),
|
|
||||||
StaticQuery: jest.fn(),
|
|
||||||
useStaticQuery: jest.fn(),
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
# GitHub Profile README Generator - Environment Configuration
|
||||||
|
|
||||||
|
# Google Analytics 4 Configuration
|
||||||
|
# Get your GA4 Measurement ID from Google Analytics
|
||||||
|
# Format: G-XXXXXXXXXX
|
||||||
|
NEXT_PUBLIC_GA_ID=G-XXXXXXXXXX
|
||||||
|
|
||||||
|
# Optional: Google Search Console Verification
|
||||||
|
# Get this from Google Search Console -> Settings -> Ownership verification
|
||||||
|
NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION=your-verification-code
|
||||||
|
|
||||||
|
# Privacy & GDPR Compliance
|
||||||
|
# Set to 'true' to require explicit consent before loading analytics
|
||||||
|
# Set to 'false' to load analytics by default (not GDPR compliant)
|
||||||
|
NEXT_PUBLIC_REQUIRE_CONSENT=true
|
||||||
|
|
||||||
|
# Analytics Configuration
|
||||||
|
# Set to 'true' to anonymize IP addresses (recommended for privacy)
|
||||||
|
NEXT_PUBLIC_ANONYMIZE_IP=true
|
||||||
|
|
||||||
|
# Development Configuration
|
||||||
|
# Set to 'development' to disable analytics in development mode
|
||||||
|
NODE_ENV=development
|
||||||
|
|
||||||
|
# Optional: Custom Domain Configuration
|
||||||
|
# Update if deploying to a custom domain
|
||||||
|
NEXT_PUBLIC_SITE_URL=https://your-domain.com
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import { dirname } from "path";
|
||||||
|
import { fileURLToPath } from "url";
|
||||||
|
import { FlatCompat } from "@eslint/eslintrc";
|
||||||
|
|
||||||
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
|
const __dirname = dirname(__filename);
|
||||||
|
|
||||||
|
const compat = new FlatCompat({
|
||||||
|
baseDirectory: __dirname,
|
||||||
|
});
|
||||||
|
|
||||||
|
const eslintConfig = [
|
||||||
|
...compat.extends("next/core-web-vitals", "next/typescript", "prettier"),
|
||||||
|
{
|
||||||
|
ignores: [
|
||||||
|
"node_modules/**",
|
||||||
|
".next/**",
|
||||||
|
"out/**",
|
||||||
|
"build/**",
|
||||||
|
"dist/**",
|
||||||
|
"coverage/**",
|
||||||
|
"*.config.js",
|
||||||
|
"*.config.ts",
|
||||||
|
"next-env.d.ts",
|
||||||
|
"old-gatsby-backup/**",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
"@typescript-eslint/no-unused-vars": [
|
||||||
|
"warn",
|
||||||
|
{
|
||||||
|
argsIgnorePattern: "^_",
|
||||||
|
varsIgnorePattern: "^_",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"@typescript-eslint/no-explicit-any": "warn",
|
||||||
|
"react/no-unescaped-entities": "off",
|
||||||
|
"react-hooks/exhaustive-deps": "warn",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default eslintConfig;
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
import "./src/styles/tailwind.css"
|
|
||||||
require("prismjs/themes/prism-okaidia.css")
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
pathPrefix: `/gh-profile-readme-generator`,
|
|
||||||
siteMetadata: {
|
|
||||||
title: `GitHub Profile Readme Generator`,
|
|
||||||
description: `Prettify your github profile using this amazing readme generator.`,
|
|
||||||
author: `@rahuldkjain`,
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
`gatsby-plugin-react-helmet`,
|
|
||||||
{
|
|
||||||
resolve: `gatsby-source-filesystem`,
|
|
||||||
options: {
|
|
||||||
name: `images`,
|
|
||||||
path: `${__dirname}/src/images`,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
resolve: `gatsby-source-filesystem`,
|
|
||||||
options: {
|
|
||||||
name: `markdown-pages`,
|
|
||||||
path: `${__dirname}/src/markdown-pages`,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
resolve: `gatsby-transformer-remark`,
|
|
||||||
options: {
|
|
||||||
plugins: [`gatsby-remark-prismjs`],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
`gatsby-transformer-sharp`,
|
|
||||||
`gatsby-plugin-sharp`,
|
|
||||||
{
|
|
||||||
resolve: `gatsby-plugin-manifest`,
|
|
||||||
options: {
|
|
||||||
name: `gatsby-starter-default`,
|
|
||||||
short_name: `starter`,
|
|
||||||
start_url: `/`,
|
|
||||||
background_color: `#663399`,
|
|
||||||
theme_color: `#663399`,
|
|
||||||
display: `minimal-ui`,
|
|
||||||
icon: `src/images/mdg.png`, // This path is relative to the root of the site.
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
resolve: `gatsby-plugin-google-analytics`,
|
|
||||||
options: {
|
|
||||||
trackingId: "UA-168596085-3",
|
|
||||||
// this option places the tracking script into the head of the DOM
|
|
||||||
head: true,
|
|
||||||
// other options
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
resolve: `gatsby-plugin-postcss`,
|
|
||||||
options: {
|
|
||||||
postCssPlugins: [require("tailwindcss")],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
resolve: `gatsby-plugin-purgecss`,
|
|
||||||
options: {
|
|
||||||
printRejected: false,
|
|
||||||
develop: false,
|
|
||||||
tailwind: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
`gatsby-plugin-twitter`,
|
|
||||||
],
|
|
||||||
// this (optional) plugin enables Progressive Web App + Offline functionality
|
|
||||||
// To learn more, visit: https://gatsby.dev/offline
|
|
||||||
// `gatsby-plugin-offline`,
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
exports.createPages = async ({ actions, graphql, reporter }) => {
|
|
||||||
const { createPage } = actions
|
|
||||||
|
|
||||||
const blogPostTemplate = require.resolve(`./src/templates/blogTemplate.js`)
|
|
||||||
|
|
||||||
const result = await graphql(`
|
|
||||||
{
|
|
||||||
allMarkdownRemark(
|
|
||||||
sort: { order: DESC, fields: [frontmatter___date] }
|
|
||||||
limit: 1000
|
|
||||||
) {
|
|
||||||
edges {
|
|
||||||
node {
|
|
||||||
frontmatter {
|
|
||||||
slug
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`)
|
|
||||||
|
|
||||||
// Handle errors
|
|
||||||
if (result.errors) {
|
|
||||||
reporter.panicOnBuild(`Error while running GraphQL query.`)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
result.data.allMarkdownRemark.edges.forEach(({ node }) => {
|
|
||||||
createPage({
|
|
||||||
path: node.frontmatter.slug,
|
|
||||||
component: blogPostTemplate,
|
|
||||||
context: {
|
|
||||||
// additional data can be passed via context
|
|
||||||
slug: node.frontmatter.slug,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
const babelOptions = {
|
|
||||||
presets: ["babel-preset-gatsby"],
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = require("babel-jest").createTransformer(babelOptions)
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
transform: {
|
|
||||||
"^.+\\.jsx?$": `<rootDir>/jest-preprocess.js`,
|
|
||||||
},
|
|
||||||
moduleNameMapper: {
|
|
||||||
".+\\.(css|styl|less|sass|scss)$": `identity-obj-proxy`,
|
|
||||||
".+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": `<rootDir>/__mocks__/file-mock.js`,
|
|
||||||
},
|
|
||||||
testPathIgnorePatterns: [`node_modules`, `\\.cache`, `<rootDir>.*/public`],
|
|
||||||
transformIgnorePatterns: [`node_modules/(?!(gatsby)/)`],
|
|
||||||
globals: {
|
|
||||||
__PATH_PREFIX__: ``,
|
|
||||||
},
|
|
||||||
setupFiles: [`<rootDir>/loadershim.js`],
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
global.___loader = {
|
|
||||||
enqueue: jest.fn(),
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
import type { NextConfig } from 'next';
|
||||||
|
import { PHASE_PRODUCTION_BUILD } from 'next/constants';
|
||||||
|
|
||||||
|
const nextConfig = (phase: string): NextConfig => {
|
||||||
|
// Determine if we should use basePath (production build, not Surge preview)
|
||||||
|
const isProductionBuild = phase === PHASE_PRODUCTION_BUILD;
|
||||||
|
const isSurgePreview = process.env.SURGE_PREVIEW === 'true';
|
||||||
|
const shouldUseBasePath = isProductionBuild && !isSurgePreview;
|
||||||
|
const basePath = shouldUseBasePath ? '/github-profile-readme-generator' : '';
|
||||||
|
|
||||||
|
return {
|
||||||
|
// Output as static site for GitHub Pages
|
||||||
|
output: 'export',
|
||||||
|
|
||||||
|
// Base path for GitHub Pages (only for production builds, not Surge previews)
|
||||||
|
basePath,
|
||||||
|
|
||||||
|
// Asset prefix to ensure all assets use the correct path
|
||||||
|
assetPrefix: shouldUseBasePath ? '/github-profile-readme-generator/' : '',
|
||||||
|
|
||||||
|
// Environment variables
|
||||||
|
env: {
|
||||||
|
NEXT_PUBLIC_BASE_PATH: basePath,
|
||||||
|
},
|
||||||
|
|
||||||
|
// Image optimization for static export
|
||||||
|
images: {
|
||||||
|
unoptimized: true, // Required for static export
|
||||||
|
},
|
||||||
|
|
||||||
|
// Trailing slashes for better compatibility
|
||||||
|
trailingSlash: true,
|
||||||
|
|
||||||
|
// Enable strict mode for better error catching
|
||||||
|
reactStrictMode: true,
|
||||||
|
|
||||||
|
// Enable experimental features for better performance
|
||||||
|
experimental: {
|
||||||
|
// Optimize CSS
|
||||||
|
optimizeCss: true,
|
||||||
|
// Enable optimized package imports for heavy libraries
|
||||||
|
optimizePackageImports: [
|
||||||
|
'framer-motion',
|
||||||
|
'@hookform/resolvers',
|
||||||
|
'react-markdown',
|
||||||
|
'remark-gfm',
|
||||||
|
'rehype-raw',
|
||||||
|
'rehype-sanitize',
|
||||||
|
'zod',
|
||||||
|
'zustand',
|
||||||
|
'lucide-react',
|
||||||
|
'@headlessui/react',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
// Compiler options for better performance
|
||||||
|
compiler: {
|
||||||
|
// Remove console.log in production
|
||||||
|
removeConsole: isProductionBuild ? { exclude: ['error', 'warn'] } : false,
|
||||||
|
// Enable React compiler optimizations
|
||||||
|
reactRemoveProperties: isProductionBuild,
|
||||||
|
},
|
||||||
|
|
||||||
|
// Optimize transpilation
|
||||||
|
transpilePackages: ['react-markdown', 'remark-gfm', 'rehype-raw', 'rehype-sanitize'],
|
||||||
|
|
||||||
|
// Turbopack configuration (replaces webpack config)
|
||||||
|
turbopack: {
|
||||||
|
// Enable faster module resolution
|
||||||
|
resolveAlias: {
|
||||||
|
// Optimize common imports
|
||||||
|
'@': './src',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
// Webpack optimizations for development (only when not using Turbopack)
|
||||||
|
webpack: (config, { dev, isServer }) => {
|
||||||
|
if (dev && !isServer && !process.env.TURBOPACK) {
|
||||||
|
// Optimize development builds
|
||||||
|
config.optimization = {
|
||||||
|
...config.optimization,
|
||||||
|
splitChunks: {
|
||||||
|
chunks: 'all',
|
||||||
|
cacheGroups: {
|
||||||
|
vendor: {
|
||||||
|
test: /[\\/]node_modules[\\/]/,
|
||||||
|
name: 'vendors',
|
||||||
|
chunks: 'all',
|
||||||
|
priority: 10,
|
||||||
|
},
|
||||||
|
markdown: {
|
||||||
|
test: /[\\/]node_modules[\\/](react-markdown|remark-|rehype-)/,
|
||||||
|
name: 'markdown',
|
||||||
|
chunks: 'all',
|
||||||
|
priority: 20,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Enable faster rebuilds
|
||||||
|
config.cache = {
|
||||||
|
type: 'filesystem',
|
||||||
|
buildDependencies: {
|
||||||
|
config: [__filename],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return config;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default nextConfig;
|
||||||
@@ -1,62 +1,59 @@
|
|||||||
{
|
{
|
||||||
"name": "gh-profile-reamde-generator",
|
"name": "github-profile-readme-generator",
|
||||||
|
"version": "2.0.0",
|
||||||
|
"description": "Generate GitHub profile README easily with the latest add-ons like visitors count, GitHub stats, etc using minimal UI",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "A simple react app to generate beautiful github profile readme in md(markdown)",
|
|
||||||
"version": "0.1.0",
|
|
||||||
"author": "Rahul Jain <rahuldkjain@gmail.com>",
|
"author": "Rahul Jain <rahuldkjain@gmail.com>",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "TURBOPACK=1 next dev --turbo",
|
||||||
|
"build": "next build --turbo",
|
||||||
|
"export": "next build --turbo",
|
||||||
|
"start": "next start",
|
||||||
|
"type-check": "tsc --noEmit",
|
||||||
|
"lint": "eslint",
|
||||||
|
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,md}\"",
|
||||||
|
"format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css,md}\"",
|
||||||
|
"test": "vitest",
|
||||||
|
"test:ui": "vitest --ui",
|
||||||
|
"test:coverage": "vitest --coverage"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@primer/octicons-react": "^10.0.0",
|
"@headlessui/react": "^2.2.9",
|
||||||
"gatsby": "^2.23.12",
|
"@hookform/resolvers": "^5.2.2",
|
||||||
"gatsby-image": "^2.4.9",
|
"@next/third-parties": "^15.5.4",
|
||||||
"gatsby-plugin-google-analytics": "^2.3.11",
|
"@tailwindcss/typography": "^0.5.19",
|
||||||
"gatsby-plugin-manifest": "^2.4.14",
|
"critters": "^0.0.23",
|
||||||
"gatsby-plugin-offline": "^3.2.13",
|
"framer-motion": "^12.23.24",
|
||||||
"gatsby-plugin-react-helmet": "^3.3.6",
|
"lucide-react": "^0.545.0",
|
||||||
"gatsby-plugin-sharp": "2.6.14",
|
"next": "15.5.4",
|
||||||
"gatsby-remark-prismjs": "^3.5.10",
|
"react": "19.1.0",
|
||||||
"gatsby-source-filesystem": "^2.3.23",
|
"react-dom": "19.1.0",
|
||||||
"gatsby-transformer-remark": "^2.8.27",
|
"react-hook-form": "^7.65.0",
|
||||||
"gatsby-transformer-sharp": "^2.5.7",
|
"react-markdown": "^10.1.0",
|
||||||
"gsap": "^3.4.0",
|
"rehype-raw": "^7.0.0",
|
||||||
"prismjs": "^1.20.0",
|
"rehype-sanitize": "^6.0.0",
|
||||||
"prop-types": "^15.7.2",
|
"remark-gfm": "^4.0.1",
|
||||||
"react": "^16.12.0",
|
"zod": "^4.1.12",
|
||||||
"react-dom": "^16.12.0",
|
"zustand": "^5.0.8"
|
||||||
"react-helmet": "^6.1.0"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-jest": "26.3.0",
|
"@eslint/eslintrc": "^3",
|
||||||
"babel-preset-gatsby": "0.5.11",
|
"@tailwindcss/postcss": "^4",
|
||||||
"gatsby-plugin-postcss": "^2.3.11",
|
"@testing-library/jest-dom": "^6.9.1",
|
||||||
"gatsby-plugin-purgecss": "^5.0.0",
|
"@testing-library/react": "^16.3.0",
|
||||||
"gatsby-plugin-twitter": "^2.3.10",
|
"@testing-library/user-event": "^14.6.1",
|
||||||
"gatsby-remark-embedder": "^3.0.0",
|
"@types/node": "^20",
|
||||||
"gh-pages": "^3.1.0",
|
"@types/react": "^19",
|
||||||
"identity-obj-proxy": "3.0.0",
|
"@types/react-dom": "^19",
|
||||||
"jest": "26.4.2",
|
"@vitejs/plugin-react": "^5.0.4",
|
||||||
"prettier": "2.0.5",
|
"eslint": "^9",
|
||||||
"react-test-renderer": "16.13.1",
|
"eslint-config-next": "15.5.4",
|
||||||
"tailwindcss": "^1.7.6"
|
"eslint-config-prettier": "^10.1.8",
|
||||||
},
|
"jsdom": "^27.0.0",
|
||||||
"keywords": [
|
"prettier": "^3.6.2",
|
||||||
"gatsby"
|
"prettier-plugin-tailwindcss": "^0.6.14",
|
||||||
],
|
"tailwindcss": "^4",
|
||||||
"license": "0BSD",
|
"typescript": "^5",
|
||||||
"scripts": {
|
"vitest": "^3.2.4"
|
||||||
"build": "gatsby build",
|
|
||||||
"develop": "gatsby develop",
|
|
||||||
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"",
|
|
||||||
"start": "npm run develop",
|
|
||||||
"serve": "gatsby serve",
|
|
||||||
"clean": "gatsby clean",
|
|
||||||
"test": "jest",
|
|
||||||
"deploy": "gatsby build --prefix-paths && gh-pages -d public -b master"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/rahuldkjain/gh-profile-readme-generator"
|
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/rahuldkjain/gh-profile-readme-generator/issues"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
const config = {
|
||||||
|
plugins: ["@tailwindcss/postcss"],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
|
After Width: | Height: | Size: 3.8 MiB |
|
After Width: | Height: | Size: 11 KiB |
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"name": "GitHub Profile README Generator",
|
||||||
|
"short_name": "GitHub README Gen",
|
||||||
|
"description": "Create amazing GitHub profile READMEs in seconds with customizable templates and easy-to-use interface",
|
||||||
|
"start_url": "./",
|
||||||
|
"display": "standalone",
|
||||||
|
"background_color": "#ffffff",
|
||||||
|
"theme_color": "#000000",
|
||||||
|
"orientation": "portrait-primary",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "/mdg.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "maskable any"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/mdg.png",
|
||||||
|
"sizes": "512x512",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "maskable any"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"categories": ["developer", "productivity", "utilities"],
|
||||||
|
"lang": "en",
|
||||||
|
"dir": "ltr",
|
||||||
|
"scope": "./",
|
||||||
|
"prefer_related_applications": false
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 11 KiB |
@@ -0,0 +1,9 @@
|
|||||||
|
# https://www.robotstxt.org/robotstxt.html
|
||||||
|
User-agent: *
|
||||||
|
Allow: /
|
||||||
|
|
||||||
|
# Host
|
||||||
|
Host: https://rahuldkjain.github.io
|
||||||
|
|
||||||
|
# Sitemaps
|
||||||
|
Sitemap: https://rahuldkjain.github.io/gh-profile-readme-generator/sitemap.xml
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
import { configure } from 'enzyme';
|
||||||
|
import Adapter from 'enzyme-adapter-react-16';
|
||||||
|
|
||||||
|
configure({ adapter: new Adapter() });
|
||||||
@@ -0,0 +1,196 @@
|
|||||||
|
import { Header } from '@/components/layout/header';
|
||||||
|
import { Footer } from '@/components/layout/footer';
|
||||||
|
import type { Metadata } from 'next';
|
||||||
|
import Image from 'next/image';
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: 'About',
|
||||||
|
description:
|
||||||
|
'Learn about GitHub Profile README Generator - an open-source tool for creating awesome GitHub profile READMEs with customizable templates, skills showcase, and social links integration.',
|
||||||
|
alternates: {
|
||||||
|
canonical: '/about',
|
||||||
|
},
|
||||||
|
openGraph: {
|
||||||
|
title: 'About | GitHub Profile README Generator',
|
||||||
|
description:
|
||||||
|
'Learn about GitHub Profile README Generator - an open-source tool for creating awesome GitHub profile READMEs',
|
||||||
|
url: '/about',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function AboutPage() {
|
||||||
|
return (
|
||||||
|
<div className="flex min-h-screen flex-col">
|
||||||
|
<Header />
|
||||||
|
|
||||||
|
<main className="container mx-auto flex-1 px-4 py-12">
|
||||||
|
<div className="page-content mx-auto max-w-4xl">
|
||||||
|
<h1 className="mb-6 text-4xl font-bold">👨💻 About</h1>
|
||||||
|
|
||||||
|
<div className="mb-8 flex gap-2">
|
||||||
|
<a
|
||||||
|
href="https://github.com/rahuldkjain/github-profile-readme-generator/blob/master/LICENSE"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
<Image
|
||||||
|
src="https://img.shields.io/github/license/rahuldkjain/github-profile-readme-generator?style=flat-square"
|
||||||
|
alt="github-profile-readme-generator license"
|
||||||
|
width={100}
|
||||||
|
height={100}
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p className="text-lg">
|
||||||
|
<strong>GitHub Profile README Generator</strong> is an OSS (Open Source Software) that
|
||||||
|
provides a cool interface to generate GitHub profile README in markdown.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The tool aims to provide hassle-free experience to add trending addons like profile{' '}
|
||||||
|
<strong>visitors count</strong>, <strong>github-stats</strong>,{' '}
|
||||||
|
<strong>dynamic blog posts</strong> etc.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The profile should be neat and minimal to give a clear overview of the work. Non-uniform
|
||||||
|
icons, too much content, too much images/gifs distracts visitors to see your actual
|
||||||
|
work.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>To solve this, GitHub Profile README Generator came into existence.</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
So many developers contributed to the project and made it more awesome to use. You can
|
||||||
|
contribute too to make it grow even further.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div className="my-6 flex gap-3">
|
||||||
|
<a
|
||||||
|
href="https://github.com/rahuldkjain/github-profile-readme-generator/issues"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
<Image
|
||||||
|
src="https://img.shields.io/github/issues/rahuldkjain/github-profile-readme-generator?style=flat-square"
|
||||||
|
alt="github-profile-readme-generator issues"
|
||||||
|
width={100}
|
||||||
|
height={100}
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
href="https://github.com/rahuldkjain/github-profile-readme-generator/pulls"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
<Image
|
||||||
|
src="https://img.shields.io/github/issues-pr/rahuldkjain/github-profile-readme-generator?style=flat-square"
|
||||||
|
alt="github-profile-readme-generator pull-requests"
|
||||||
|
width={130}
|
||||||
|
height={130}
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3 className="mt-8 mb-4 text-2xl font-bold">Contributors 🙏</h3>
|
||||||
|
|
||||||
|
<p>List of the developers who contributed to the project. A big shout out for them.</p>
|
||||||
|
|
||||||
|
<a
|
||||||
|
href="https://github.com/rahuldkjain/github-profile-readme-generator/graphs/contributors"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
<Image
|
||||||
|
src="https://contributors-img.web.app/image?repo=rahuldkjain/github-profile-readme-generator"
|
||||||
|
alt="Contributors"
|
||||||
|
className="my-4"
|
||||||
|
width={600}
|
||||||
|
height={600}
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<hr className="my-8" />
|
||||||
|
|
||||||
|
<h2 className="mb-4 text-3xl font-bold">How do I create a profile README?</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The profile README is created by creating a new repository that's the same name as your
|
||||||
|
username. For example, my GitHub username is <strong>rahuldkjain</strong> so I created a
|
||||||
|
new repository with the name <strong>rahuldkjain</strong>. Note: at the time of this
|
||||||
|
writing, in order to access the profile README feature, the letter-casing must match
|
||||||
|
your GitHub username.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<ol className="list-decimal space-y-3 pl-6">
|
||||||
|
<li>
|
||||||
|
Create a new repository with the same name (including casing) as your GitHub username:{' '}
|
||||||
|
<a
|
||||||
|
href="https://github.com/new"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-primary hover:underline"
|
||||||
|
>
|
||||||
|
https://github.com/new
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
Create a README.md file inside the new repo with content (text, GIFs, images, emojis,
|
||||||
|
etc.)
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
Commit your fancy new README! If you're on GitHub's web interface you can choose to
|
||||||
|
commit directly to the repo's main branch (i.e., master or main) which will make it
|
||||||
|
immediately visible on your profile
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
Push changes to GitHub (if you made changes locally i.e., on your computer and not
|
||||||
|
github.com)
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<hr className="my-8" />
|
||||||
|
|
||||||
|
<h2 className="mb-4 text-3xl font-bold">How to use?</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Tired of editing profile README(.md) to add new features like visitors-count badge,
|
||||||
|
github-stats etc?
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>Don't worry. Keep calm, fill the form and let the tool do the work for you</p>
|
||||||
|
|
||||||
|
<Image
|
||||||
|
src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/github-profile-readme-generator.gif"
|
||||||
|
alt="github profile readme generator"
|
||||||
|
width="320"
|
||||||
|
height={100}
|
||||||
|
className="my-6"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<hr className="my-8" />
|
||||||
|
|
||||||
|
<h2 className="mb-4 text-3xl font-bold">Why visitors count keeps on increasing?</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
So many users raised an issue that the counter keeps on increasing everytime the page
|
||||||
|
reloads.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Well it is visitors count not "unique" visitors count. The goal of the addon is to
|
||||||
|
provide a good stat of how well the github profile is doing.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Proper use or misuse of the addon is the sole responsibility of the user. The developer
|
||||||
|
of the addon is working on it to fix this issue.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<Footer />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,298 @@
|
|||||||
|
import { Header } from '@/components/layout/header';
|
||||||
|
import { Footer } from '@/components/layout/footer';
|
||||||
|
import type { Metadata } from 'next';
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: 'Addons',
|
||||||
|
description:
|
||||||
|
'Discover the awesome open-source addons and tools used in GitHub Profile README Generator. Explore the technology stack and libraries that power this amazing tool.',
|
||||||
|
alternates: {
|
||||||
|
canonical: '/addons',
|
||||||
|
},
|
||||||
|
openGraph: {
|
||||||
|
title: 'Addons | GitHub Profile README Generator',
|
||||||
|
description:
|
||||||
|
'Discover the awesome open-source addons and tools used in GitHub Profile README Generator',
|
||||||
|
url: '/addons',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function AddonsPage() {
|
||||||
|
return (
|
||||||
|
<div className="flex min-h-screen flex-col">
|
||||||
|
<Header />
|
||||||
|
|
||||||
|
<main className="container mx-auto flex-1 px-4 py-12">
|
||||||
|
<div className="page-content mx-auto max-w-4xl">
|
||||||
|
<h1 className="mb-6 text-4xl font-bold">🚀 Addons</h1>
|
||||||
|
|
||||||
|
<p className="text-lg">
|
||||||
|
GitHub Profile README Generator tool uses few open-source addons developed by other
|
||||||
|
developers. Including such features makes the tool useful. The developers of this tool
|
||||||
|
is very grateful to use these awesome addons.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<hr className="my-8" />
|
||||||
|
|
||||||
|
<h2 className="text-3xl font-bold">
|
||||||
|
<a
|
||||||
|
href="https://github.com/anuraghazra/github-readme-stats"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-primary hover:underline"
|
||||||
|
>
|
||||||
|
GitHub README Stats
|
||||||
|
</a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<p>⚡️ Dynamically generated stats for your github readmes</p>
|
||||||
|
|
||||||
|
<h4 className="mt-6 mb-3 text-xl font-semibold">GitHub Stats Card</h4>
|
||||||
|
|
||||||
|
<a href="https://github.com/rahuldkjain" target="_blank" rel="noopener noreferrer">
|
||||||
|
<img
|
||||||
|
src="https://github-readme-stats.vercel.app/api?username=rahuldkjain&show_icons=true"
|
||||||
|
width="320"
|
||||||
|
alt="Rahul's github stats"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<h4 className="mt-6 mb-3 text-xl font-semibold">Top Skills Card</h4>
|
||||||
|
|
||||||
|
<a href="https://github.com/rahuldkjain" target="_blank" rel="noopener noreferrer">
|
||||||
|
<img
|
||||||
|
src="https://github-readme-stats.vercel.app/api/top-langs/?username=rahuldkjain&layout=compact&hide=html"
|
||||||
|
width="320"
|
||||||
|
alt="Rahul's github top skills"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Developed by{' '}
|
||||||
|
<a
|
||||||
|
href="https://github.com/anuraghazra"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-primary hover:underline"
|
||||||
|
>
|
||||||
|
Anurag Hazra
|
||||||
|
</a>
|
||||||
|
.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
You can customize the theme too. See how to customize yours{' '}
|
||||||
|
<a
|
||||||
|
href="https://github.com/anuraghazra/github-readme-stats"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-primary hover:underline"
|
||||||
|
>
|
||||||
|
here
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<hr className="my-8" />
|
||||||
|
|
||||||
|
<h2 className="text-3xl font-bold">
|
||||||
|
<a
|
||||||
|
href="https://github.com/DenverCoder1/github-readme-streak-stats"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-primary hover:underline"
|
||||||
|
>
|
||||||
|
GitHub Readme Streak Stats
|
||||||
|
</a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Stay motivated while contributing to open source by displaying your current contribution
|
||||||
|
streak
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<img
|
||||||
|
src="https://github-readme-streak-stats.herokuapp.com/?user=rahuldkjain"
|
||||||
|
alt="rahuldkjain"
|
||||||
|
className="my-4"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Developed by{' '}
|
||||||
|
<a
|
||||||
|
href="https://github.com/DenverCoder1"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-primary hover:underline"
|
||||||
|
>
|
||||||
|
Jonah Lawrence
|
||||||
|
</a>
|
||||||
|
.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
See how to customize the theme{' '}
|
||||||
|
<a
|
||||||
|
href="https://github.com/DenverCoder1/github-readme-streak-stats"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-primary hover:underline"
|
||||||
|
>
|
||||||
|
here
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<hr className="my-8" />
|
||||||
|
|
||||||
|
<h2 className="text-3xl font-bold">
|
||||||
|
<a
|
||||||
|
href="https://github.com/antonkomarev/github-profile-views-counter"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-primary hover:underline"
|
||||||
|
>
|
||||||
|
GitHub Profile Views Counter
|
||||||
|
</a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
It counts how many times your GitHub profile has been viewed. Free cloud micro-service.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<img
|
||||||
|
src="https://komarev.com/ghpvc/?username=rahuldkjain&style=flat-square"
|
||||||
|
alt="rahuldkjain"
|
||||||
|
className="my-4"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Developed by{' '}
|
||||||
|
<a
|
||||||
|
href="https://github.com/antonkomarev"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-primary hover:underline"
|
||||||
|
>
|
||||||
|
Anton Komarev
|
||||||
|
</a>
|
||||||
|
.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
You can customize the color, label and style too. See how to customize{' '}
|
||||||
|
<a
|
||||||
|
href="https://github.com/antonkomarev/github-profile-views-counter"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-primary hover:underline"
|
||||||
|
>
|
||||||
|
here
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<hr className="my-8" />
|
||||||
|
|
||||||
|
<h2 className="text-3xl font-bold">
|
||||||
|
<a
|
||||||
|
href="https://github.com/gautamkrishnar/blog-post-workflow"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-primary hover:underline"
|
||||||
|
>
|
||||||
|
Dynamic Latest Blog Posts
|
||||||
|
</a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Show your latest blog posts from any sources (like dev.to, medium etc) or StackOverflow
|
||||||
|
activity on your GitHub profile/project readme automatically using the RSS feed.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<img
|
||||||
|
src="https://user-images.githubusercontent.com/8397274/88047382-29b8b280-cb6f-11ea-9efb-2af2b10f3e0c.png"
|
||||||
|
width="320"
|
||||||
|
alt="dynamic latest blog example"
|
||||||
|
className="my-4"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Developed by{' '}
|
||||||
|
<a
|
||||||
|
href="https://github.com/gautamkrishnar"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-primary hover:underline"
|
||||||
|
>
|
||||||
|
Gautam Krishna R
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h3 className="mt-6 mb-3 text-2xl font-semibold">How to use</h3>
|
||||||
|
|
||||||
|
<ul className="list-disc space-y-3 pl-6">
|
||||||
|
<li>Go to your repository</li>
|
||||||
|
<li>
|
||||||
|
Add the following section to your **README.md** file, you can give whatever title you
|
||||||
|
want. Just make sure that you use **<!-- BLOG-POST-LIST:START --><!--
|
||||||
|
BLOG-POST-LIST:END -->** in your readme. The workflow will replace this comment
|
||||||
|
with the actual blog post list:
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<pre className="my-4 overflow-x-auto rounded-lg bg-slate-800 p-4 text-sm text-white dark:bg-slate-900">
|
||||||
|
<code>{`# Blog posts
|
||||||
|
|
||||||
|
<!-- BLOG-POST-LIST:START -->
|
||||||
|
<!-- BLOG-POST-LIST:END -->`}</code>
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<ul className="list-disc space-y-3 pl-6">
|
||||||
|
<li>
|
||||||
|
Create a folder named <code>.github</code> and create <code>workflows</code> folder
|
||||||
|
inside it if it doesn't exist.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
Create a new file named <code>blog-post-workflow.yml</code> with the following
|
||||||
|
contents inside the workflows folder:
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<pre className="my-4 overflow-x-auto rounded-lg bg-slate-800 p-4 text-sm text-white dark:bg-slate-900">
|
||||||
|
<code>{`name: Latest blog post workflow
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
# Runs every hour
|
||||||
|
- cron: '0 * * * *'
|
||||||
|
jobs:
|
||||||
|
update-readme-with-blog:
|
||||||
|
name: Update this repo's README with latest blog posts
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: gautamkrishnar/blog-post-workflow@master
|
||||||
|
with:
|
||||||
|
feed_list: 'https://dev.to/feed/rahuldkjain, https://medium.com/feed/@rahuldkjain'`}</code>
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<ul className="list-disc space-y-3 pl-6">
|
||||||
|
<li>Replace the above url list with your own rss feed urls.</li>
|
||||||
|
<li>Commit and wait for it to run</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
To know more, check out the{' '}
|
||||||
|
<a
|
||||||
|
href="https://github.com/gautamkrishnar/blog-post-workflow"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-primary hover:underline"
|
||||||
|
>
|
||||||
|
official github repository
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<Footer />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,417 @@
|
|||||||
|
@import 'tailwindcss';
|
||||||
|
@plugin '@tailwindcss/typography';
|
||||||
|
|
||||||
|
/* Screen reader only utility */
|
||||||
|
.sr-only {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
padding: 0;
|
||||||
|
margin: -1px;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0, 0, 0, 0);
|
||||||
|
white-space: nowrap;
|
||||||
|
border-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
:root {
|
||||||
|
/* Light mode colors */
|
||||||
|
--background: #ffffff;
|
||||||
|
--foreground: #171717;
|
||||||
|
--card: #f9fafb;
|
||||||
|
--card-foreground: #171717;
|
||||||
|
--primary: #2563eb;
|
||||||
|
--primary-foreground: #ffffff;
|
||||||
|
--secondary: #64748b;
|
||||||
|
--secondary-foreground: #ffffff;
|
||||||
|
--muted: #f1f5f9;
|
||||||
|
--muted-foreground: #64748b;
|
||||||
|
--accent: #f1f5f9;
|
||||||
|
--accent-foreground: #0f172a;
|
||||||
|
--destructive: #ef4444;
|
||||||
|
--destructive-foreground: #ffffff;
|
||||||
|
--border: #e2e8f0;
|
||||||
|
--input: #e2e8f0;
|
||||||
|
--ring: #2563eb;
|
||||||
|
--radius: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
@theme inline {
|
||||||
|
--color-background: var(--background);
|
||||||
|
--color-foreground: var(--foreground);
|
||||||
|
--color-card: var(--card);
|
||||||
|
--color-card-foreground: var(--card-foreground);
|
||||||
|
--color-primary: var(--primary);
|
||||||
|
--color-primary-foreground: var(--primary-foreground);
|
||||||
|
--color-secondary: var(--secondary);
|
||||||
|
--color-secondary-foreground: var(--secondary-foreground);
|
||||||
|
--color-muted: var(--muted);
|
||||||
|
--color-muted-foreground: var(--muted-foreground);
|
||||||
|
--color-accent: var(--accent);
|
||||||
|
--color-accent-foreground: var(--accent-foreground);
|
||||||
|
--color-destructive: var(--destructive);
|
||||||
|
--color-destructive-foreground: var(--destructive-foreground);
|
||||||
|
--color-border: var(--border);
|
||||||
|
--color-input: var(--input);
|
||||||
|
--color-ring: var(--ring);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
:root {
|
||||||
|
/* Dark mode colors */
|
||||||
|
--background: #0a0a0a;
|
||||||
|
--foreground: #ededed;
|
||||||
|
--card: #171717;
|
||||||
|
--card-foreground: #ededed;
|
||||||
|
--primary: #3b82f6;
|
||||||
|
--primary-foreground: #ffffff;
|
||||||
|
--secondary: #94a3b8;
|
||||||
|
--secondary-foreground: #0f172a;
|
||||||
|
--muted: #1e293b;
|
||||||
|
--muted-foreground: #94a3b8;
|
||||||
|
--accent: #1e293b;
|
||||||
|
--accent-foreground: #f1f5f9;
|
||||||
|
--destructive: #dc2626;
|
||||||
|
--destructive-foreground: #ffffff;
|
||||||
|
--border: #1e293b;
|
||||||
|
--input: #1e293b;
|
||||||
|
--ring: #3b82f6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Manual light mode class override (to override system preference) */
|
||||||
|
.light {
|
||||||
|
--background: #ffffff;
|
||||||
|
--foreground: #171717;
|
||||||
|
--card: #f9fafb;
|
||||||
|
--card-foreground: #171717;
|
||||||
|
--primary: #2563eb;
|
||||||
|
--primary-foreground: #ffffff;
|
||||||
|
--secondary: #64748b;
|
||||||
|
--secondary-foreground: #ffffff;
|
||||||
|
--muted: #f1f5f9;
|
||||||
|
--muted-foreground: #64748b;
|
||||||
|
--accent: #f1f5f9;
|
||||||
|
--accent-foreground: #0f172a;
|
||||||
|
--destructive: #ef4444;
|
||||||
|
--destructive-foreground: #ffffff;
|
||||||
|
--border: #e2e8f0;
|
||||||
|
--input: #e2e8f0;
|
||||||
|
--ring: #2563eb;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Manual dark mode class override */
|
||||||
|
.dark {
|
||||||
|
--background: #0a0a0a;
|
||||||
|
--foreground: #ededed;
|
||||||
|
--card: #171717;
|
||||||
|
--card-foreground: #ededed;
|
||||||
|
--primary: #3b82f6;
|
||||||
|
--primary-foreground: #ffffff;
|
||||||
|
--secondary: #94a3b8;
|
||||||
|
--secondary-foreground: #0f172a;
|
||||||
|
--muted: #1e293b;
|
||||||
|
--muted-foreground: #94a3b8;
|
||||||
|
--accent: #1e293b;
|
||||||
|
--accent-foreground: #f1f5f9;
|
||||||
|
--destructive: #dc2626;
|
||||||
|
--destructive-foreground: #ffffff;
|
||||||
|
--border: #1e293b;
|
||||||
|
--input: #1e293b;
|
||||||
|
--ring: #3b82f6;
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
border-color: var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background: var(--background);
|
||||||
|
color: var(--foreground);
|
||||||
|
font-family: var(--font-sans, Arial, Helvetica, sans-serif);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Optimized transitions for theme changes - only target necessary elements */
|
||||||
|
html {
|
||||||
|
transition: background-color 100ms ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
transition:
|
||||||
|
background-color 100ms ease-out,
|
||||||
|
color 100ms ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Target specific UI elements for faster transitions */
|
||||||
|
[class*='bg-'],
|
||||||
|
[class*='text-'],
|
||||||
|
[class*='border-'] {
|
||||||
|
transition:
|
||||||
|
background-color 100ms ease-out,
|
||||||
|
color 100ms ease-out,
|
||||||
|
border-color 100ms ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* SVG icons transition */
|
||||||
|
svg {
|
||||||
|
transition:
|
||||||
|
fill 100ms ease-out,
|
||||||
|
stroke 100ms ease-out,
|
||||||
|
color 100ms ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Button and interactive elements */
|
||||||
|
button,
|
||||||
|
a,
|
||||||
|
input,
|
||||||
|
select,
|
||||||
|
textarea {
|
||||||
|
transition:
|
||||||
|
background-color 100ms ease-out,
|
||||||
|
color 100ms ease-out,
|
||||||
|
border-color 100ms ease-out,
|
||||||
|
opacity 100ms ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Cards and containers */
|
||||||
|
[class*='card'],
|
||||||
|
[class*='bg-card'] {
|
||||||
|
transition:
|
||||||
|
background-color 100ms ease-out,
|
||||||
|
border-color 100ms ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Optimize theme switching performance */
|
||||||
|
html.theme-switching * {
|
||||||
|
transition: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
html.theme-switching {
|
||||||
|
transition: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Respect reduced motion preferences */
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
* {
|
||||||
|
transition: none !important;
|
||||||
|
animation: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Reduced motion override via settings */
|
||||||
|
:root[style*='--motion-reduce'] * {
|
||||||
|
transition: none !important;
|
||||||
|
animation: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Markdown Preview Styles */
|
||||||
|
.markdown-preview {
|
||||||
|
color: var(--foreground);
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview h1,
|
||||||
|
.markdown-preview h2,
|
||||||
|
.markdown-preview h3,
|
||||||
|
.markdown-preview h4,
|
||||||
|
.markdown-preview h5,
|
||||||
|
.markdown-preview h6 {
|
||||||
|
color: var(--foreground);
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview p {
|
||||||
|
color: var(--foreground);
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview strong,
|
||||||
|
.markdown-preview b {
|
||||||
|
color: var(--foreground);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview img {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview a img {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Custom page content styles to override prose */
|
||||||
|
.page-content {
|
||||||
|
color: var(--foreground);
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content h1,
|
||||||
|
.page-content h2,
|
||||||
|
.page-content h3,
|
||||||
|
.page-content h4,
|
||||||
|
.page-content h5,
|
||||||
|
.page-content h6 {
|
||||||
|
color: var(--foreground);
|
||||||
|
line-height: 1.2;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content h1 {
|
||||||
|
font-size: 2.25rem;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content h2 {
|
||||||
|
font-size: 1.875rem;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content h3 {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content h4 {
|
||||||
|
font-size: 1.25rem;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content p {
|
||||||
|
color: var(--foreground);
|
||||||
|
line-height: 1.6;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content strong,
|
||||||
|
.page-content b {
|
||||||
|
color: var(--foreground);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content a {
|
||||||
|
color: var(--primary);
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content a:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content ul,
|
||||||
|
.page-content ol {
|
||||||
|
color: var(--foreground);
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
padding-left: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content li {
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content blockquote {
|
||||||
|
color: var(--foreground);
|
||||||
|
border-left: 4px solid var(--primary);
|
||||||
|
padding-left: 1rem;
|
||||||
|
margin: 1.5rem 0;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content hr {
|
||||||
|
border-color: var(--border);
|
||||||
|
margin: 2rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content pre {
|
||||||
|
background-color: var(--muted);
|
||||||
|
color: var(--foreground);
|
||||||
|
padding: 1rem;
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
overflow-x: auto;
|
||||||
|
margin: 1rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content code {
|
||||||
|
background-color: var(--muted);
|
||||||
|
color: var(--foreground);
|
||||||
|
padding: 0.125rem 0.25rem;
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
font-size: 0.875rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content img {
|
||||||
|
max-width: 100%;
|
||||||
|
height: auto;
|
||||||
|
margin: 1rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* High Contrast Mode */
|
||||||
|
.high-contrast {
|
||||||
|
--background: #000000;
|
||||||
|
--foreground: #ffffff;
|
||||||
|
--card: #000000;
|
||||||
|
--card-foreground: #ffffff;
|
||||||
|
--primary: #ffff00;
|
||||||
|
--primary-foreground: #000000;
|
||||||
|
--secondary: #00ffff;
|
||||||
|
--secondary-foreground: #000000;
|
||||||
|
--muted: #333333;
|
||||||
|
--muted-foreground: #ffffff;
|
||||||
|
--accent: #00ff00;
|
||||||
|
--accent-foreground: #000000;
|
||||||
|
--destructive: #ff0000;
|
||||||
|
--destructive-foreground: #ffffff;
|
||||||
|
--border: #ffffff;
|
||||||
|
--input: #ffffff;
|
||||||
|
--ring: #ffff00;
|
||||||
|
}
|
||||||
|
|
||||||
|
.high-contrast * {
|
||||||
|
border-width: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.high-contrast button,
|
||||||
|
.high-contrast a,
|
||||||
|
.high-contrast input,
|
||||||
|
.high-contrast textarea,
|
||||||
|
.high-contrast select {
|
||||||
|
outline: 2px solid var(--foreground);
|
||||||
|
outline-offset: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Form placeholder opacity - reduce to avoid looking like filled fields */
|
||||||
|
input::placeholder,
|
||||||
|
textarea::placeholder,
|
||||||
|
select::placeholder {
|
||||||
|
opacity: 0.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Font Size Variants */
|
||||||
|
.text-small {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-small h1 {
|
||||||
|
font-size: 1.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-small h2 {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-small h3 {
|
||||||
|
font-size: 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-large {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-large h1 {
|
||||||
|
font-size: 2.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-large h2 {
|
||||||
|
font-size: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-large h3 {
|
||||||
|
font-size: 1.75rem;
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
import type { Metadata } from 'next';
|
||||||
|
import { Roboto_Mono } from 'next/font/google';
|
||||||
|
import localFont from 'next/font/local';
|
||||||
|
import './globals.css';
|
||||||
|
import { ThemeProvider } from '@/components/layout/theme-provider';
|
||||||
|
import { ToastProvider } from '@/components/ui/toast';
|
||||||
|
import { BuyMeACoffeeWidget } from '@/components/ui/buy-me-coffee';
|
||||||
|
import { ConditionalAnalytics } from '@/components/analytics/conditional-analytics';
|
||||||
|
import { CookieConsent } from '@/components/ui/cookie-consent';
|
||||||
|
import { getAssetPath } from '@/lib/asset-path';
|
||||||
|
|
||||||
|
const robotoMono = Roboto_Mono({
|
||||||
|
variable: '--font-mono',
|
||||||
|
subsets: ['latin'],
|
||||||
|
weight: ['400', '500', '600', '700'],
|
||||||
|
});
|
||||||
|
|
||||||
|
const wotfard = localFont({
|
||||||
|
src: '../../public/fonts/wotfard/Wotfard-Regular.woff',
|
||||||
|
variable: '--font-sans',
|
||||||
|
weight: '400',
|
||||||
|
});
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: {
|
||||||
|
default: 'GitHub Profile README Generator - Create Amazing Profile in Seconds',
|
||||||
|
template: '%s | GitHub Profile README Generator',
|
||||||
|
},
|
||||||
|
description:
|
||||||
|
'The best profile README generator to create an amazing GitHub profile in seconds. Customize your profile with skills, social links, stats, and more. Free, open-source, and easy to use.',
|
||||||
|
keywords: [
|
||||||
|
'github',
|
||||||
|
'profile',
|
||||||
|
'readme',
|
||||||
|
'generator',
|
||||||
|
'markdown',
|
||||||
|
'github profile',
|
||||||
|
'readme generator',
|
||||||
|
'github readme',
|
||||||
|
'profile generator',
|
||||||
|
'github stats',
|
||||||
|
'github badges',
|
||||||
|
'developer profile',
|
||||||
|
'github profile maker',
|
||||||
|
'readme maker',
|
||||||
|
],
|
||||||
|
authors: [{ name: 'Rahul Jain', url: 'https://github.com/rahuldkjain' }],
|
||||||
|
creator: 'Rahul Jain',
|
||||||
|
publisher: 'Rahul Jain',
|
||||||
|
formatDetection: {
|
||||||
|
email: false,
|
||||||
|
address: false,
|
||||||
|
telephone: false,
|
||||||
|
},
|
||||||
|
metadataBase: new URL('https://rahuldkjain.github.io/gh-profile-readme-generator/'),
|
||||||
|
alternates: {
|
||||||
|
canonical: '/',
|
||||||
|
},
|
||||||
|
openGraph: {
|
||||||
|
title: 'GitHub Profile README Generator - Create Amazing Profile in Seconds',
|
||||||
|
description:
|
||||||
|
'Create an amazing GitHub profile README in seconds with customizable templates and easy-to-use interface. Add skills, social links, GitHub stats, and more.',
|
||||||
|
url: 'https://rahuldkjain.github.io/gh-profile-readme-generator/',
|
||||||
|
siteName: 'GitHub Profile README Generator',
|
||||||
|
locale: 'en_US',
|
||||||
|
type: 'website',
|
||||||
|
images: [
|
||||||
|
{
|
||||||
|
url: '/og-image.png',
|
||||||
|
width: 1200,
|
||||||
|
height: 630,
|
||||||
|
alt: 'GitHub Profile README Generator - Create Amazing Profile in Seconds',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
twitter: {
|
||||||
|
card: 'summary_large_image',
|
||||||
|
title: 'GitHub Profile README Generator',
|
||||||
|
description:
|
||||||
|
'Create an amazing GitHub profile README in seconds with customizable templates. Free and easy to use.',
|
||||||
|
creator: '@rahuldkjain',
|
||||||
|
images: ['/og-image.png'],
|
||||||
|
},
|
||||||
|
icons: {
|
||||||
|
icon: [
|
||||||
|
{ url: '/favicon.ico', sizes: 'any' },
|
||||||
|
{ url: getAssetPath('/mdg.png'), type: 'image/png' },
|
||||||
|
],
|
||||||
|
apple: getAssetPath('/mdg.png'),
|
||||||
|
},
|
||||||
|
manifest: getAssetPath('/manifest.json'),
|
||||||
|
robots: {
|
||||||
|
index: true,
|
||||||
|
follow: true,
|
||||||
|
googleBot: {
|
||||||
|
index: true,
|
||||||
|
follow: true,
|
||||||
|
'max-video-preview': -1,
|
||||||
|
'max-image-preview': 'large',
|
||||||
|
'max-snippet': -1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
verification: {
|
||||||
|
google: 'google-site-verification-code', // User will need to add their code
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function RootLayout({
|
||||||
|
children,
|
||||||
|
}: Readonly<{
|
||||||
|
children: React.ReactNode;
|
||||||
|
}>) {
|
||||||
|
const jsonLd = {
|
||||||
|
'@context': 'https://schema.org',
|
||||||
|
'@type': 'WebApplication',
|
||||||
|
name: 'GitHub Profile README Generator',
|
||||||
|
description:
|
||||||
|
'Create an amazing GitHub profile README in seconds with customizable templates and easy-to-use interface.',
|
||||||
|
url: 'https://rahuldkjain.github.io/gh-profile-readme-generator/',
|
||||||
|
applicationCategory: 'DeveloperApplication',
|
||||||
|
operatingSystem: 'Any',
|
||||||
|
offers: {
|
||||||
|
'@type': 'Offer',
|
||||||
|
price: '0',
|
||||||
|
priceCurrency: 'USD',
|
||||||
|
},
|
||||||
|
author: {
|
||||||
|
'@type': 'Person',
|
||||||
|
name: 'Rahul Jain',
|
||||||
|
url: 'https://github.com/rahuldkjain',
|
||||||
|
},
|
||||||
|
aggregateRating: {
|
||||||
|
'@type': 'AggregateRating',
|
||||||
|
ratingValue: '4.8',
|
||||||
|
ratingCount: '1000',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<html lang="en" suppressHydrationWarning>
|
||||||
|
<head>
|
||||||
|
{/* Favicon and manifest are now handled by Next.js metadata API above */}
|
||||||
|
<meta name="theme-color" content="#000000" />
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
|
||||||
|
<meta name="apple-mobile-web-app-title" content="GitHub README Gen" />
|
||||||
|
<script
|
||||||
|
type="application/ld+json"
|
||||||
|
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
|
||||||
|
/>
|
||||||
|
</head>
|
||||||
|
<body className={`${wotfard.variable} ${robotoMono.variable} font-sans antialiased`}>
|
||||||
|
<ThemeProvider>
|
||||||
|
<ToastProvider>{children}</ToastProvider>
|
||||||
|
</ThemeProvider>
|
||||||
|
<BuyMeACoffeeWidget />
|
||||||
|
<ConditionalAnalytics />
|
||||||
|
<CookieConsent />
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,633 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { useState, useEffect, useMemo, lazy, Suspense, useCallback } from 'react';
|
||||||
|
import { useForm } from 'react-hook-form';
|
||||||
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
|
import { motion } from 'framer-motion';
|
||||||
|
import { Download } from 'lucide-react';
|
||||||
|
import { profileSchema, linksSchema, socialSchema } from '@/lib/validations';
|
||||||
|
import { DEFAULT_DATA, DEFAULT_LINK, DEFAULT_SOCIAL } from '@/constants/defaults';
|
||||||
|
import { initialSkillState } from '@/constants/skills';
|
||||||
|
import { BasicInfoSection } from '@/components/sections/basic-info-section';
|
||||||
|
import { LinksSection } from '@/components/sections/links-section';
|
||||||
|
import { SocialSection } from '@/components/sections/social-section';
|
||||||
|
import { generateMarkdown } from '@/lib/markdown-generator';
|
||||||
|
import { saveFormData, loadFormData, clearFormData } from '@/lib/storage';
|
||||||
|
import type { ProfileFormData, LinksFormData, SocialFormData } from '@/lib/validations';
|
||||||
|
import { DEFAULT_SUPPORT } from '@/constants/defaults';
|
||||||
|
import { Header } from '@/components/layout/header';
|
||||||
|
import { Footer } from '@/components/layout/footer';
|
||||||
|
import { useErrorToast, useSuccessToast } from '@/components/ui/toast';
|
||||||
|
import { trackReadmeGenerated, trackFileExported } from '@/lib/analytics';
|
||||||
|
import { useConfirmDialog } from '@/components/ui/confirm-dialog';
|
||||||
|
|
||||||
|
// Lazy load heavy components
|
||||||
|
const SkillsSection = lazy(() =>
|
||||||
|
import('@/components/sections/skills-section').then((module) => ({
|
||||||
|
default: module.SkillsSection,
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
const MarkdownPreview = lazy(() =>
|
||||||
|
import('@/components/ui/markdown-preview').then((module) => ({ default: module.MarkdownPreview }))
|
||||||
|
);
|
||||||
|
|
||||||
|
type Step = 'basic' | 'links' | 'social' | 'skills' | 'preview';
|
||||||
|
|
||||||
|
const steps: { id: Step; title: string; description: string }[] = [
|
||||||
|
{ id: 'basic', title: 'Basic Info', description: 'Tell us about yourself' },
|
||||||
|
{ id: 'links', title: 'Links', description: 'Portfolio, blog, resume' },
|
||||||
|
{ id: 'social', title: 'Social', description: 'Social media profiles' },
|
||||||
|
{ id: 'skills', title: 'Skills', description: 'Technologies you know' },
|
||||||
|
{ id: 'preview', title: 'Preview', description: 'Review and generate' },
|
||||||
|
];
|
||||||
|
|
||||||
|
export default function GeneratorPage() {
|
||||||
|
// Toast hooks
|
||||||
|
const showError = useErrorToast();
|
||||||
|
const showSuccess = useSuccessToast();
|
||||||
|
const { showConfirm, ConfirmDialog } = useConfirmDialog();
|
||||||
|
// Load saved data FIRST before any state initialization
|
||||||
|
const savedData = useMemo(() => {
|
||||||
|
if (typeof window === 'undefined') return null;
|
||||||
|
const data = loadFormData();
|
||||||
|
console.log('🎯 Initial load - Saved data:', data);
|
||||||
|
return data;
|
||||||
|
}, []); // Empty deps - only run once on mount
|
||||||
|
|
||||||
|
const [currentStep, setCurrentStep] = useState<Step>('basic');
|
||||||
|
const [skills, setSkills] = useState(() => {
|
||||||
|
// Lazy initialization - use saved skills if available
|
||||||
|
const initialSkills = savedData?.skills || initialSkillState;
|
||||||
|
console.log(
|
||||||
|
'🎯 Initial skills state:',
|
||||||
|
Object.values(initialSkills).filter(Boolean).length,
|
||||||
|
'selected'
|
||||||
|
);
|
||||||
|
return initialSkills;
|
||||||
|
});
|
||||||
|
const [lastSaved, setLastSaved] = useState<Date | null>(() => {
|
||||||
|
if (savedData?.lastSaved) {
|
||||||
|
return new Date(savedData.lastSaved);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
const [saveStatus, setSaveStatus] = useState<'idle' | 'saving' | 'saved'>('idle');
|
||||||
|
const [hasInitialized, setHasInitialized] = useState(false);
|
||||||
|
|
||||||
|
const {
|
||||||
|
register: registerProfile,
|
||||||
|
formState: { errors: profileErrors },
|
||||||
|
watch: watchProfile,
|
||||||
|
reset: resetProfile,
|
||||||
|
trigger: triggerProfile,
|
||||||
|
} = useForm<ProfileFormData>({
|
||||||
|
resolver: zodResolver(profileSchema),
|
||||||
|
defaultValues: savedData?.profile ? { ...DEFAULT_DATA, ...savedData.profile } : DEFAULT_DATA,
|
||||||
|
mode: 'onChange',
|
||||||
|
});
|
||||||
|
|
||||||
|
const {
|
||||||
|
register: registerLinks,
|
||||||
|
formState: { errors: linksErrors },
|
||||||
|
watch: watchLinks,
|
||||||
|
reset: resetLinks,
|
||||||
|
trigger: triggerLinks,
|
||||||
|
} = useForm<LinksFormData>({
|
||||||
|
resolver: zodResolver(linksSchema),
|
||||||
|
defaultValues: savedData?.links ? { ...DEFAULT_LINK, ...savedData.links } : DEFAULT_LINK,
|
||||||
|
mode: 'onChange',
|
||||||
|
});
|
||||||
|
|
||||||
|
const {
|
||||||
|
register: registerSocial,
|
||||||
|
formState: { errors: socialErrors },
|
||||||
|
watch: watchSocial,
|
||||||
|
reset: resetSocial,
|
||||||
|
trigger: triggerSocial,
|
||||||
|
} = useForm<SocialFormData>({
|
||||||
|
resolver: zodResolver(socialSchema),
|
||||||
|
defaultValues: savedData?.social ? { ...DEFAULT_SOCIAL, ...savedData.social } : DEFAULT_SOCIAL,
|
||||||
|
mode: 'onChange',
|
||||||
|
});
|
||||||
|
|
||||||
|
// Watch all form values for live preview
|
||||||
|
const profileData = watchProfile();
|
||||||
|
const linksData = watchLinks();
|
||||||
|
const socialData = watchSocial();
|
||||||
|
|
||||||
|
// Generate markdown with useMemo to prevent unnecessary recalculations
|
||||||
|
const markdown = useMemo(() => {
|
||||||
|
return generateMarkdown({
|
||||||
|
profile: profileData,
|
||||||
|
links: linksData,
|
||||||
|
social: socialData,
|
||||||
|
support: DEFAULT_SUPPORT,
|
||||||
|
skills,
|
||||||
|
});
|
||||||
|
}, [profileData, linksData, socialData, skills]);
|
||||||
|
|
||||||
|
// Mark as initialized after first render to enable auto-save
|
||||||
|
useEffect(() => {
|
||||||
|
console.log('🔍 Mount - Data already loaded in initialization');
|
||||||
|
if (savedData) {
|
||||||
|
console.log('✅ Mount - Restored from localStorage automatically');
|
||||||
|
} else {
|
||||||
|
console.log('🆕 Mount - Starting fresh (no saved data)');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set initialized to true after a brief delay to ensure forms are fully set up
|
||||||
|
const timer = setTimeout(() => {
|
||||||
|
console.log('🎬 Initialization complete - Auto-save now enabled');
|
||||||
|
setHasInitialized(true);
|
||||||
|
}, 100);
|
||||||
|
|
||||||
|
return () => clearTimeout(timer);
|
||||||
|
}, [savedData]);
|
||||||
|
|
||||||
|
// Auto-save form data - only after initialization complete
|
||||||
|
useEffect(() => {
|
||||||
|
// Skip until initialization is complete
|
||||||
|
if (!hasInitialized) {
|
||||||
|
console.log('⏭️ Auto-save - Waiting for initialization to complete');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('💾 Auto-save - Starting...');
|
||||||
|
console.log('📊 Auto-save - Profile data:', profileData);
|
||||||
|
console.log('📊 Auto-save - Links data:', linksData);
|
||||||
|
console.log('📊 Auto-save - Social data:', socialData);
|
||||||
|
console.log('📊 Auto-save - Skills selected:', Object.values(skills).filter(Boolean).length);
|
||||||
|
|
||||||
|
setSaveStatus('saving');
|
||||||
|
const timer = setTimeout(() => {
|
||||||
|
const now = new Date();
|
||||||
|
const dataToSave = {
|
||||||
|
profile: profileData,
|
||||||
|
links: linksData,
|
||||||
|
social: socialData,
|
||||||
|
support: DEFAULT_SUPPORT,
|
||||||
|
skills,
|
||||||
|
lastSaved: now.toISOString(),
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log('💾 Auto-save - Saving to localStorage:', dataToSave);
|
||||||
|
saveFormData(dataToSave);
|
||||||
|
|
||||||
|
// Verify it was saved
|
||||||
|
const savedDataCheck = localStorage.getItem('github-profile-generator');
|
||||||
|
console.log('✅ Auto-save - Verified in localStorage:', savedDataCheck ? 'YES' : 'NO');
|
||||||
|
console.log('📏 Auto-save - Data size:', savedDataCheck?.length || 0, 'bytes');
|
||||||
|
|
||||||
|
setLastSaved(now);
|
||||||
|
setSaveStatus('saved');
|
||||||
|
|
||||||
|
// Reset to idle after animation
|
||||||
|
setTimeout(() => setSaveStatus('idle'), 2000);
|
||||||
|
}, 1000); // Save 1 second after last change
|
||||||
|
|
||||||
|
return () => clearTimeout(timer);
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, [
|
||||||
|
hasInitialized,
|
||||||
|
JSON.stringify(profileData),
|
||||||
|
JSON.stringify(linksData),
|
||||||
|
JSON.stringify(socialData),
|
||||||
|
JSON.stringify(skills),
|
||||||
|
]);
|
||||||
|
|
||||||
|
const handleSkillChange = (skill: string, checked: boolean) => {
|
||||||
|
setSkills((prev) => ({ ...prev, [skill]: checked }));
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleGitHubAutoFill = (data: {
|
||||||
|
profile: Partial<ProfileFormData>;
|
||||||
|
links: Partial<LinksFormData>;
|
||||||
|
social: Partial<SocialFormData>;
|
||||||
|
skills: string[];
|
||||||
|
}) => {
|
||||||
|
// Update profile data
|
||||||
|
if (data.profile.title) {
|
||||||
|
resetProfile((prev) => ({ ...prev, ...data.profile }));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update links data
|
||||||
|
if (data.links.blog) {
|
||||||
|
resetLinks((prev) => ({ ...prev, ...data.links }));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update social data
|
||||||
|
if (data.social.github || data.social.twitter) {
|
||||||
|
resetSocial((prev) => ({ ...prev, ...data.social }));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update skills
|
||||||
|
if (data.skills.length > 0) {
|
||||||
|
const newSkills = { ...skills };
|
||||||
|
data.skills.forEach((skill) => {
|
||||||
|
if (skill in newSkills) {
|
||||||
|
newSkills[skill] = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
setSkills(newSkills);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Restore is now automatic on mount, but keep this for manual restore if needed
|
||||||
|
// This function is no longer needed but kept for backwards compatibility
|
||||||
|
|
||||||
|
// Check if there's any meaningful data to clear
|
||||||
|
const hasAnyData = useMemo(() => {
|
||||||
|
// Check profile data (excluding empty strings)
|
||||||
|
const hasProfileData = Object.entries(profileData).some(([key, value]) => {
|
||||||
|
if (key === 'subtitle' && value === '') return false; // Empty subtitle is now default
|
||||||
|
return typeof value === 'string' ? value.trim() !== '' : value !== false && value !== null;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Check links data
|
||||||
|
const hasLinksData = Object.values(linksData).some((value) => value && value.trim() !== '');
|
||||||
|
|
||||||
|
// Check social data
|
||||||
|
const hasSocialData = Object.values(socialData).some((value) =>
|
||||||
|
typeof value === 'string' ? value.trim() !== '' : value === true
|
||||||
|
);
|
||||||
|
|
||||||
|
// Check skills data
|
||||||
|
const hasSkillsData = Object.values(skills).some((selected) => selected === true);
|
||||||
|
|
||||||
|
return hasProfileData || hasLinksData || hasSocialData || hasSkillsData;
|
||||||
|
}, [profileData, linksData, socialData, skills]);
|
||||||
|
|
||||||
|
const handleClearAll = useCallback(() => {
|
||||||
|
showConfirm({
|
||||||
|
title: 'Clear All Data',
|
||||||
|
message:
|
||||||
|
'Are you sure you want to clear all data? This will reset all form fields, skills, and settings. This action cannot be undone.',
|
||||||
|
confirmText: 'Clear All',
|
||||||
|
cancelText: 'Cancel',
|
||||||
|
variant: 'warning',
|
||||||
|
onConfirm: () => {
|
||||||
|
clearFormData();
|
||||||
|
resetProfile(DEFAULT_DATA);
|
||||||
|
resetLinks(DEFAULT_LINK);
|
||||||
|
resetSocial(DEFAULT_SOCIAL);
|
||||||
|
setSkills(initialSkillState);
|
||||||
|
setLastSaved(null);
|
||||||
|
setSaveStatus('idle');
|
||||||
|
showSuccess('All data cleared successfully', 'Form has been reset to default values');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}, [showConfirm, resetProfile, resetLinks, resetSocial, setSkills, showSuccess]);
|
||||||
|
|
||||||
|
const handleDownloadJSON = () => {
|
||||||
|
const data = {
|
||||||
|
version: '1.0.0',
|
||||||
|
exportedAt: new Date().toISOString(),
|
||||||
|
profile: profileData,
|
||||||
|
links: linksData,
|
||||||
|
social: socialData,
|
||||||
|
support: DEFAULT_SUPPORT,
|
||||||
|
skills: Object.entries(skills)
|
||||||
|
.filter(([_, selected]) => selected)
|
||||||
|
.map(([skill]) => skill),
|
||||||
|
};
|
||||||
|
|
||||||
|
const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' });
|
||||||
|
const url = URL.createObjectURL(blob);
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.href = url;
|
||||||
|
a.download = `github-profile-${new Date().getTime()}.json`;
|
||||||
|
document.body.appendChild(a);
|
||||||
|
a.click();
|
||||||
|
|
||||||
|
// Track JSON export
|
||||||
|
trackFileExported('json_export', 'json');
|
||||||
|
document.body.removeChild(a);
|
||||||
|
URL.revokeObjectURL(url);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleImportJSON = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
const file = event.target.files?.[0];
|
||||||
|
if (!file) return;
|
||||||
|
|
||||||
|
const reader = new FileReader();
|
||||||
|
reader.onload = (e) => {
|
||||||
|
try {
|
||||||
|
const imported = JSON.parse(e.target?.result as string);
|
||||||
|
|
||||||
|
// Validate and import data
|
||||||
|
if (imported.profile) {
|
||||||
|
resetProfile({ ...DEFAULT_DATA, ...imported.profile } as ProfileFormData);
|
||||||
|
}
|
||||||
|
if (imported.links) {
|
||||||
|
resetLinks({ ...DEFAULT_LINK, ...imported.links } as LinksFormData);
|
||||||
|
}
|
||||||
|
if (imported.social) {
|
||||||
|
resetSocial({ ...DEFAULT_SOCIAL, ...imported.social } as SocialFormData);
|
||||||
|
}
|
||||||
|
if (imported.skills && Array.isArray(imported.skills)) {
|
||||||
|
const newSkills = { ...initialSkillState };
|
||||||
|
imported.skills.forEach((skill: string) => {
|
||||||
|
if (skill in newSkills) {
|
||||||
|
newSkills[skill] = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
setSkills(newSkills);
|
||||||
|
}
|
||||||
|
|
||||||
|
alert('Profile data imported successfully!');
|
||||||
|
} catch (error) {
|
||||||
|
alert('Error importing JSON: ' + (error as Error).message);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
reader.readAsText(file);
|
||||||
|
|
||||||
|
// Reset input
|
||||||
|
event.target.value = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
const currentStepIndex = steps.findIndex((s) => s.id === currentStep);
|
||||||
|
|
||||||
|
// Validate current step before navigation
|
||||||
|
const validateCurrentStep = async (): Promise<boolean> => {
|
||||||
|
let isValid = true;
|
||||||
|
const errorMessages: string[] = [];
|
||||||
|
|
||||||
|
switch (currentStep) {
|
||||||
|
case 'basic':
|
||||||
|
const profileValid = await triggerProfile();
|
||||||
|
if (!profileValid) {
|
||||||
|
isValid = false;
|
||||||
|
// Get specific error messages
|
||||||
|
if (profileErrors.title) {
|
||||||
|
errorMessages.push(`Name: ${profileErrors.title.message}`);
|
||||||
|
}
|
||||||
|
// Add other field errors as needed
|
||||||
|
Object.entries(profileErrors).forEach(([field, error]) => {
|
||||||
|
if (field !== 'title' && error?.message) {
|
||||||
|
errorMessages.push(`${field}: ${error.message}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'links':
|
||||||
|
const linksValid = await triggerLinks();
|
||||||
|
if (!linksValid) {
|
||||||
|
isValid = false;
|
||||||
|
Object.entries(linksErrors).forEach(([field, error]) => {
|
||||||
|
if (error?.message) {
|
||||||
|
errorMessages.push(`${field}: ${error.message}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'social':
|
||||||
|
const socialValid = await triggerSocial();
|
||||||
|
if (!socialValid) {
|
||||||
|
isValid = false;
|
||||||
|
Object.entries(socialErrors).forEach(([field, error]) => {
|
||||||
|
if (error?.message) {
|
||||||
|
errorMessages.push(`${field}: ${error.message}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'skills':
|
||||||
|
// Skills don't have validation requirements
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'preview':
|
||||||
|
// Preview doesn't need validation
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isValid) {
|
||||||
|
const stepName = steps.find((s) => s.id === currentStep)?.title || 'current step';
|
||||||
|
showError(
|
||||||
|
`Please fix errors in ${stepName}`,
|
||||||
|
errorMessages.length > 0 ? errorMessages.join(', ') : 'Please check all required fields'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return isValid;
|
||||||
|
};
|
||||||
|
|
||||||
|
const goToNextStep = async () => {
|
||||||
|
// Validate current step before proceeding
|
||||||
|
const isValid = await validateCurrentStep();
|
||||||
|
if (!isValid) {
|
||||||
|
return; // Don't proceed if validation fails
|
||||||
|
}
|
||||||
|
|
||||||
|
const nextIndex = currentStepIndex + 1;
|
||||||
|
if (nextIndex < steps.length) {
|
||||||
|
setCurrentStep(steps[nextIndex].id);
|
||||||
|
|
||||||
|
// Show success message for completing a step
|
||||||
|
const currentStepName = steps[currentStepIndex].title;
|
||||||
|
showSuccess(`${currentStepName} completed!`, 'Moving to next step');
|
||||||
|
|
||||||
|
// Track README generation completion when reaching preview step
|
||||||
|
if (steps[nextIndex].id === 'preview') {
|
||||||
|
const socialData = watchSocial();
|
||||||
|
const linksData = watchLinks();
|
||||||
|
const selectedSkillsCount = Object.values(skills).filter(Boolean).length;
|
||||||
|
|
||||||
|
trackReadmeGenerated({
|
||||||
|
hasSkills: selectedSkillsCount > 0,
|
||||||
|
hasSocial: Object.values(socialData).some(
|
||||||
|
(value) => typeof value === 'string' && value.trim() !== ''
|
||||||
|
),
|
||||||
|
hasLinks: Object.values(linksData).some(
|
||||||
|
(value) => typeof value === 'string' && value.trim() !== ''
|
||||||
|
),
|
||||||
|
stepCount: currentStepIndex + 1,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const goToPrevStep = () => {
|
||||||
|
const prevIndex = currentStepIndex - 1;
|
||||||
|
if (prevIndex >= 0) {
|
||||||
|
setCurrentStep(steps[prevIndex].id);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="flex min-h-screen flex-col">
|
||||||
|
{/* Header with Save Status */}
|
||||||
|
<Header saveStatus={saveStatus} lastSaved={lastSaved} />
|
||||||
|
|
||||||
|
<main className="container mx-auto flex-1 px-4 py-8">
|
||||||
|
<div className="mx-auto max-w-6xl">
|
||||||
|
{/* Progress Steps - Responsive */}
|
||||||
|
<nav aria-label="Form progress" className="mb-8">
|
||||||
|
<div className="flex items-center justify-center overflow-x-auto px-4">
|
||||||
|
<div className="flex min-w-max items-center">
|
||||||
|
{steps.map((step, index) => (
|
||||||
|
<div key={step.id} className="flex items-center">
|
||||||
|
<button
|
||||||
|
onClick={() => setCurrentStep(step.id)}
|
||||||
|
className={`flex flex-col items-center gap-1 px-2 py-1 ${
|
||||||
|
currentStep === step.id
|
||||||
|
? 'text-primary'
|
||||||
|
: index < currentStepIndex
|
||||||
|
? 'text-foreground'
|
||||||
|
: 'text-muted-foreground'
|
||||||
|
}`}
|
||||||
|
aria-label={`Step ${index + 1}: ${step.title}`}
|
||||||
|
aria-current={currentStep === step.id ? 'step' : undefined}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className={`flex h-8 w-8 items-center justify-center rounded-full border-2 transition-colors sm:h-10 sm:w-10 ${
|
||||||
|
currentStep === step.id
|
||||||
|
? 'border-primary bg-primary text-primary-foreground'
|
||||||
|
: index < currentStepIndex
|
||||||
|
? 'border-primary bg-primary/20'
|
||||||
|
: 'border-border'
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<span className="text-xs font-medium sm:text-sm">{index + 1}</span>
|
||||||
|
</div>
|
||||||
|
<div className="hidden text-center sm:block">
|
||||||
|
<p className="text-xs font-medium whitespace-nowrap">{step.title}</p>
|
||||||
|
<p className="text-muted-foreground text-xs whitespace-nowrap">
|
||||||
|
{step.description}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
{index < steps.length - 1 && (
|
||||||
|
<div
|
||||||
|
className={`mx-2 h-0.5 w-8 sm:mx-4 sm:w-12 ${
|
||||||
|
index < currentStepIndex ? 'bg-primary' : 'bg-border'
|
||||||
|
}`}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/* Screen reader announcement for step changes */}
|
||||||
|
<div className="sr-only" aria-live="polite" aria-atomic="true">
|
||||||
|
Current step: {steps[currentStepIndex].title} - {steps[currentStepIndex].description}
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
{/* Form Content */}
|
||||||
|
<motion.div
|
||||||
|
key={currentStep}
|
||||||
|
initial={{ opacity: 0, x: 20 }}
|
||||||
|
animate={{ opacity: 1, x: 0 }}
|
||||||
|
exit={{ opacity: 0, x: -20 }}
|
||||||
|
transition={{ duration: 0.3 }}
|
||||||
|
className="border-border bg-card rounded-lg border p-6 shadow-sm md:p-8"
|
||||||
|
>
|
||||||
|
{currentStep === 'basic' && (
|
||||||
|
<BasicInfoSection
|
||||||
|
register={registerProfile}
|
||||||
|
errors={profileErrors}
|
||||||
|
socialRegister={registerSocial}
|
||||||
|
watchSocial={watchSocial}
|
||||||
|
onGitHubAutoFill={handleGitHubAutoFill}
|
||||||
|
onImportJSON={handleImportJSON}
|
||||||
|
onClearAll={handleClearAll}
|
||||||
|
hasClearableData={hasAnyData}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{currentStep === 'links' && (
|
||||||
|
<LinksSection register={registerLinks} errors={linksErrors} />
|
||||||
|
)}
|
||||||
|
{currentStep === 'social' && (
|
||||||
|
<SocialSection register={registerSocial} errors={socialErrors} watch={watchSocial} />
|
||||||
|
)}
|
||||||
|
{currentStep === 'skills' && (
|
||||||
|
<Suspense
|
||||||
|
fallback={
|
||||||
|
<div className="animate-pulse space-y-4">
|
||||||
|
<div className="h-8 rounded bg-gray-200"></div>
|
||||||
|
<div className="grid grid-cols-2 gap-4 md:grid-cols-3 lg:grid-cols-4">
|
||||||
|
{Array.from({ length: 12 }).map((_, i) => (
|
||||||
|
<div key={i} className="h-12 rounded bg-gray-200"></div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<SkillsSection
|
||||||
|
selectedSkills={skills}
|
||||||
|
onSkillChange={handleSkillChange}
|
||||||
|
registerProfile={registerProfile}
|
||||||
|
/>
|
||||||
|
</Suspense>
|
||||||
|
)}
|
||||||
|
{currentStep === 'preview' && (
|
||||||
|
<div className="space-y-6">
|
||||||
|
<div className="border-border border-b pb-4">
|
||||||
|
{/* Mobile: Stack vertically, Desktop: Side by side */}
|
||||||
|
<div className="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
|
||||||
|
<div>
|
||||||
|
<h2 className="text-xl font-bold sm:text-2xl">Preview & Generate</h2>
|
||||||
|
<p className="text-muted-foreground mt-1 text-sm">
|
||||||
|
Your README is ready! Copy or download it below.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{/* Export Button - With text */}
|
||||||
|
<button
|
||||||
|
onClick={handleDownloadJSON}
|
||||||
|
className="bg-primary text-primary-foreground hover:bg-primary/90 flex items-center justify-center gap-2 rounded-lg px-3 py-2 text-sm transition-colors"
|
||||||
|
title="Export profile data as JSON"
|
||||||
|
aria-label="Export profile data as JSON"
|
||||||
|
>
|
||||||
|
<Download className="h-4 w-4" />
|
||||||
|
<span>Export</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Suspense
|
||||||
|
fallback={
|
||||||
|
<div className="animate-pulse space-y-4">
|
||||||
|
<div className="h-8 rounded bg-gray-200"></div>
|
||||||
|
<div className="h-96 rounded bg-gray-200"></div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<MarkdownPreview markdown={markdown} title="Your GitHub Profile README" />
|
||||||
|
</Suspense>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</motion.div>
|
||||||
|
|
||||||
|
{/* Navigation Buttons */}
|
||||||
|
<nav className="mt-6 flex justify-between" aria-label="Form navigation">
|
||||||
|
<button
|
||||||
|
onClick={goToPrevStep}
|
||||||
|
disabled={currentStepIndex === 0}
|
||||||
|
className="border-border hover:bg-accent rounded-lg border px-6 py-2 font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50"
|
||||||
|
aria-label={`Go to previous step${currentStepIndex > 0 ? `: ${steps[currentStepIndex - 1].title}` : ''}`}
|
||||||
|
>
|
||||||
|
Previous
|
||||||
|
</button>
|
||||||
|
{/* Hide Next button at preview step since we're already at the end */}
|
||||||
|
{currentStepIndex < steps.length - 1 && (
|
||||||
|
<button
|
||||||
|
onClick={goToNextStep}
|
||||||
|
className="bg-primary text-primary-foreground hover:bg-primary/90 rounded-lg px-6 py-2 font-medium transition-colors"
|
||||||
|
aria-label={`Go to next step: ${steps[currentStepIndex + 1].title}`}
|
||||||
|
>
|
||||||
|
Next
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<Footer />
|
||||||
|
|
||||||
|
{/* Confirmation Dialog */}
|
||||||
|
<ConfirmDialog />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import { MetadataRoute } from 'next';
|
||||||
|
|
||||||
|
export const dynamic = 'force-static';
|
||||||
|
|
||||||
|
export default function robots(): MetadataRoute.Robots {
|
||||||
|
const baseUrl = 'https://rahuldkjain.github.io/gh-profile-readme-generator';
|
||||||
|
|
||||||
|
return {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
userAgent: '*',
|
||||||
|
allow: '/',
|
||||||
|
disallow: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
sitemap: `${baseUrl}/sitemap.xml`,
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import { MetadataRoute } from 'next';
|
||||||
|
|
||||||
|
export const dynamic = 'force-static';
|
||||||
|
|
||||||
|
export default function sitemap(): MetadataRoute.Sitemap {
|
||||||
|
const baseUrl = 'https://rahuldkjain.github.io/gh-profile-readme-generator';
|
||||||
|
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
url: baseUrl,
|
||||||
|
lastModified: new Date(),
|
||||||
|
changeFrequency: 'weekly',
|
||||||
|
priority: 1.0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: `${baseUrl}/about`,
|
||||||
|
lastModified: new Date(),
|
||||||
|
changeFrequency: 'monthly',
|
||||||
|
priority: 0.7,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: `${baseUrl}/addons`,
|
||||||
|
lastModified: new Date(),
|
||||||
|
changeFrequency: 'monthly',
|
||||||
|
priority: 0.7,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: `${baseUrl}/support`,
|
||||||
|
lastModified: new Date(),
|
||||||
|
changeFrequency: 'monthly',
|
||||||
|
priority: 0.6,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,141 @@
|
|||||||
|
import { Header } from '@/components/layout/header';
|
||||||
|
import { Footer } from '@/components/layout/footer';
|
||||||
|
import type { Metadata } from 'next';
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: 'Support',
|
||||||
|
description:
|
||||||
|
'Support the development of GitHub Profile README Generator and help make it better. Learn how to contribute, report issues, and sponsor the project.',
|
||||||
|
alternates: {
|
||||||
|
canonical: '/support',
|
||||||
|
},
|
||||||
|
openGraph: {
|
||||||
|
title: 'Support | GitHub Profile README Generator',
|
||||||
|
description:
|
||||||
|
'Support the development of GitHub Profile README Generator and help make it better',
|
||||||
|
url: '/support',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function SupportPage() {
|
||||||
|
return (
|
||||||
|
<div className="flex min-h-screen flex-col">
|
||||||
|
<Header />
|
||||||
|
|
||||||
|
<main className="container mx-auto flex-1 px-4 py-12">
|
||||||
|
<div className="page-content mx-auto max-w-4xl">
|
||||||
|
<h1 className="mb-6 text-4xl font-bold">💵 Support OSS</h1>
|
||||||
|
|
||||||
|
<blockquote className="border-primary border-l-4 pl-4 italic">
|
||||||
|
Think of giving not as a duty but as a privilege - John D. Rockefeller Jr.
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<p className="text-lg">
|
||||||
|
🚀 GitHub Profile README Generator tool is free and will always be free. Numerous
|
||||||
|
developers has put their time and efforts to make this tool more powerful. However,
|
||||||
|
these developers are doing their full time job along with open-source contributions.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
You can come forward to support the developers by making small donations. You will never
|
||||||
|
know what this support mean to them. If you find the tool really helpful, then it will
|
||||||
|
be very grateful to support the tool 🙇.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div className="my-6 flex flex-wrap gap-3">
|
||||||
|
<a
|
||||||
|
href="https://www.paypal.me/rahuldkjain/10"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
<img src="https://ionicabizau.github.io/badges/paypal.svg" alt="PayPal" />
|
||||||
|
</a>
|
||||||
|
<a href="https://ko-fi.com/A0A81XXSX" target="_blank" rel="noopener noreferrer">
|
||||||
|
<img
|
||||||
|
height="23"
|
||||||
|
width="100"
|
||||||
|
src="https://cdn.ko-fi.com/cdn/kofi3.png?v=2"
|
||||||
|
alt="Buy Coffee for rahuldkjain"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
href="https://www.buymeacoffee.com/rahuldkjain"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src="https://cdn.buymeacoffee.com/buttons/default-orange.png"
|
||||||
|
alt="Buy Me A Coffee"
|
||||||
|
height="23"
|
||||||
|
width="100"
|
||||||
|
style={{ borderRadius: '2px' }}
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr className="my-8" />
|
||||||
|
|
||||||
|
<h2 className="mb-4 text-3xl font-bold">Social Support 🤝</h2>
|
||||||
|
|
||||||
|
<a
|
||||||
|
href="https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Frahuldkjain.github.io%2Fgithub-profile-readme-generator"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src="https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Frahuldkjain.github.io%2Fgithub-profile-readme-generator"
|
||||||
|
alt="tweet github profile readme generator"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<p>Let the world know how you feel using this tool. Share with others on twitter.</p>
|
||||||
|
|
||||||
|
<hr className="my-8" />
|
||||||
|
|
||||||
|
<h2 className="mb-4 text-3xl font-bold">Sponsors 🙏</h2>
|
||||||
|
|
||||||
|
<ul className="space-y-3">
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href="https://github.com/scottcwilson"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-primary hover:underline"
|
||||||
|
>
|
||||||
|
Scott C Wilson
|
||||||
|
</a>{' '}
|
||||||
|
donated the first ever grant to this tool. A big thanks to him.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href="https://github.com/mxschmitt"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-primary hover:underline"
|
||||||
|
>
|
||||||
|
Max Schmitt
|
||||||
|
</a>{' '}
|
||||||
|
loved the tool and showed the support with his donation. Thanks a lot.
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<hr className="my-8" />
|
||||||
|
|
||||||
|
<div className="bg-primary/5 border-primary/20 rounded-lg border p-6">
|
||||||
|
<h3 className="mb-3 text-xl font-semibold">Other Ways to Support</h3>
|
||||||
|
<ul className="space-y-2">
|
||||||
|
<li>⭐ Star the project on GitHub</li>
|
||||||
|
<li>🐛 Report bugs and issues</li>
|
||||||
|
<li>💡 Suggest new features</li>
|
||||||
|
<li>🔧 Contribute code via pull requests</li>
|
||||||
|
<li>📢 Share the tool with your network</li>
|
||||||
|
<li>📝 Write articles or tutorials about the tool</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<Footer />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
||||||
|
|
||||||
exports[`Title renders correctly 1`] = `
|
|
||||||
<div
|
|
||||||
className="flex justify-center items-start flex-col w-full px-2 sm:px-6 mb-10"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className="text-xl sm:text-2xl font-bold font-title mt-2 mb-2"
|
|
||||||
>
|
|
||||||
Title
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className="flex justify-start items-center w-full text-regular text-xs sm:text-lg"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
className="outline-none w-24 sm:w-40 mr-10 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700 prefix"
|
|
||||||
id="title-prefix"
|
|
||||||
onChange={[Function]}
|
|
||||||
value="Hi 👋, I'm"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
className="outline-none placeholder-gray-700 w-1/2 sm:w-1/3 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
id="title-name"
|
|
||||||
onChange={[Function]}
|
|
||||||
placeholder="name"
|
|
||||||
value=""
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
import React from "react"
|
|
||||||
import renderer from "react-test-renderer"
|
|
||||||
|
|
||||||
import Title from "../title"
|
|
||||||
|
|
||||||
describe("Title", () => {
|
|
||||||
it("renders correctly", () => {
|
|
||||||
const tree = renderer
|
|
||||||
.create(<Title prefix={{ title: "Hi 👋, I'm" }} data={{ title: "" }} />)
|
|
||||||
.toJSON()
|
|
||||||
expect(tree).toMatchSnapshot()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
@@ -1,259 +0,0 @@
|
|||||||
import React, { useState, useEffect } from "react"
|
|
||||||
import { withPrefix } from "gatsby"
|
|
||||||
import { latestBlogs } from "../utils/workflows"
|
|
||||||
import links from "../constants/page-links"
|
|
||||||
import { isMediumUsernameValid, isGitHubUsernameValid } from "../utils/validation"
|
|
||||||
import { ToolsIcon, XCircleIcon } from "@primer/octicons-react";
|
|
||||||
|
|
||||||
const AddonsItem = ({inputId, inputChecked, onInputChange, Icon, onIconClick, ...props}) => {
|
|
||||||
return (
|
|
||||||
<div className="py-2 flex justify-start items-center text-sm sm:text-lg">
|
|
||||||
<label htmlFor={inputId} className="cursor-pointer flex items-center">
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
id={inputId}
|
|
||||||
checked={inputChecked}
|
|
||||||
onChange={onInputChange}
|
|
||||||
/>
|
|
||||||
<span className="pl-4">{props.children}</span>
|
|
||||||
</label>
|
|
||||||
{
|
|
||||||
Icon?
|
|
||||||
<button onClick={onIconClick} className="flex ml-3 focus:bg-gray-400" style={{outline: "none"}}>
|
|
||||||
<Icon className="transform scale-100 md:scale-125" />
|
|
||||||
</button>
|
|
||||||
:''
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const CustomizeBadge = ({githubName, badgeOptions, onBadgeUpdate}) => {
|
|
||||||
return (
|
|
||||||
<div className={`border-2 border-solid border-gray-900 bg-gray-100 p-2 ml-8`} style={{maxWidth: '21rem'}}>
|
|
||||||
<header className="text-base sm:text-lg">Customize Badge</header>
|
|
||||||
<hr className="border-gray-500"/>
|
|
||||||
<div className="text-sm sm:text-lg flex flex-col mt-2 ml-0 md:ml-4">
|
|
||||||
<label htmlFor="badge-style">Style:
|
|
||||||
<select
|
|
||||||
id="badge-style"
|
|
||||||
onChange={(e) => onBadgeUpdate('badgeStyle', e.target.value)}
|
|
||||||
value = {badgeOptions.badgeStyle}
|
|
||||||
>
|
|
||||||
<option value="flat">Flat</option>
|
|
||||||
<option value="flat-square">Flat Square</option>
|
|
||||||
<option value="plastic">Plastic</option>
|
|
||||||
</select>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<label htmlFor="badge-color">Color:
|
|
||||||
<input
|
|
||||||
type="color"
|
|
||||||
id="badge-color"
|
|
||||||
defaultValue={`#${badgeOptions.badgeColor}`}
|
|
||||||
className="w-6"
|
|
||||||
onChange={(e) => onBadgeUpdate('badgeColor', e.target.value.replace('#', ''))}
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<label htmlFor="badge-label-text">Label Text:
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
id="badge-label-text"
|
|
||||||
placeholder="Profile views"
|
|
||||||
className="w-2/4 bg-gray-300 pl-2"
|
|
||||||
onChange={(e) => onBadgeUpdate('badgeLabel', e.target.value.trim())}
|
|
||||||
defaultValue={badgeOptions.badgeLabel}
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<span className="mt-2 flex items-center">
|
|
||||||
Preview:
|
|
||||||
{
|
|
||||||
isGitHubUsernameValid(githubName)?
|
|
||||||
<img
|
|
||||||
src={`https://komarev.com/ghpvc/`
|
|
||||||
+ `?username=${githubName}`
|
|
||||||
+ `&label=${encodeURI(badgeOptions.badgeLabel)}`
|
|
||||||
+ `&color=${badgeOptions.badgeColor}`
|
|
||||||
+ `&style=${badgeOptions.badgeStyle}`
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
: <span className="text-xxs md:text-sm text-red-600">Invalid GitHub username</span>
|
|
||||||
}
|
|
||||||
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const Addons = props => {
|
|
||||||
const [customizeBadgeOpen, setCustomizeOpen] = useState(false);
|
|
||||||
const [debounce, setDebounce] = useState(undefined);
|
|
||||||
const [badgeOptions, setBadgeOptions] = useState({
|
|
||||||
badgeStyle: props.data.badgeStyle,
|
|
||||||
badgeColor: props.data.badgeColor,
|
|
||||||
badgeLabel: props.data.badgeLabel
|
|
||||||
});
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setBadgeOptions({
|
|
||||||
badgeStyle: props.data.badgeStyle,
|
|
||||||
badgeColor: props.data.badgeColor,
|
|
||||||
badgeLabel: props.data.badgeLabel
|
|
||||||
})
|
|
||||||
}, [props.data.badgeStyle, props.data.badgeColor, props.data.badgeLabel])
|
|
||||||
|
|
||||||
const blogPostPorkflow = () => {
|
|
||||||
let payload = {
|
|
||||||
dev: {
|
|
||||||
show: props.data.devDynamicBlogs,
|
|
||||||
username: props.social.dev,
|
|
||||||
},
|
|
||||||
medium: {
|
|
||||||
show: props.data.mediumDynamicBlogs,
|
|
||||||
username: props.social.medium,
|
|
||||||
},
|
|
||||||
rssurl: {
|
|
||||||
show: props.data.rssDynamicBlogs,
|
|
||||||
username: props.social.rssurl,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
var actionContent = latestBlogs(payload)
|
|
||||||
var tempElement = document.createElement("a")
|
|
||||||
tempElement.setAttribute(
|
|
||||||
"href",
|
|
||||||
"data:text/yaml;charset=utf-8," + encodeURIComponent(actionContent)
|
|
||||||
)
|
|
||||||
tempElement.setAttribute("download", "blog-post-workflow.yml")
|
|
||||||
tempElement.style.display = "none"
|
|
||||||
document.body.appendChild(tempElement)
|
|
||||||
tempElement.click()
|
|
||||||
document.body.removeChild(tempElement)
|
|
||||||
}
|
|
||||||
|
|
||||||
const onCustomizeClick = () => {
|
|
||||||
setCustomizeOpen(!customizeBadgeOpen);
|
|
||||||
}
|
|
||||||
|
|
||||||
const onBadgeUpdate = (option, value) => {
|
|
||||||
const callback = () => {
|
|
||||||
let newVal = (option==='badgeLabel' && value==='')?'Profile views':value;
|
|
||||||
setBadgeOptions({...badgeOptions, [option]: newVal});
|
|
||||||
props.handleDataChange(option, {target: {value: newVal}})
|
|
||||||
}
|
|
||||||
clearTimeout(debounce);
|
|
||||||
setDebounce(setTimeout(callback, 300));
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
<div className="flex justify-center items-start flex-col w-full px-2 sm:px-6 mb-10">
|
|
||||||
<div className="text-xl sm:text-2xl font-bold font-title mt-2 mb-2">
|
|
||||||
Add-ons
|
|
||||||
</div>
|
|
||||||
<AddonsItem
|
|
||||||
inputId="visitors-count"
|
|
||||||
inputChecked={props.data.visitorsBadge}
|
|
||||||
onInputChange={() => props.handleCheckChange("visitorsBadge")}
|
|
||||||
Icon={ customizeBadgeOpen ? XCircleIcon : ToolsIcon }
|
|
||||||
onIconClick={onCustomizeClick}
|
|
||||||
>
|
|
||||||
display visitors count badge
|
|
||||||
</AddonsItem>
|
|
||||||
{
|
|
||||||
customizeBadgeOpen?
|
|
||||||
<CustomizeBadge
|
|
||||||
githubName={props.social.github}
|
|
||||||
badgeOptions={badgeOptions}
|
|
||||||
onBadgeUpdate={onBadgeUpdate}
|
|
||||||
/>
|
|
||||||
: ''
|
|
||||||
}
|
|
||||||
<AddonsItem
|
|
||||||
inputId="github-profile-trophy"
|
|
||||||
inputChecked={props.data.githubProfileTrophy}
|
|
||||||
onInputChange={() => props.handleCheckChange("githubProfileTrophy")}
|
|
||||||
>
|
|
||||||
display github trophy
|
|
||||||
</AddonsItem>
|
|
||||||
<AddonsItem
|
|
||||||
inputId="github-stats"
|
|
||||||
inputChecked={props.data.githubStats}
|
|
||||||
onInputChange={() => props.handleCheckChange("githubStats")}
|
|
||||||
>
|
|
||||||
display github profile stats card
|
|
||||||
</AddonsItem>
|
|
||||||
<AddonsItem
|
|
||||||
inputId="top-languages"
|
|
||||||
inputChecked={props.data.topLanguages}
|
|
||||||
onInputChange={() => props.handleCheckChange("topLanguages")}
|
|
||||||
>
|
|
||||||
display top skills
|
|
||||||
</AddonsItem>
|
|
||||||
<AddonsItem
|
|
||||||
inputId="twitter-badge"
|
|
||||||
inputChecked={props.data.twitterBadge}
|
|
||||||
onInputChange={() => props.handleCheckChange("twitterBadge")}
|
|
||||||
>
|
|
||||||
display twitter badge
|
|
||||||
</AddonsItem>
|
|
||||||
<AddonsItem
|
|
||||||
inputId="dev-dynamic-blogs"
|
|
||||||
inputChecked={props.data.devDynamicBlogs}
|
|
||||||
onInputChange={() => props.handleCheckChange("devDynamicBlogs")}
|
|
||||||
>
|
|
||||||
display latest dev.to blogs dynamically (GitHub Action)
|
|
||||||
</AddonsItem>
|
|
||||||
<AddonsItem
|
|
||||||
inputId="medium-dynamic-blogs"
|
|
||||||
inputChecked={props.data.mediumDynamicBlogs}
|
|
||||||
onInputChange={() => props.handleCheckChange("mediumDynamicBlogs")}
|
|
||||||
>
|
|
||||||
display latest medium blogs dynamically (GitHub Action)
|
|
||||||
</AddonsItem>
|
|
||||||
<AddonsItem
|
|
||||||
inputId="rss-dynamic-blogs"
|
|
||||||
inputChecked={props.data.rssDynamicBlogs}
|
|
||||||
onInputChange={() => props.handleCheckChange("rssDynamicBlogs")}
|
|
||||||
>
|
|
||||||
display latest blogs from your personal blog dynamically (GitHub Action)
|
|
||||||
</AddonsItem>
|
|
||||||
|
|
||||||
{(props.data.devDynamicBlogs && props.social.dev) ||
|
|
||||||
(props.data.rssDynamicBlogs && props.social.rssurl) ||
|
|
||||||
(props.data.mediumDynamicBlogs &&
|
|
||||||
props.social.medium &&
|
|
||||||
isMediumUsernameValid(props.social.medium)) ? (
|
|
||||||
<div className="workflow">
|
|
||||||
<div>
|
|
||||||
download
|
|
||||||
<span
|
|
||||||
onClick={blogPostPorkflow}
|
|
||||||
onKeyDown={(e) => e.keyCode === 13 && blogPostPorkflow()}
|
|
||||||
role="button"
|
|
||||||
tabIndex="0"
|
|
||||||
style={{ cursor: "pointer", color: "#002ead" }}
|
|
||||||
>
|
|
||||||
{" "}
|
|
||||||
blog-post-workflow.yml
|
|
||||||
</span>{" "}
|
|
||||||
file(learn
|
|
||||||
<a
|
|
||||||
href={withPrefix(links.addons)}
|
|
||||||
target="blank"
|
|
||||||
style={{ color: "#002ead" }}
|
|
||||||
>
|
|
||||||
{" "}
|
|
||||||
how to setup
|
|
||||||
</a>
|
|
||||||
)
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Addons
|
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { useEffect } from 'react';
|
||||||
|
import { GoogleAnalytics } from '@next/third-parties/google';
|
||||||
|
import { useConsent } from '@/hooks/use-consent';
|
||||||
|
import { initializeAnalytics } from '@/lib/analytics';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Conditionally loads Google Analytics based on user consent
|
||||||
|
*/
|
||||||
|
export function ConditionalAnalytics() {
|
||||||
|
const { status } = useConsent();
|
||||||
|
const gaId = process.env.NEXT_PUBLIC_GA_ID;
|
||||||
|
|
||||||
|
// Initialize analytics when consent is accepted
|
||||||
|
useEffect(() => {
|
||||||
|
if (status === 'accepted' && gaId) {
|
||||||
|
// Small delay to ensure GA4 is loaded
|
||||||
|
const timer = setTimeout(() => {
|
||||||
|
initializeAnalytics();
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
return () => clearTimeout(timer);
|
||||||
|
}
|
||||||
|
}, [status, gaId]);
|
||||||
|
|
||||||
|
// Only render GoogleAnalytics if consent is accepted and GA ID exists
|
||||||
|
if (status !== 'accepted' || !gaId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return <GoogleAnalytics gaId={gaId} />;
|
||||||
|
}
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
import React from "react"
|
|
||||||
const Donate = () => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<div className="text-center text-4xl my-2">Support
|
|
||||||
<span role="img" aria-label="praying hand emoji">🙏</span>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col sm:flex-row items-start justify-between">
|
|
||||||
<div className="w-full sm:w-2/3">
|
|
||||||
<div className="text-2xl mb-2">
|
|
||||||
Are you using the tool and happy with it to create your GitHub
|
|
||||||
Profile?
|
|
||||||
</div>
|
|
||||||
<div className="text-lg">
|
|
||||||
Your kind support keeps open-source tools like this free for others.
|
|
||||||
</div>
|
|
||||||
<div className="mt-4">
|
|
||||||
<a
|
|
||||||
className="flex items-center justify-start w-20"
|
|
||||||
href="https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Frahuldkjain.github.io%2Fgithub-profile-readme-generator"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
className="w-20"
|
|
||||||
src="https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Frahuldkjain.github.io%2Fgithub-profile-readme-generator"
|
|
||||||
alt="tweet github profile readme generator"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
Let the world know how you feel using this tool. Share with others
|
|
||||||
on twitter.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="w-full sm:w-1/3 flex flex-col justify-center items-center">
|
|
||||||
<span>Tip<span role="img" aria-label="Dollar medal">💰</span></span>
|
|
||||||
{/* Ko-Fi */}
|
|
||||||
<a
|
|
||||||
href="https://ko-fi.com/A0A81XXSX"
|
|
||||||
className="flex items-center justify-evenly bg-red-500 text-white py-2 px-4 my-2"
|
|
||||||
target="_blank"
|
|
||||||
rel="noreferrer"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
className="w-6 h-6 mr-2"
|
|
||||||
src="https://www.vectorlogo.zone/logos/ko-fi/ko-fi-icon.svg"
|
|
||||||
alt="Buy ko-fi for rahuldkjain"
|
|
||||||
/>
|
|
||||||
Buy me a ko-fi
|
|
||||||
</a>
|
|
||||||
{/* Paypal */}
|
|
||||||
<a
|
|
||||||
href="https://www.paypal.me/rahuldkjain/10"
|
|
||||||
className="flex items-center justify-evenly bg-blue-500 text-white py-2 px-4 my-2"
|
|
||||||
target="_blank"
|
|
||||||
rel="noreferrer"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
className="w-6 h-6 mr-2"
|
|
||||||
src="https://cdn.worldvectorlogo.com/logos/paypal-icon.svg"
|
|
||||||
alt="Donate rahuldkjain via paypal"
|
|
||||||
/>
|
|
||||||
Paypal
|
|
||||||
</a>
|
|
||||||
{/* BuyMeACoffee */}
|
|
||||||
<a
|
|
||||||
href="https://www.buymeacoffee.com/rahuldkjain"
|
|
||||||
className="flex items-center justify-evenly bg-orange-500 text-white py-2 px-4 my-2"
|
|
||||||
target="_blank"
|
|
||||||
rel="noreferrer"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
className="w-6 h-6 mr-2"
|
|
||||||
src="https://www.vectorlogo.zone/logos/buymeacoffee/buymeacoffee-icon.svg"
|
|
||||||
alt="Buy rahuldkjain A Coffee"
|
|
||||||
/>
|
|
||||||
Buy me a coffee
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Donate
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
import React from "react"
|
|
||||||
import links from "../constants/page-links"
|
|
||||||
import logo from "../images/mdg.png"
|
|
||||||
import discord from "../images/Discord-Logo.png"
|
|
||||||
import { Link } from "gatsby"
|
|
||||||
const Footer = () => {
|
|
||||||
return (
|
|
||||||
<div className="bg-gray-100 p-4 flex flex-col justify-center items-center shadow-inner mt-2">
|
|
||||||
<div className="w-full flex justify-evenly py-2">
|
|
||||||
<div className="mr-6">
|
|
||||||
<h1 className="text-base font-bold font-title sm:text-2xl flex-col items-end">
|
|
||||||
<img
|
|
||||||
src={logo}
|
|
||||||
className="h-24"
|
|
||||||
alt="github profile markdown generator logo"
|
|
||||||
/>
|
|
||||||
GitHub Profile README Generator
|
|
||||||
</h1>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div className="mb-2 font-bold font-medium font-title">
|
|
||||||
<strong>Pages</strong>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<Link to={links.addons} activeStyle={{ color: "#002ead" }}>
|
|
||||||
Addons
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<Link to={links.support} activeStyle={{ color: "#002ead" }}>
|
|
||||||
Support
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<Link to={links.about} activeStyle={{ color: "#002ead" }}>
|
|
||||||
About
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div className="mb-2 font-bold font-medium font-title">
|
|
||||||
<strong>More</strong>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<a
|
|
||||||
href="https://github.com/rahuldkjain/github-profile-readme-generator"
|
|
||||||
aria-label="Github rahuldkjain/github-profile-readme-generator"
|
|
||||||
target="blank"
|
|
||||||
>
|
|
||||||
Github
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<a
|
|
||||||
href="https://github.com/rahuldkjain/github-profile-readme-generator/releases"
|
|
||||||
aria-label="Releases on Github rahuldkjain/github-profile-readme-generator"
|
|
||||||
target="blank"
|
|
||||||
>
|
|
||||||
Releases
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div className="mb-2 font-bold font-medium font-title">
|
|
||||||
<strong>Community</strong>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<a
|
|
||||||
href="https://discord.gg/HHMs7Eg"
|
|
||||||
aria-label="Discord of the community"
|
|
||||||
target="blank"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
src={discord}
|
|
||||||
className="h-12"
|
|
||||||
alt="Discord of the community"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="py-2 mt-2">
|
|
||||||
Developed in India{" "}
|
|
||||||
<span role="img" aria-label="india">
|
|
||||||
{" "}
|
|
||||||
🇮🇳
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
export default Footer
|
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
import { render, screen } from '@testing-library/react';
|
||||||
|
import userEvent from '@testing-library/user-event';
|
||||||
|
import { describe, it, expect, vi } from 'vitest';
|
||||||
|
import { FormInput } from '../form-input';
|
||||||
|
|
||||||
|
describe('FormInput', () => {
|
||||||
|
it('renders basic input with label', () => {
|
||||||
|
render(<FormInput id="test-input" label="Test Label" />);
|
||||||
|
|
||||||
|
expect(screen.getByLabelText('Test Label')).toBeInTheDocument();
|
||||||
|
expect(screen.getByRole('textbox')).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders without label when not provided', () => {
|
||||||
|
render(<FormInput id="test-input" placeholder="Enter text" />);
|
||||||
|
|
||||||
|
expect(screen.getByPlaceholderText('Enter text')).toBeInTheDocument();
|
||||||
|
expect(screen.queryByRole('label')).not.toBeInTheDocument();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('shows required asterisk when required prop is true', () => {
|
||||||
|
render(<FormInput id="test-input" label="Required Field" required />);
|
||||||
|
|
||||||
|
expect(screen.getByText('*')).toBeInTheDocument();
|
||||||
|
expect(screen.getByText('*')).toHaveClass('text-destructive');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('displays error message when error prop is provided', () => {
|
||||||
|
const errorMessage = 'This field is required';
|
||||||
|
render(<FormInput id="test-input" label="Test Field" error={errorMessage} />);
|
||||||
|
|
||||||
|
const errorElement = screen.getByRole('alert');
|
||||||
|
expect(errorElement).toBeInTheDocument();
|
||||||
|
expect(errorElement).toHaveTextContent(errorMessage);
|
||||||
|
expect(errorElement).toHaveClass('text-destructive');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('displays helper text when provided and no error', () => {
|
||||||
|
const helperText = 'This is helpful information';
|
||||||
|
render(<FormInput id="test-input" label="Test Field" helperText={helperText} />);
|
||||||
|
|
||||||
|
expect(screen.getByText(helperText)).toBeInTheDocument();
|
||||||
|
expect(screen.getByText(helperText)).toHaveClass('text-muted-foreground');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('hides helper text when error is present', () => {
|
||||||
|
const helperText = 'This is helpful information';
|
||||||
|
const errorMessage = 'Error occurred';
|
||||||
|
|
||||||
|
render(
|
||||||
|
<FormInput id="test-input" label="Test Field" helperText={helperText} error={errorMessage} />
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(screen.getByText(errorMessage)).toBeInTheDocument();
|
||||||
|
expect(screen.queryByText(helperText)).not.toBeInTheDocument();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('applies error styling when error is present', () => {
|
||||||
|
render(<FormInput id="test-input" label="Test Field" error="Error message" />);
|
||||||
|
|
||||||
|
const input = screen.getByRole('textbox');
|
||||||
|
expect(input).toHaveClass('border-destructive', 'focus:ring-destructive');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('applies custom className', () => {
|
||||||
|
const customClass = 'custom-input-class';
|
||||||
|
render(<FormInput id="test-input" className={customClass} />);
|
||||||
|
|
||||||
|
const input = screen.getByRole('textbox');
|
||||||
|
expect(input).toHaveClass(customClass);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('forwards ref correctly', () => {
|
||||||
|
const ref = vi.fn();
|
||||||
|
render(<FormInput ref={ref} id="test-input" />);
|
||||||
|
|
||||||
|
expect(ref).toHaveBeenCalledWith(expect.any(HTMLInputElement));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('handles user input correctly', async () => {
|
||||||
|
const user = userEvent.setup();
|
||||||
|
const handleChange = vi.fn();
|
||||||
|
|
||||||
|
render(<FormInput id="test-input" onChange={handleChange} />);
|
||||||
|
|
||||||
|
const input = screen.getByRole('textbox');
|
||||||
|
await user.type(input, 'Hello World');
|
||||||
|
|
||||||
|
expect(input).toHaveValue('Hello World');
|
||||||
|
expect(handleChange).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('passes through all HTML input attributes', () => {
|
||||||
|
render(
|
||||||
|
<FormInput
|
||||||
|
id="test-input"
|
||||||
|
type="email"
|
||||||
|
placeholder="Enter email"
|
||||||
|
disabled
|
||||||
|
maxLength={50}
|
||||||
|
data-testid="email-input"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
const input = screen.getByTestId('email-input');
|
||||||
|
expect(input).toHaveAttribute('type', 'email');
|
||||||
|
expect(input).toHaveAttribute('placeholder', 'Enter email');
|
||||||
|
expect(input).toBeDisabled();
|
||||||
|
expect(input).toHaveAttribute('maxLength', '50');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('associates label with input using htmlFor and id', () => {
|
||||||
|
render(<FormInput id="test-input" label="Test Label" />);
|
||||||
|
|
||||||
|
const label = screen.getByText('Test Label');
|
||||||
|
const input = screen.getByRole('textbox');
|
||||||
|
|
||||||
|
expect(label).toHaveAttribute('for', 'test-input');
|
||||||
|
expect(input).toHaveAttribute('id', 'test-input');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('has proper accessibility attributes for error state', () => {
|
||||||
|
render(<FormInput id="test-input" label="Test Field" error="Error message" />);
|
||||||
|
|
||||||
|
const errorElement = screen.getByRole('alert');
|
||||||
|
expect(errorElement).toHaveAttribute('role', 'alert');
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { forwardRef } from 'react';
|
||||||
|
import type { InputHTMLAttributes } from 'react';
|
||||||
|
|
||||||
|
export interface FormCheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
||||||
|
label?: string;
|
||||||
|
error?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const FormCheckbox = forwardRef<HTMLInputElement, FormCheckboxProps>(
|
||||||
|
({ label, error, className = '', ...props }, ref) => {
|
||||||
|
return (
|
||||||
|
<div className="w-full space-y-1">
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<input
|
||||||
|
ref={ref}
|
||||||
|
type="checkbox"
|
||||||
|
className={`border-input bg-background text-primary focus:ring-ring h-4 w-4 rounded transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 ${
|
||||||
|
error ? 'border-destructive' : ''
|
||||||
|
} ${className}`}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
{label && (
|
||||||
|
<label htmlFor={props.id} className="text-foreground text-sm font-medium">
|
||||||
|
{label}
|
||||||
|
</label>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{error && (
|
||||||
|
<p className="text-destructive text-sm" role="alert">
|
||||||
|
{error}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
FormCheckbox.displayName = 'FormCheckbox';
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { forwardRef } from 'react';
|
||||||
|
import type { InputHTMLAttributes } from 'react';
|
||||||
|
|
||||||
|
export interface FormInputProps extends InputHTMLAttributes<HTMLInputElement> {
|
||||||
|
label?: string;
|
||||||
|
error?: string;
|
||||||
|
helperText?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const FormInput = forwardRef<HTMLInputElement, FormInputProps>(
|
||||||
|
({ label, error, helperText, className = '', ...props }, ref) => {
|
||||||
|
return (
|
||||||
|
<div className="w-full space-y-2">
|
||||||
|
{label && (
|
||||||
|
<label htmlFor={props.id} className="text-foreground block text-sm font-medium">
|
||||||
|
{label}
|
||||||
|
{props.required && <span className="text-destructive ml-1">*</span>}
|
||||||
|
</label>
|
||||||
|
)}
|
||||||
|
<input
|
||||||
|
ref={ref}
|
||||||
|
className={`border-input bg-background text-foreground placeholder:text-muted-foreground focus:ring-ring w-full rounded-lg border px-4 py-2 transition-colors focus:ring-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 ${
|
||||||
|
error ? 'border-destructive focus:ring-destructive' : ''
|
||||||
|
} ${className}`}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
{error && (
|
||||||
|
<p className="text-destructive text-sm" role="alert">
|
||||||
|
{error}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
{helperText && !error && <p className="text-muted-foreground text-sm">{helperText}</p>}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
FormInput.displayName = 'FormInput';
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { forwardRef } from 'react';
|
||||||
|
import { Select, type SelectOption } from '@/components/ui/select';
|
||||||
|
|
||||||
|
export interface FormSelectProps {
|
||||||
|
label?: string;
|
||||||
|
error?: string;
|
||||||
|
helperText?: string;
|
||||||
|
placeholder?: string;
|
||||||
|
options: SelectOption[];
|
||||||
|
value?: string;
|
||||||
|
onChange?: (value: string) => void;
|
||||||
|
disabled?: boolean;
|
||||||
|
required?: boolean;
|
||||||
|
id?: string;
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const FormSelect = forwardRef<HTMLButtonElement, FormSelectProps>((props, ref) => {
|
||||||
|
return <Select ref={ref} {...props} />;
|
||||||
|
});
|
||||||
|
|
||||||
|
FormSelect.displayName = 'FormSelect';
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { forwardRef } from 'react';
|
||||||
|
import type { TextareaHTMLAttributes } from 'react';
|
||||||
|
|
||||||
|
export interface FormTextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
||||||
|
label?: string;
|
||||||
|
error?: string;
|
||||||
|
helperText?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const FormTextarea = forwardRef<HTMLTextAreaElement, FormTextareaProps>(
|
||||||
|
({ label, error, helperText, className = '', ...props }, ref) => {
|
||||||
|
return (
|
||||||
|
<div className="w-full space-y-2">
|
||||||
|
{label && (
|
||||||
|
<label htmlFor={props.id} className="text-foreground block text-sm font-medium">
|
||||||
|
{label}
|
||||||
|
{props.required && <span className="text-destructive ml-1">*</span>}
|
||||||
|
</label>
|
||||||
|
)}
|
||||||
|
<textarea
|
||||||
|
ref={ref}
|
||||||
|
className={`border-input bg-background text-foreground placeholder:text-muted-foreground focus:ring-ring w-full rounded-lg border px-4 py-2 transition-colors focus:ring-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 ${
|
||||||
|
error ? 'border-destructive focus:ring-destructive' : ''
|
||||||
|
} ${className}`}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
{error && (
|
||||||
|
<p className="text-destructive text-sm" role="alert">
|
||||||
|
{error}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
{helperText && !error && <p className="text-muted-foreground text-sm">{helperText}</p>}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
FormTextarea.displayName = 'FormTextarea';
|
||||||
@@ -0,0 +1,138 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { forwardRef } from 'react';
|
||||||
|
import {
|
||||||
|
fetchGitHubUser,
|
||||||
|
mapLanguageToSkills,
|
||||||
|
generateSmartSubtitle,
|
||||||
|
type GitHubApiError,
|
||||||
|
} from '@/lib/github-api';
|
||||||
|
import { useErrorToast, useToast } from '@/components/ui/toast';
|
||||||
|
import { trackGitHubAutofill } from '@/lib/analytics';
|
||||||
|
import type { ProfileFormData, LinksFormData, SocialFormData } from '@/lib/validations';
|
||||||
|
|
||||||
|
interface GitHubUsernameInputProps {
|
||||||
|
value: string;
|
||||||
|
name?: string;
|
||||||
|
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
||||||
|
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
||||||
|
onDataFetched?: (data: {
|
||||||
|
profile: Partial<ProfileFormData>;
|
||||||
|
links: Partial<LinksFormData>;
|
||||||
|
social: Partial<SocialFormData>;
|
||||||
|
skills: string[];
|
||||||
|
}) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const GitHubUsernameInput = forwardRef<HTMLInputElement, GitHubUsernameInputProps>(
|
||||||
|
function GitHubUsernameInput({ value, name, onChange, onBlur, onDataFetched }, ref) {
|
||||||
|
const errorToast = useErrorToast();
|
||||||
|
const { promise } = useToast();
|
||||||
|
|
||||||
|
const handleFetch = async () => {
|
||||||
|
if (!value.trim()) {
|
||||||
|
errorToast('Please enter a GitHub username');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Track GitHub auto-fill usage
|
||||||
|
trackGitHubAutofill(value.trim());
|
||||||
|
|
||||||
|
try {
|
||||||
|
const userData = await promise(fetchGitHubUser(value.trim()), {
|
||||||
|
loading: `Fetching data for ${value.trim()}...`,
|
||||||
|
success: (data) => `Successfully loaded ${data?.name || value.trim()}'s profile!`,
|
||||||
|
error: (error: GitHubApiError) => error.message,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!userData) {
|
||||||
|
errorToast('Unable to fetch user data', 'Please check the username and try again.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Map GitHub data to form data
|
||||||
|
const suggestedSkills: string[] = [];
|
||||||
|
userData.topLanguages.forEach((lang) => {
|
||||||
|
suggestedSkills.push(...mapLanguageToSkills(lang));
|
||||||
|
});
|
||||||
|
|
||||||
|
if (onDataFetched) {
|
||||||
|
onDataFetched({
|
||||||
|
profile: {
|
||||||
|
title: userData.name,
|
||||||
|
subtitle: generateSmartSubtitle(userData),
|
||||||
|
},
|
||||||
|
links: {
|
||||||
|
blog: userData.blog,
|
||||||
|
},
|
||||||
|
social: {
|
||||||
|
github: userData.username,
|
||||||
|
twitter: userData.twitter,
|
||||||
|
},
|
||||||
|
skills: [...new Set(suggestedSkills)], // Remove duplicates
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
const apiError = error as GitHubApiError;
|
||||||
|
|
||||||
|
// Handle rate limit errors with retry action
|
||||||
|
if (apiError.type === 'rate_limit') {
|
||||||
|
errorToast(
|
||||||
|
'GitHub API Rate Limit Exceeded',
|
||||||
|
apiError.message,
|
||||||
|
apiError.retryAfter
|
||||||
|
? {
|
||||||
|
label: `Retry in ${apiError.retryAfter}m`,
|
||||||
|
onClick: () => {
|
||||||
|
setTimeout(() => handleFetch(), apiError.retryAfter! * 60 * 1000);
|
||||||
|
},
|
||||||
|
}
|
||||||
|
: undefined
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// For other errors, show retry action
|
||||||
|
errorToast('Failed to fetch GitHub data', apiError.message, {
|
||||||
|
label: 'Retry',
|
||||||
|
onClick: handleFetch,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="space-y-3">
|
||||||
|
{/* Mobile: Stack vertically, Desktop: Side by side */}
|
||||||
|
<div className="flex flex-col gap-2 sm:flex-row">
|
||||||
|
<input
|
||||||
|
ref={ref}
|
||||||
|
type="text"
|
||||||
|
name={name}
|
||||||
|
value={value}
|
||||||
|
onChange={onChange}
|
||||||
|
onBlur={onBlur}
|
||||||
|
placeholder="Enter GitHub username"
|
||||||
|
className="border-border bg-input focus:border-ring focus:ring-ring w-full rounded-lg border px-3 py-2 text-sm focus:ring-2 focus:outline-none sm:flex-1"
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
e.preventDefault();
|
||||||
|
handleFetch();
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
onClick={handleFetch}
|
||||||
|
className="bg-primary text-primary-foreground hover:bg-primary/90 w-full rounded-lg px-4 py-2 text-sm font-medium transition-colors sm:w-auto sm:whitespace-nowrap"
|
||||||
|
aria-label="Auto-fill from GitHub profile"
|
||||||
|
>
|
||||||
|
✨ Auto-fill
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p className="text-muted-foreground text-xs">
|
||||||
|
Enter your GitHub username and click "Auto-fill" to populate fields with your profile data
|
||||||
|
and suggest relevant skills.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
@@ -1,93 +0,0 @@
|
|||||||
import React, { useEffect, useState } from "react"
|
|
||||||
import { StarIcon, RepoForkedIcon } from "@primer/octicons-react"
|
|
||||||
import logo from "../images/mdg.png"
|
|
||||||
import links from "../constants/page-links"
|
|
||||||
import gsap from "gsap"
|
|
||||||
import axios from "axios"
|
|
||||||
import { Link } from "gatsby"
|
|
||||||
|
|
||||||
const Header = props => {
|
|
||||||
const fetchData = async () => {
|
|
||||||
var response = await axios.get(
|
|
||||||
"https://api.github.com/repos/rahuldkjain/github-profile-readme-generator"
|
|
||||||
)
|
|
||||||
|
|
||||||
const { stargazers_count, forks_count } = response.data
|
|
||||||
|
|
||||||
setstats({
|
|
||||||
starsCount: stargazers_count,
|
|
||||||
forksCount: forks_count,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const [stats, setstats] = useState({
|
|
||||||
starsCount: 0,
|
|
||||||
forksCount: 0,
|
|
||||||
})
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
fetchData()
|
|
||||||
setInterval(fetchData, 60000)
|
|
||||||
|
|
||||||
gsap.set(".star, .fork", {
|
|
||||||
transformOrigin: "center",
|
|
||||||
})
|
|
||||||
gsap.to(".star, .fork", {
|
|
||||||
rotateZ: "360",
|
|
||||||
duration: 2,
|
|
||||||
ease: "elastic.inOut",
|
|
||||||
repeat: -1,
|
|
||||||
yoyo: true,
|
|
||||||
})
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="shadow flex items-center justify-center flex-col mb-2 py-2">
|
|
||||||
<Link to={links.home}>
|
|
||||||
<h1 className="text-base font-bold font-title sm:text-2xl font-medium text-blue-800 flex justify-center items-center flex-col">
|
|
||||||
<img
|
|
||||||
src={logo}
|
|
||||||
className="w-12 h-12"
|
|
||||||
alt="github profile markdown generator logo"
|
|
||||||
/>
|
|
||||||
<div>{props.heading}</div>
|
|
||||||
</h1>
|
|
||||||
</Link>
|
|
||||||
<div className="flex justify-center items-center">
|
|
||||||
<a
|
|
||||||
href="https://github.com/rahuldkjain/github-profile-readme-generator"
|
|
||||||
aria-label="Star rahuldkjain/github-profile-readme-generator on GitHub"
|
|
||||||
target="blank"
|
|
||||||
className="mr-2"
|
|
||||||
>
|
|
||||||
<div className="text-xxs sm:text-sm border-2 border-solid border-gray-900 bg-gray-100 flex items-center justify-center py-1 px-2">
|
|
||||||
<StarIcon size={16} id="star-icon" className="px-1 w-6 star" />
|
|
||||||
Star this repo
|
|
||||||
<span className="github-count px-1 sm:px-2">
|
|
||||||
{stats.starsCount}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
<a
|
|
||||||
href="https://github.com/rahuldkjain/github-profile-readme-generator/fork"
|
|
||||||
aria-label="Fork rahuldkjain/github-profile-readme-generator on GitHub"
|
|
||||||
target="blank"
|
|
||||||
>
|
|
||||||
<div className="text-xxs sm:text-sm border-2 border-solid border-gray-900 bg-gray-100 flex items-center justify-center py-1 px-2">
|
|
||||||
<RepoForkedIcon
|
|
||||||
size={16}
|
|
||||||
id="fork-icon"
|
|
||||||
className="px-1 w-6 fork"
|
|
||||||
/>
|
|
||||||
Fork on GitHub
|
|
||||||
<span className="github-count px-1 sm:px-2">
|
|
||||||
{stats.forksCount}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Header
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
import React from "react"
|
|
||||||
import Header from "./header"
|
|
||||||
import Footer from "./footer"
|
|
||||||
|
|
||||||
const Layout = ({ children }) => {
|
|
||||||
return (
|
|
||||||
<div className="flex flex-col min-h-screen">
|
|
||||||
<header>
|
|
||||||
<Header heading="GitHub Profile README Generator" />
|
|
||||||
</header>
|
|
||||||
<main className="flex-grow">{children}</main>
|
|
||||||
<footer>
|
|
||||||
<Footer />
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
export default Layout
|
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
import Link from 'next/link';
|
||||||
|
import Image from 'next/image';
|
||||||
|
import { getAssetPath } from '@/lib/asset-path';
|
||||||
|
|
||||||
|
export function Footer() {
|
||||||
|
return (
|
||||||
|
<footer className="border-border bg-card border-t py-8">
|
||||||
|
<div className="container mx-auto px-4">
|
||||||
|
{/* Logo Section */}
|
||||||
|
<div className="mb-8 flex items-center justify-center gap-3">
|
||||||
|
<Image
|
||||||
|
src={getAssetPath('/mdg.png')}
|
||||||
|
alt="GitHub Profile README Generator Logo"
|
||||||
|
width={48}
|
||||||
|
height={48}
|
||||||
|
className="h-12 w-12"
|
||||||
|
unoptimized
|
||||||
|
/>
|
||||||
|
<span className="text-xl font-bold">GitHub Profile README Generator</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="grid gap-8 md:grid-cols-4">
|
||||||
|
{/* About */}
|
||||||
|
<div>
|
||||||
|
<h3 className="mb-3 font-semibold">About</h3>
|
||||||
|
<p className="text-muted-foreground text-sm">
|
||||||
|
Create an awesome GitHub profile README with ease. Made with ❤️ for the developer
|
||||||
|
community.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Quick Links */}
|
||||||
|
<div>
|
||||||
|
<h3 className="mb-3 font-semibold">Quick Links</h3>
|
||||||
|
<ul className="space-y-2 text-sm">
|
||||||
|
<li>
|
||||||
|
<Link
|
||||||
|
href="/"
|
||||||
|
className="text-muted-foreground hover:text-primary transition-colors"
|
||||||
|
>
|
||||||
|
Generator
|
||||||
|
</Link>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<Link
|
||||||
|
href="/addons"
|
||||||
|
className="text-muted-foreground hover:text-primary transition-colors"
|
||||||
|
>
|
||||||
|
Addons
|
||||||
|
</Link>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<Link
|
||||||
|
href="/about"
|
||||||
|
className="text-muted-foreground hover:text-primary transition-colors"
|
||||||
|
>
|
||||||
|
About
|
||||||
|
</Link>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<Link
|
||||||
|
href="/support"
|
||||||
|
className="text-muted-foreground hover:text-primary transition-colors"
|
||||||
|
>
|
||||||
|
Support
|
||||||
|
</Link>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Resources */}
|
||||||
|
<div>
|
||||||
|
<h3 className="mb-3 font-semibold">Resources</h3>
|
||||||
|
<ul className="space-y-2 text-sm">
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href="https://github.com/rahuldkjain/github-profile-readme-generator"
|
||||||
|
className="text-muted-foreground hover:text-primary transition-colors"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
GitHub Repository
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href="https://github.com/rahuldkjain/github-profile-readme-generator/issues"
|
||||||
|
className="text-muted-foreground hover:text-primary transition-colors"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
Report Issues
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href="https://github.com/rahuldkjain/github-profile-readme-generator/blob/master/LICENSE"
|
||||||
|
className="text-muted-foreground hover:text-primary transition-colors"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
License
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Connect */}
|
||||||
|
<div>
|
||||||
|
<h3 className="mb-3 font-semibold">Connect</h3>
|
||||||
|
<ul className="space-y-2 text-sm">
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href="https://github.com/rahuldkjain"
|
||||||
|
className="text-muted-foreground hover:text-primary transition-colors"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
GitHub
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href="https://twitter.com/rahuldkjain"
|
||||||
|
className="text-muted-foreground hover:text-primary transition-colors"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
Twitter
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href="https://linkedin.com/in/rahuldkjain"
|
||||||
|
className="text-muted-foreground hover:text-primary transition-colors"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
LinkedIn
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="text-muted-foreground border-border mt-8 border-t pt-6 text-center text-sm">
|
||||||
|
<p>
|
||||||
|
© {new Date().getFullYear()} GitHub Profile README Generator. Made with ❤️ by{' '}
|
||||||
|
<a
|
||||||
|
href="https://github.com/rahuldkjain"
|
||||||
|
className="text-primary font-medium hover:underline"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
Rahul Jain
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
<p className="mt-2">
|
||||||
|
Open source under the{' '}
|
||||||
|
<a
|
||||||
|
href="https://github.com/rahuldkjain/github-profile-readme-generator/blob/master/LICENSE"
|
||||||
|
className="text-primary hover:underline"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
Apache License 2.0
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,111 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import Link from 'next/link';
|
||||||
|
import Image from 'next/image';
|
||||||
|
import { usePathname } from 'next/navigation';
|
||||||
|
import { ThemeToggle } from '@/components/ui/theme-toggle';
|
||||||
|
import { AccessibilityMenu } from '@/components/ui/accessibility-menu';
|
||||||
|
import { GitHubStats } from '@/components/ui/github-stats';
|
||||||
|
import { getAssetPath } from '@/lib/asset-path';
|
||||||
|
|
||||||
|
const navigation = [
|
||||||
|
{ name: 'Generator', href: '/' },
|
||||||
|
{ name: 'Addons', href: '/addons' },
|
||||||
|
{ name: 'About', href: '/about' },
|
||||||
|
{ name: 'Support', href: '/support' },
|
||||||
|
];
|
||||||
|
|
||||||
|
interface HeaderProps {
|
||||||
|
saveStatus?: 'idle' | 'saving' | 'saved';
|
||||||
|
lastSaved?: Date | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function Header({}: HeaderProps = {}) {
|
||||||
|
const pathname = usePathname();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<header className="border-border bg-card sticky top-0 z-50 border-b">
|
||||||
|
<div className="container mx-auto px-4 py-4">
|
||||||
|
<div className="flex items-center justify-between gap-4">
|
||||||
|
{/* Logo, Title, and GitHub Stats */}
|
||||||
|
<div className="flex items-center gap-4">
|
||||||
|
<Link href="/" prefetch={true} className="flex items-center gap-3 hover:opacity-80">
|
||||||
|
<Image
|
||||||
|
src={getAssetPath('/mdg.png')}
|
||||||
|
alt="GitHub Profile README Generator Logo"
|
||||||
|
width={40}
|
||||||
|
height={40}
|
||||||
|
className="h-10 w-10"
|
||||||
|
priority
|
||||||
|
unoptimized
|
||||||
|
/>
|
||||||
|
<span className="hidden text-xl font-bold sm:inline-block lg:text-2xl">
|
||||||
|
GitHub Profile README Generator
|
||||||
|
</span>
|
||||||
|
</Link>
|
||||||
|
<GitHubStats />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Right side content */}
|
||||||
|
<div className="flex items-center gap-3">
|
||||||
|
<nav className="hidden lg:block" aria-label="Main navigation">
|
||||||
|
<ul className="flex gap-4">
|
||||||
|
{navigation.map((item) => {
|
||||||
|
// Normalize paths for comparison (remove trailing slashes)
|
||||||
|
const normalizedPathname = pathname.replace(/\/$/, '') || '/';
|
||||||
|
const normalizedHref = item.href.replace(/\/$/, '') || '/';
|
||||||
|
const isActive = normalizedPathname === normalizedHref;
|
||||||
|
return (
|
||||||
|
<li key={item.name}>
|
||||||
|
<Link
|
||||||
|
href={item.href}
|
||||||
|
prefetch={true}
|
||||||
|
className={`hover:text-primary text-sm font-medium transition-colors ${
|
||||||
|
isActive ? 'text-primary font-semibold' : 'text-muted-foreground'
|
||||||
|
}`}
|
||||||
|
aria-current={isActive ? 'page' : undefined}
|
||||||
|
>
|
||||||
|
{item.name}
|
||||||
|
</Link>
|
||||||
|
</li>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<AccessibilityMenu />
|
||||||
|
<ThemeToggle />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Mobile Navigation */}
|
||||||
|
<nav className="mt-4 lg:hidden" aria-label="Mobile navigation">
|
||||||
|
<ul className="flex gap-4 overflow-x-auto">
|
||||||
|
{navigation.map((item) => {
|
||||||
|
// Normalize paths for comparison (remove trailing slashes)
|
||||||
|
const normalizedPathname = pathname.replace(/\/$/, '') || '/';
|
||||||
|
const normalizedHref = item.href.replace(/\/$/, '') || '/';
|
||||||
|
const isActive = normalizedPathname === normalizedHref;
|
||||||
|
return (
|
||||||
|
<li key={item.name}>
|
||||||
|
<Link
|
||||||
|
href={item.href}
|
||||||
|
prefetch={true}
|
||||||
|
className={`hover:text-primary text-sm font-medium whitespace-nowrap transition-colors ${
|
||||||
|
isActive ? 'text-primary font-semibold' : 'text-muted-foreground'
|
||||||
|
}`}
|
||||||
|
aria-current={isActive ? 'page' : undefined}
|
||||||
|
>
|
||||||
|
{item.name}
|
||||||
|
</Link>
|
||||||
|
</li>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
import { useTheme } from '@/hooks/use-theme';
|
||||||
|
import { useThemeStore } from '@/lib/store';
|
||||||
|
|
||||||
|
export function ThemeProvider({ children }: { children: React.ReactNode }) {
|
||||||
|
const [mounted, setMounted] = useState(false);
|
||||||
|
const { accessibility } = useThemeStore();
|
||||||
|
useTheme(); // Initialize theme
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setMounted(true);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// Apply accessibility settings to document
|
||||||
|
useEffect(() => {
|
||||||
|
if (!mounted) return;
|
||||||
|
|
||||||
|
const root = document.documentElement;
|
||||||
|
|
||||||
|
// High contrast mode
|
||||||
|
if (accessibility.highContrast) {
|
||||||
|
root.classList.add('high-contrast');
|
||||||
|
} else {
|
||||||
|
root.classList.remove('high-contrast');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Font size
|
||||||
|
root.classList.remove('text-small', 'text-large');
|
||||||
|
if (accessibility.fontSize === 'small') {
|
||||||
|
root.classList.add('text-small');
|
||||||
|
} else if (accessibility.fontSize === 'large') {
|
||||||
|
root.classList.add('text-large');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reduced motion (already handled by CSS)
|
||||||
|
if (accessibility.reducedMotion) {
|
||||||
|
root.style.setProperty('--motion-reduce', '1');
|
||||||
|
} else {
|
||||||
|
root.style.removeProperty('--motion-reduce');
|
||||||
|
}
|
||||||
|
}, [mounted, accessibility]);
|
||||||
|
|
||||||
|
// Prevent flash of unstyled content
|
||||||
|
if (!mounted) {
|
||||||
|
return <div style={{ visibility: 'hidden' }}>{children}</div>;
|
||||||
|
}
|
||||||
|
|
||||||
|
return <>{children}</>;
|
||||||
|
}
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
import React, { useRef, useEffect } from "react"
|
|
||||||
import gsap from "gsap"
|
|
||||||
const Loader = () => {
|
|
||||||
let arrow = useRef([])
|
|
||||||
useEffect(() => {
|
|
||||||
var tl = new gsap.timeline({ repeat: -1 })
|
|
||||||
tl.fromTo(
|
|
||||||
arrow.current,
|
|
||||||
{
|
|
||||||
y: 0,
|
|
||||||
color: "#3b3b4f",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
y: -50,
|
|
||||||
color: "#d0d0d5",
|
|
||||||
stagger: 0.1,
|
|
||||||
duration: 0.5,
|
|
||||||
ease: "Linear.easeNone",
|
|
||||||
}
|
|
||||||
)
|
|
||||||
tl.add("cp")
|
|
||||||
tl.fromTo(
|
|
||||||
arrow.current,
|
|
||||||
{
|
|
||||||
y: -50,
|
|
||||||
color: "#d0d0d5",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
y: 0,
|
|
||||||
color: "#3b3b4f",
|
|
||||||
stagger: 0.1,
|
|
||||||
duration: 0.5,
|
|
||||||
ease: "Linear.easeNone",
|
|
||||||
},
|
|
||||||
"cp-=0.3"
|
|
||||||
)
|
|
||||||
})
|
|
||||||
return (
|
|
||||||
<div className="loader">
|
|
||||||
<span ref={el => (arrow.current[0] = el)}>↓</span>
|
|
||||||
<span ref={el => (arrow.current[1] = el)}>↓</span>
|
|
||||||
<span ref={el => (arrow.current[2] = el)}>↓</span>
|
|
||||||
<span ref={el => (arrow.current[3] = el)}>↓</span>
|
|
||||||
<span ref={el => (arrow.current[4] = el)}>↓</span>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Loader
|
|
||||||
@@ -1,506 +0,0 @@
|
|||||||
import React from "react"
|
|
||||||
import { isMediumUsernameValid } from "../utils/validation"
|
|
||||||
import { icons, skills, skillWebsites } from "../constants/skills"
|
|
||||||
|
|
||||||
const Markdown = props => {
|
|
||||||
const Title = props => {
|
|
||||||
if (props.prefix && props.title) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{`<h1 align="center">${props.prefix + " " + props.title}</h1>`}
|
|
||||||
<br />
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
const SubTitle = props => {
|
|
||||||
if (props.subtitle) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{`<h3 align="center">${props.subtitle}</h3>`}
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
const SectionTitle = props => {
|
|
||||||
if (props.label) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{`<h3 align="left">${props.label}</h3>`}
|
|
||||||
<br />
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
const DisplayWork = props => {
|
|
||||||
if (props.prefix && props.project) {
|
|
||||||
if (props.link) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{`- ${props.prefix} [${props.project}](${props.link})`}
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{`- ${props.prefix} **${props.project}**`}
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (props.prefix && props.link) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{`- ${props.prefix} [${props.link}](${props.link})`}
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
const DisplaySocial = props => {
|
|
||||||
if (props.username) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{`<a href="${props.base}/${props.username}" target="blank"><img align="center" src="${props.icon}" alt="${props.username}" height="30" width="40" /></a>`}
|
|
||||||
<br />
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
const VisitorsBadge = props => {
|
|
||||||
let link = "https://komarev.com/ghpvc/?username="
|
|
||||||
+ props.github
|
|
||||||
+ `&label=${props.badgeOptions.badgeLabel}`
|
|
||||||
+ `&color=${props.badgeOptions.badgeColor}`
|
|
||||||
+ `&style=${props.badgeOptions.badgeStyle}`
|
|
||||||
if (props.show) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{`<p align="left"> <img src="${link}" alt="${props.github}" /> </p>`}
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
const TwitterBadge = props => {
|
|
||||||
let link = "https://img.shields.io/twitter/follow/" + props.twitter + "?logo=twitter&style=for-the-badge"
|
|
||||||
if (props.show) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{`<p align="left"> <a href="${props.base}/${props.twitter}" target="blank"><img src="${link}" alt="${props.twitter}" /></a> </p>`}
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
const GithubProfileTrophy = props => {
|
|
||||||
let link =
|
|
||||||
"https://github-profile-trophy.vercel.app/?username=" + props.github
|
|
||||||
if (props.show) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{`<p align="left"> <a href="https://github.com/ryo-ma/github-profile-trophy"><img src="${link}" alt="${props.github}" /></a> </p>`}
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
const GitHubStats = props => {
|
|
||||||
let link =
|
|
||||||
"https://github-readme-stats.vercel.app/api?username=" +
|
|
||||||
props.github +
|
|
||||||
"&show_icons=true"
|
|
||||||
if (props.show) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{`<p> <img align="center" src="${link}" alt="${props.github}" /></p>`}
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
const isSocial = social => {
|
|
||||||
return (
|
|
||||||
social.dev ||
|
|
||||||
social.twitter ||
|
|
||||||
social.codepen ||
|
|
||||||
social.codesandbox ||
|
|
||||||
social.stackoverflow ||
|
|
||||||
social.linkedin ||
|
|
||||||
social.kaggle ||
|
|
||||||
social.instagram ||
|
|
||||||
social.fb ||
|
|
||||||
social.dribbble ||
|
|
||||||
social.behance ||
|
|
||||||
social.medium ||
|
|
||||||
social.youtube ||
|
|
||||||
social.codechef ||
|
|
||||||
social.hackerrank ||
|
|
||||||
social.codeforces ||
|
|
||||||
social.leetcode ||
|
|
||||||
social.topcoder ||
|
|
||||||
social.hackerearth ||
|
|
||||||
social.geeks_for_geeks ||
|
|
||||||
social.rssurl
|
|
||||||
)
|
|
||||||
}
|
|
||||||
const DisplaySkills = props => {
|
|
||||||
const listChosenSkills = []
|
|
||||||
skills.forEach(skill => {
|
|
||||||
if (props.skills[skill]) {
|
|
||||||
listChosenSkills.push(
|
|
||||||
`
|
|
||||||
<a href="${skillWebsites[skill]}" target="_blank">
|
|
||||||
<img src="${icons[skill]}" alt="${skill}" width="40" height="40"/>
|
|
||||||
</a>
|
|
||||||
`
|
|
||||||
)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return listChosenSkills.length > 0 ? (
|
|
||||||
<>
|
|
||||||
<SectionTitle label="Languages and Tools:" />
|
|
||||||
{`<p align="left">${listChosenSkills.join(" ")}</p>`}
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)
|
|
||||||
}
|
|
||||||
const DisplayDynamicBlogs = props => {
|
|
||||||
if (props.show) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{`### Blogs posts`}
|
|
||||||
<br />
|
|
||||||
{`<!-- BLOG-POST-LIST:START -->`}
|
|
||||||
<br />
|
|
||||||
{`<!-- BLOG-POST-LIST:END -->`}
|
|
||||||
<br /> <br />
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
const DisplayTopLanguages = props => {
|
|
||||||
let link =
|
|
||||||
"https://github-readme-stats.vercel.app/api/top-langs/?username=" +
|
|
||||||
props.github +
|
|
||||||
"&layout=compact"
|
|
||||||
if (props.show) {
|
|
||||||
if (!props.showStats) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{`<p><img align="center" src="${link}" alt="${props.github}" /></p>`}
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{`<p><img align="left" src="${link}" alt="${props.github}" /></p>`}
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
<div id="markdown-content" className="break-words">
|
|
||||||
<>
|
|
||||||
<Title prefix={props.prefix.title} title={props.data.title} />
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<SubTitle subtitle={props.data.subtitle} />
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<VisitorsBadge
|
|
||||||
show={props.data.visitorsBadge}
|
|
||||||
github={props.social.github}
|
|
||||||
badgeOptions={{
|
|
||||||
badgeLabel: encodeURI(props.data.badgeLabel),
|
|
||||||
badgeColor: props.data.badgeColor,
|
|
||||||
badgeStyle: props.data.badgeStyle
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<GithubProfileTrophy
|
|
||||||
show={props.data.githubProfileTrophy}
|
|
||||||
github={props.social.github}
|
|
||||||
/>
|
|
||||||
<TwitterBadge
|
|
||||||
base="https://twitter.com"
|
|
||||||
show={props.data.twitterBadge}
|
|
||||||
twitter={props.social.twitter}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplayWork
|
|
||||||
prefix={props.prefix.currentWork}
|
|
||||||
project={props.data.currentWork}
|
|
||||||
link={props.link.currentWork}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplayWork
|
|
||||||
prefix={props.prefix.currentLearn}
|
|
||||||
project={props.data.currentLearn}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplayWork
|
|
||||||
prefix={props.prefix.collaborateOn}
|
|
||||||
project={props.data.collaborateOn}
|
|
||||||
link={props.link.collaborateOn}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplayWork
|
|
||||||
prefix={props.prefix.helpWith}
|
|
||||||
project={props.data.helpWith}
|
|
||||||
link={props.link.helpWith}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplayWork
|
|
||||||
prefix={props.prefix.portfolio}
|
|
||||||
link={props.link.portfolio}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplayWork prefix={props.prefix.blog} link={props.link.blog} />
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplayWork prefix={props.prefix.ama} project={props.data.ama} />
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplayWork
|
|
||||||
prefix={props.prefix.contact}
|
|
||||||
project={props.data.contact}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplayWork prefix={props.prefix.resume} link={props.link.resume} />
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplayWork
|
|
||||||
prefix={props.prefix.funFact}
|
|
||||||
project={props.data.funFact}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplayDynamicBlogs
|
|
||||||
show={
|
|
||||||
(props.data.devDynamicBlogs && props.social.dev) ||
|
|
||||||
(props.data.rssDynamicBlogs && props.social.rssurl) ||
|
|
||||||
(props.data.mediumDynamicBlogs &&
|
|
||||||
props.social.medium &&
|
|
||||||
isMediumUsernameValid(props.social.medium))
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
{isSocial(props.social) ? `<p align="left">` : ""} <br />
|
|
||||||
<>
|
|
||||||
<SectionTitle label="Connect with me:" />
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://codepen.io"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/codepen.svg"
|
|
||||||
username={props.social.codepen}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://dev.to"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/dev-dot-to.svg"
|
|
||||||
username={props.social.dev}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://twitter.com"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/twitter.svg"
|
|
||||||
username={props.social.twitter}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://linkedin.com/in"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/linkedin.svg"
|
|
||||||
username={props.social.linkedin}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://stackoverflow.com/users"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/stackoverflow.svg"
|
|
||||||
username={props.social.stackoverflow}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://codesandbox.com"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/codesandbox.svg"
|
|
||||||
username={props.social.codesandbox}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://kaggle.com"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/kaggle.svg"
|
|
||||||
username={props.social.kaggle}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://fb.com"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/facebook.svg"
|
|
||||||
username={props.social.fb}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://instagram.com"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/instagram.svg"
|
|
||||||
username={props.social.instagram}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://dribbble.com"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/dribbble.svg"
|
|
||||||
username={props.social.dribbble}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://www.behance.net"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/behance.svg"
|
|
||||||
username={props.social.behance}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://medium.com"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/medium.svg"
|
|
||||||
username={props.social.medium}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://www.youtube.com/c"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/youtube.svg"
|
|
||||||
username={props.social.youtube}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://www.codechef.com/users"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.1.0/icons/codechef.svg"
|
|
||||||
username={props.social.codechef}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://www.hackerrank.com"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/hackerrank.svg"
|
|
||||||
username={props.social.hackerrank}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://codeforces.com/profile"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/codeforces.svg"
|
|
||||||
username={props.social.codeforces}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://www.leetcode.com"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/leetcode.svg"
|
|
||||||
username={props.social.leetcode}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://www.hackerearth.com"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/hackerearth.svg"
|
|
||||||
username={props.social.hackerearth}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://auth.geeksforgeeks.org/user"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/geeksforgeeks.svg"
|
|
||||||
username={props.social.geeks_for_geeks}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://www.topcoder.com/members"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/topcoder.svg"
|
|
||||||
username={props.social.topcoder}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplaySocial
|
|
||||||
base=""
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/rss.svg"
|
|
||||||
username={props.social.rssurl}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
{isSocial(props.social) ? (
|
|
||||||
<>
|
|
||||||
{`</p>`}
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
<>
|
|
||||||
<DisplaySkills skills={props.skills} />
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<DisplayTopLanguages
|
|
||||||
show={props.data.topLanguages}
|
|
||||||
showStats={props.data.githubStats}
|
|
||||||
github={props.social.github}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
<>
|
|
||||||
<GitHubStats
|
|
||||||
show={props.data.githubStats}
|
|
||||||
github={props.social.github}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Markdown
|
|
||||||
@@ -1,361 +0,0 @@
|
|||||||
import React from "react"
|
|
||||||
import { icons, skills, skillWebsites } from "../constants/skills"
|
|
||||||
|
|
||||||
const MarkdownPreview = props => {
|
|
||||||
const TitlePreview = props => {
|
|
||||||
if (props.prefix && props.title) {
|
|
||||||
return (
|
|
||||||
<h1 className="text-center text-xl font-bold">
|
|
||||||
{props.prefix + " " + props.title}
|
|
||||||
</h1>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
const SubTitlePreview = props => {
|
|
||||||
if (props.subtitle) {
|
|
||||||
return <h3 className="text-center font-medium">{props.subtitle}</h3>
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
const SectionTitle = props => {
|
|
||||||
if (props.label) {
|
|
||||||
return <h3 className="w-full text-lg sm:text-xl">{props.label}</h3>
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
const DisplayWork = props => {
|
|
||||||
if (props.prefix && props.project) {
|
|
||||||
if (props.link) {
|
|
||||||
return (
|
|
||||||
<div className="my-2">
|
|
||||||
{props.prefix + " "}
|
|
||||||
<a
|
|
||||||
href={props.link}
|
|
||||||
className="no-underline text-blue-700"
|
|
||||||
target="blank"
|
|
||||||
>
|
|
||||||
{props.project}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
return (
|
|
||||||
<div className="my-2">
|
|
||||||
{props.prefix + " "}
|
|
||||||
<b>{props.project}</b>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (props.prefix && props.link) {
|
|
||||||
return (
|
|
||||||
<div className="my-2">
|
|
||||||
{props.prefix + " "}
|
|
||||||
<a
|
|
||||||
href={props.link}
|
|
||||||
className="no-underline text-blue-700"
|
|
||||||
target="blank"
|
|
||||||
>
|
|
||||||
{props.link}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
const WorkPreview = props => {
|
|
||||||
const prefix = props.work.prefix
|
|
||||||
const data = props.work.data
|
|
||||||
const link = props.work.link
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<DisplayWork
|
|
||||||
prefix={prefix.currentWork}
|
|
||||||
project={data.currentWork}
|
|
||||||
link={link.currentWork}
|
|
||||||
/>
|
|
||||||
<DisplayWork prefix={prefix.currentLearn} project={data.currentLearn} />
|
|
||||||
<DisplayWork
|
|
||||||
prefix={prefix.helpWith}
|
|
||||||
project={data.helpWith}
|
|
||||||
link={link.helpWith}
|
|
||||||
/>
|
|
||||||
<DisplayWork
|
|
||||||
prefix={prefix.collaborateOn}
|
|
||||||
project={data.collaborateOn}
|
|
||||||
link={link.collaborateOn}
|
|
||||||
/>
|
|
||||||
<DisplayWork prefix={prefix.ama} project={data.ama} />
|
|
||||||
<DisplayWork prefix={prefix.portfolio} link={link.portfolio} />
|
|
||||||
<DisplayWork prefix={prefix.blog} link={link.blog} />
|
|
||||||
<DisplayWork prefix={prefix.resume} link={link.resume} />
|
|
||||||
<DisplayWork prefix={prefix.contact} project={data.contact} />
|
|
||||||
<DisplayWork prefix={prefix.funFact} project={data.funFact} />
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
const DisplaySocial = props => {
|
|
||||||
if (props.username) {
|
|
||||||
return (
|
|
||||||
<a
|
|
||||||
className="no-underline text-blue-700 m-2"
|
|
||||||
href={props.base + "/" + props.username}
|
|
||||||
target="blank"
|
|
||||||
>
|
|
||||||
<img className="w-6 h-6" src={props.icon} alt="props.username" />
|
|
||||||
</a>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
const SocialPreview = props => {
|
|
||||||
return (
|
|
||||||
<div className="flex justify-start items-end flex-wrap">
|
|
||||||
<SectionTitle label="Connect with me:" />
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://codepen.io"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/codepen.svg"
|
|
||||||
username={props.social.codepen}
|
|
||||||
/>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://dev.to"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/dev-dot-to.svg"
|
|
||||||
username={props.social.dev}
|
|
||||||
/>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://twitter.com"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/twitter.svg"
|
|
||||||
username={props.social.twitter}
|
|
||||||
/>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://linkedin.com/in"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/linkedin.svg"
|
|
||||||
username={props.social.linkedin}
|
|
||||||
/>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://stackoverflow.com/users"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/stackoverflow.svg"
|
|
||||||
username={props.social.stackoverflow}
|
|
||||||
/>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://codesandbox.com"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/codesandbox.svg"
|
|
||||||
username={props.social.codesandbox}
|
|
||||||
/>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://kaggle.com"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/kaggle.svg"
|
|
||||||
username={props.social.kaggle}
|
|
||||||
/>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://fb.com"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/facebook.svg"
|
|
||||||
username={props.social.fb}
|
|
||||||
/>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://instagram.com"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/instagram.svg"
|
|
||||||
username={props.social.instagram}
|
|
||||||
/>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://dribbble.com"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/dribbble.svg"
|
|
||||||
username={props.social.dribbble}
|
|
||||||
/>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://www.behance.net"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/behance.svg"
|
|
||||||
username={props.social.behance}
|
|
||||||
/>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://medium.com"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/medium.svg"
|
|
||||||
username={props.social.medium}
|
|
||||||
/>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://www.youtube.com/c"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/youtube.svg"
|
|
||||||
username={props.social.youtube}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://www.codechef.com/users"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/codechef.svg"
|
|
||||||
username={props.social.codechef}
|
|
||||||
/>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://codeforces.com/profile"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/codeforces.svg"
|
|
||||||
username={props.social.codeforces}
|
|
||||||
/>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://www.hackerrank.com"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/hackerrank.svg"
|
|
||||||
username={props.social.hackerrank}
|
|
||||||
/>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://auth.geeksforgeeks.org/user"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/geeksforgeeks.svg"
|
|
||||||
username={props.social.geeks_for_geeks}
|
|
||||||
/>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://www.hackerearth.com"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/hackerearth.svg"
|
|
||||||
username={props.social.hackerearth}
|
|
||||||
/>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://www.topcoder.com/members"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/topcoder.svg"
|
|
||||||
username={props.social.topcoder}
|
|
||||||
/>
|
|
||||||
<DisplaySocial
|
|
||||||
base="https://www.leetcode.com"
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/leetcode.svg"
|
|
||||||
username={props.social.leetcode}
|
|
||||||
/>
|
|
||||||
<DisplaySocial
|
|
||||||
base=""
|
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/rss.svg"
|
|
||||||
username={props.social.rssurl}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
const VisitorsBadgePreview = props => {
|
|
||||||
let link = "https://komarev.com/ghpvc/?username="
|
|
||||||
+ props.github
|
|
||||||
+ `&label=${props.badgeOptions.badgeLabel}`
|
|
||||||
+ `&color=${props.badgeOptions.badgeColor}`
|
|
||||||
+ `&style=${props.badgeOptions.badgeStyle}`
|
|
||||||
if (props.show) {
|
|
||||||
return (
|
|
||||||
<div className="text-left my-2">
|
|
||||||
{" "}
|
|
||||||
<img className="h-4 sm:h-6" src={link} alt={props.github} />{" "}
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
const TwitterBadgePreview = props => {
|
|
||||||
let link = "https://img.shields.io/twitter/follow/" + props.twitter + "?logo=twitter&style=for-the-badge"
|
|
||||||
if (props.show) {
|
|
||||||
return (
|
|
||||||
<div className="text-left my-2">
|
|
||||||
{" "}
|
|
||||||
<a href="https://twitter.com/${props.twitter}" target="blank">
|
|
||||||
<img className="h-4 sm:h-6" src={link} alt={props.twitter} />
|
|
||||||
</a>{" "}
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
const GithubProfileTrophyPreview = props => {
|
|
||||||
let link =
|
|
||||||
"https://github-profile-trophy.vercel.app/?username=" + props.github
|
|
||||||
if (props.show) {
|
|
||||||
return (
|
|
||||||
<div className="text-left my-2">
|
|
||||||
{" "}
|
|
||||||
<a href="https://github.com/ryo-ma/github-profile-trophy">
|
|
||||||
<img src={link} alt={props.github} />
|
|
||||||
</a>{" "}
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
const GitHubStatsPreview = props => {
|
|
||||||
let link =
|
|
||||||
"https://github-readme-stats.vercel.app/api?username=" +
|
|
||||||
props.github +
|
|
||||||
"&show_icons=true"
|
|
||||||
if (props.show) {
|
|
||||||
return (
|
|
||||||
<div className="text-center mx-4 mb-4">
|
|
||||||
<img src={link} alt={props.github} />
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
const TopLanguagesPreview = props => {
|
|
||||||
let link =
|
|
||||||
"https://github-readme-stats.vercel.app/api/top-langs/?username=" +
|
|
||||||
props.github +
|
|
||||||
"&layout=compact"
|
|
||||||
if (props.show) {
|
|
||||||
return (
|
|
||||||
<div className="text-center mx-4 mb-4">
|
|
||||||
<img src={link} alt={props.github} />
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return <div className="text-center mx-4 mb-4"> </div>
|
|
||||||
}
|
|
||||||
const SkillsPreview = props => {
|
|
||||||
var listSkills = []
|
|
||||||
skills.forEach(skill => {
|
|
||||||
if (props.skills[skill]) {
|
|
||||||
listSkills.push(
|
|
||||||
<a href={skillWebsites[skill]} target="_blank" rel="noreferrer">
|
|
||||||
<img
|
|
||||||
className="mb-4 mr-4 h-6 w-6 sm:h-10 sm:w-10"
|
|
||||||
key={skill}
|
|
||||||
src={icons[skill]}
|
|
||||||
alt={skill}
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return listSkills.length > 0 ? (
|
|
||||||
<div className="flex flex-wrap justify-start items-center">
|
|
||||||
<SectionTitle label="Languages and Tools:" />
|
|
||||||
{listSkills}
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
<div id="markdown-preview">
|
|
||||||
<TitlePreview prefix={props.prefix.title} title={props.data.title} />
|
|
||||||
<SubTitlePreview subtitle={props.data.subtitle} />
|
|
||||||
<VisitorsBadgePreview
|
|
||||||
show={props.data.visitorsBadge}
|
|
||||||
github={props.social.github}
|
|
||||||
badgeOptions={{
|
|
||||||
badgeLabel: encodeURI(props.data.badgeLabel),
|
|
||||||
badgeColor: props.data.badgeColor,
|
|
||||||
badgeStyle: props.data.badgeStyle
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<GithubProfileTrophyPreview
|
|
||||||
show={props.data.githubProfileTrophy}
|
|
||||||
github={props.social.github}
|
|
||||||
/>
|
|
||||||
<TwitterBadgePreview
|
|
||||||
show={props.data.twitterBadge}
|
|
||||||
twitter={props.social.twitter}
|
|
||||||
/>
|
|
||||||
<WorkPreview work={props} />
|
|
||||||
<SocialPreview social={props.social} />
|
|
||||||
<SkillsPreview skills={props.skills} />
|
|
||||||
<div className="block sm:flex sm:justify-center sm:items-start">
|
|
||||||
<TopLanguagesPreview
|
|
||||||
show={props.data.topLanguages}
|
|
||||||
github={props.social.github}
|
|
||||||
/>
|
|
||||||
<GitHubStatsPreview
|
|
||||||
show={props.data.githubStats}
|
|
||||||
github={props.social.github}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default MarkdownPreview
|
|
||||||
@@ -0,0 +1,319 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { Upload } from 'lucide-react';
|
||||||
|
|
||||||
|
import { useState, useEffect } from 'react';
|
||||||
|
import { UseFormRegister, FieldErrors, UseFormWatch } from 'react-hook-form';
|
||||||
|
import { FormInput } from '@/components/forms/form-input';
|
||||||
|
import { FormTextarea } from '@/components/forms/form-textarea';
|
||||||
|
import { FormCheckbox } from '@/components/forms/form-checkbox';
|
||||||
|
import { GitHubUsernameInput } from '@/components/forms/github-username-input';
|
||||||
|
import { CollapsibleSection } from '@/components/ui/collapsible-section';
|
||||||
|
import type { ProfileFormData, LinksFormData, SocialFormData } from '@/lib/validations';
|
||||||
|
|
||||||
|
interface BasicInfoSectionProps {
|
||||||
|
register: UseFormRegister<ProfileFormData>;
|
||||||
|
errors: FieldErrors<ProfileFormData>;
|
||||||
|
socialRegister: UseFormRegister<SocialFormData>;
|
||||||
|
watchSocial: UseFormWatch<SocialFormData>;
|
||||||
|
onGitHubAutoFill?: (data: {
|
||||||
|
profile: Partial<ProfileFormData>;
|
||||||
|
links: Partial<LinksFormData>;
|
||||||
|
social: Partial<SocialFormData>;
|
||||||
|
skills: string[];
|
||||||
|
}) => void;
|
||||||
|
onImportJSON?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
||||||
|
onClearAll?: () => void;
|
||||||
|
hasClearableData?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function BasicInfoSection({
|
||||||
|
register,
|
||||||
|
errors,
|
||||||
|
socialRegister,
|
||||||
|
watchSocial,
|
||||||
|
onGitHubAutoFill,
|
||||||
|
onImportJSON,
|
||||||
|
onClearAll,
|
||||||
|
hasClearableData = true,
|
||||||
|
}: BasicInfoSectionProps) {
|
||||||
|
const githubUsername = watchSocial('github') || '';
|
||||||
|
const [isMobile, setIsMobile] = useState(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const checkMobile = () => {
|
||||||
|
setIsMobile(window.innerWidth < 768);
|
||||||
|
};
|
||||||
|
checkMobile();
|
||||||
|
window.addEventListener('resize', checkMobile);
|
||||||
|
return () => window.removeEventListener('resize', checkMobile);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="space-y-6">
|
||||||
|
<div className="border-border border-b pb-4">
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<h2 className="text-2xl font-bold">Basic Information</h2>
|
||||||
|
<p className="text-muted-foreground mt-1 text-sm">
|
||||||
|
Tell us about yourself and what you do
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{/* Action Buttons */}
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
{/* Clear All Button */}
|
||||||
|
{onClearAll && (
|
||||||
|
<button
|
||||||
|
onClick={onClearAll}
|
||||||
|
disabled={!hasClearableData}
|
||||||
|
className={`flex items-center justify-center rounded-lg border p-3 transition-colors ${
|
||||||
|
hasClearableData
|
||||||
|
? 'bg-muted/50 text-muted-foreground hover:bg-muted hover:text-foreground border-border'
|
||||||
|
: 'bg-muted text-muted-foreground border-border cursor-not-allowed opacity-50'
|
||||||
|
}`}
|
||||||
|
title={hasClearableData ? 'Clear all data' : 'No data to clear'}
|
||||||
|
aria-label={hasClearableData ? 'Clear all data' : 'No data to clear'}
|
||||||
|
>
|
||||||
|
<svg className="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
|
<path
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth={2}
|
||||||
|
d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
<span className="ml-2 text-sm">Clear All</span>
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Import JSON Button */}
|
||||||
|
{onImportJSON && (
|
||||||
|
<label className="bg-secondary text-secondary-foreground hover:bg-secondary/90 flex cursor-pointer items-center justify-center rounded-lg p-3 transition-colors">
|
||||||
|
<Upload className="h-5 w-5" />
|
||||||
|
<input
|
||||||
|
type="file"
|
||||||
|
accept=".json"
|
||||||
|
onChange={onImportJSON}
|
||||||
|
className="hidden"
|
||||||
|
title="Import profile data from JSON"
|
||||||
|
aria-label="Import profile data from JSON"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Quick Start: GitHub Auto-fill */}
|
||||||
|
{onGitHubAutoFill && (
|
||||||
|
<div className="border-primary/30 bg-primary/5 rounded-lg border-2 p-4">
|
||||||
|
<div className="mb-3 flex items-start gap-2">
|
||||||
|
<span className="text-2xl">🚀</span>
|
||||||
|
<div className="flex-1">
|
||||||
|
<h3 className="text-sm font-semibold">Quick Start with GitHub</h3>
|
||||||
|
<p className="text-muted-foreground mt-1 text-xs">
|
||||||
|
Enter your GitHub username to automatically populate your profile with smart
|
||||||
|
defaults
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<GitHubUsernameInput
|
||||||
|
{...socialRegister('github')}
|
||||||
|
value={githubUsername}
|
||||||
|
onDataFetched={onGitHubAutoFill}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Basic Fields - Always visible */}
|
||||||
|
<div className="grid gap-6 md:grid-cols-2">
|
||||||
|
<FormInput
|
||||||
|
{...register('title')}
|
||||||
|
id="title"
|
||||||
|
label="Your Name"
|
||||||
|
placeholder="John Doe"
|
||||||
|
error={errors.title?.message}
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormInput
|
||||||
|
{...register('subtitle')}
|
||||||
|
id="subtitle"
|
||||||
|
label="Subtitle"
|
||||||
|
placeholder="A passionate developer"
|
||||||
|
error={errors.subtitle?.message}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Additional Fields - Collapsible on mobile */}
|
||||||
|
{isMobile ? (
|
||||||
|
<div className="space-y-3">
|
||||||
|
<CollapsibleSection title="Current Work" icon="🔭" description="What you're working on">
|
||||||
|
<FormTextarea
|
||||||
|
{...register('currentWork')}
|
||||||
|
id="currentWork"
|
||||||
|
label="I'm currently working on"
|
||||||
|
placeholder="a MERN Stack project"
|
||||||
|
rows={2}
|
||||||
|
error={errors.currentWork?.message}
|
||||||
|
/>
|
||||||
|
</CollapsibleSection>
|
||||||
|
|
||||||
|
<CollapsibleSection title="Learning" icon="🌱" description="What you're learning">
|
||||||
|
<FormTextarea
|
||||||
|
{...register('currentLearn')}
|
||||||
|
id="currentLearn"
|
||||||
|
label="I'm currently learning"
|
||||||
|
placeholder="GraphQL and TypeScript"
|
||||||
|
rows={2}
|
||||||
|
error={errors.currentLearn?.message}
|
||||||
|
/>
|
||||||
|
</CollapsibleSection>
|
||||||
|
|
||||||
|
<CollapsibleSection
|
||||||
|
title="Collaboration"
|
||||||
|
icon="👯"
|
||||||
|
description="What you want to collaborate on"
|
||||||
|
>
|
||||||
|
<FormTextarea
|
||||||
|
{...register('collaborateOn')}
|
||||||
|
id="collaborateOn"
|
||||||
|
label="I'm looking to collaborate on"
|
||||||
|
placeholder="open source projects"
|
||||||
|
rows={2}
|
||||||
|
error={errors.collaborateOn?.message}
|
||||||
|
/>
|
||||||
|
</CollapsibleSection>
|
||||||
|
|
||||||
|
<CollapsibleSection title="Help Needed" icon="🤝" description="What you need help with">
|
||||||
|
<FormTextarea
|
||||||
|
{...register('helpWith')}
|
||||||
|
id="helpWith"
|
||||||
|
label="I'm looking for help with"
|
||||||
|
placeholder="learning system design"
|
||||||
|
rows={2}
|
||||||
|
error={errors.helpWith?.message}
|
||||||
|
/>
|
||||||
|
</CollapsibleSection>
|
||||||
|
|
||||||
|
<CollapsibleSection title="Ask Me About" icon="💬" description="Your areas of expertise">
|
||||||
|
<FormTextarea
|
||||||
|
{...register('ama')}
|
||||||
|
id="ama"
|
||||||
|
label="Ask me about"
|
||||||
|
placeholder="React, Node.js, and web development"
|
||||||
|
rows={2}
|
||||||
|
error={errors.ama?.message}
|
||||||
|
/>
|
||||||
|
</CollapsibleSection>
|
||||||
|
|
||||||
|
<CollapsibleSection title="Contact" icon="📫" description="How to reach you">
|
||||||
|
<FormInput
|
||||||
|
{...register('contact')}
|
||||||
|
id="contact"
|
||||||
|
label="How to reach me"
|
||||||
|
type="email"
|
||||||
|
placeholder="your.email@example.com"
|
||||||
|
error={errors.contact?.message}
|
||||||
|
/>
|
||||||
|
</CollapsibleSection>
|
||||||
|
|
||||||
|
<CollapsibleSection
|
||||||
|
title="Fun Fact"
|
||||||
|
icon="⚡"
|
||||||
|
description="Something interesting about you"
|
||||||
|
>
|
||||||
|
<FormTextarea
|
||||||
|
{...register('funFact')}
|
||||||
|
id="funFact"
|
||||||
|
label="Fun fact"
|
||||||
|
placeholder="I think I am funny"
|
||||||
|
rows={2}
|
||||||
|
error={errors.funFact?.message}
|
||||||
|
/>
|
||||||
|
</CollapsibleSection>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<FormTextarea
|
||||||
|
{...register('currentWork')}
|
||||||
|
id="currentWork"
|
||||||
|
label="🔭 I'm currently working on"
|
||||||
|
placeholder="a MERN Stack project"
|
||||||
|
rows={2}
|
||||||
|
error={errors.currentWork?.message}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormTextarea
|
||||||
|
{...register('currentLearn')}
|
||||||
|
id="currentLearn"
|
||||||
|
label="🌱 I'm currently learning"
|
||||||
|
placeholder="GraphQL and TypeScript"
|
||||||
|
rows={2}
|
||||||
|
error={errors.currentLearn?.message}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormTextarea
|
||||||
|
{...register('collaborateOn')}
|
||||||
|
id="collaborateOn"
|
||||||
|
label="👯 I'm looking to collaborate on"
|
||||||
|
placeholder="open source projects"
|
||||||
|
rows={2}
|
||||||
|
error={errors.collaborateOn?.message}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormTextarea
|
||||||
|
{...register('helpWith')}
|
||||||
|
id="helpWith"
|
||||||
|
label="🤝 I'm looking for help with"
|
||||||
|
placeholder="learning system design"
|
||||||
|
rows={2}
|
||||||
|
error={errors.helpWith?.message}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormTextarea
|
||||||
|
{...register('ama')}
|
||||||
|
id="ama"
|
||||||
|
label="💬 Ask me about"
|
||||||
|
placeholder="React, Node.js, and web development"
|
||||||
|
rows={2}
|
||||||
|
error={errors.ama?.message}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormInput
|
||||||
|
{...register('contact')}
|
||||||
|
id="contact"
|
||||||
|
label="📫 How to reach me"
|
||||||
|
type="email"
|
||||||
|
placeholder="your.email@example.com"
|
||||||
|
error={errors.contact?.message}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormTextarea
|
||||||
|
{...register('funFact')}
|
||||||
|
id="funFact"
|
||||||
|
label="⚡ Fun fact"
|
||||||
|
placeholder="I think I am funny"
|
||||||
|
rows={2}
|
||||||
|
error={errors.funFact?.message}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Profile Badge Option */}
|
||||||
|
<div className="border-border mt-6 border-t pt-6">
|
||||||
|
<div className="bg-accent/50 rounded-lg p-4">
|
||||||
|
<h4 className="mb-2 flex items-center gap-2 text-sm font-semibold">
|
||||||
|
<span>📊</span>
|
||||||
|
<span>Profile Enhancement</span>
|
||||||
|
</h4>
|
||||||
|
<FormCheckbox
|
||||||
|
{...register('visitorsBadge')}
|
||||||
|
id="visitorsBadge"
|
||||||
|
label="Show profile visitors counter badge"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { UseFormRegister, FieldErrors } from 'react-hook-form';
|
||||||
|
import { FormInput } from '@/components/forms/form-input';
|
||||||
|
import type { LinksFormData } from '@/lib/validations';
|
||||||
|
|
||||||
|
interface LinksSectionProps {
|
||||||
|
register: UseFormRegister<LinksFormData>;
|
||||||
|
errors: FieldErrors<LinksFormData>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function LinksSection({ register, errors }: LinksSectionProps) {
|
||||||
|
return (
|
||||||
|
<div className="space-y-6">
|
||||||
|
<div className="border-b border-border pb-4">
|
||||||
|
<h2 className="text-2xl font-bold">Links</h2>
|
||||||
|
<p className="text-muted-foreground mt-1 text-sm">
|
||||||
|
Add links to your portfolio, blog, and resume
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<FormInput
|
||||||
|
{...register('portfolio')}
|
||||||
|
id="portfolio"
|
||||||
|
label="👨💻 Portfolio"
|
||||||
|
type="url"
|
||||||
|
placeholder="https://yourportfolio.com"
|
||||||
|
error={errors.portfolio?.message}
|
||||||
|
helperText="Your personal website or portfolio"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormInput
|
||||||
|
{...register('blog')}
|
||||||
|
id="blog"
|
||||||
|
label="📝 Blog"
|
||||||
|
type="url"
|
||||||
|
placeholder="https://yourblog.com"
|
||||||
|
error={errors.blog?.message}
|
||||||
|
helperText="Where you write articles"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormInput
|
||||||
|
{...register('resume')}
|
||||||
|
id="resume"
|
||||||
|
label="📄 Resume/CV"
|
||||||
|
type="url"
|
||||||
|
placeholder="https://drive.google.com/your-resume"
|
||||||
|
error={errors.resume?.message}
|
||||||
|
helperText="Link to your resume or CV"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,264 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { useState, useMemo, useEffect } from 'react';
|
||||||
|
import { Info } from 'lucide-react';
|
||||||
|
import { UseFormRegister } from 'react-hook-form';
|
||||||
|
import { FormCheckbox } from '@/components/forms/form-checkbox';
|
||||||
|
import { FormInput } from '@/components/forms/form-input';
|
||||||
|
import { Select } from '@/components/ui/select';
|
||||||
|
import { CollapsibleSection } from '@/components/ui/collapsible-section';
|
||||||
|
import { categorizedSkills, categories } from '@/constants/skills';
|
||||||
|
import { getSkillIconUrl } from '@/lib/markdown-generator';
|
||||||
|
import type { ProfileFormData } from '@/lib/validations';
|
||||||
|
|
||||||
|
interface SkillsSectionProps {
|
||||||
|
selectedSkills: Record<string, boolean>;
|
||||||
|
onSkillChange: (skill: string, checked: boolean) => void;
|
||||||
|
registerProfile: UseFormRegister<ProfileFormData>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function SkillsSection({
|
||||||
|
selectedSkills,
|
||||||
|
onSkillChange,
|
||||||
|
registerProfile,
|
||||||
|
}: SkillsSectionProps) {
|
||||||
|
const [searchQuery, setSearchQuery] = useState('');
|
||||||
|
const [selectedCategory, setSelectedCategory] = useState<string>('all');
|
||||||
|
const [isMobile, setIsMobile] = useState(false);
|
||||||
|
|
||||||
|
// Check if we're on mobile for responsive behavior
|
||||||
|
useEffect(() => {
|
||||||
|
const checkMobile = () => {
|
||||||
|
setIsMobile(window.innerWidth < 768);
|
||||||
|
};
|
||||||
|
checkMobile();
|
||||||
|
window.addEventListener('resize', checkMobile);
|
||||||
|
return () => window.removeEventListener('resize', checkMobile);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const selectedCount = useMemo(() => {
|
||||||
|
return Object.values(selectedSkills).filter(Boolean).length;
|
||||||
|
}, [selectedSkills]);
|
||||||
|
|
||||||
|
const filteredCategories = useMemo(() => {
|
||||||
|
if (selectedCategory !== 'all') {
|
||||||
|
return [selectedCategory];
|
||||||
|
}
|
||||||
|
return categories;
|
||||||
|
}, [selectedCategory]);
|
||||||
|
|
||||||
|
const filterSkills = (skills: string[]) => {
|
||||||
|
if (!searchQuery) return skills;
|
||||||
|
return skills.filter((skill) => skill.toLowerCase().includes(searchQuery.toLowerCase()));
|
||||||
|
};
|
||||||
|
|
||||||
|
// Create options for the select component
|
||||||
|
const categoryOptions = [
|
||||||
|
{ value: 'all', label: 'All Categories' },
|
||||||
|
...categories.map((category) => ({
|
||||||
|
value: category,
|
||||||
|
label: categorizedSkills[category].title,
|
||||||
|
})),
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="space-y-6">
|
||||||
|
<div className="border-border border-b pb-4">
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<h2 className="text-2xl font-bold">Skills & Technologies</h2>
|
||||||
|
<p className="text-muted-foreground mt-1 text-sm">
|
||||||
|
Select the skills you want to showcase ({selectedCount} selected)
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Search and Filter - Stack on mobile */}
|
||||||
|
<div className="flex flex-col gap-4 sm:grid sm:grid-cols-2">
|
||||||
|
<FormInput
|
||||||
|
id="skill-search"
|
||||||
|
placeholder="Search skills..."
|
||||||
|
value={searchQuery}
|
||||||
|
onChange={(e) => setSearchQuery(e.target.value)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Select
|
||||||
|
value={selectedCategory}
|
||||||
|
onChange={setSelectedCategory}
|
||||||
|
options={categoryOptions}
|
||||||
|
placeholder="Select category"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Skills Grid - Responsive layout */}
|
||||||
|
<div className="space-y-6">
|
||||||
|
{filteredCategories.map((category) => {
|
||||||
|
const { title, skills } = categorizedSkills[category];
|
||||||
|
const filtered = filterSkills(skills);
|
||||||
|
|
||||||
|
if (filtered.length === 0) return null;
|
||||||
|
|
||||||
|
const skillsGrid = (
|
||||||
|
<div className="grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5">
|
||||||
|
{filtered.map((skill) => {
|
||||||
|
const iconUrl = getSkillIconUrl(skill);
|
||||||
|
const isSelected = selectedSkills[skill] || false;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
key={skill}
|
||||||
|
type="button"
|
||||||
|
onClick={() => onSkillChange(skill, !isSelected)}
|
||||||
|
className={`relative flex flex-col items-center gap-2 rounded-lg border-2 p-2 transition-all hover:scale-105 sm:p-3 ${
|
||||||
|
isSelected
|
||||||
|
? 'border-primary bg-primary/10'
|
||||||
|
: 'border-border hover:border-primary/50'
|
||||||
|
}`}
|
||||||
|
aria-pressed={isSelected}
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src={iconUrl}
|
||||||
|
alt={skill}
|
||||||
|
className="h-8 w-8 object-contain sm:h-10 sm:w-10"
|
||||||
|
loading="eager"
|
||||||
|
/>
|
||||||
|
<span className="text-center text-xs leading-tight capitalize">
|
||||||
|
{skill.replace(/_/g, ' ')}
|
||||||
|
</span>
|
||||||
|
{isSelected && (
|
||||||
|
<div className="bg-primary absolute top-1 right-1 h-2 w-2 rounded-full" />
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
// On mobile, use collapsible sections for better organization
|
||||||
|
if (isMobile && selectedCategory === 'all') {
|
||||||
|
return (
|
||||||
|
<CollapsibleSection
|
||||||
|
key={category}
|
||||||
|
title={title}
|
||||||
|
description={`${filtered.length} skills available`}
|
||||||
|
icon="🛠️"
|
||||||
|
defaultOpen={filtered.some((skill) => selectedSkills[skill])}
|
||||||
|
>
|
||||||
|
{skillsGrid}
|
||||||
|
</CollapsibleSection>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Desktop layout or when a specific category is selected
|
||||||
|
return (
|
||||||
|
<div key={category} className="space-y-4">
|
||||||
|
<h3 className="text-lg font-semibold">{title}</h3>
|
||||||
|
{skillsGrid}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{searchQuery &&
|
||||||
|
filteredCategories.every(
|
||||||
|
(cat) => filterSkills(categorizedSkills[cat].skills).length === 0
|
||||||
|
) && (
|
||||||
|
<div className="text-muted-foreground py-8 text-center">
|
||||||
|
<p>No skills found matching "{searchQuery}"</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* GitHub Stats & Badges - Mobile-friendly layout */}
|
||||||
|
<div className="border-border mt-8 border-t pt-6">
|
||||||
|
<div
|
||||||
|
className={`space-y-4 rounded-lg p-4 transition-all sm:p-6 ${selectedCount > 0 ? 'bg-accent/50' : 'bg-muted/30'}`}
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<h4 className="mb-1 flex items-center gap-2 text-base font-semibold sm:text-lg">
|
||||||
|
<span>📈</span>
|
||||||
|
<span>GitHub Profile Enhancements</span>
|
||||||
|
</h4>
|
||||||
|
<p className="text-muted-foreground text-sm">
|
||||||
|
Add visual statistics and achievements to your profile
|
||||||
|
</p>
|
||||||
|
{selectedCount === 0 && (
|
||||||
|
<p className="text-muted-foreground mt-2 flex items-center gap-1 text-xs">
|
||||||
|
<Info className="h-3 w-3" />
|
||||||
|
Select at least one skill above to enable these enhancements
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Mobile: Use collapsible section, Desktop: Show grid */}
|
||||||
|
{isMobile ? (
|
||||||
|
<CollapsibleSection
|
||||||
|
title="Enhancement Options"
|
||||||
|
description={`${selectedCount > 0 ? 'Available' : 'Disabled'} - Select skills first`}
|
||||||
|
icon="⚙️"
|
||||||
|
defaultOpen={selectedCount > 0}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className={`space-y-3 ${selectedCount === 0 ? 'pointer-events-none opacity-50' : ''}`}
|
||||||
|
>
|
||||||
|
<FormCheckbox
|
||||||
|
{...registerProfile('githubStats')}
|
||||||
|
id="githubStats"
|
||||||
|
label="GitHub Stats Card"
|
||||||
|
disabled={selectedCount === 0}
|
||||||
|
/>
|
||||||
|
<FormCheckbox
|
||||||
|
{...registerProfile('topLanguages')}
|
||||||
|
id="topLanguages"
|
||||||
|
label="Top Languages Card"
|
||||||
|
disabled={selectedCount === 0}
|
||||||
|
/>
|
||||||
|
<FormCheckbox
|
||||||
|
{...registerProfile('streakStats')}
|
||||||
|
id="streakStats"
|
||||||
|
label="GitHub Streak Stats"
|
||||||
|
disabled={selectedCount === 0}
|
||||||
|
/>
|
||||||
|
<FormCheckbox
|
||||||
|
{...registerProfile('githubProfileTrophy')}
|
||||||
|
id="githubProfileTrophy"
|
||||||
|
label="GitHub Profile Trophy"
|
||||||
|
disabled={selectedCount === 0}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</CollapsibleSection>
|
||||||
|
) : (
|
||||||
|
<div
|
||||||
|
className={`grid gap-3 sm:grid-cols-2 ${selectedCount === 0 ? 'pointer-events-none opacity-50' : ''}`}
|
||||||
|
>
|
||||||
|
<FormCheckbox
|
||||||
|
{...registerProfile('githubStats')}
|
||||||
|
id="githubStats"
|
||||||
|
label="GitHub Stats Card"
|
||||||
|
disabled={selectedCount === 0}
|
||||||
|
/>
|
||||||
|
<FormCheckbox
|
||||||
|
{...registerProfile('topLanguages')}
|
||||||
|
id="topLanguages"
|
||||||
|
label="Top Languages Card"
|
||||||
|
disabled={selectedCount === 0}
|
||||||
|
/>
|
||||||
|
<FormCheckbox
|
||||||
|
{...registerProfile('streakStats')}
|
||||||
|
id="streakStats"
|
||||||
|
label="GitHub Streak Stats"
|
||||||
|
disabled={selectedCount === 0}
|
||||||
|
/>
|
||||||
|
<FormCheckbox
|
||||||
|
{...registerProfile('githubProfileTrophy')}
|
||||||
|
id="githubProfileTrophy"
|
||||||
|
label="GitHub Profile Trophy"
|
||||||
|
disabled={selectedCount === 0}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { Info } from 'lucide-react';
|
||||||
|
|
||||||
|
import { UseFormRegister, FieldErrors, UseFormWatch } from 'react-hook-form';
|
||||||
|
import { FormInput } from '@/components/forms/form-input';
|
||||||
|
import { FormCheckbox } from '@/components/forms/form-checkbox';
|
||||||
|
import type { SocialFormData } from '@/lib/validations';
|
||||||
|
|
||||||
|
interface SocialSectionProps {
|
||||||
|
register: UseFormRegister<SocialFormData>;
|
||||||
|
errors: FieldErrors<SocialFormData>;
|
||||||
|
watch: UseFormWatch<SocialFormData>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function SocialSection({ register, errors, watch }: SocialSectionProps) {
|
||||||
|
const socialPlatforms = [
|
||||||
|
{ key: 'github', label: 'GitHub', icon: '🐙', placeholder: 'username' },
|
||||||
|
{ key: 'linkedin', label: 'LinkedIn', icon: '💼', placeholder: 'username' },
|
||||||
|
{ key: 'twitter', label: 'Twitter', icon: '🐦', placeholder: 'username' },
|
||||||
|
{ key: 'dev', label: 'Dev.to', icon: '📝', placeholder: 'username' },
|
||||||
|
{ key: 'stackoverflow', label: 'Stack Overflow', icon: '📚', placeholder: 'userid/username' },
|
||||||
|
{ key: 'medium', label: 'Medium', icon: '✍️', placeholder: '@username' },
|
||||||
|
{ key: 'youtube', label: 'YouTube', icon: '📺', placeholder: 'channel-id' },
|
||||||
|
{ key: 'instagram', label: 'Instagram', icon: '📷', placeholder: 'username' },
|
||||||
|
{ key: 'fb', label: 'Facebook', icon: '👤', placeholder: 'username' },
|
||||||
|
{ key: 'codepen', label: 'CodePen', icon: '🖊️', placeholder: 'username' },
|
||||||
|
{ key: 'codesandbox', label: 'CodeSandbox', icon: '📦', placeholder: 'username' },
|
||||||
|
{ key: 'kaggle', label: 'Kaggle', icon: '🔬', placeholder: 'username' },
|
||||||
|
{ key: 'leetcode', label: 'LeetCode', icon: '💻', placeholder: 'username' },
|
||||||
|
{ key: 'hackerrank', label: 'HackerRank', icon: '🏆', placeholder: 'username' },
|
||||||
|
{ key: 'codeforces', label: 'Codeforces', icon: '⚡', placeholder: 'username' },
|
||||||
|
{ key: 'codechef', label: 'CodeChef', icon: '👨🍳', placeholder: 'username' },
|
||||||
|
{ key: 'topcoder', label: 'TopCoder', icon: '🥇', placeholder: 'username' },
|
||||||
|
{ key: 'hackerearth', label: 'HackerEarth', icon: '🌍', placeholder: '@username' },
|
||||||
|
{ key: 'geeks_for_geeks', label: 'GeeksforGeeks', icon: '🤓', placeholder: 'username' },
|
||||||
|
{ key: 'dribbble', label: 'Dribbble', icon: '🎨', placeholder: 'username' },
|
||||||
|
{ key: 'behance', label: 'Behance', icon: '🎭', placeholder: 'username' },
|
||||||
|
{ key: 'discord', label: 'Discord', icon: '💬', placeholder: 'invite-code' },
|
||||||
|
{ key: 'rssurl', label: 'RSS Feed', icon: '📡', placeholder: 'https://...' },
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="space-y-6">
|
||||||
|
<div className="border-border border-b pb-4">
|
||||||
|
<h2 className="text-2xl font-bold">Social Profiles</h2>
|
||||||
|
<p className="text-muted-foreground mt-1 text-sm">
|
||||||
|
Connect your social media and coding platforms
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Instructions Banner */}
|
||||||
|
<div className="border-primary/30 bg-primary/5 rounded-lg border-2 p-4">
|
||||||
|
<div className="flex gap-3">
|
||||||
|
<div className="flex-shrink-0">
|
||||||
|
<svg
|
||||||
|
className="text-primary h-5 w-5"
|
||||||
|
fill="none"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
stroke="currentColor"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth={2}
|
||||||
|
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
<div className="flex-1">
|
||||||
|
<h4 className="mb-1 text-sm font-semibold">Enter usernames only, not full URLs</h4>
|
||||||
|
<p className="text-muted-foreground mb-2 text-sm">
|
||||||
|
Just provide your username or handle for each platform. We'll automatically generate
|
||||||
|
the correct URLs.
|
||||||
|
</p>
|
||||||
|
<div className="text-muted-foreground space-y-1 text-xs">
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<span className="text-green-600 dark:text-green-400">✓</span>
|
||||||
|
<span>
|
||||||
|
<strong>Correct:</strong> johndoe
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<span className="text-red-600 dark:text-red-400">✗</span>
|
||||||
|
<span>
|
||||||
|
<strong>Incorrect:</strong> https://twitter.com/johndoe
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="grid gap-4 md:grid-cols-2">
|
||||||
|
{socialPlatforms.map(({ key, label, icon, placeholder }) => (
|
||||||
|
<FormInput
|
||||||
|
key={key}
|
||||||
|
{...register(key as keyof SocialFormData)}
|
||||||
|
id={key}
|
||||||
|
label={`${icon} ${label}`}
|
||||||
|
placeholder={placeholder}
|
||||||
|
error={errors[key as keyof SocialFormData]?.message}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Twitter Badge Option - Show always with disabled state and hint */}
|
||||||
|
<div className="border-border mt-6 border-t pt-6">
|
||||||
|
<div
|
||||||
|
className={`rounded-lg p-4 transition-all ${watch('twitter') ? 'bg-accent/50' : 'bg-muted/30'}`}
|
||||||
|
>
|
||||||
|
<h4 className="mb-2 flex items-center gap-2 text-sm font-semibold">
|
||||||
|
<span>🐦</span>
|
||||||
|
<span>Twitter Enhancement</span>
|
||||||
|
</h4>
|
||||||
|
{!watch('twitter') && (
|
||||||
|
<p className="text-muted-foreground mb-3 flex items-center gap-1 text-xs">
|
||||||
|
<Info className="h-3 w-3" />
|
||||||
|
Enter your Twitter username above to enable this feature
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
<div className={!watch('twitter') ? 'pointer-events-none opacity-50' : ''}>
|
||||||
|
<FormCheckbox
|
||||||
|
{...register('twitterBadge')}
|
||||||
|
id="twitterBadge"
|
||||||
|
label="Show Twitter follow badge on profile"
|
||||||
|
disabled={!watch('twitter')}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
/**
|
|
||||||
* SEO component that queries for data with
|
|
||||||
* Gatsby's useStaticQuery React hook
|
|
||||||
*
|
|
||||||
* See: https://www.gatsbyjs.org/docs/use-static-query/
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from "react"
|
|
||||||
import PropTypes from "prop-types"
|
|
||||||
import { Helmet } from "react-helmet"
|
|
||||||
import { useStaticQuery, graphql } from "gatsby"
|
|
||||||
|
|
||||||
function SEO({ description, lang, meta, title }) {
|
|
||||||
const { site } = useStaticQuery(
|
|
||||||
graphql`
|
|
||||||
query {
|
|
||||||
site {
|
|
||||||
siteMetadata {
|
|
||||||
title
|
|
||||||
description
|
|
||||||
author
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
|
||||||
)
|
|
||||||
|
|
||||||
const metaDescription = description || site.siteMetadata.description
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Helmet
|
|
||||||
htmlAttributes={{
|
|
||||||
lang,
|
|
||||||
}}
|
|
||||||
title={title}
|
|
||||||
titleTemplate={`%s | ${site.siteMetadata.title}`}
|
|
||||||
meta={[
|
|
||||||
{
|
|
||||||
name: `description`,
|
|
||||||
content: metaDescription,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
property: `og:title`,
|
|
||||||
content: title,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
property: `og:description`,
|
|
||||||
content: metaDescription,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
property: `og:type`,
|
|
||||||
content: `website`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: `twitter:card`,
|
|
||||||
content: `summary`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: `twitter:creator`,
|
|
||||||
content: site.siteMetadata.author,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: `twitter:title`,
|
|
||||||
content: title,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: `twitter:description`,
|
|
||||||
content: metaDescription,
|
|
||||||
},
|
|
||||||
].concat(meta)}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
SEO.defaultProps = {
|
|
||||||
lang: `en`,
|
|
||||||
meta: [],
|
|
||||||
description: ``,
|
|
||||||
}
|
|
||||||
|
|
||||||
SEO.propTypes = {
|
|
||||||
description: PropTypes.string,
|
|
||||||
lang: PropTypes.string,
|
|
||||||
meta: PropTypes.arrayOf(PropTypes.object),
|
|
||||||
title: PropTypes.string.isRequired,
|
|
||||||
}
|
|
||||||
|
|
||||||
export default SEO
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
import React from "react"
|
|
||||||
import { icons, categorizedSkills } from "../constants/skills"
|
|
||||||
|
|
||||||
const Skills = props => {
|
|
||||||
const createSkill = skill => {
|
|
||||||
return (
|
|
||||||
<div className="w-1/3 sm:w-1/4 my-6" key={skill}>
|
|
||||||
<label
|
|
||||||
htmlFor={skill}
|
|
||||||
className="skillCheckboxLabel cursor-pointer flex items-center justify-start"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
id={skill}
|
|
||||||
type="checkbox"
|
|
||||||
checked={props.skills[skill]}
|
|
||||||
onChange={event => props.handleSkillsChange(skill)}
|
|
||||||
/>
|
|
||||||
<img
|
|
||||||
className="ml-4 w-8 h-8 sm:w-10 sm:h-10"
|
|
||||||
src={icons[skill]}
|
|
||||||
alt={skill}
|
|
||||||
/>
|
|
||||||
<span className="tooltiptext">{skill}</span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="px-2 sm:px-6 mb-10">
|
|
||||||
<div className="text-xl sm:text-2xl font-bold font-title mt-2 mb-2">
|
|
||||||
Skills
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{Object.keys(categorizedSkills).map(key => (
|
|
||||||
<div key={key}>
|
|
||||||
<h4 className="text-sm sm:text-xl text-gray-900 text-left">
|
|
||||||
{categorizedSkills[key].title}
|
|
||||||
</h4>
|
|
||||||
<div className="flex justify-start items-center flex-wrap w-full mb-6 pl-4 sm:pl-10">
|
|
||||||
{categorizedSkills[key].skills.map(skill => createSkill(skill))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Skills
|
|
||||||
@@ -1,325 +0,0 @@
|
|||||||
import React from "react"
|
|
||||||
|
|
||||||
const Social = props => {
|
|
||||||
return (
|
|
||||||
<div className="px-2 sm:px-6 mb-4">
|
|
||||||
<div className="text-xl sm:text-2xl font-bold font-title mt-2 mb-2">
|
|
||||||
Social
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-wrap justify-center items-center">
|
|
||||||
<div className="w-1/2 flex justify-center items-center text-xxs sm:text-lg py-4 pr-2 sm:pr-0">
|
|
||||||
<img
|
|
||||||
src="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg"
|
|
||||||
className="w-6 h-6 sm:w-8 sm:h-8 mr-1 sm:mr-4"
|
|
||||||
alt="github"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="github"
|
|
||||||
placeholder="github username"
|
|
||||||
className="outline-none placeholder-gray-700 w-32 sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-1 sm:px-2 focus:border-blue-700"
|
|
||||||
value={props.social.github}
|
|
||||||
onChange={event => props.handleSocialChange("github", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="w-1/2 flex justify-center items-center text-xxs sm:text-lg py-4 pr-2 sm:pr-0">
|
|
||||||
<img
|
|
||||||
src="https://cdn.jsdelivr.net/npm/simple-icons@v3/icons/twitter.svg"
|
|
||||||
className="w-6 h-6 sm:w-8 sm:h-8 mr-1 sm:mr-4"
|
|
||||||
alt="twitter"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="twitter"
|
|
||||||
placeholder="twitter username"
|
|
||||||
className="outline-none placeholder-gray-700 w-32 sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.social.twitter}
|
|
||||||
onChange={event => props.handleSocialChange("twitter", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="w-1/2 flex justify-center items-center text-xxs sm:text-lg py-4 pr-2 sm:pr-0">
|
|
||||||
<img
|
|
||||||
src="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/dev-dot-to.svg"
|
|
||||||
className="w-6 h-6 sm:w-8 sm:h-8 mr-1 sm:mr-4"
|
|
||||||
alt="dev.to"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="dev"
|
|
||||||
placeholder="dev.to username"
|
|
||||||
className="outline-none placeholder-gray-700 w-32 sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.social.dev}
|
|
||||||
onChange={event => props.handleSocialChange("dev", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="w-1/2 flex justify-center items-center text-xxs sm:text-lg py-4 pr-2 sm:pr-0">
|
|
||||||
<img
|
|
||||||
src="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/codepen.svg"
|
|
||||||
className="w-6 h-6 sm:w-8 sm:h-8 mr-1 sm:mr-4"
|
|
||||||
alt="codepen"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="codepen"
|
|
||||||
placeholder="codepen username"
|
|
||||||
className="outline-none placeholder-gray-700 w-32 sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.social.codepen}
|
|
||||||
onChange={event => props.handleSocialChange("codepen", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="w-1/2 flex justify-center items-center text-xxs sm:text-lg py-4 pr-2 sm:pr-0">
|
|
||||||
<img
|
|
||||||
src="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/codesandbox.svg"
|
|
||||||
className="w-6 h-6 sm:w-8 sm:h-8 mr-1 sm:mr-4"
|
|
||||||
alt="codesandbox"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="codesandbox"
|
|
||||||
placeholder="codesandbox username"
|
|
||||||
className="outline-none placeholder-gray-700 w-32 sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.social.codesandbox}
|
|
||||||
onChange={event => props.handleSocialChange("codesandbox", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="w-1/2 flex justify-center items-center text-xxs sm:text-lg py-4 pr-2 sm:pr-0">
|
|
||||||
<img
|
|
||||||
src="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/stackoverflow.svg"
|
|
||||||
className="w-6 h-6 sm:w-8 sm:h-8 mr-1 sm:mr-4"
|
|
||||||
alt="stackoverflow"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="stackoverflow"
|
|
||||||
placeholder="stackoverflow user ID"
|
|
||||||
className="outline-none placeholder-gray-700 w-32 sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.social.stackoverflow}
|
|
||||||
onChange={event => props.handleSocialChange("stackoverflow", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="w-1/2 flex justify-center items-center text-xxs sm:text-lg py-4 pr-2 sm:pr-0">
|
|
||||||
<img
|
|
||||||
src="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/linkedin.svg"
|
|
||||||
className="w-6 h-6 sm:w-8 sm:h-8 mr-1 sm:mr-4"
|
|
||||||
alt="linkedin"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="linkedin"
|
|
||||||
placeholder="linkedin username"
|
|
||||||
className="outline-none placeholder-gray-700 w-32 sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.social.linkedin}
|
|
||||||
onChange={event => props.handleSocialChange("linkedin", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="w-1/2 flex justify-center items-center text-xxs sm:text-lg py-4 pr-2 sm:pr-0">
|
|
||||||
<img
|
|
||||||
src="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/kaggle.svg"
|
|
||||||
className="w-6 h-6 sm:w-8 sm:h-8 mr-1 sm:mr-4"
|
|
||||||
alt="kaggle"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="kaggle"
|
|
||||||
placeholder="kaggle username"
|
|
||||||
className="outline-none placeholder-gray-700 w-32 sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.social.kaggle}
|
|
||||||
onChange={event => props.handleSocialChange("kaggle", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="w-1/2 flex justify-center items-center text-xxs sm:text-lg py-4 pr-2 sm:pr-0">
|
|
||||||
<img
|
|
||||||
src="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/facebook.svg"
|
|
||||||
className="w-6 h-6 sm:w-8 sm:h-8 mr-1 sm:mr-4"
|
|
||||||
alt="facebook"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="fb"
|
|
||||||
placeholder="facebook username"
|
|
||||||
className="outline-none placeholder-gray-700 w-32 sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.social.fb}
|
|
||||||
onChange={event => props.handleSocialChange("fb", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="w-1/2 flex justify-center items-center text-xxs sm:text-lg py-4 pr-2 sm:pr-0">
|
|
||||||
<img
|
|
||||||
src="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/instagram.svg"
|
|
||||||
className="w-6 h-6 sm:w-8 sm:h-8 mr-1 sm:mr-4"
|
|
||||||
alt="instagram"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="instagram"
|
|
||||||
placeholder="instagram username"
|
|
||||||
className="outline-none placeholder-gray-700 w-32 sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.social.instagram}
|
|
||||||
onChange={event => props.handleSocialChange("instagram", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="w-1/2 flex justify-center items-center text-xxs sm:text-lg py-4 pr-2 sm:pr-0">
|
|
||||||
<img
|
|
||||||
src="https://cdn.jsdelivr.net/npm/simple-icons@3.1.0/icons/dribbble.svg"
|
|
||||||
className="w-6 h-6 sm:w-8 sm:h-8 mr-1 sm:mr-4"
|
|
||||||
alt="dribbble"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="dribbble"
|
|
||||||
placeholder="dribbble username"
|
|
||||||
className="outline-none placeholder-gray-700 w-32 sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.social.dribbble}
|
|
||||||
onChange={event => props.handleSocialChange("dribbble", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="w-1/2 flex justify-center items-center text-xxs sm:text-lg py-4 pr-2 sm:pr-0">
|
|
||||||
<img
|
|
||||||
src="https://cdn.jsdelivr.net/npm/simple-icons@3.1.0/icons/behance.svg"
|
|
||||||
className="w-6 h-6 sm:w-8 sm:h-8 mr-1 sm:mr-4"
|
|
||||||
alt="behance"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="behance"
|
|
||||||
placeholder="behance username"
|
|
||||||
className="outline-none placeholder-gray-700 w-32 sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.social.behance}
|
|
||||||
onChange={event => props.handleSocialChange("behance", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="w-1/2 flex justify-center items-center text-xxs sm:text-lg py-4 pr-2 sm:pr-0">
|
|
||||||
<img
|
|
||||||
src="https://cdn.jsdelivr.net/npm/simple-icons@3.1.0/icons/medium.svg"
|
|
||||||
className="w-6 h-6 sm:w-8 sm:h-8 mr-1 sm:mr-4"
|
|
||||||
alt="medium"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="medium"
|
|
||||||
placeholder="medium username (with @)"
|
|
||||||
className="outline-none placeholder-gray-700 w-32 sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.social.medium}
|
|
||||||
onChange={event => props.handleSocialChange("medium", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="w-1/2 flex justify-center items-center text-xxs sm:text-lg py-4 pr-2 sm:pr-0">
|
|
||||||
<img
|
|
||||||
src="https://cdn.jsdelivr.net/npm/simple-icons@3.1.0/icons/youtube.svg"
|
|
||||||
className="w-6 h-6 sm:w-8 sm:h-8 mr-1 sm:mr-4"
|
|
||||||
alt="youtube"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="youtube"
|
|
||||||
placeholder="youtube channel name"
|
|
||||||
className="outline-none placeholder-gray-700 w-32 sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.social.youtube}
|
|
||||||
onChange={event => props.handleSocialChange("youtube", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="w-1/2 flex justify-center items-center text-xxs sm:text-lg py-4 pr-2 sm:pr-0">
|
|
||||||
<img
|
|
||||||
src="https://cdn.jsdelivr.net/npm/simple-icons@3.1.0/icons/codechef.svg"
|
|
||||||
className="w-6 h-6 sm:w-8 sm:h-8 mr-1 sm:mr-4"
|
|
||||||
alt="codechef"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="codechef"
|
|
||||||
placeholder="codechef username"
|
|
||||||
className="outline-none placeholder-gray-700 w-32 sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.social.codechef}
|
|
||||||
onChange={event => props.handleSocialChange("codechef", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="w-1/2 flex justify-center items-center text-xxs sm:text-lg py-4 pr-2 sm:pr-0">
|
|
||||||
<img
|
|
||||||
src="https://cdn.jsdelivr.net/npm/simple-icons@3.1.0/icons/hackerrank.svg"
|
|
||||||
className="w-6 h-6 sm:w-8 sm:h-8 mr-1 sm:mr-4"
|
|
||||||
alt="hackerrank"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="hackerrank"
|
|
||||||
placeholder="hackerrank username"
|
|
||||||
className="outline-none placeholder-gray-700 w-32 sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.social.hackerrank}
|
|
||||||
onChange={event => props.handleSocialChange("hackerrank", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="w-1/2 flex justify-center items-center text-xxs sm:text-lg py-4 pr-2 sm:pr-0">
|
|
||||||
<img
|
|
||||||
src="https://cdn.jsdelivr.net/npm/simple-icons@3.1.0/icons/codeforces.svg"
|
|
||||||
className="w-6 h-6 sm:w-8 sm:h-8 mr-1 sm:mr-4"
|
|
||||||
alt="codeforces"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="codeforces"
|
|
||||||
placeholder="codeforces username"
|
|
||||||
className="outline-none placeholder-gray-700 w-32 sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.social.codeforces}
|
|
||||||
onChange={event => props.handleSocialChange("codeforces", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="w-1/2 flex justify-center items-center text-xxs sm:text-lg py-4 pr-2 sm:pr-0">
|
|
||||||
<img
|
|
||||||
src="https://cdn.jsdelivr.net/npm/simple-icons@3.1.0/icons/leetcode.svg"
|
|
||||||
className="w-6 h-6 sm:w-8 sm:h-8 mr-1 sm:mr-4"
|
|
||||||
alt="leetcode"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="leetcode"
|
|
||||||
placeholder="leetcode username"
|
|
||||||
className="outline-none placeholder-gray-700 w-32 sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.social.leetcode}
|
|
||||||
onChange={event => props.handleSocialChange("leetcode", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="w-1/2 flex justify-center items-center text-xxs sm:text-lg py-4 pr-2 sm:pr-0">
|
|
||||||
<img
|
|
||||||
src="https://cdn.jsdelivr.net/npm/simple-icons@3.1.0/icons/topcoder.svg"
|
|
||||||
className="w-6 h-6 sm:w-8 sm:h-8 mr-1 sm:mr-4"
|
|
||||||
alt="topcoder"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="topcoder"
|
|
||||||
placeholder="topcoder username"
|
|
||||||
className="outline-none placeholder-gray-700 w-32 sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.social.topcoder}
|
|
||||||
onChange={event => props.handleSocialChange("topcoder", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="w-1/2 flex justify-center items-center text-xxs sm:text-lg py-4 pr-2 sm:pr-0">
|
|
||||||
<img
|
|
||||||
src="https://cdn.jsdelivr.net/npm/simple-icons@3.1.0/icons/hackerearth.svg"
|
|
||||||
className="w-6 h-6 sm:w-8 sm:h-8 mr-1 sm:mr-4"
|
|
||||||
alt="hackerearth"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="hackerearth"
|
|
||||||
placeholder="hackerearth user (with @)"
|
|
||||||
className="outline-none placeholder-gray-700 w-32 sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.social.hackerearth}
|
|
||||||
onChange={event => props.handleSocialChange("hackerearth", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="w-1/2 flex justify-center items-center text-xxs sm:text-lg py-4 pr-2 sm:pr-0">
|
|
||||||
<img
|
|
||||||
src="https://cdn.jsdelivr.net/npm/simple-icons@3.1.0/icons/geeksforgeeks.svg"
|
|
||||||
className="w-6 h-6 sm:w-8 sm:h-8 mr-1 sm:mr-4"
|
|
||||||
alt="geeksforgeeks"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="geeksforgeeks"
|
|
||||||
placeholder="GFG (<username>/profile)"
|
|
||||||
className="outline-none placeholder-gray-700 w-32 sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.social.geeks_for_geeks}
|
|
||||||
onChange={event =>
|
|
||||||
props.handleSocialChange("geeks_for_geeks", event)
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="w-1/2 flex justify-center items-center text-xxs sm:text-lg py-4 pr-2 sm:pr-0">
|
|
||||||
<img
|
|
||||||
src="https://cdn.jsdelivr.net/npm/simple-icons@3.1.0/icons/rss.svg"
|
|
||||||
className="w-6 h-6 sm:w-8 sm:h-8 mr-1 sm:mr-4"
|
|
||||||
alt="rssfeed"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="rssurl"
|
|
||||||
placeholder="RSS feed URL"
|
|
||||||
className="outline-none placeholder-gray-700 w-32 sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.social.rssurl}
|
|
||||||
onChange={event => props.handleSocialChange("rssurl", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Social
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import React from "react"
|
|
||||||
|
|
||||||
const Subtitle = props => {
|
|
||||||
return (
|
|
||||||
<div className="flex justify-center items-start flex-col w-full px-2 sm:px-6 mb-10">
|
|
||||||
<div className="text-xl sm:text-2xl font-bold font-title mt-2 mb-2">
|
|
||||||
Subtitle
|
|
||||||
</div>
|
|
||||||
<input
|
|
||||||
id="subtitle"
|
|
||||||
className="outline-none w-full text-xs sm:text-lg sm:w-1/2 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.data.subtitle}
|
|
||||||
onChange={event => props.handleDataChange("subtitle", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Subtitle
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
import React from "react"
|
|
||||||
|
|
||||||
const Title = props => {
|
|
||||||
return (
|
|
||||||
<div className="flex justify-center items-start flex-col w-full px-2 sm:px-6 mb-10">
|
|
||||||
<div className="text-xl sm:text-2xl font-bold font-title mt-2 mb-2">
|
|
||||||
Title
|
|
||||||
</div>
|
|
||||||
<div className="flex justify-start items-center w-full text-regular text-xs sm:text-lg">
|
|
||||||
<input
|
|
||||||
id="title-prefix"
|
|
||||||
className="outline-none w-24 sm:w-40 mr-10 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700 prefix"
|
|
||||||
value={props.prefix.title}
|
|
||||||
onChange={event => props.handlePrefixChange("title", event)}
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="title-name"
|
|
||||||
placeholder="name"
|
|
||||||
className="outline-none placeholder-gray-700 w-1/2 sm:w-1/3 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.data.title}
|
|
||||||
onChange={event => props.handleDataChange("title", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Title
|
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { useState } from 'react';
|
||||||
|
import { Settings } from 'lucide-react';
|
||||||
|
import { Select } from '@/components/ui/select';
|
||||||
|
import { useThemeStore } from '@/lib/store';
|
||||||
|
|
||||||
|
export function AccessibilityMenu() {
|
||||||
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
|
const { accessibility, setAccessibility } = useThemeStore();
|
||||||
|
|
||||||
|
// Font size options for the select component
|
||||||
|
const fontSizeOptions = [
|
||||||
|
{ value: 'small', label: 'Small' },
|
||||||
|
{ value: 'medium', label: 'Medium (Default)' },
|
||||||
|
{ value: 'large', label: 'Large' },
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="relative">
|
||||||
|
<button
|
||||||
|
onClick={() => setIsOpen(!isOpen)}
|
||||||
|
className="border-border bg-card hover:bg-accent flex h-11 w-11 items-center justify-center rounded-lg border !p-3 transition-colors"
|
||||||
|
aria-label="Accessibility settings"
|
||||||
|
title="Accessibility settings"
|
||||||
|
aria-expanded={isOpen}
|
||||||
|
>
|
||||||
|
<Settings className="h-5 w-5" />
|
||||||
|
</button>
|
||||||
|
|
||||||
|
{isOpen && (
|
||||||
|
<>
|
||||||
|
{/* Backdrop */}
|
||||||
|
<div className="fixed inset-0 z-40" onClick={() => setIsOpen(false)} aria-hidden="true" />
|
||||||
|
|
||||||
|
{/* Menu */}
|
||||||
|
<div className="border-border bg-card absolute top-full right-0 z-50 mt-2 w-72 rounded-lg border p-4 shadow-lg">
|
||||||
|
<h3 className="mb-4 text-sm font-semibold">Accessibility Settings</h3>
|
||||||
|
|
||||||
|
<div className="space-y-4">
|
||||||
|
{/* High Contrast */}
|
||||||
|
<label className="flex cursor-pointer items-center justify-between">
|
||||||
|
<span className="text-sm">High Contrast Mode</span>
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
checked={accessibility.highContrast}
|
||||||
|
onChange={(e) => setAccessibility({ highContrast: e.target.checked })}
|
||||||
|
className="border-border bg-input text-primary focus:ring-ring h-4 w-4 rounded focus:ring-2"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
{/* Font Size */}
|
||||||
|
<div className="space-y-2">
|
||||||
|
<Select
|
||||||
|
label="Font Size"
|
||||||
|
value={accessibility.fontSize}
|
||||||
|
onChange={(value) =>
|
||||||
|
setAccessibility({ fontSize: value as 'small' | 'medium' | 'large' })
|
||||||
|
}
|
||||||
|
options={fontSizeOptions}
|
||||||
|
id="fontSize"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Reduced Motion */}
|
||||||
|
<label className="flex cursor-pointer items-center justify-between">
|
||||||
|
<span className="text-sm">Reduce Motion</span>
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
checked={accessibility.reducedMotion}
|
||||||
|
onChange={(e) => setAccessibility({ reducedMotion: e.target.checked })}
|
||||||
|
className="border-border bg-input text-primary focus:ring-ring h-4 w-4 rounded focus:ring-2"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p className="border-border text-muted-foreground mt-4 border-t pt-3 text-xs">
|
||||||
|
These settings are saved locally and persist across sessions.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { useEffect } from 'react';
|
||||||
|
|
||||||
|
export function BuyMeACoffeeWidget() {
|
||||||
|
useEffect(() => {
|
||||||
|
const script = document.createElement('script');
|
||||||
|
script.setAttribute('data-name', 'BMC-Widget');
|
||||||
|
script.src = 'https://cdnjs.buymeacoffee.com/1.0.0/widget.prod.min.js';
|
||||||
|
script.setAttribute('data-id', 'rahuldkjain');
|
||||||
|
script.setAttribute('data-description', 'Support rahuldkjain on Buy me a coffee!');
|
||||||
|
script.setAttribute('data-message', '');
|
||||||
|
script.setAttribute('data-color', '#ffdd00');
|
||||||
|
script.setAttribute('data-position', 'Right');
|
||||||
|
script.setAttribute('data-x_margin', '18');
|
||||||
|
script.setAttribute('data-y_margin', '18');
|
||||||
|
script.async = true;
|
||||||
|
|
||||||
|
script.onload = function () {
|
||||||
|
const event = new CustomEvent('DOMContentLoaded', {
|
||||||
|
bubbles: true,
|
||||||
|
cancelable: true,
|
||||||
|
});
|
||||||
|
window.dispatchEvent(event);
|
||||||
|
};
|
||||||
|
|
||||||
|
document.head.appendChild(script);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
document.head.removeChild(script);
|
||||||
|
const widget = document.getElementById('bmc-wbtn');
|
||||||
|
if (widget) {
|
||||||
|
document.body.removeChild(widget);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { useState } from 'react';
|
||||||
|
import { motion, AnimatePresence } from 'framer-motion';
|
||||||
|
import { ChevronDown } from 'lucide-react';
|
||||||
|
|
||||||
|
interface CollapsibleSectionProps {
|
||||||
|
title: string;
|
||||||
|
description?: string;
|
||||||
|
icon?: string;
|
||||||
|
defaultOpen?: boolean;
|
||||||
|
children: React.ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollapsibleSection({
|
||||||
|
title,
|
||||||
|
description,
|
||||||
|
icon,
|
||||||
|
defaultOpen = false,
|
||||||
|
children,
|
||||||
|
}: CollapsibleSectionProps) {
|
||||||
|
const [isOpen, setIsOpen] = useState(defaultOpen);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="border-border bg-card rounded-lg border">
|
||||||
|
<button
|
||||||
|
onClick={() => setIsOpen(!isOpen)}
|
||||||
|
className="hover:bg-accent/50 flex w-full items-center justify-between p-4 text-left transition-colors"
|
||||||
|
aria-expanded={isOpen}
|
||||||
|
aria-label={`${isOpen ? 'Collapse' : 'Expand'} ${title} section`}
|
||||||
|
>
|
||||||
|
<div className="flex items-center gap-3">
|
||||||
|
{icon && <span className="text-xl">{icon}</span>}
|
||||||
|
<div>
|
||||||
|
<h3 className="text-sm font-semibold">{title}</h3>
|
||||||
|
{description && <p className="text-muted-foreground mt-0.5 text-xs">{description}</p>}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<motion.div
|
||||||
|
animate={{ rotate: isOpen ? 180 : 0 }}
|
||||||
|
transition={{ duration: 0.2 }}
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
<ChevronDown className="h-5 w-5" />
|
||||||
|
</motion.div>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<AnimatePresence initial={false}>
|
||||||
|
{isOpen && (
|
||||||
|
<motion.div
|
||||||
|
initial={{ height: 0, opacity: 0 }}
|
||||||
|
animate={{ height: 'auto', opacity: 1 }}
|
||||||
|
exit={{ height: 0, opacity: 0 }}
|
||||||
|
transition={{ duration: 0.2, ease: 'easeInOut' }}
|
||||||
|
style={{ overflow: 'hidden' }}
|
||||||
|
>
|
||||||
|
<div className="border-border border-t p-4">{children}</div>
|
||||||
|
</motion.div>
|
||||||
|
)}
|
||||||
|
</AnimatePresence>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,175 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { useState } from 'react';
|
||||||
|
import { motion, AnimatePresence } from 'framer-motion';
|
||||||
|
import { AlertTriangle, X } from 'lucide-react';
|
||||||
|
|
||||||
|
interface ConfirmDialogProps {
|
||||||
|
isOpen: boolean;
|
||||||
|
onClose: () => void;
|
||||||
|
onConfirm: () => void;
|
||||||
|
title: string;
|
||||||
|
message: string;
|
||||||
|
confirmText?: string;
|
||||||
|
cancelText?: string;
|
||||||
|
variant?: 'danger' | 'warning' | 'info';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ConfirmDialog({
|
||||||
|
isOpen,
|
||||||
|
onClose,
|
||||||
|
onConfirm,
|
||||||
|
title,
|
||||||
|
message,
|
||||||
|
confirmText = 'Confirm',
|
||||||
|
cancelText = 'Cancel',
|
||||||
|
variant = 'danger',
|
||||||
|
}: ConfirmDialogProps) {
|
||||||
|
const handleConfirm = () => {
|
||||||
|
onConfirm();
|
||||||
|
onClose();
|
||||||
|
};
|
||||||
|
|
||||||
|
const variantStyles = {
|
||||||
|
danger: {
|
||||||
|
icon: 'text-red-600',
|
||||||
|
confirmButton: 'bg-red-600 hover:bg-red-700 text-white',
|
||||||
|
backdrop: 'bg-red-50',
|
||||||
|
},
|
||||||
|
warning: {
|
||||||
|
icon: 'text-amber-600',
|
||||||
|
confirmButton: 'bg-amber-600 hover:bg-amber-700 text-white',
|
||||||
|
backdrop: 'bg-amber-50',
|
||||||
|
},
|
||||||
|
info: {
|
||||||
|
icon: 'text-blue-600',
|
||||||
|
confirmButton: 'bg-blue-600 hover:bg-blue-700 text-white',
|
||||||
|
backdrop: 'bg-blue-50',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const styles = variantStyles[variant];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AnimatePresence>
|
||||||
|
{isOpen && (
|
||||||
|
<>
|
||||||
|
{/* Backdrop */}
|
||||||
|
<motion.div
|
||||||
|
initial={{ opacity: 0 }}
|
||||||
|
animate={{ opacity: 1 }}
|
||||||
|
exit={{ opacity: 0 }}
|
||||||
|
className="fixed inset-0 z-50 bg-black/50 backdrop-blur-sm"
|
||||||
|
onClick={onClose}
|
||||||
|
aria-hidden="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
{/* Dialog */}
|
||||||
|
<motion.div
|
||||||
|
initial={{ opacity: 0, scale: 0.95, y: 20 }}
|
||||||
|
animate={{ opacity: 1, scale: 1, y: 0 }}
|
||||||
|
exit={{ opacity: 0, scale: 0.95, y: 20 }}
|
||||||
|
transition={{ type: 'spring', duration: 0.3 }}
|
||||||
|
className="fixed top-1/2 left-1/2 z-50 w-full max-w-md -translate-x-1/2 -translate-y-1/2 p-4"
|
||||||
|
role="dialog"
|
||||||
|
aria-labelledby="confirm-dialog-title"
|
||||||
|
aria-describedby="confirm-dialog-description"
|
||||||
|
aria-modal="true"
|
||||||
|
>
|
||||||
|
<div className="bg-card border-border rounded-xl border shadow-2xl">
|
||||||
|
{/* Header */}
|
||||||
|
<div className="flex items-start gap-4 p-6 pb-4">
|
||||||
|
<div className={`rounded-full p-2 ${styles.backdrop}`}>
|
||||||
|
<AlertTriangle className={`h-5 w-5 ${styles.icon}`} />
|
||||||
|
</div>
|
||||||
|
<div className="flex-1">
|
||||||
|
<h3 id="confirm-dialog-title" className="text-lg leading-6 font-semibold">
|
||||||
|
{title}
|
||||||
|
</h3>
|
||||||
|
<p
|
||||||
|
id="confirm-dialog-description"
|
||||||
|
className="text-muted-foreground mt-2 text-sm leading-relaxed"
|
||||||
|
>
|
||||||
|
{message}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
onClick={onClose}
|
||||||
|
className="text-muted-foreground hover:text-foreground rounded-lg p-1 transition-colors"
|
||||||
|
aria-label="Close dialog"
|
||||||
|
>
|
||||||
|
<X className="h-4 w-4" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Actions */}
|
||||||
|
<div className="flex gap-3 p-6 pt-2">
|
||||||
|
<button
|
||||||
|
onClick={onClose}
|
||||||
|
className="border-border hover:bg-accent flex-1 rounded-lg border px-4 py-2 text-sm font-medium transition-colors"
|
||||||
|
>
|
||||||
|
{cancelText}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
onClick={handleConfirm}
|
||||||
|
className={`flex-1 rounded-lg px-4 py-2 text-sm font-medium transition-colors ${styles.confirmButton}`}
|
||||||
|
>
|
||||||
|
{confirmText}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</motion.div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</AnimatePresence>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hook for using confirmation dialogs
|
||||||
|
*/
|
||||||
|
export function useConfirmDialog() {
|
||||||
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
|
const [config, setConfig] = useState<
|
||||||
|
Omit<ConfirmDialogProps, 'isOpen' | 'onClose' | 'onConfirm'>
|
||||||
|
>({
|
||||||
|
title: '',
|
||||||
|
message: '',
|
||||||
|
});
|
||||||
|
const [confirmCallback, setConfirmCallback] = useState<(() => void) | null>(null);
|
||||||
|
|
||||||
|
const showConfirm = (
|
||||||
|
options: Omit<ConfirmDialogProps, 'isOpen' | 'onClose' | 'onConfirm'> & {
|
||||||
|
onConfirm: () => void;
|
||||||
|
}
|
||||||
|
) => {
|
||||||
|
const { onConfirm, ...rest } = options;
|
||||||
|
setConfig(rest);
|
||||||
|
setConfirmCallback(() => onConfirm);
|
||||||
|
setIsOpen(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const closeDialog = () => {
|
||||||
|
setIsOpen(false);
|
||||||
|
// Clear callback after a small delay to prevent race conditions
|
||||||
|
setTimeout(() => {
|
||||||
|
setConfirmCallback(null);
|
||||||
|
}, 100);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleConfirm = () => {
|
||||||
|
if (confirmCallback) {
|
||||||
|
confirmCallback();
|
||||||
|
}
|
||||||
|
closeDialog();
|
||||||
|
};
|
||||||
|
|
||||||
|
const ConfirmDialogComponent = () => (
|
||||||
|
<ConfirmDialog isOpen={isOpen} onClose={closeDialog} onConfirm={handleConfirm} {...config} />
|
||||||
|
);
|
||||||
|
|
||||||
|
return {
|
||||||
|
showConfirm,
|
||||||
|
ConfirmDialog: ConfirmDialogComponent,
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { motion, AnimatePresence } from 'framer-motion';
|
||||||
|
import { Cookie, ShieldCheck } from 'lucide-react';
|
||||||
|
import { useConsent } from '@/hooks/use-consent';
|
||||||
|
|
||||||
|
export function CookieConsent() {
|
||||||
|
const { showBanner, acceptConsent, rejectConsent } = useConsent();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AnimatePresence>
|
||||||
|
{showBanner && (
|
||||||
|
<>
|
||||||
|
{/* Backdrop */}
|
||||||
|
<motion.div
|
||||||
|
initial={{ opacity: 0 }}
|
||||||
|
animate={{ opacity: 1 }}
|
||||||
|
exit={{ opacity: 0 }}
|
||||||
|
className="fixed inset-0 z-40 bg-black/20 backdrop-blur-sm"
|
||||||
|
aria-hidden="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
{/* Consent Banner */}
|
||||||
|
<motion.div
|
||||||
|
initial={{ opacity: 0, y: 100, scale: 0.95 }}
|
||||||
|
animate={{ opacity: 1, y: 0, scale: 1 }}
|
||||||
|
exit={{ opacity: 0, y: 100, scale: 0.95 }}
|
||||||
|
transition={{ type: 'spring', duration: 0.5 }}
|
||||||
|
className="fixed right-4 bottom-4 left-4 z-50 mx-auto max-w-2xl"
|
||||||
|
role="dialog"
|
||||||
|
aria-labelledby="cookie-consent-title"
|
||||||
|
aria-describedby="cookie-consent-description"
|
||||||
|
>
|
||||||
|
<div className="bg-card border-border rounded-xl border p-6 shadow-2xl">
|
||||||
|
{/* Header */}
|
||||||
|
<div className="mb-4 flex items-start gap-3">
|
||||||
|
<div className="bg-primary/10 text-primary rounded-lg p-2">
|
||||||
|
<Cookie className="h-5 w-5" />
|
||||||
|
</div>
|
||||||
|
<div className="flex-1">
|
||||||
|
<h3 id="cookie-consent-title" className="text-lg font-semibold">
|
||||||
|
We use cookies to improve your experience
|
||||||
|
</h3>
|
||||||
|
<p
|
||||||
|
id="cookie-consent-description"
|
||||||
|
className="text-muted-foreground mt-1 text-sm leading-relaxed"
|
||||||
|
>
|
||||||
|
We use Google Analytics to understand how you interact with our site and improve
|
||||||
|
your experience. Your data is anonymized and we don't track personal
|
||||||
|
information.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Privacy Info */}
|
||||||
|
<div className="bg-muted/50 mb-4 rounded-lg p-3">
|
||||||
|
<div className="flex items-center gap-2 text-sm">
|
||||||
|
<ShieldCheck className="h-4 w-4 text-green-600" />
|
||||||
|
<span className="font-medium">Privacy-friendly tracking</span>
|
||||||
|
</div>
|
||||||
|
<ul className="text-muted-foreground mt-2 space-y-1 text-xs">
|
||||||
|
<li>• IP addresses are anonymized</li>
|
||||||
|
<li>• No personal data is collected</li>
|
||||||
|
<li>• You can opt-out anytime</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Actions */}
|
||||||
|
<div className="flex flex-col gap-3 sm:flex-row sm:justify-between">
|
||||||
|
<div className="flex gap-2">
|
||||||
|
<button
|
||||||
|
onClick={acceptConsent}
|
||||||
|
className="bg-primary text-primary-foreground hover:bg-primary/90 flex-1 rounded-lg px-4 py-2 text-sm font-medium transition-colors sm:flex-none"
|
||||||
|
>
|
||||||
|
Accept Analytics
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
onClick={rejectConsent}
|
||||||
|
className="border-border hover:bg-accent flex-1 rounded-lg border px-4 py-2 text-sm font-medium transition-colors sm:flex-none"
|
||||||
|
>
|
||||||
|
Reject
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Learn More Link */}
|
||||||
|
<div className="flex items-center justify-center text-xs">
|
||||||
|
<a
|
||||||
|
href="https://policies.google.com/privacy"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-muted-foreground hover:text-foreground underline transition-colors"
|
||||||
|
>
|
||||||
|
Learn about Google's privacy policy
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</motion.div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</AnimatePresence>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Privacy Settings Component (for settings page or footer)
|
||||||
|
*/
|
||||||
|
export function PrivacySettings() {
|
||||||
|
const { status, resetConsent } = useConsent();
|
||||||
|
|
||||||
|
if (status === 'pending') {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="border-border bg-card rounded-lg border p-4">
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<h4 className="font-medium">Analytics Cookies</h4>
|
||||||
|
<p className="text-muted-foreground text-sm">
|
||||||
|
Status: {status === 'accepted' ? 'Enabled' : 'Disabled'}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
onClick={resetConsent}
|
||||||
|
className="border-border hover:bg-accent rounded-lg border px-3 py-2 text-sm transition-colors"
|
||||||
|
>
|
||||||
|
Change Settings
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
import { motion } from 'framer-motion';
|
||||||
|
import { useErrorToast } from '@/components/ui/toast';
|
||||||
|
|
||||||
|
interface GitHubStats {
|
||||||
|
stars: number;
|
||||||
|
forks: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function GitHubStats() {
|
||||||
|
const [stats, setStats] = useState<GitHubStats | null>(null);
|
||||||
|
const [isLoading, setIsLoading] = useState(true);
|
||||||
|
const [error, setError] = useState(false);
|
||||||
|
const errorToast = useErrorToast();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
// Smart request logic like original
|
||||||
|
const shouldRequestStats = () => {
|
||||||
|
const isFirstRequest = stats === null;
|
||||||
|
const isVisible = typeof window !== 'undefined' && document.visibilityState === 'visible';
|
||||||
|
const hasFocus = typeof window !== 'undefined' && document.hasFocus();
|
||||||
|
return isFirstRequest || (isVisible && hasFocus);
|
||||||
|
};
|
||||||
|
|
||||||
|
const fetchStats = async () => {
|
||||||
|
if (!shouldRequestStats()) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await fetch(
|
||||||
|
'https://api.github.com/repos/rahuldkjain/github-profile-readme-generator'
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
if (response.status === 403) {
|
||||||
|
const rateLimitRemaining = response.headers.get('X-RateLimit-Remaining');
|
||||||
|
if (rateLimitRemaining === '0') {
|
||||||
|
console.warn('GitHub API rate limit exceeded for stats');
|
||||||
|
setError(true);
|
||||||
|
setIsLoading(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new Error(`Failed to fetch stats (${response.status})`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = await response.json();
|
||||||
|
setStats({
|
||||||
|
stars: data.stargazers_count || 0,
|
||||||
|
forks: data.forks_count || 0,
|
||||||
|
});
|
||||||
|
setIsLoading(false);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Error fetching GitHub stats:', err);
|
||||||
|
setError(true);
|
||||||
|
setIsLoading(false);
|
||||||
|
|
||||||
|
// Only show error toast on first load, not on periodic refreshes
|
||||||
|
if (stats === null) {
|
||||||
|
errorToast(
|
||||||
|
'Failed to load GitHub stats',
|
||||||
|
"Unable to fetch repository statistics. This won't affect the generator functionality.",
|
||||||
|
{
|
||||||
|
label: 'Retry',
|
||||||
|
onClick: fetchStats,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Initial fetch
|
||||||
|
fetchStats();
|
||||||
|
|
||||||
|
// Periodic refresh like original (every minute)
|
||||||
|
const interval = setInterval(fetchStats, 60000);
|
||||||
|
|
||||||
|
return () => clearInterval(interval);
|
||||||
|
}, []); // Remove stats dependency to prevent infinite loop
|
||||||
|
|
||||||
|
if (error || isLoading) {
|
||||||
|
return null; // Don't show anything if loading or error
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!stats) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<motion.div
|
||||||
|
className="hidden items-center gap-3 lg:flex"
|
||||||
|
initial={{ opacity: 0, y: -10 }}
|
||||||
|
animate={{ opacity: 1, y: 0 }}
|
||||||
|
transition={{ duration: 0.5, ease: 'easeOut' }}
|
||||||
|
>
|
||||||
|
{/* Star Button - Styled like original */}
|
||||||
|
<motion.a
|
||||||
|
href="https://github.com/rahuldkjain/github-profile-readme-generator"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="border-foreground bg-muted hover:bg-accent flex items-center gap-1.5 border-2 px-3 py-1.5 text-xs font-medium transition-colors"
|
||||||
|
title="Star rahuldkjain/github-profile-readme-generator on GitHub"
|
||||||
|
whileHover={{ scale: 1.05 }}
|
||||||
|
whileTap={{ scale: 0.95 }}
|
||||||
|
>
|
||||||
|
<motion.svg
|
||||||
|
className="h-4 w-4"
|
||||||
|
fill="currentColor"
|
||||||
|
viewBox="0 0 20 20"
|
||||||
|
aria-hidden="true"
|
||||||
|
animate={{
|
||||||
|
rotate: [0, 360],
|
||||||
|
scale: [1, 1.1, 1],
|
||||||
|
}}
|
||||||
|
transition={{
|
||||||
|
duration: 2,
|
||||||
|
ease: 'easeInOut',
|
||||||
|
repeat: Infinity,
|
||||||
|
repeatType: 'reverse',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" />
|
||||||
|
</motion.svg>
|
||||||
|
<span>Stars</span>
|
||||||
|
<span className="font-bold">{stats.stars.toLocaleString()}</span>
|
||||||
|
</motion.a>
|
||||||
|
|
||||||
|
{/* Fork Button - Styled like original */}
|
||||||
|
<motion.a
|
||||||
|
href="https://github.com/rahuldkjain/github-profile-readme-generator/fork"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="border-foreground bg-muted hover:bg-accent flex items-center gap-1.5 border-2 px-3 py-1.5 text-xs font-medium transition-colors"
|
||||||
|
title="Fork rahuldkjain/github-profile-readme-generator on GitHub"
|
||||||
|
whileHover={{ scale: 1.05 }}
|
||||||
|
whileTap={{ scale: 0.95 }}
|
||||||
|
>
|
||||||
|
<motion.svg
|
||||||
|
className="h-4 w-4"
|
||||||
|
fill="currentColor"
|
||||||
|
viewBox="0 0 16 16"
|
||||||
|
aria-hidden="true"
|
||||||
|
animate={{
|
||||||
|
rotate: [0, 360],
|
||||||
|
scale: [1, 1.1, 1],
|
||||||
|
}}
|
||||||
|
transition={{
|
||||||
|
duration: 2,
|
||||||
|
ease: 'easeInOut',
|
||||||
|
repeat: Infinity,
|
||||||
|
repeatType: 'reverse',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<path d="M5 3.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm0 2.122a2.25 2.25 0 10-1.5 0v.878A2.25 2.25 0 005.75 8.5h1.5v2.128a2.251 2.251 0 101.5 0V8.5h1.5a2.25 2.25 0 002.25-2.25v-.878a2.25 2.25 0 10-1.5 0v.878a.75.75 0 01-.75.75h-4.5A.75.75 0 015 6.25v-.878zm3.75 7.378a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm3-8.75a.75.75 0 100-1.5.75.75 0 000 1.5z" />
|
||||||
|
</motion.svg>
|
||||||
|
<span>Forks</span>
|
||||||
|
<span className="font-bold">{stats.forks.toLocaleString()}</span>
|
||||||
|
</motion.a>
|
||||||
|
</motion.div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,203 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { useState, memo, useMemo } from 'react';
|
||||||
|
import ReactMarkdown from 'react-markdown';
|
||||||
|
import remarkGfm from 'remark-gfm';
|
||||||
|
import rehypeRaw from 'rehype-raw';
|
||||||
|
import rehypeSanitize from 'rehype-sanitize';
|
||||||
|
import { trackFileExported } from '@/lib/analytics';
|
||||||
|
|
||||||
|
interface MarkdownPreviewProps {
|
||||||
|
markdown: string;
|
||||||
|
title?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const MarkdownPreview = memo(function MarkdownPreview({
|
||||||
|
markdown,
|
||||||
|
title = 'Preview',
|
||||||
|
}: MarkdownPreviewProps) {
|
||||||
|
const [viewMode, setViewMode] = useState<'preview' | 'markdown'>('preview');
|
||||||
|
const [copied, setCopied] = useState(false);
|
||||||
|
|
||||||
|
const handleCopy = async () => {
|
||||||
|
try {
|
||||||
|
await navigator.clipboard.writeText(markdown);
|
||||||
|
setCopied(true);
|
||||||
|
setTimeout(() => setCopied(false), 2000);
|
||||||
|
|
||||||
|
// Track copy event
|
||||||
|
trackFileExported('copy', 'markdown');
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to copy:', err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleDownload = () => {
|
||||||
|
const blob = new Blob([markdown], { type: 'text/markdown' });
|
||||||
|
const url = URL.createObjectURL(blob);
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.href = url;
|
||||||
|
a.download = 'README.md';
|
||||||
|
document.body.appendChild(a);
|
||||||
|
a.click();
|
||||||
|
document.body.removeChild(a);
|
||||||
|
URL.revokeObjectURL(url);
|
||||||
|
|
||||||
|
// Track download event
|
||||||
|
trackFileExported('download', 'markdown');
|
||||||
|
};
|
||||||
|
|
||||||
|
// Memoize custom components to prevent ReactMarkdown re-renders
|
||||||
|
const markdownComponents = useMemo(
|
||||||
|
() => ({
|
||||||
|
// Custom rendering to maintain alignment and styling
|
||||||
|
p: ({ children }: any) => <p className="my-2">{children}</p>,
|
||||||
|
h1: ({ children }: any) => <h1 className="mb-4 text-center text-xl font-bold">{children}</h1>,
|
||||||
|
h3: ({ children }: any) => <h3 className="mb-2 text-lg font-semibold">{children}</h3>,
|
||||||
|
img: ({ src, alt, width }: any) => {
|
||||||
|
// Skill icons have width=40, resize them responsively
|
||||||
|
if (width === '40' || width === 40) {
|
||||||
|
return (
|
||||||
|
<img src={src} alt={alt} className="mr-4 mb-4 inline-block h-6 w-6 sm:h-10 sm:w-10" />
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// Other images (badges, stats, etc.) keep their original size
|
||||||
|
return <img src={src} alt={alt} className="inline-block" />;
|
||||||
|
},
|
||||||
|
a: ({ href, children }: any) => (
|
||||||
|
<a
|
||||||
|
href={href}
|
||||||
|
className="text-blue-600 no-underline hover:underline dark:text-blue-400"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</a>
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
[] // Empty deps - components never change
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="space-y-4" role="region" aria-label="Markdown preview and export">
|
||||||
|
{/* Header with actions - Aligned layout */}
|
||||||
|
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
||||||
|
<h3 className="text-lg font-semibold" id="preview-title">
|
||||||
|
{title}
|
||||||
|
</h3>
|
||||||
|
<div
|
||||||
|
className="flex items-center justify-between gap-4"
|
||||||
|
role="toolbar"
|
||||||
|
aria-label="Preview actions"
|
||||||
|
>
|
||||||
|
{/* View Mode Toggle - With border */}
|
||||||
|
<div
|
||||||
|
className="border-border inline-flex rounded-lg border"
|
||||||
|
role="group"
|
||||||
|
aria-label="View mode toggle"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
onClick={() => setViewMode('preview')}
|
||||||
|
className={`rounded-l-lg px-3 py-2 text-sm font-medium transition-colors ${
|
||||||
|
viewMode === 'preview' ? 'bg-primary text-primary-foreground' : 'hover:bg-accent'
|
||||||
|
}`}
|
||||||
|
aria-pressed={viewMode === 'preview'}
|
||||||
|
aria-label="Show rendered preview"
|
||||||
|
>
|
||||||
|
Preview
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
onClick={() => setViewMode('markdown')}
|
||||||
|
className={`border-border rounded-r-lg border-l px-3 py-2 text-sm font-medium transition-colors ${
|
||||||
|
viewMode === 'markdown' ? 'bg-primary text-primary-foreground' : 'hover:bg-accent'
|
||||||
|
}`}
|
||||||
|
aria-pressed={viewMode === 'markdown'}
|
||||||
|
aria-label="Show raw markdown"
|
||||||
|
>
|
||||||
|
Markdown
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Action buttons - Aligned to end */}
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
{/* Copy Button */}
|
||||||
|
<button
|
||||||
|
onClick={handleCopy}
|
||||||
|
className="border-border hover:bg-accent rounded-lg border p-2 transition-colors"
|
||||||
|
aria-label="Copy markdown to clipboard"
|
||||||
|
title="Copy markdown to clipboard"
|
||||||
|
>
|
||||||
|
{copied ? (
|
||||||
|
<svg
|
||||||
|
className="h-4 w-4 text-green-600"
|
||||||
|
fill="none"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
stroke="currentColor"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth={2}
|
||||||
|
d="M5 13l4 4L19 7"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
) : (
|
||||||
|
<svg className="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
|
<path
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth={2}
|
||||||
|
d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
{/* Download Button */}
|
||||||
|
<button
|
||||||
|
onClick={handleDownload}
|
||||||
|
className="bg-primary text-primary-foreground hover:bg-primary/90 rounded-lg p-2 transition-colors"
|
||||||
|
aria-label="Download README.md file"
|
||||||
|
title="Download README.md file"
|
||||||
|
>
|
||||||
|
<svg className="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
|
<path
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth={2}
|
||||||
|
d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Content */}
|
||||||
|
<div className="border-border bg-card min-h-[400px] rounded-lg border p-6">
|
||||||
|
{/* Copy success announcement for screen readers */}
|
||||||
|
{copied && (
|
||||||
|
<div className="sr-only" role="status" aria-live="polite">
|
||||||
|
Markdown copied to clipboard successfully
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{viewMode === 'preview' ? (
|
||||||
|
<div className="markdown-preview" role="document" aria-labelledby="preview-title">
|
||||||
|
<ReactMarkdown
|
||||||
|
remarkPlugins={[remarkGfm]}
|
||||||
|
rehypePlugins={[rehypeRaw, rehypeSanitize]}
|
||||||
|
components={markdownComponents}
|
||||||
|
>
|
||||||
|
{markdown}
|
||||||
|
</ReactMarkdown>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<pre className="text-foreground overflow-x-auto text-sm break-words whitespace-pre-wrap">
|
||||||
|
{markdown}
|
||||||
|
</pre>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
});
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { Fragment, forwardRef } from 'react';
|
||||||
|
import {
|
||||||
|
Listbox,
|
||||||
|
ListboxButton,
|
||||||
|
ListboxOptions,
|
||||||
|
ListboxOption,
|
||||||
|
Transition,
|
||||||
|
} from '@headlessui/react';
|
||||||
|
import { ChevronDown, Check } from 'lucide-react';
|
||||||
|
|
||||||
|
export interface SelectOption {
|
||||||
|
value: string;
|
||||||
|
label: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SelectProps {
|
||||||
|
label?: string;
|
||||||
|
error?: string;
|
||||||
|
helperText?: string;
|
||||||
|
placeholder?: string;
|
||||||
|
options: SelectOption[];
|
||||||
|
value?: string;
|
||||||
|
onChange?: (value: string) => void;
|
||||||
|
disabled?: boolean;
|
||||||
|
required?: boolean;
|
||||||
|
id?: string;
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Select = forwardRef<HTMLButtonElement, SelectProps>(
|
||||||
|
(
|
||||||
|
{
|
||||||
|
label,
|
||||||
|
error,
|
||||||
|
helperText,
|
||||||
|
placeholder = 'Select an option',
|
||||||
|
options,
|
||||||
|
value,
|
||||||
|
onChange,
|
||||||
|
disabled = false,
|
||||||
|
required = false,
|
||||||
|
id,
|
||||||
|
className = '',
|
||||||
|
},
|
||||||
|
ref
|
||||||
|
) => {
|
||||||
|
const selectedOption = options.find((option) => option.value === value);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={`w-full space-y-2 ${className}`}>
|
||||||
|
{label && (
|
||||||
|
<label htmlFor={id} className="text-foreground block text-sm font-medium">
|
||||||
|
{label}
|
||||||
|
{required && <span className="text-destructive ml-1">*</span>}
|
||||||
|
</label>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<Listbox value={value} onChange={onChange} disabled={disabled}>
|
||||||
|
<div className="relative">
|
||||||
|
<ListboxButton
|
||||||
|
ref={ref}
|
||||||
|
id={id}
|
||||||
|
className={`border-input bg-background text-foreground focus:ring-ring relative w-full cursor-default rounded-lg border py-2 pr-10 pl-4 text-left transition-colors focus:ring-2 focus:outline-none ${
|
||||||
|
error ? 'border-destructive focus:ring-destructive' : ''
|
||||||
|
} ${disabled ? 'cursor-not-allowed opacity-50' : 'hover:bg-accent/50'}`}
|
||||||
|
>
|
||||||
|
<span className="block truncate">
|
||||||
|
{selectedOption ? selectedOption.label : placeholder}
|
||||||
|
</span>
|
||||||
|
<span className="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3">
|
||||||
|
<ChevronDown className="text-muted-foreground h-4 w-4" aria-hidden="true" />
|
||||||
|
</span>
|
||||||
|
</ListboxButton>
|
||||||
|
|
||||||
|
<Transition
|
||||||
|
as={Fragment}
|
||||||
|
leave="transition ease-in duration-100"
|
||||||
|
leaveFrom="opacity-100"
|
||||||
|
leaveTo="opacity-0"
|
||||||
|
>
|
||||||
|
<ListboxOptions className="border-border bg-background text-foreground absolute z-50 mt-1 max-h-60 w-full overflow-auto rounded-lg border py-1 shadow-lg focus:outline-none">
|
||||||
|
{options.map((option) => (
|
||||||
|
<ListboxOption
|
||||||
|
key={option.value}
|
||||||
|
className={({ active }) =>
|
||||||
|
`relative cursor-default py-2 pr-4 pl-10 transition-colors select-none ${
|
||||||
|
active ? 'bg-accent text-accent-foreground' : ''
|
||||||
|
}`
|
||||||
|
}
|
||||||
|
value={option.value}
|
||||||
|
>
|
||||||
|
{({ selected }) => (
|
||||||
|
<>
|
||||||
|
<span
|
||||||
|
className={`block truncate ${selected ? 'font-medium' : 'font-normal'}`}
|
||||||
|
>
|
||||||
|
{option.label}
|
||||||
|
</span>
|
||||||
|
{selected ? (
|
||||||
|
<span className="text-primary absolute inset-y-0 left-0 flex items-center pl-3">
|
||||||
|
<Check className="h-4 w-4" aria-hidden="true" />
|
||||||
|
</span>
|
||||||
|
) : null}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</ListboxOption>
|
||||||
|
))}
|
||||||
|
</ListboxOptions>
|
||||||
|
</Transition>
|
||||||
|
</div>
|
||||||
|
</Listbox>
|
||||||
|
|
||||||
|
{error && (
|
||||||
|
<p className="text-destructive text-sm" role="alert">
|
||||||
|
{error}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
{helperText && !error && <p className="text-muted-foreground text-sm">{helperText}</p>}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
Select.displayName = 'Select';
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
import { Sun, Moon, Monitor } from 'lucide-react';
|
||||||
|
import { useTheme } from '@/hooks/use-theme';
|
||||||
|
import type { ThemeMode } from '@/types/theme';
|
||||||
|
|
||||||
|
export function ThemeToggle() {
|
||||||
|
const { theme, setTheme } = useTheme();
|
||||||
|
const [mounted, setMounted] = useState(false);
|
||||||
|
|
||||||
|
// Prevent hydration mismatch by only rendering after mount
|
||||||
|
useEffect(() => {
|
||||||
|
setMounted(true);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handleToggle = () => {
|
||||||
|
const modes: ThemeMode[] = ['light', 'dark', 'system'];
|
||||||
|
const currentIndex = modes.indexOf(theme);
|
||||||
|
const nextIndex = (currentIndex + 1) % modes.length;
|
||||||
|
setTheme(modes[nextIndex]);
|
||||||
|
};
|
||||||
|
|
||||||
|
const getIcon = () => {
|
||||||
|
switch (theme) {
|
||||||
|
case 'light':
|
||||||
|
return <Sun className="h-5 w-5" />;
|
||||||
|
case 'dark':
|
||||||
|
return <Moon className="h-5 w-5" />;
|
||||||
|
case 'system':
|
||||||
|
return <Monitor className="h-5 w-5" />;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Render a skeleton button during SSR to prevent layout shift
|
||||||
|
if (!mounted) {
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
className="border-border bg-card flex h-11 w-11 items-center justify-center rounded-lg border !p-3"
|
||||||
|
aria-label="Toggle theme"
|
||||||
|
title="Toggle theme"
|
||||||
|
disabled
|
||||||
|
>
|
||||||
|
<Monitor className="h-5 w-5" />
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
onClick={handleToggle}
|
||||||
|
className="border-border bg-card hover:bg-accent flex h-11 w-11 items-center justify-center rounded-lg border !p-3 transition-colors"
|
||||||
|
aria-label={`Switch to ${theme === 'light' ? 'dark' : theme === 'dark' ? 'system' : 'light'} mode`}
|
||||||
|
title={`Current: ${theme} mode. Click to switch.`}
|
||||||
|
>
|
||||||
|
{getIcon()}
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,257 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { createContext, useContext, useState, useCallback, ReactNode } from 'react';
|
||||||
|
import { motion, AnimatePresence } from 'framer-motion';
|
||||||
|
import { CheckCircle, XCircle, AlertTriangle, Info, X, Loader2 } from 'lucide-react';
|
||||||
|
|
||||||
|
interface Toast {
|
||||||
|
id: string;
|
||||||
|
type: 'success' | 'error' | 'warning' | 'info' | 'loading';
|
||||||
|
title: string;
|
||||||
|
description?: string;
|
||||||
|
duration?: number;
|
||||||
|
action?: {
|
||||||
|
label: string;
|
||||||
|
onClick: () => void;
|
||||||
|
};
|
||||||
|
dismissible?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ToastContextType {
|
||||||
|
toasts: Toast[];
|
||||||
|
addToast: (toast: Omit<Toast, 'id'>) => void;
|
||||||
|
removeToast: (id: string) => void;
|
||||||
|
updateToast: (id: string, updates: Partial<Toast>) => void;
|
||||||
|
promise: <T>(
|
||||||
|
promise: Promise<T>,
|
||||||
|
options: {
|
||||||
|
loading: string;
|
||||||
|
success: string | ((data: T) => string);
|
||||||
|
error: string | ((error: any) => string);
|
||||||
|
}
|
||||||
|
) => Promise<T>;
|
||||||
|
}
|
||||||
|
|
||||||
|
const ToastContext = createContext<ToastContextType | undefined>(undefined);
|
||||||
|
|
||||||
|
export function ToastProvider({ children }: { children: ReactNode }) {
|
||||||
|
const [toasts, setToasts] = useState<Toast[]>([]);
|
||||||
|
|
||||||
|
const addToast = useCallback((toast: Omit<Toast, 'id'>) => {
|
||||||
|
const id =
|
||||||
|
typeof crypto !== 'undefined' && crypto.randomUUID
|
||||||
|
? crypto.randomUUID()
|
||||||
|
: Math.random().toString(36).substring(2, 11);
|
||||||
|
const duration = toast.duration ?? (toast.type === 'loading' ? 0 : 5000);
|
||||||
|
const dismissible = toast.dismissible ?? true;
|
||||||
|
const newToast: Toast = {
|
||||||
|
...toast,
|
||||||
|
id,
|
||||||
|
duration,
|
||||||
|
dismissible,
|
||||||
|
};
|
||||||
|
|
||||||
|
setToasts((prev) => [...prev, newToast]);
|
||||||
|
|
||||||
|
// Auto-remove toast after duration (except loading toasts)
|
||||||
|
if (duration > 0 && toast.type !== 'loading') {
|
||||||
|
setTimeout(() => {
|
||||||
|
removeToast(id);
|
||||||
|
}, duration);
|
||||||
|
}
|
||||||
|
|
||||||
|
return id;
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const removeToast = useCallback((id: string) => {
|
||||||
|
setToasts((prev) => prev.filter((toast) => toast.id !== id));
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const updateToast = useCallback((id: string, updates: Partial<Toast>) => {
|
||||||
|
setToasts((prev) => prev.map((toast) => (toast.id === id ? { ...toast, ...updates } : toast)));
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const promiseToast = useCallback(
|
||||||
|
async <T,>(
|
||||||
|
promise: Promise<T>,
|
||||||
|
options: {
|
||||||
|
loading: string;
|
||||||
|
success: string | ((data: T) => string);
|
||||||
|
error: string | ((error: any) => string);
|
||||||
|
}
|
||||||
|
): Promise<T> => {
|
||||||
|
const loadingId = addToast({
|
||||||
|
type: 'loading',
|
||||||
|
title: options.loading,
|
||||||
|
duration: 0,
|
||||||
|
dismissible: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
const data = await promise;
|
||||||
|
|
||||||
|
// Remove loading toast and show success
|
||||||
|
removeToast(loadingId);
|
||||||
|
addToast({
|
||||||
|
type: 'success',
|
||||||
|
title: typeof options.success === 'function' ? options.success(data) : options.success,
|
||||||
|
duration: 4000,
|
||||||
|
});
|
||||||
|
|
||||||
|
return data;
|
||||||
|
} catch (error) {
|
||||||
|
// Remove loading toast and show error
|
||||||
|
removeToast(loadingId);
|
||||||
|
addToast({
|
||||||
|
type: 'error',
|
||||||
|
title: typeof options.error === 'function' ? options.error(error) : options.error,
|
||||||
|
duration: 6000,
|
||||||
|
});
|
||||||
|
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[addToast, removeToast]
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ToastContext.Provider
|
||||||
|
value={{ toasts, addToast, removeToast, updateToast, promise: promiseToast }}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
<ToastContainer />
|
||||||
|
</ToastContext.Provider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useToast() {
|
||||||
|
const context = useContext(ToastContext);
|
||||||
|
if (context === undefined) {
|
||||||
|
throw new Error('useToast must be used within a ToastProvider');
|
||||||
|
}
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
|
||||||
|
function ToastContainer() {
|
||||||
|
const { toasts, removeToast } = useToast();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="fixed right-4 bottom-4 z-50 flex max-w-sm flex-col gap-2">
|
||||||
|
<AnimatePresence>
|
||||||
|
{toasts.map((toast) => (
|
||||||
|
<ToastItem key={toast.id} toast={toast} onRemove={removeToast} />
|
||||||
|
))}
|
||||||
|
</AnimatePresence>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function ToastItem({ toast, onRemove }: { toast: Toast; onRemove: (id: string) => void }) {
|
||||||
|
const getToastStyles = () => {
|
||||||
|
switch (toast.type) {
|
||||||
|
case 'success':
|
||||||
|
return 'bg-green-50 border-green-200 text-green-800 dark:bg-green-900 dark:border-green-700 dark:text-green-100';
|
||||||
|
case 'error':
|
||||||
|
return 'bg-red-50 border-red-200 text-red-800 dark:bg-red-900 dark:border-red-700 dark:text-red-100';
|
||||||
|
case 'warning':
|
||||||
|
return 'bg-yellow-50 border-yellow-200 text-yellow-800 dark:bg-yellow-900 dark:border-yellow-700 dark:text-yellow-100';
|
||||||
|
case 'info':
|
||||||
|
return 'bg-blue-50 border-blue-200 text-blue-800 dark:bg-blue-900 dark:border-blue-700 dark:text-blue-100';
|
||||||
|
case 'loading':
|
||||||
|
return 'bg-gray-50 border-gray-200 text-gray-800 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-100';
|
||||||
|
default:
|
||||||
|
return 'bg-card border-border text-foreground';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const getIcon = () => {
|
||||||
|
switch (toast.type) {
|
||||||
|
case 'success':
|
||||||
|
return <CheckCircle className="h-5 w-5" />;
|
||||||
|
case 'error':
|
||||||
|
return <XCircle className="h-5 w-5" />;
|
||||||
|
case 'warning':
|
||||||
|
return <AlertTriangle className="h-5 w-5" />;
|
||||||
|
case 'info':
|
||||||
|
return <Info className="h-5 w-5" />;
|
||||||
|
case 'loading':
|
||||||
|
return <Loader2 className="h-5 w-5 animate-spin" />;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<motion.div
|
||||||
|
initial={{ opacity: 0, y: 50, scale: 0.3 }}
|
||||||
|
animate={{ opacity: 1, y: 0, scale: 1 }}
|
||||||
|
exit={{ opacity: 0, y: 20, scale: 0.5 }}
|
||||||
|
transition={{ duration: 0.2 }}
|
||||||
|
className={`relative flex items-start gap-3 rounded-lg border p-4 shadow-lg ${getToastStyles()}`}
|
||||||
|
>
|
||||||
|
<div className="flex-shrink-0">{getIcon()}</div>
|
||||||
|
|
||||||
|
<div className="min-w-0 flex-1">
|
||||||
|
<p className="text-sm font-medium">{toast.title}</p>
|
||||||
|
{toast.description && <p className="mt-1 text-sm">{toast.description}</p>}
|
||||||
|
{toast.action && (
|
||||||
|
<button
|
||||||
|
onClick={toast.action.onClick}
|
||||||
|
className="mt-2 text-sm font-medium underline hover:no-underline"
|
||||||
|
>
|
||||||
|
{toast.action.label}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{toast.dismissible !== false && (
|
||||||
|
<button
|
||||||
|
onClick={() => onRemove(toast.id)}
|
||||||
|
className="ml-4 inline-flex flex-shrink-0 text-sm transition-opacity hover:opacity-80"
|
||||||
|
aria-label="Close notification"
|
||||||
|
>
|
||||||
|
<X className="h-4 w-4" />
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</motion.div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convenience hooks for different toast types
|
||||||
|
export function useSuccessToast() {
|
||||||
|
const { addToast } = useToast();
|
||||||
|
return useCallback(
|
||||||
|
(title: string, description?: string) => {
|
||||||
|
addToast({ type: 'success', title, description });
|
||||||
|
},
|
||||||
|
[addToast]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useErrorToast() {
|
||||||
|
const { addToast } = useToast();
|
||||||
|
return useCallback(
|
||||||
|
(title: string, description?: string, action?: Toast['action']) => {
|
||||||
|
addToast({ type: 'error', title, description, action, duration: 8000 });
|
||||||
|
},
|
||||||
|
[addToast]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useWarningToast() {
|
||||||
|
const { addToast } = useToast();
|
||||||
|
return useCallback(
|
||||||
|
(title: string, description?: string) => {
|
||||||
|
addToast({ type: 'warning', title, description });
|
||||||
|
},
|
||||||
|
[addToast]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useInfoToast() {
|
||||||
|
const { addToast } = useToast();
|
||||||
|
return useCallback(
|
||||||
|
(title: string, description?: string) => {
|
||||||
|
addToast({ type: 'info', title, description });
|
||||||
|
},
|
||||||
|
[addToast]
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,189 +0,0 @@
|
|||||||
import React from "react"
|
|
||||||
|
|
||||||
const Work = props => {
|
|
||||||
return (
|
|
||||||
<div className="flex justify-center items-start flex-col w-full px-2 sm:px-6 mb-10">
|
|
||||||
<div className="text-xl sm:text-2xl font-bold font-title mt-2 mb-2">
|
|
||||||
Work
|
|
||||||
</div>
|
|
||||||
<div className="text-xs sm:text-lg flex flex-col sm:flex-row mb-10 justify-center sm:justify-start items-center sm:items-start w-full px-4 sm:px-0">
|
|
||||||
<input
|
|
||||||
id="currentWork-prefix"
|
|
||||||
placeholder="Hi, I'm "
|
|
||||||
className="outline-none placeholder-gray-700 mr-8 w-full sm:w-1/3 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.prefix.currentWork}
|
|
||||||
onChange={event => props.handlePrefixChange("currentWork", event)}
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="currentWork"
|
|
||||||
placeholder="project name"
|
|
||||||
className="outline-none placeholder-gray-700 mr-8 w-full sm:w-1/4 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.data.currentWork}
|
|
||||||
onChange={event => props.handleDataChange("currentWork", event)}
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="currentWork-link"
|
|
||||||
placeholder="project link"
|
|
||||||
className="outline-none placeholder-gray-700 mr-8 sm:mr-0 text-blue-700 w-full sm:w-1/4 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.link.currentWork}
|
|
||||||
onChange={event => props.handleLinkChange("currentWork", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="text-xs sm:text-lg flex flex-col sm:flex-row mb-10 justify-center sm:justify-start items-center sm:items-start w-full px-4 sm:px-0">
|
|
||||||
<input
|
|
||||||
id="collaborateOn-prefix"
|
|
||||||
className="outline-none mr-8 w-full sm:w-1/3 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.prefix.collaborateOn}
|
|
||||||
onChange={event => props.handlePrefixChange("collaborateOn", event)}
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="collaborateOn"
|
|
||||||
placeholder="project name"
|
|
||||||
className="outline-none placeholder-gray-700 mr-8 w-full sm:w-1/4 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.data.collaborateOn}
|
|
||||||
onChange={event => props.handleDataChange("collaborateOn", event)}
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="collaborateOn-link"
|
|
||||||
placeholder="project link"
|
|
||||||
className="outline-none placeholder-gray-700 mr-8 sm:mr-0 text-blue-700 w-full sm:w-1/4 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.link.collaborateOn}
|
|
||||||
onChange={event => props.handleLinkChange("collaborateOn", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="text-xs sm:text-lg flex flex-col sm:flex-row mb-10 justify-center sm:justify-start items-center sm:items-start w-full px-4 sm:px-0">
|
|
||||||
<input
|
|
||||||
id="helpWith-prefix"
|
|
||||||
className="outline-none placeholder-gray-700 mr-8 w-full sm:w-1/3 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.prefix.helpWith}
|
|
||||||
onChange={event => props.handlePrefixChange("helpWith", event)}
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="helpWith"
|
|
||||||
placeholder="project name"
|
|
||||||
className="outline-none placeholder-gray-700 mr-8 w-full sm:w-1/4 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.data.helpWith}
|
|
||||||
onChange={event => props.handleDataChange("helpWith", event)}
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="helpWith-link"
|
|
||||||
placeholder="project link"
|
|
||||||
className="outline-none placeholder-gray-700 mr-8 sm:mr-0 text-blue-700 w-full sm:w-1/4 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.link.helpWith}
|
|
||||||
onChange={event => props.handleLinkChange("helpWith", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="text-xs sm:text-lg flex flex-col sm:flex-row mb-10 justify-center sm:justify-start items-center sm:items-start w-full px-4 sm:px-0">
|
|
||||||
<input
|
|
||||||
id="currentLearn-prefix"
|
|
||||||
className="outline-none mr-8 w-full sm:w-1/3 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.prefix.currentLearn}
|
|
||||||
onChange={event => props.handlePrefixChange("currentLearn", event)}
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="currentLearn"
|
|
||||||
placeholder="Frameworks, courses etc."
|
|
||||||
className="outline-none placeholder-gray-700 w-full sm:w-1/3 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.data.currentLearn}
|
|
||||||
onChange={event => props.handleDataChange("currentLearn", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="text-xs sm:text-lg flex flex-col sm:flex-row mb-10 justify-center sm:justify-start items-center sm:items-start w-full px-4 sm:px-0">
|
|
||||||
<input
|
|
||||||
id="ama-prefix"
|
|
||||||
className="outline-none mr-8 w-full sm:w-1/3 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.prefix.ama}
|
|
||||||
onChange={event => props.handlePrefixChange("ama", event)}
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="ama"
|
|
||||||
placeholder="react, vue and gsap"
|
|
||||||
className="outline-none placeholder-gray-700 mr-8 sm:mr-0 w-full sm:w-1/3 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.data.ama}
|
|
||||||
onChange={event => props.handleDataChange("ama", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="text-xs sm:text-lg flex flex-col sm:flex-row mb-10 justify-center sm:justify-start items-center sm:items-start w-full px-4 sm:px-0">
|
|
||||||
<input
|
|
||||||
id="contact-prefix"
|
|
||||||
className="outline-none mr-8 w-full sm:w-1/3 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.prefix.contact}
|
|
||||||
onChange={event => props.handlePrefixChange("contact", event)}
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="contact"
|
|
||||||
placeholder="example@gmail.com"
|
|
||||||
className="outline-none placeholder-gray-700 mr-8 sm:mr-0 w-full sm:w-1/3 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.data.contact}
|
|
||||||
onChange={event => props.handleDataChange("contact", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="text-xs sm:text-lg flex flex-col sm:flex-row mb-10 justify-center sm:justify-start items-center sm:items-start w-full px-4 sm:px-0">
|
|
||||||
<input
|
|
||||||
id="portfolio-prefix"
|
|
||||||
className="outline-none mr-8 w-full sm:w-1/3 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.prefix.portfolio}
|
|
||||||
onChange={event => props.handlePrefixChange("portfolio", event)}
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="portfolio"
|
|
||||||
placeholder="portfolio link"
|
|
||||||
className="outline-none placeholder-gray-700 mr-8 sm:mr-0 text-blue-700 w-full sm:w-1/3 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.link.portfolio}
|
|
||||||
onChange={event => props.handleLinkChange("portfolio", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="text-xs sm:text-lg flex flex-col sm:flex-row mb-10 justify-center sm:justify-start items-center sm:items-start w-full px-4 sm:px-0">
|
|
||||||
<input
|
|
||||||
id="blog-prefix"
|
|
||||||
className="outline-none mr-8 w-full sm:w-1/3 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.prefix.blog}
|
|
||||||
onChange={event => props.handlePrefixChange("blog", event)}
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="blog"
|
|
||||||
placeholder="blog link"
|
|
||||||
className="outline-none placeholder-gray-700 mr-8 sm:mr-0 text-blue-700 w-full sm:w-1/3 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.link.blog}
|
|
||||||
onChange={event => props.handleLinkChange("blog", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="text-xs sm:text-lg flex flex-col sm:flex-row mb-10 justify-center sm:justify-start items-center sm:items-start w-full px-4 sm:px-0">
|
|
||||||
<input
|
|
||||||
id="resume-prefix"
|
|
||||||
className="outline-none mr-8 w-full sm:w-1/3 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.prefix.resume}
|
|
||||||
onChange={event => props.handlePrefixChange("resume", event)}
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="resume"
|
|
||||||
placeholder="resume link"
|
|
||||||
className="outline-none placeholder-gray-700 mr-8 sm:mr-0 text-blue-700 w-full sm:w-1/3 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.link.resume}
|
|
||||||
onChange={event => props.handleLinkChange("resume", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="text-xs sm:text-lg flex flex-col sm:flex-row mb-10 justify-center sm:justify-start items-center sm:items-start w-full px-4 sm:px-0">
|
|
||||||
<input
|
|
||||||
id="funFact-prefix"
|
|
||||||
className="outline-none mr-8 w-full sm:w-1/3 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.prefix.funFact}
|
|
||||||
onChange={event => props.handlePrefixChange("funFact", event)}
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="funFact"
|
|
||||||
placeholder="I think I am funny"
|
|
||||||
className="outline-none placeholder-gray-700 mr-8 sm:mr-0 w-full sm:w-1/3 border-t-0 border-l-0 border-r-0 border solid border-gray-900 py-1 px-2 focus:border-blue-700"
|
|
||||||
value={props.data.funFact}
|
|
||||||
onChange={event => props.handleDataChange("funFact", event)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Work
|
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
import type {
|
||||||
|
ProfilePrefix,
|
||||||
|
ProfileData,
|
||||||
|
ProfileLinks,
|
||||||
|
SocialLinks,
|
||||||
|
SupportLinks,
|
||||||
|
} from '@/types/profile';
|
||||||
|
|
||||||
|
export const DEFAULT_PREFIX: ProfilePrefix = {
|
||||||
|
title: "Hi 👋, I'm",
|
||||||
|
currentWork: "🔭 I'm currently working on",
|
||||||
|
currentLearn: "🌱 I'm currently learning",
|
||||||
|
collaborateOn: "👯 I'm looking to collaborate on",
|
||||||
|
helpWith: "🤝 I'm looking for help with",
|
||||||
|
ama: '💬 Ask me about',
|
||||||
|
contact: '📫 How to reach me',
|
||||||
|
resume: '📄 Know about my experiences',
|
||||||
|
funFact: '⚡ Fun fact',
|
||||||
|
portfolio: '👨💻 All of my projects are available at',
|
||||||
|
blog: '📝 I regularly write articles on',
|
||||||
|
};
|
||||||
|
|
||||||
|
export const DEFAULT_DATA: ProfileData = {
|
||||||
|
title: '',
|
||||||
|
subtitle: '',
|
||||||
|
currentWork: '',
|
||||||
|
currentLearn: '',
|
||||||
|
collaborateOn: '',
|
||||||
|
helpWith: '',
|
||||||
|
ama: '',
|
||||||
|
contact: '',
|
||||||
|
funFact: '',
|
||||||
|
visitorsBadge: false,
|
||||||
|
badgeStyle: 'flat',
|
||||||
|
badgeColor: '0e75b6',
|
||||||
|
badgeLabel: 'Profile views',
|
||||||
|
githubProfileTrophy: false,
|
||||||
|
githubStats: false,
|
||||||
|
githubStatsOptions: {
|
||||||
|
theme: '',
|
||||||
|
titleColor: '',
|
||||||
|
textColor: '',
|
||||||
|
bgColor: '',
|
||||||
|
hideBorder: false,
|
||||||
|
cacheSeconds: null,
|
||||||
|
locale: 'en',
|
||||||
|
},
|
||||||
|
topLanguages: false,
|
||||||
|
topLanguagesOptions: {
|
||||||
|
theme: '',
|
||||||
|
titleColor: '',
|
||||||
|
textColor: '',
|
||||||
|
bgColor: '',
|
||||||
|
hideBorder: false,
|
||||||
|
cacheSeconds: null,
|
||||||
|
locale: 'en',
|
||||||
|
},
|
||||||
|
streakStats: false,
|
||||||
|
streakStatsOptions: {
|
||||||
|
theme: '',
|
||||||
|
},
|
||||||
|
devDynamicBlogs: false,
|
||||||
|
mediumDynamicBlogs: false,
|
||||||
|
rssDynamicBlogs: false,
|
||||||
|
};
|
||||||
|
|
||||||
|
export const DEFAULT_LINK: ProfileLinks = {
|
||||||
|
currentWork: '',
|
||||||
|
collaborateOn: '',
|
||||||
|
helpWith: '',
|
||||||
|
portfolio: '',
|
||||||
|
blog: '',
|
||||||
|
resume: '',
|
||||||
|
};
|
||||||
|
|
||||||
|
export const DEFAULT_SOCIAL: SocialLinks = {
|
||||||
|
github: '',
|
||||||
|
dev: '',
|
||||||
|
linkedin: '',
|
||||||
|
codepen: '',
|
||||||
|
stackoverflow: '',
|
||||||
|
kaggle: '',
|
||||||
|
codesandbox: '',
|
||||||
|
fb: '',
|
||||||
|
instagram: '',
|
||||||
|
twitter: '',
|
||||||
|
dribbble: '',
|
||||||
|
behance: '',
|
||||||
|
medium: '',
|
||||||
|
youtube: '',
|
||||||
|
codechef: '',
|
||||||
|
hackerrank: '',
|
||||||
|
codeforces: '',
|
||||||
|
leetcode: '',
|
||||||
|
topcoder: '',
|
||||||
|
hackerearth: '',
|
||||||
|
geeks_for_geeks: '',
|
||||||
|
discord: '',
|
||||||
|
rssurl: '',
|
||||||
|
twitterBadge: false,
|
||||||
|
};
|
||||||
|
|
||||||
|
export const DEFAULT_SUPPORT: SupportLinks = {
|
||||||
|
buyMeACoffee: '',
|
||||||
|
};
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
const links = {
|
|
||||||
home: "/",
|
|
||||||
about: "/about",
|
|
||||||
addons: "/addons",
|
|
||||||
support: "/support",
|
|
||||||
}
|
|
||||||
export default links
|
|
||||||
@@ -1,568 +0,0 @@
|
|||||||
//const baseURL = 'https://devicons.github.io/devicon/devicon.git/icons/';
|
|
||||||
const categorizedSkills = {
|
|
||||||
language: {
|
|
||||||
title: "Programming Languages",
|
|
||||||
skills: [
|
|
||||||
"c",
|
|
||||||
"cplusplus",
|
|
||||||
"csharp",
|
|
||||||
"go",
|
|
||||||
"java",
|
|
||||||
"javascript",
|
|
||||||
"typescript",
|
|
||||||
"php",
|
|
||||||
"perl",
|
|
||||||
"ruby",
|
|
||||||
"scala",
|
|
||||||
"python",
|
|
||||||
"swift",
|
|
||||||
"objectivec",
|
|
||||||
"clojure",
|
|
||||||
"rust",
|
|
||||||
"haskell",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
|
|
||||||
frontend_dev: {
|
|
||||||
title: "Frontend Development",
|
|
||||||
skills: [
|
|
||||||
"vuejs",
|
|
||||||
"react",
|
|
||||||
"svelte",
|
|
||||||
"angularjs",
|
|
||||||
"backbonejs",
|
|
||||||
"bootstrap",
|
|
||||||
"vuetify",
|
|
||||||
"css3",
|
|
||||||
"html5",
|
|
||||||
"pug",
|
|
||||||
"gulp",
|
|
||||||
"sass",
|
|
||||||
"redux",
|
|
||||||
"webpack",
|
|
||||||
"babel",
|
|
||||||
"tailwind",
|
|
||||||
"materialize",
|
|
||||||
"bulma",
|
|
||||||
"gtk",
|
|
||||||
"qt",
|
|
||||||
"wx_widgets",
|
|
||||||
"ember",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
|
|
||||||
backend_dev: {
|
|
||||||
title: "Backend Development",
|
|
||||||
skills: [
|
|
||||||
"nodejs",
|
|
||||||
"spring",
|
|
||||||
"express",
|
|
||||||
"graphql",
|
|
||||||
"kafka",
|
|
||||||
"solr",
|
|
||||||
"rabbitMQ",
|
|
||||||
"hadoop",
|
|
||||||
"nginx",
|
|
||||||
"openresty",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
|
|
||||||
mobile_dev: {
|
|
||||||
title: "Mobile App Development",
|
|
||||||
skills: [
|
|
||||||
"android",
|
|
||||||
"flutter",
|
|
||||||
"dart",
|
|
||||||
"kotlin",
|
|
||||||
"nativescript",
|
|
||||||
"xamarin",
|
|
||||||
"reactnative",
|
|
||||||
"ionic",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
|
|
||||||
ai: {
|
|
||||||
title: "AI/ML",
|
|
||||||
skills: ["tensorflow", "pytorch", "opencv", "scikit_learn"],
|
|
||||||
},
|
|
||||||
|
|
||||||
database: {
|
|
||||||
title: "Database",
|
|
||||||
skills: [
|
|
||||||
"mongodb",
|
|
||||||
"mysql",
|
|
||||||
"postgresql",
|
|
||||||
"redis",
|
|
||||||
"oracle",
|
|
||||||
"cassandra",
|
|
||||||
"couchdb",
|
|
||||||
"hive",
|
|
||||||
"realm",
|
|
||||||
"mariadb",
|
|
||||||
"cockroachdb",
|
|
||||||
"elasticsearch",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
|
|
||||||
data_visualization: {
|
|
||||||
title: "Data Visualization",
|
|
||||||
skills: ["d3js", "chartjs", "canvasjs", "kibana", "grafana"],
|
|
||||||
},
|
|
||||||
|
|
||||||
devops: {
|
|
||||||
title: "Devops",
|
|
||||||
skills: [
|
|
||||||
"aws",
|
|
||||||
"docker",
|
|
||||||
"jenkins",
|
|
||||||
"gcp",
|
|
||||||
"kubernetes",
|
|
||||||
"bash",
|
|
||||||
"azure",
|
|
||||||
"vagrant",
|
|
||||||
"circleci"
|
|
||||||
],
|
|
||||||
},
|
|
||||||
|
|
||||||
baas: {
|
|
||||||
title: "Backend as a Service(BaaS)",
|
|
||||||
skills: ["firebase", "amplify"],
|
|
||||||
},
|
|
||||||
|
|
||||||
framework: {
|
|
||||||
title: "Framework",
|
|
||||||
skills: [
|
|
||||||
"django",
|
|
||||||
"dotnet",
|
|
||||||
"electron",
|
|
||||||
"symfony",
|
|
||||||
"laravel",
|
|
||||||
"codeigniter",
|
|
||||||
"rails",
|
|
||||||
"flask",
|
|
||||||
"quasar"
|
|
||||||
],
|
|
||||||
},
|
|
||||||
|
|
||||||
testing: {
|
|
||||||
title: "Testing",
|
|
||||||
skills: [
|
|
||||||
"cypress",
|
|
||||||
"selenium",
|
|
||||||
"jest",
|
|
||||||
"mocha",
|
|
||||||
"puppeteer",
|
|
||||||
"karma",
|
|
||||||
"jasmine",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
|
|
||||||
software: {
|
|
||||||
title: "Software",
|
|
||||||
skills: [
|
|
||||||
"illustrator",
|
|
||||||
"photoshop",
|
|
||||||
"xd",
|
|
||||||
"figma",
|
|
||||||
"blender",
|
|
||||||
"sketch",
|
|
||||||
"invision",
|
|
||||||
"framer",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
|
|
||||||
static_site_generator: {
|
|
||||||
title: "Static Site Generators",
|
|
||||||
skills: [
|
|
||||||
"gatsby",
|
|
||||||
"gridsome",
|
|
||||||
"hugo",
|
|
||||||
"jekyll",
|
|
||||||
"nextjs",
|
|
||||||
"nuxtjs",
|
|
||||||
"11ty",
|
|
||||||
"scully",
|
|
||||||
"sculpin",
|
|
||||||
"sapper",
|
|
||||||
"vuepress"
|
|
||||||
],
|
|
||||||
},
|
|
||||||
|
|
||||||
game_engines:{
|
|
||||||
title: "Game Engines",
|
|
||||||
skills: ["unity"],
|
|
||||||
},
|
|
||||||
|
|
||||||
other: {
|
|
||||||
title: "Other",
|
|
||||||
skills: ["linux", "git"],
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
const icons = {
|
|
||||||
vuejs:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/vuejs/vuejs-original-wordmark.svg",
|
|
||||||
react:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/react/react-original-wordmark.svg",
|
|
||||||
angularjs:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/angularjs/angularjs-original.svg",
|
|
||||||
aws:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/amazonwebservices/amazonwebservices-original-wordmark.svg",
|
|
||||||
android:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/android/android-original-wordmark.svg",
|
|
||||||
backbonejs:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/backbonejs/backbonejs-original-wordmark.svg",
|
|
||||||
bootstrap:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/bootstrap/bootstrap-plain.svg",
|
|
||||||
c: "https://devicons.github.io/devicon/devicon.git/icons/c/c-original.svg",
|
|
||||||
canvasjs:
|
|
||||||
"https://raw.githubusercontent.com/Hardik0307/Hardik0307/master/assets/canvasjs-charts.svg",
|
|
||||||
coffeescript:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/coffeescript/coffeescript-original-wordmark.svg",
|
|
||||||
codeigniter: "https://cdn.worldvectorlogo.com/logos/codeigniter.svg",
|
|
||||||
cplusplus:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/cplusplus/cplusplus-original.svg",
|
|
||||||
css3:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/css3/css3-original-wordmark.svg",
|
|
||||||
csharp:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/csharp/csharp-original.svg",
|
|
||||||
d3js:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/d3js/d3js-original.svg",
|
|
||||||
django:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/django/django-original.svg",
|
|
||||||
docker:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/docker/docker-original-wordmark.svg",
|
|
||||||
dotnet:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/dot-net/dot-net-original-wordmark.svg",
|
|
||||||
electron:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/electron/electron-original.svg",
|
|
||||||
express:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/express/express-original-wordmark.svg",
|
|
||||||
go: "https://devicons.github.io/devicon/devicon.git/icons/go/go-original.svg",
|
|
||||||
graphql: "https://www.vectorlogo.zone/logos/graphql/graphql-icon.svg",
|
|
||||||
gulp:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/gulp/gulp-plain.svg",
|
|
||||||
html5:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/html5/html5-original-wordmark.svg",
|
|
||||||
hugo: "https://api.iconify.design/logos-hugo.svg",
|
|
||||||
java:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/java/java-original-wordmark.svg",
|
|
||||||
javascript:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/javascript/javascript-original.svg",
|
|
||||||
ionic: "https://upload.wikimedia.org/wikipedia/commons/d/d1/Ionic_Logo.svg",
|
|
||||||
laravel:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/laravel/laravel-plain-wordmark.svg",
|
|
||||||
meteor:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/meteor/meteor-original-wordmark.svg",
|
|
||||||
mongodb:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/mongodb/mongodb-original-wordmark.svg",
|
|
||||||
mysql:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/mysql/mysql-original-wordmark.svg",
|
|
||||||
nginx:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/nginx/nginx-original.svg",
|
|
||||||
nodejs:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/nodejs/nodejs-original-wordmark.svg",
|
|
||||||
openresty:
|
|
||||||
"https://symbols-electrical.getvecta.com/stencil_25/66_openresty.403a21ca72.svg",
|
|
||||||
oracle:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/oracle/oracle-original.svg",
|
|
||||||
photoshop:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/photoshop/photoshop-plain.svg",
|
|
||||||
xd:
|
|
||||||
"https://cdn.worldvectorlogo.com/logos/adobe-xd.svg",
|
|
||||||
php:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/php/php-original.svg",
|
|
||||||
perl:
|
|
||||||
"https://api.iconify.design/logos-perl.svg",
|
|
||||||
postgresql:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/postgresql/postgresql-original-wordmark.svg",
|
|
||||||
python:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/python/python-original.svg",
|
|
||||||
rails:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/rails/rails-original-wordmark.svg",
|
|
||||||
redis:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/redis/redis-original-wordmark.svg",
|
|
||||||
ruby:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/ruby/ruby-original-wordmark.svg",
|
|
||||||
rust:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/rust/rust-plain.svg",
|
|
||||||
sass:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/sass/sass-original.svg",
|
|
||||||
scala:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/scala/scala-original-wordmark.svg",
|
|
||||||
symfony: "https://symfony.com/logos/symfony_black_03.svg",
|
|
||||||
spring: "https://www.vectorlogo.zone/logos/springio/springio-icon.svg",
|
|
||||||
swift:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/swift/swift-original-wordmark.svg",
|
|
||||||
typescript:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/typescript/typescript-original.svg",
|
|
||||||
linux:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/linux/linux-original.svg",
|
|
||||||
redux:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/redux/redux-original.svg",
|
|
||||||
webpack:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/webpack/webpack-original.svg",
|
|
||||||
flutter: "https://www.vectorlogo.zone/logos/flutterio/flutterio-icon.svg",
|
|
||||||
dart: "https://www.vectorlogo.zone/logos/dartlang/dartlang-icon.svg",
|
|
||||||
kotlin: "https://www.vectorlogo.zone/logos/kotlinlang/kotlinlang-icon.svg",
|
|
||||||
tensorflow:
|
|
||||||
"https://www.vectorlogo.zone/logos/tensorflow/tensorflow-icon.svg",
|
|
||||||
chartjs: "https://www.chartjs.org/media/logo-title.svg",
|
|
||||||
jenkins: "https://www.vectorlogo.zone/logos/jenkins/jenkins-icon.svg",
|
|
||||||
gcp: "https://www.vectorlogo.zone/logos/google_cloud/google_cloud-icon.svg",
|
|
||||||
kubernetes:
|
|
||||||
"https://www.vectorlogo.zone/logos/kubernetes/kubernetes-icon.svg",
|
|
||||||
azure:
|
|
||||||
"https://www.vectorlogo.zone/logos/microsoft_azure/microsoft_azure-icon.svg",
|
|
||||||
git: "https://www.vectorlogo.zone/logos/git-scm/git-scm-icon.svg",
|
|
||||||
kafka: "https://www.vectorlogo.zone/logos/apache_kafka/apache_kafka-icon.svg",
|
|
||||||
solr: "https://www.vectorlogo.zone/logos/apache_solr/apache_solr-icon.svg",
|
|
||||||
cassandra:
|
|
||||||
"https://www.vectorlogo.zone/logos/apache_cassandra/apache_cassandra-icon.svg",
|
|
||||||
rabbitMQ: "https://www.vectorlogo.zone/logos/rabbitmq/rabbitmq-icon.svg",
|
|
||||||
hadoop:
|
|
||||||
"https://www.vectorlogo.zone/logos/apache_hadoop/apache_hadoop-icon.svg",
|
|
||||||
bash: "https://www.vectorlogo.zone/logos/gnu_bash/gnu_bash-icon.svg",
|
|
||||||
pytorch: "https://www.vectorlogo.zone/logos/pytorch/pytorch-icon.svg",
|
|
||||||
opencv: "https://www.vectorlogo.zone/logos/opencv/opencv-icon.svg",
|
|
||||||
illustrator:
|
|
||||||
"https://www.vectorlogo.zone/logos/adobe_illustrator/adobe_illustrator-icon.svg",
|
|
||||||
figma: "https://www.vectorlogo.zone/logos/figma/figma-icon.svg",
|
|
||||||
blender:
|
|
||||||
"https://download.blender.org/branding/community/blender_community_badge_white.svg",
|
|
||||||
babel: "https://www.vectorlogo.zone/logos/babeljs/babeljs-icon.svg",
|
|
||||||
sketch: "https://www.vectorlogo.zone/logos/sketchapp/sketchapp-icon.svg",
|
|
||||||
flask: "https://www.vectorlogo.zone/logos/pocoo_flask/pocoo_flask-icon.svg",
|
|
||||||
nativescript:
|
|
||||||
"https://raw.githubusercontent.com/detain/svg-logos/780f25886640cef088af994181646db2f6b1a3f8/svg/nativescript.svg",
|
|
||||||
xamarin:
|
|
||||||
"https://raw.githubusercontent.com/detain/svg-logos/780f25886640cef088af994181646db2f6b1a3f8/svg/xamarin.svg",
|
|
||||||
vagrant: "https://www.vectorlogo.zone/logos/vagrantup/vagrantup-icon.svg",
|
|
||||||
tailwind:
|
|
||||||
"https://www.vectorlogo.zone/logos/tailwindcss/tailwindcss-icon.svg",
|
|
||||||
materialize:
|
|
||||||
"https://raw.githubusercontent.com/prplx/svg-logos/5585531d45d294869c4eaab4d7cf2e9c167710a9/svg/materialize.svg",
|
|
||||||
invision:
|
|
||||||
"https://www.vectorlogo.zone/logos/invisionapp/invisionapp-icon.svg",
|
|
||||||
framer: "https://www.vectorlogo.zone/logos/framer/framer-icon.svg",
|
|
||||||
bulma:
|
|
||||||
"https://raw.githubusercontent.com/gilbarbara/logos/804dc257b59e144eaca5bc6ffd16949752c6f789/logos/bulma.svg",
|
|
||||||
couchdb:
|
|
||||||
"https://raw.githubusercontent.com/devicons/devicon/0d6c64dbbf311879f7d563bfc3ccf559f9ed111c/icons/couchdb/couchdb-original.svg",
|
|
||||||
firebase: "https://www.vectorlogo.zone/logos/firebase/firebase-icon.svg",
|
|
||||||
amplify: "https://docs.amplify.aws/assets/logo-dark.svg",
|
|
||||||
hive: "https://www.vectorlogo.zone/logos/apache_hive/apache_hive-icon.svg",
|
|
||||||
realm:
|
|
||||||
"https://raw.githubusercontent.com/bestofjs/bestofjs-webui/8665e8c267a0215f3159df28b33c365198101df5/public/logos/realm.svg",
|
|
||||||
gatsby: "https://www.vectorlogo.zone/logos/gatsbyjs/gatsbyjs-icon.svg",
|
|
||||||
gridsome: "https://www.vectorlogo.zone/logos/gridsome/gridsome-icon.svg",
|
|
||||||
nuxtjs: "https://www.vectorlogo.zone/logos/nuxtjs/nuxtjs-icon.svg",
|
|
||||||
jekyll: "https://www.vectorlogo.zone/logos/jekyllrb/jekyllrb-icon.svg",
|
|
||||||
nextjs: "https://cdn.worldvectorlogo.com/logos/nextjs-3.svg",
|
|
||||||
reactnative: "https://reactnative.dev/img/header_logo.svg",
|
|
||||||
mariadb: "https://www.vectorlogo.zone/logos/mariadb/mariadb-icon.svg",
|
|
||||||
cockroachdb: "https://cdn.worldvectorlogo.com/logos/cockroachdb.svg",
|
|
||||||
objectivec:
|
|
||||||
"https://www.vectorlogo.zone/logos/apple_objectivec/apple_objectivec-icon.svg",
|
|
||||||
clojure:
|
|
||||||
"https://upload.wikimedia.org/wikipedia/commons/5/5d/Clojure_logo.svg",
|
|
||||||
haskell:
|
|
||||||
"https://upload.wikimedia.org/wikipedia/commons/1/1c/Haskell-Logo.svg",
|
|
||||||
svelte: "https://upload.wikimedia.org/wikipedia/commons/1/1b/Svelte_Logo.svg",
|
|
||||||
vuetify: "https://bestofjs.org/logos/vuetify.svg",
|
|
||||||
pug: "https://cdn.worldvectorlogo.com/logos/pug.svg",
|
|
||||||
mocha: "https://www.vectorlogo.zone/logos/mochajs/mochajs-icon.svg",
|
|
||||||
jest: "https://www.vectorlogo.zone/logos/jestjsio/jestjsio-icon.svg",
|
|
||||||
cypress:
|
|
||||||
"https://raw.githubusercontent.com/simple-icons/simple-icons/6e46ec1fc23b60c8fd0d2f2ff46db82e16dbd75f/icons/cypress.svg",
|
|
||||||
selenium:
|
|
||||||
"https://raw.githubusercontent.com/detain/svg-logos/780f25886640cef088af994181646db2f6b1a3f8/svg/selenium-logo.svg",
|
|
||||||
puppeteer: "https://www.vectorlogo.zone/logos/pptrdev/pptrdev-official.svg",
|
|
||||||
karma:
|
|
||||||
"https://raw.githubusercontent.com/detain/svg-logos/780f25886640cef088af994181646db2f6b1a3f8/svg/karma.svg",
|
|
||||||
jasmine: "https://www.vectorlogo.zone/logos/jasmine/jasmine-icon.svg",
|
|
||||||
gtk: "https://upload.wikimedia.org/wikipedia/commons/7/71/GTK_logo.svg",
|
|
||||||
qt: "https://upload.wikimedia.org/wikipedia/commons/0/0b/Qt_logo_2016.svg",
|
|
||||||
wx_widgets:
|
|
||||||
"https://upload.wikimedia.org/wikipedia/commons/b/bb/WxWidgets.svg",
|
|
||||||
ember:
|
|
||||||
"https://devicons.github.io/devicon/devicon.git/icons/ember/ember-original-wordmark.svg",
|
|
||||||
scikit_learn:
|
|
||||||
"https://upload.wikimedia.org/wikipedia/commons/0/05/Scikit_learn_logo_small.svg",
|
|
||||||
quasar:
|
|
||||||
"https://cdn.quasar.dev/logo/svg/quasar-logo.svg",
|
|
||||||
kibana:
|
|
||||||
"https://www.vectorlogo.zone/logos/elasticco_kibana/elasticco_kibana-icon.svg",
|
|
||||||
grafana:
|
|
||||||
"https://www.vectorlogo.zone/logos/grafana/grafana-icon.svg",
|
|
||||||
elasticsearch:
|
|
||||||
"https://www.vectorlogo.zone/logos/elastic/elastic-icon.svg",
|
|
||||||
circleci:
|
|
||||||
"https://www.vectorlogo.zone/logos/circleci/circleci-icon.svg",
|
|
||||||
scully:
|
|
||||||
"https://raw.githubusercontent.com/scullyio/scully/main/assets/logos/SVG/scullyio-icon.svg",
|
|
||||||
"11ty":
|
|
||||||
"https://gist.githubusercontent.com/vivek32ta/c7f7bf583c1fb1c58d89301ea40f37fd/raw/f4c85cce5790758286b8f155ef9a177710b995df/11ty.svg",
|
|
||||||
sculpin:
|
|
||||||
"https://gist.githubusercontent.com/vivek32ta/c7f7bf583c1fb1c58d89301ea40f37fd/raw/1782aef8672484698c0dd407f900c4a329ed5bc4/sculpin.svg",
|
|
||||||
sapper:
|
|
||||||
"https://raw.githubusercontent.com/bestofjs/bestofjs-webui/master/public/logos/sapper.svg",
|
|
||||||
vuepress:
|
|
||||||
"https://raw.githubusercontent.com/AliasIO/wappalyzer/master/src/drivers/webextension/images/icons/VuePress.svg",
|
|
||||||
unity:
|
|
||||||
"https://www.vectorlogo.zone/logos/unity3d/unity3d-icon.svg"
|
|
||||||
}
|
|
||||||
|
|
||||||
const skillWebsites = {
|
|
||||||
vuejs: "https://vuejs.org/",
|
|
||||||
react: "https://reactjs.org/",
|
|
||||||
angularjs: "https://angular.io",
|
|
||||||
aws: "https://aws.amazon.com",
|
|
||||||
android: "https://developer.android.com",
|
|
||||||
backbonejs: "https://backbonejs.org",
|
|
||||||
bootstrap: "https://getbootstrap.com",
|
|
||||||
c: "https://www.cprogramming.com/",
|
|
||||||
canvasjs: "https://canvasjs.com",
|
|
||||||
coffeescript: "https://offeescript.org",
|
|
||||||
codeigniter: "https://codeigniter.com",
|
|
||||||
cplusplus: "https://www.w3schools.com/cpp/",
|
|
||||||
css3: "https://www.w3schools.com/css/",
|
|
||||||
csharp: "https://www.w3schools.com/cs/",
|
|
||||||
d3js: "https://d3js.org/",
|
|
||||||
django: "https://www.djangoproject.com/",
|
|
||||||
docker: "https://www.docker.com/",
|
|
||||||
dotnet: "https://dotnet.microsoft.com/",
|
|
||||||
electron: "https://www.electronjs.org",
|
|
||||||
express: "https://expressjs.com",
|
|
||||||
go: "https://golang.org",
|
|
||||||
graphql: "https://graphql.org",
|
|
||||||
gulp: "https://gulpjs.com",
|
|
||||||
html5: "https://www.w3.org/html/",
|
|
||||||
hugo: "https://gohugo.io/",
|
|
||||||
java: "https://www.java.com",
|
|
||||||
javascript: "https://developer.mozilla.org/en-US/docs/Web/JavaScript",
|
|
||||||
ionic: "https://ionicframework.com",
|
|
||||||
laravel: "https://laravel.com/",
|
|
||||||
meteor: "https://www.meteor.com/",
|
|
||||||
mongodb: "https://www.mongodb.com/",
|
|
||||||
mysql: "https://www.mysql.com/",
|
|
||||||
nginx: "https://www.nginx.com",
|
|
||||||
nodejs: "https://nodejs.org",
|
|
||||||
openresty: "https://openresty.org/",
|
|
||||||
oracle: "https://www.oracle.com/",
|
|
||||||
photoshop: "https://www.photoshop.com/en",
|
|
||||||
xd: "https://www.adobe.com/products/xd.html",
|
|
||||||
php: "https://www.php.net",
|
|
||||||
perl: "https://www.perl.org/",
|
|
||||||
postgresql: "https://www.postgresql.org",
|
|
||||||
python: "https://www.python.org",
|
|
||||||
rails: "https://rubyonrails.org",
|
|
||||||
redis: "https://redis.io",
|
|
||||||
ruby: "https://www.ruby-lang.org/en/",
|
|
||||||
rust: "https://www.rust-lang.org",
|
|
||||||
sass: "https://sass-lang.com",
|
|
||||||
scala: "https://www.scala-lang.org",
|
|
||||||
symfony: "https://symfony.com",
|
|
||||||
spring: "",
|
|
||||||
swift: "",
|
|
||||||
typescript: "https://www.typescriptlang.org/",
|
|
||||||
linux: "https://www.linux.org/",
|
|
||||||
redux: "https://redux.js.org",
|
|
||||||
webpack: "https://webpack.js.org",
|
|
||||||
flutter: "https://flutter.dev",
|
|
||||||
dart: "https://dart.dev",
|
|
||||||
kotlin: "https://kotlinlang.org",
|
|
||||||
tensorflow: "https://www.tensorflow.org",
|
|
||||||
chartjs: "https://www.chartjs.org",
|
|
||||||
jenkins: "https://www.jenkins.io",
|
|
||||||
gcp: "https://cloud.google.com",
|
|
||||||
kubernetes: "https://kubernetes.io",
|
|
||||||
azure: "https://azure.microsoft.com/en-in/",
|
|
||||||
git: "https://git-scm.com/",
|
|
||||||
kafka: "https://kafka.apache.org/",
|
|
||||||
solr: "https://lucene.apache.org/solr/",
|
|
||||||
cassandra: "https://cassandra.apache.org/",
|
|
||||||
rabbitMQ: "https://www.rabbitmq.com",
|
|
||||||
hadoop: "https://hadoop.apache.org/",
|
|
||||||
bash: "https://www.gnu.org/software/bash/",
|
|
||||||
pytorch: "https://pytorch.org/",
|
|
||||||
opencv: "https://opencv.org/",
|
|
||||||
illustrator: "https://www.adobe.com/in/products/illustrator.html",
|
|
||||||
figma: "https://www.figma.com/",
|
|
||||||
blender: "",
|
|
||||||
babel: "https://babeljs.io/",
|
|
||||||
sketch: "https://www.sketch.com/",
|
|
||||||
flask: "",
|
|
||||||
nativescript: "https://nativescript.org/",
|
|
||||||
xamarin: "https://dotnet.microsoft.com/apps/xamarin",
|
|
||||||
vagrant: "",
|
|
||||||
tailwind: "https://tailwindcss.com/",
|
|
||||||
materialize: "https://materializecss.com/",
|
|
||||||
invision: "https://www.invisionapp.com/",
|
|
||||||
framer: "",
|
|
||||||
bulma: "https://bulma.io/",
|
|
||||||
couchdb: "",
|
|
||||||
firebase: "https://firebase.google.com/",
|
|
||||||
amplify: "https://aws.amazon.com/amplify/",
|
|
||||||
hive: "",
|
|
||||||
realm: "",
|
|
||||||
gatsby: "https://www.gatsbyjs.com/",
|
|
||||||
gridsome: "",
|
|
||||||
nuxtjs: "https://nuxtjs.org/",
|
|
||||||
jekyll: "https://jekyllrb.com/",
|
|
||||||
nextjs: "https://nextjs.org/",
|
|
||||||
reactnative: "https://reactnative.dev/",
|
|
||||||
mariadb: "https://mariadb.org/",
|
|
||||||
cockroachdb: "https://www.cockroachlabs.com/product/cockroachdb/",
|
|
||||||
objectivec: "",
|
|
||||||
clojure: "",
|
|
||||||
haskell: "",
|
|
||||||
svelte: "https://svelte.dev",
|
|
||||||
vuetify: "https://vuetifyjs.com/en/",
|
|
||||||
pug: "https://pugjs.org",
|
|
||||||
mocha: "https://mochajs.org",
|
|
||||||
jest: "https://jestjs.io",
|
|
||||||
cypress: "https://www.cypress.io",
|
|
||||||
selenium: "https://www.selenium.dev",
|
|
||||||
puppeteer: "https://github.com/puppeteer/puppeteer",
|
|
||||||
karma: "https://karma-runner.github.io/latest/index.html",
|
|
||||||
jasmine: "https://jasmine.github.io/",
|
|
||||||
gtk: "",
|
|
||||||
qt: "",
|
|
||||||
wx_widgets: "",
|
|
||||||
ember: "",
|
|
||||||
scikit_learn: "",
|
|
||||||
quasar: "https://quasar.dev/",
|
|
||||||
kibana: "https://www.elastic.co/kibana",
|
|
||||||
grafana: "https://grafana.com",
|
|
||||||
elasticsearch: "https://www.elastic.co",
|
|
||||||
circleci: "https://circleci.com",
|
|
||||||
scully: "https://scully.io/",
|
|
||||||
sculpin: "https://sculpin.io/",
|
|
||||||
"11ty": "https://www.11ty.dev/",
|
|
||||||
sapper: "https://sapper.svelte.dev/",
|
|
||||||
vuepress: "https://vuepress.vuejs.org/",
|
|
||||||
unity: "https://unity.com/"
|
|
||||||
}
|
|
||||||
|
|
||||||
const initialSkillState = {}
|
|
||||||
|
|
||||||
const skillsArray = Object.keys(categorizedSkills).map(
|
|
||||||
key => categorizedSkills[key].skills
|
|
||||||
)
|
|
||||||
const skills = [].concat.apply([], skillsArray).sort()
|
|
||||||
|
|
||||||
skills.forEach(skill => {
|
|
||||||
initialSkillState[skill] = false
|
|
||||||
})
|
|
||||||
|
|
||||||
const categories = Object.keys(categorizedSkills)
|
|
||||||
|
|
||||||
export {
|
|
||||||
initialSkillState,
|
|
||||||
icons,
|
|
||||||
skills,
|
|
||||||
skillWebsites,
|
|
||||||
categorizedSkills,
|
|
||||||
categories,
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,245 @@
|
|||||||
|
import type { CategorizedSkills, SkillState } from '@/types/skills';
|
||||||
|
|
||||||
|
export const categorizedSkills: CategorizedSkills = {
|
||||||
|
language: {
|
||||||
|
title: 'Programming Languages',
|
||||||
|
skills: [
|
||||||
|
'c',
|
||||||
|
'cplusplus',
|
||||||
|
'csharp',
|
||||||
|
'go',
|
||||||
|
'java',
|
||||||
|
'javascript',
|
||||||
|
'typescript',
|
||||||
|
'php',
|
||||||
|
'perl',
|
||||||
|
'ruby',
|
||||||
|
'scala',
|
||||||
|
'python',
|
||||||
|
'swift',
|
||||||
|
'objectivec',
|
||||||
|
'clojure',
|
||||||
|
'rust',
|
||||||
|
'haskell',
|
||||||
|
'coffeescript',
|
||||||
|
'elixir',
|
||||||
|
'erlang',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
frontend_dev: {
|
||||||
|
title: 'Frontend Development',
|
||||||
|
skills: [
|
||||||
|
'vuejs',
|
||||||
|
'react',
|
||||||
|
'svelte',
|
||||||
|
'angularjs',
|
||||||
|
'angular',
|
||||||
|
'backbonejs',
|
||||||
|
'bootstrap',
|
||||||
|
'vuetify',
|
||||||
|
'css3',
|
||||||
|
'html5',
|
||||||
|
'pug',
|
||||||
|
'gulp',
|
||||||
|
'sass',
|
||||||
|
'redux',
|
||||||
|
'webpack',
|
||||||
|
'babel',
|
||||||
|
'tailwind',
|
||||||
|
'materialize',
|
||||||
|
'bulma',
|
||||||
|
'gtk',
|
||||||
|
'qt',
|
||||||
|
'ember',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
backend_dev: {
|
||||||
|
title: 'Backend Development',
|
||||||
|
skills: [
|
||||||
|
'nodejs',
|
||||||
|
'spring',
|
||||||
|
'express',
|
||||||
|
'graphql',
|
||||||
|
'kafka',
|
||||||
|
'solr',
|
||||||
|
'rabbitMQ',
|
||||||
|
'hadoop',
|
||||||
|
'nginx',
|
||||||
|
'openresty',
|
||||||
|
'nestjs',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
mobile_dev: {
|
||||||
|
title: 'Mobile App Development',
|
||||||
|
skills: [
|
||||||
|
'android',
|
||||||
|
'flutter',
|
||||||
|
'dart',
|
||||||
|
'kotlin',
|
||||||
|
'nativescript',
|
||||||
|
'xamarin',
|
||||||
|
'reactnative',
|
||||||
|
'ionic',
|
||||||
|
'apachecordova',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
ai: {
|
||||||
|
title: 'AI/ML',
|
||||||
|
skills: [
|
||||||
|
// Core ML Frameworks
|
||||||
|
'tensorflow',
|
||||||
|
'pytorch',
|
||||||
|
'keras',
|
||||||
|
'scikit_learn',
|
||||||
|
'opencv',
|
||||||
|
// Data Science
|
||||||
|
'pandas',
|
||||||
|
'numpy',
|
||||||
|
'matplotlib',
|
||||||
|
'seaborn',
|
||||||
|
'jupyter',
|
||||||
|
'anaconda',
|
||||||
|
// Modern AI Tools
|
||||||
|
'langchain',
|
||||||
|
'huggingface',
|
||||||
|
'ollama',
|
||||||
|
// ML Ops & Deployment
|
||||||
|
'mlflow',
|
||||||
|
'streamlit',
|
||||||
|
'fastapi',
|
||||||
|
'gradio',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
database: {
|
||||||
|
title: 'Database',
|
||||||
|
skills: [
|
||||||
|
'mongodb',
|
||||||
|
'mysql',
|
||||||
|
'postgresql',
|
||||||
|
'redis',
|
||||||
|
'oracle',
|
||||||
|
'cassandra',
|
||||||
|
'couchdb',
|
||||||
|
'hive',
|
||||||
|
'realm',
|
||||||
|
'mariadb',
|
||||||
|
'cockroachdb',
|
||||||
|
'elasticsearch',
|
||||||
|
'sqlite',
|
||||||
|
'mssql',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
data_visualization: {
|
||||||
|
title: 'Data Visualization',
|
||||||
|
skills: ['d3js', 'chartjs', 'canvasjs', 'kibana', 'grafana'],
|
||||||
|
},
|
||||||
|
|
||||||
|
devops: {
|
||||||
|
title: 'Devops',
|
||||||
|
skills: [
|
||||||
|
'aws',
|
||||||
|
'docker',
|
||||||
|
'jenkins',
|
||||||
|
'gcp',
|
||||||
|
'kubernetes',
|
||||||
|
'bash',
|
||||||
|
'azure',
|
||||||
|
'vagrant',
|
||||||
|
'circleci',
|
||||||
|
'travisci',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
baas: {
|
||||||
|
title: 'Backend as a Service(BaaS)',
|
||||||
|
skills: ['firebase', 'appwrite', 'amplify', 'heroku'],
|
||||||
|
},
|
||||||
|
|
||||||
|
framework: {
|
||||||
|
title: 'Framework',
|
||||||
|
skills: [
|
||||||
|
'django',
|
||||||
|
'dotnet',
|
||||||
|
'electron',
|
||||||
|
'symfony',
|
||||||
|
'laravel',
|
||||||
|
'codeigniter',
|
||||||
|
'rails',
|
||||||
|
'flask',
|
||||||
|
'quasar',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
testing: {
|
||||||
|
title: 'Testing',
|
||||||
|
skills: ['cypress', 'selenium', 'jest', 'mocha', 'puppeteer', 'karma', 'jasmine'],
|
||||||
|
},
|
||||||
|
|
||||||
|
software: {
|
||||||
|
title: 'Software',
|
||||||
|
skills: [
|
||||||
|
'illustrator',
|
||||||
|
'photoshop',
|
||||||
|
'xd',
|
||||||
|
'figma',
|
||||||
|
'blender',
|
||||||
|
'sketch',
|
||||||
|
'invision',
|
||||||
|
'framer',
|
||||||
|
'matlab',
|
||||||
|
'postman',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
static_site_generator: {
|
||||||
|
title: 'Static Site Generators',
|
||||||
|
skills: [
|
||||||
|
'gatsby',
|
||||||
|
'gridsome',
|
||||||
|
'hugo',
|
||||||
|
'jekyll',
|
||||||
|
'nextjs',
|
||||||
|
'nuxtjs',
|
||||||
|
'11ty',
|
||||||
|
'scully',
|
||||||
|
'sculpin',
|
||||||
|
'vuepress',
|
||||||
|
'hexo',
|
||||||
|
'middleman',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
game_engines: {
|
||||||
|
title: 'Game Engines',
|
||||||
|
skills: ['unity', 'unreal'],
|
||||||
|
},
|
||||||
|
|
||||||
|
automation: {
|
||||||
|
title: 'Automation',
|
||||||
|
skills: ['zapier', 'ifttt'],
|
||||||
|
},
|
||||||
|
|
||||||
|
other: {
|
||||||
|
title: 'Other',
|
||||||
|
skills: ['linux', 'git', 'arduino'],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Get all skills as a flat array
|
||||||
|
const skillsArray = Object.keys(categorizedSkills).map((key) => categorizedSkills[key].skills);
|
||||||
|
export const skills = skillsArray.flat().sort();
|
||||||
|
|
||||||
|
// Initialize skill state
|
||||||
|
export const initialSkillState: SkillState = {};
|
||||||
|
skills.forEach((skill) => {
|
||||||
|
initialSkillState[skill] = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Export categories
|
||||||
|
export const categories = Object.keys(categorizedSkills);
|
||||||
|
Before Width: | Height: | Size: 395 KiB |
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 968 KiB |
@@ -0,0 +1,101 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { useState, useEffect } from 'react';
|
||||||
|
|
||||||
|
export type ConsentStatus = 'pending' | 'accepted' | 'rejected';
|
||||||
|
|
||||||
|
interface ConsentState {
|
||||||
|
status: ConsentStatus;
|
||||||
|
showBanner: boolean;
|
||||||
|
acceptConsent: () => void;
|
||||||
|
rejectConsent: () => void;
|
||||||
|
resetConsent: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hook for managing GDPR cookie consent
|
||||||
|
*/
|
||||||
|
export function useConsent(): ConsentState {
|
||||||
|
const [status, setStatus] = useState<ConsentStatus>('pending');
|
||||||
|
const [showBanner, setShowBanner] = useState(false);
|
||||||
|
|
||||||
|
// Load consent status from localStorage on mount
|
||||||
|
useEffect(() => {
|
||||||
|
if (typeof window === 'undefined') return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const savedConsent = localStorage.getItem('analytics-consent');
|
||||||
|
const consentTimestamp = localStorage.getItem('analytics-consent-timestamp');
|
||||||
|
|
||||||
|
if (savedConsent && consentTimestamp) {
|
||||||
|
// Check if consent is still valid (30 days)
|
||||||
|
const consentDate = new Date(consentTimestamp);
|
||||||
|
const thirtyDaysAgo = new Date();
|
||||||
|
thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30);
|
||||||
|
|
||||||
|
if (consentDate > thirtyDaysAgo) {
|
||||||
|
setStatus(savedConsent as ConsentStatus);
|
||||||
|
setShowBanner(false);
|
||||||
|
} else {
|
||||||
|
// Consent expired, show banner again
|
||||||
|
setStatus('pending');
|
||||||
|
setShowBanner(true);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// No consent found, show banner
|
||||||
|
setStatus('pending');
|
||||||
|
setShowBanner(true);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.warn('Failed to load consent status:', error);
|
||||||
|
setStatus('pending');
|
||||||
|
setShowBanner(true);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const acceptConsent = () => {
|
||||||
|
try {
|
||||||
|
localStorage.setItem('analytics-consent', 'accepted');
|
||||||
|
localStorage.setItem('analytics-consent-timestamp', new Date().toISOString());
|
||||||
|
setStatus('accepted');
|
||||||
|
setShowBanner(false);
|
||||||
|
|
||||||
|
// Reload page to initialize analytics
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.warn('Failed to save consent:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const rejectConsent = () => {
|
||||||
|
try {
|
||||||
|
localStorage.setItem('analytics-consent', 'rejected');
|
||||||
|
localStorage.setItem('analytics-consent-timestamp', new Date().toISOString());
|
||||||
|
setStatus('rejected');
|
||||||
|
setShowBanner(false);
|
||||||
|
} catch (error) {
|
||||||
|
console.warn('Failed to save consent rejection:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const resetConsent = () => {
|
||||||
|
try {
|
||||||
|
localStorage.removeItem('analytics-consent');
|
||||||
|
localStorage.removeItem('analytics-consent-timestamp');
|
||||||
|
setStatus('pending');
|
||||||
|
setShowBanner(true);
|
||||||
|
} catch (error) {
|
||||||
|
console.warn('Failed to reset consent:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
status,
|
||||||
|
showBanner,
|
||||||
|
acceptConsent,
|
||||||
|
rejectConsent,
|
||||||
|
resetConsent,
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { useState, useEffect, useCallback } from 'react';
|
||||||
|
|
||||||
|
export function useLocalStorage<T>(key: string, initialValue: T) {
|
||||||
|
// State to store our value
|
||||||
|
const [storedValue, setStoredValue] = useState<T>(initialValue);
|
||||||
|
const [isLoaded, setIsLoaded] = useState(false);
|
||||||
|
|
||||||
|
// Load initial value from localStorage
|
||||||
|
useEffect(() => {
|
||||||
|
try {
|
||||||
|
const item = window.localStorage.getItem(key);
|
||||||
|
if (item) {
|
||||||
|
setStoredValue(JSON.parse(item));
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Error loading ${key} from localStorage:`, error);
|
||||||
|
} finally {
|
||||||
|
setIsLoaded(true);
|
||||||
|
}
|
||||||
|
}, [key]);
|
||||||
|
|
||||||
|
// Return a wrapped version of useState's setter function that persists the new value to localStorage
|
||||||
|
const setValue = useCallback(
|
||||||
|
(value: T | ((val: T) => T)) => {
|
||||||
|
try {
|
||||||
|
// Allow value to be a function so we have same API as useState
|
||||||
|
const valueToStore = value instanceof Function ? value(storedValue) : value;
|
||||||
|
setStoredValue(valueToStore);
|
||||||
|
window.localStorage.setItem(key, JSON.stringify(valueToStore));
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Error saving ${key} to localStorage:`, error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[key, storedValue]
|
||||||
|
);
|
||||||
|
|
||||||
|
const clearValue = useCallback(() => {
|
||||||
|
try {
|
||||||
|
window.localStorage.removeItem(key);
|
||||||
|
setStoredValue(initialValue);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Error clearing ${key} from localStorage:`, error);
|
||||||
|
}
|
||||||
|
}, [key, initialValue]);
|
||||||
|
|
||||||
|
return [storedValue, setValue, clearValue, isLoaded] as const;
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { useEffect } from 'react';
|
||||||
|
import { useThemeStore } from '@/lib/store';
|
||||||
|
import type { ThemeMode } from '@/types/theme';
|
||||||
|
|
||||||
|
export function useTheme() {
|
||||||
|
const { mode, resolvedTheme, setMode, setResolvedTheme } = useThemeStore();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const root = document.documentElement;
|
||||||
|
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
||||||
|
|
||||||
|
const updateTheme = () => {
|
||||||
|
const isDark = mode === 'dark' || (mode === 'system' && mediaQuery.matches);
|
||||||
|
const newTheme = isDark ? 'dark' : 'light';
|
||||||
|
|
||||||
|
// Only update if theme actually changed
|
||||||
|
if (resolvedTheme !== newTheme) {
|
||||||
|
setResolvedTheme(newTheme);
|
||||||
|
|
||||||
|
// Temporarily disable transitions for instant theme switch
|
||||||
|
root.classList.add('theme-switching');
|
||||||
|
|
||||||
|
// Use requestAnimationFrame for smoother transitions
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
// Remove both classes first to avoid conflicts
|
||||||
|
root.classList.remove('dark', 'light');
|
||||||
|
|
||||||
|
// Add the new theme class
|
||||||
|
root.classList.add(newTheme);
|
||||||
|
|
||||||
|
// Re-enable transitions after a short delay (matching CSS transition duration)
|
||||||
|
setTimeout(() => {
|
||||||
|
root.classList.remove('theme-switching');
|
||||||
|
}, 25); // Half of 100ms for optimal timing
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
updateTheme();
|
||||||
|
|
||||||
|
const listener = () => {
|
||||||
|
if (mode === 'system') {
|
||||||
|
updateTheme();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
mediaQuery.addEventListener('change', listener);
|
||||||
|
return () => mediaQuery.removeEventListener('change', listener);
|
||||||
|
}, [mode, resolvedTheme, setResolvedTheme]);
|
||||||
|
|
||||||
|
const setTheme = (newMode: ThemeMode) => {
|
||||||
|
setMode(newMode);
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
theme: mode,
|
||||||
|
resolvedTheme,
|
||||||
|
setTheme,
|
||||||
|
};
|
||||||
|
}
|
||||||