Compare commits
312 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1713b6d82b | ||
|
|
92a49a6302 | ||
|
|
7f9d0d9514 | ||
|
|
692c8ba8c7 | ||
|
|
ac7356a222 | ||
|
|
fe5fec779e | ||
|
|
eb4d65b44a | ||
|
|
b6c7a2ede0 | ||
|
|
91d4e799a4 | ||
|
|
e724ca8aca | ||
|
|
d87f8986ee | ||
|
|
0f9ceb0d98 | ||
|
|
b2429b359d | ||
|
|
cacd093f6f | ||
|
|
afc303a889 | ||
|
|
4be3b67118 | ||
|
|
143a16c410 | ||
|
|
dc8f1d68a9 | ||
|
|
68d04646b3 | ||
|
|
03e267fe99 | ||
|
|
1cc331be52 | ||
|
|
fee3cebf54 | ||
|
|
903af97cfe | ||
|
|
b7c8b21999 | ||
|
|
6fce517b0b | ||
|
|
dbdabc7b4a | ||
|
|
66bd370f34 | ||
|
|
caff2ce258 | ||
|
|
a4ad42f40d | ||
|
|
4edef5df4b | ||
|
|
9cab9f209b | ||
|
|
f4a1fff90f | ||
|
|
ac00471cdc | ||
|
|
d97c758629 | ||
|
|
098e5cdd1e | ||
|
|
8d4d8b219e | ||
|
|
0805080cce | ||
|
|
2c60ff1ec9 | ||
|
|
f115c763a2 | ||
|
|
e5aa0d516e | ||
|
|
1ae972acd3 | ||
|
|
ded02858a8 | ||
|
|
fb7b64c4e8 | ||
|
|
8901157e01 | ||
|
|
6944b2ca4d | ||
|
|
a8a56d67e4 | ||
|
|
04e14af71a | ||
|
|
a4b296172e | ||
|
|
e16f50b349 | ||
|
|
0c2b93ff85 | ||
|
|
fb55338ea9 | ||
|
|
c279dc9ac5 | ||
|
|
6ef1a5fe9b | ||
|
|
eccb38a29c | ||
|
|
107ffae90d | ||
|
|
56b5906e01 | ||
|
|
ed6396c2c2 | ||
|
|
f41fc775a9 | ||
|
|
5e3fa7075a | ||
|
|
21634afb62 | ||
|
|
5fcb803436 | ||
|
|
305044a8fc | ||
|
|
dc80a9db9e | ||
|
|
e8d0d8eb28 | ||
|
|
efbd5f96fe | ||
|
|
630d9711ec | ||
|
|
647195f224 | ||
|
|
be09c170b9 | ||
|
|
6020ecf818 | ||
|
|
7cd1bd87fd | ||
|
|
0d6eef906f | ||
|
|
6b3d089b4b | ||
|
|
36097918fd | ||
|
|
e5cc04ec57 | ||
|
|
b1fcdcf0c5 | ||
|
|
2b50dfcf6c | ||
|
|
43b0bc91f0 | ||
|
|
6672d91d1c | ||
|
|
aad79fa521 | ||
|
|
fb08deafd6 | ||
|
|
7f73463863 | ||
|
|
5983a95a9f | ||
|
|
ea9f8977b8 | ||
|
|
4b07170613 | ||
|
|
f6f38d908c | ||
|
|
dcd1b56fe7 | ||
|
|
166392a306 | ||
|
|
5a4423e7fa | ||
|
|
4800b0e1ae | ||
|
|
ff3d0f1abd | ||
|
|
035eb95723 | ||
|
|
0f3becb8f9 | ||
|
|
9486c2b3ef | ||
|
|
bbb8911495 | ||
|
|
f0849a1bbb | ||
|
|
bbb7f41dd3 | ||
|
|
d7194ecada | ||
|
|
4b5ec65fe7 | ||
|
|
36f9487eca | ||
|
|
5731e64819 | ||
|
|
66d680e2ec | ||
|
|
6f64574f5c | ||
|
|
28abcd0570 | ||
|
|
aef59d1d68 | ||
|
|
5345d2af3d | ||
|
|
df281242e1 | ||
|
|
fabb4f67a7 | ||
|
|
665ee17be9 | ||
|
|
296c2adc46 | ||
|
|
fb8f5e3bec | ||
|
|
19955a44d0 | ||
|
|
7d9b1d9606 | ||
|
|
48f4920c1d | ||
|
|
8dbe879711 | ||
|
|
cdc66ea70b | ||
|
|
851f761104 | ||
|
|
6c2ca85bc9 | ||
|
|
54ff094b64 | ||
|
|
e46529b25b | ||
|
|
21f8b0633d | ||
|
|
37618822b7 | ||
|
|
d00fa61b08 | ||
|
|
f75eae4547 | ||
|
|
2743dee9aa | ||
|
|
4cb107e168 | ||
|
|
59a9a2fac4 | ||
|
|
263984b0a4 | ||
|
|
7794d543d3 | ||
|
|
2623da910b | ||
|
|
277fe5b01c | ||
|
|
9f24ddbe46 | ||
|
|
8dedc09ea8 | ||
|
|
82eb282e17 | ||
|
|
c6066fd038 | ||
|
|
5058711985 | ||
|
|
bbac82bd16 | ||
|
|
39125b018c | ||
|
|
7964ae57bb | ||
|
|
b3715bca0a | ||
|
|
07e1e090a1 | ||
|
|
c453eb95fd | ||
|
|
9ac2e49a58 | ||
|
|
24b2194129 | ||
|
|
d5bea5a160 | ||
|
|
2209b21942 | ||
|
|
725091dc52 | ||
|
|
4013491663 | ||
|
|
4390701a8c | ||
|
|
ad2439316e | ||
|
|
a4b1660004 | ||
|
|
4bbbf7cde3 | ||
|
|
b89dd276df | ||
|
|
7f007a8bb0 | ||
|
|
741e8ff6cd | ||
|
|
ebc01a51f9 | ||
|
|
f309fdb5a6 | ||
|
|
764fbea04b | ||
|
|
e0b62bb38c | ||
|
|
db3d5c363d | ||
|
|
f409069210 | ||
|
|
da281dfc80 | ||
|
|
a40a6a669f | ||
|
|
d7fa99c787 | ||
|
|
1f74163548 | ||
|
|
ea71fdee1d | ||
|
|
d719e38531 | ||
|
|
f8fff21f3c | ||
|
|
e9ac566737 | ||
|
|
0a9671bddc | ||
|
|
adc5fc857f | ||
|
|
ab3eb39618 | ||
|
|
101e00845d | ||
|
|
f711238d73 | ||
|
|
fe21ead1f2 | ||
|
|
20ac254201 | ||
|
|
b864c2cdd7 | ||
|
|
d1fb373ead | ||
|
|
42746ae8ef | ||
|
|
07d0b15460 | ||
|
|
a6063253f2 | ||
|
|
059dce3dbe | ||
|
|
2ba2674a7f | ||
|
|
19243fde6a | ||
|
|
4ac53af497 | ||
|
|
b5a3cfa798 | ||
|
|
b020acd1bc | ||
|
|
79c10e0e0b | ||
|
|
ec458191fb | ||
|
|
a2ada305a7 | ||
|
|
3354eb9f9b | ||
|
|
b1ba17e17a | ||
|
|
ddcb175234 | ||
|
|
3529f39b7f | ||
|
|
7866762a76 | ||
|
|
189e0f695e | ||
|
|
875ba4c899 | ||
|
|
c1068821a1 | ||
|
|
8f45e648c1 | ||
|
|
7da02cbceb | ||
|
|
5c9f17d5f1 | ||
|
|
3a67c9ba31 | ||
|
|
34e2d1da01 | ||
|
|
e91c8d9df0 | ||
|
|
2951f53fc0 | ||
|
|
da1810adf0 | ||
|
|
c3360fa0f7 | ||
|
|
ab093235e3 | ||
|
|
32c663fd55 | ||
|
|
b4d65da1a7 | ||
|
|
b4c81095e8 | ||
|
|
86ad16ee31 | ||
|
|
fdffd280b7 | ||
|
|
7a935e9cb5 | ||
|
|
206ae1c8b6 | ||
|
|
1565307200 | ||
|
|
ee36b5c49c | ||
|
|
1a87e391b2 | ||
|
|
ab55fa68f1 | ||
|
|
b69ced8ce0 | ||
|
|
2b94b40bf3 | ||
|
|
10238cc3a4 | ||
|
|
d79bec006a | ||
|
|
d76c4fd52d | ||
|
|
6673428533 | ||
|
|
9b1e01b8df | ||
|
|
ce8a736106 | ||
|
|
be3e0d1ffb | ||
|
|
0ff1235735 | ||
|
|
a533524604 | ||
|
|
92bdc1acf6 | ||
|
|
9d1de8173f | ||
|
|
c0d1a68123 | ||
|
|
1fc3ca059a | ||
|
|
fce65c18e2 | ||
|
|
aaf7e4a8cf | ||
|
|
a3db9fddb3 | ||
|
|
d47bbe079c | ||
|
|
87d92c4c91 | ||
|
|
e47a6f722e | ||
|
|
ff83fa6be8 | ||
|
|
100bd7816e | ||
|
|
cf043dab4c | ||
|
|
6979ee8c5c | ||
|
|
6cb49fc61b | ||
|
|
91667f155f | ||
|
|
50f0f49afe | ||
|
|
54b21cfcbc | ||
|
|
18e7e671f3 | ||
|
|
1ff81c8358 | ||
|
|
f01ca017a3 | ||
|
|
528c278890 | ||
|
|
9c324acddf | ||
|
|
7b7502a118 | ||
|
|
6a9496aa51 | ||
|
|
0bc0d0aa9c | ||
|
|
59e53ac245 | ||
|
|
9280f317ee | ||
|
|
893f52ee96 | ||
|
|
529b4047f3 | ||
|
|
5d2fafa0b0 | ||
|
|
2d4376645d | ||
|
|
545212d7f5 | ||
|
|
a0557a1691 | ||
|
|
d19f490d26 | ||
|
|
f4cfcbbe5e | ||
|
|
a1f983ef16 | ||
|
|
d8880234e0 | ||
|
|
654a5449bb | ||
|
|
daa1212e66 | ||
|
|
30399395c1 | ||
|
|
fd6d5a09dd | ||
|
|
23f07cc8ef | ||
|
|
2ded9a0625 | ||
|
|
f5c197e2c5 | ||
|
|
49db2972c2 | ||
|
|
5da67dfcc0 | ||
|
|
2fd66cc027 | ||
|
|
fadc5f3f7e | ||
|
|
edd365ef01 | ||
|
|
16aadfa664 | ||
|
|
1cadcc1f59 | ||
|
|
03c566615a | ||
|
|
7a4d8aefdf | ||
|
|
d9de322944 | ||
|
|
bc5bec50f4 | ||
|
|
e6006e387a | ||
|
|
e4005d288d | ||
|
|
0424045f55 | ||
|
|
a71c4ca330 | ||
|
|
ebf5af2451 | ||
|
|
6477cceb86 | ||
|
|
8f167cc940 | ||
|
|
d5c715e16e | ||
|
|
343ad767f0 | ||
|
|
fd1a96c160 | ||
|
|
de964e620b | ||
|
|
bb7c671e3b | ||
|
|
67246fd888 | ||
|
|
9b7a270f92 | ||
|
|
31181711df | ||
|
|
c4241c65b9 | ||
|
|
a69bee5cd0 | ||
|
|
d7696f070e | ||
|
|
6041dc51aa | ||
|
|
b3c06be528 | ||
|
|
d36d0f74e1 | ||
|
|
5b337e1ddb | ||
|
|
1a054c39b6 | ||
|
|
287e750548 | ||
|
|
07cd0ad4ed | ||
|
|
2d1cf94612 | ||
|
|
71d2c30130 |
24
.eslintignore
Normal file
@@ -0,0 +1,24 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
29
.eslintrc.js
Normal file
@@ -0,0 +1,29 @@
|
||||
// .eslintrc.js
|
||||
module.exports = {
|
||||
env: {
|
||||
browser: true,
|
||||
es2021: true,
|
||||
node: true,
|
||||
},
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:react/recommended',
|
||||
'plugin:prettier/recommended',
|
||||
],
|
||||
settings: {
|
||||
react: {
|
||||
version: 'detect',
|
||||
},
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
},
|
||||
plugins: ['react'],
|
||||
rules: {
|
||||
'react/react-in-jsx-scope': 'off',
|
||||
},
|
||||
};
|
||||
6
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: 'npm'
|
||||
directory: '/'
|
||||
schedule:
|
||||
interval: 'weekly'
|
||||
41
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
name: Deploy to gh-pages Branch
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
**/node_modules
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
env:
|
||||
CI: ''
|
||||
|
||||
- name: Deploy
|
||||
uses: JamesIves/github-pages-deploy-action@v4
|
||||
with:
|
||||
branch: gh-pages
|
||||
folder: dist
|
||||
38
.github/workflows/test-deploy.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: Test Deployment
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
**/node_modules
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run lint
|
||||
run: npm run lint
|
||||
|
||||
- name: Run prettier
|
||||
run: npm run prettier
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
env:
|
||||
CI: ''
|
||||
41
.gitignore
vendored
@@ -1,23 +1,24 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
14
.npmignore
Normal file
@@ -0,0 +1,14 @@
|
||||
public
|
||||
src
|
||||
.eslintignore
|
||||
.eslintrc.js
|
||||
.prettierignore
|
||||
.prettierrc
|
||||
CODE_OF_CONDUCT.md
|
||||
CONTRIBUTING.md
|
||||
gitprofile.config.js
|
||||
index.html
|
||||
library.config.js
|
||||
tailwind.config.js
|
||||
vite.config.js
|
||||
stats.html
|
||||
24
.prettierignore
Normal file
@@ -0,0 +1,24 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
8
.prettierrc
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"semi": true,
|
||||
"arrowParens": "always",
|
||||
"bracketSpacing": true,
|
||||
"printWidth": 80,
|
||||
"singleQuote": true,
|
||||
"tabWidth": 2
|
||||
}
|
||||
76
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,76 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||
level of experience, education, socio-economic status, nationality, personal
|
||||
appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
- Using welcoming and inclusive language
|
||||
- Being respectful of differing viewpoints and experiences
|
||||
- Gracefully accepting constructive criticism
|
||||
- Focusing on what is best for the community
|
||||
- Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
- The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
- Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
- Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at fdkhadra@gmail.com. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see
|
||||
https://www.contributor-covenant.org/faq
|
||||
44
CONTRIBUTING.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# Contributing
|
||||
|
||||
👍🎉 First off, thanks for taking the time to contribute! 🎉👍
|
||||
|
||||
If you have found an issue or would like to request a new feature, simply create a new issue detailing the request. We also welcome pull requests. See below for information on getting started with development and submitting pull requests.
|
||||
|
||||
Please note we have a [code of conduct](https://github.com/arifszn/gitprofile/blob/main/CODE_OF_CONDUCT.md), please follow it in all your interactions with the project.
|
||||
|
||||
## Found an Issue?
|
||||
|
||||
If you find a bug in the source code or a mistake in the documentation, you can help us by
|
||||
submitting an issue to our [GitHub Repository](https://github.com/arifszn/gitprofile/issues/new). Even better you can submit a Pull Request
|
||||
with a fix.
|
||||
|
||||
## Submitting a Pull Request
|
||||
|
||||
- If applicable, update the `readme`
|
||||
- Use `npm run lint` and `npm run prettier` before committing
|
||||
- Example for a commit message
|
||||
|
||||
```
|
||||
Fix type validation for typescript
|
||||
```
|
||||
|
||||
### Developing
|
||||
|
||||
Fork, then clone the repo:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/your-username/gitprofile.git
|
||||
cd gitprofile
|
||||
```
|
||||
|
||||
Install dependencies:
|
||||
|
||||
```sh
|
||||
npm install
|
||||
```
|
||||
|
||||
Run dev server:
|
||||
|
||||
```sh
|
||||
npm run dev
|
||||
```
|
||||
2
LICENSE
@@ -186,7 +186,7 @@
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
Copyright 2022 Ariful Alam
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
462
README.md
@@ -1,150 +1,238 @@
|
||||
<p align="center">
|
||||
<a href="http://arifszn.github.io/ezprofile" target="_blank">
|
||||
<img src="https://arifszn.github.io/assets/img/hosted/ezprofile/logo.png" alt="ezProfile" title="ezProfile" width="80">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<h1 align="center">ezProfile</h1>
|
||||
<p align="center">A modern, responsive and customizable portfolio builder for Developers!</p>
|
||||
<p align="center">https://arifszn.github.io/ezprofile</p>
|
||||
|
||||
<br/>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://arifszn.github.io/ezprofile">
|
||||
<img src="https://arifszn.github.io/assets/img/hosted/ezprofile/preview.gif" width="60%" alt="Preview"/>
|
||||
<img src="https://user-images.githubusercontent.com/45073703/177566625-9b84e793-4559-4475-ba54-8d3d5f4123d4.png" width="35%">
|
||||
|
||||
<h4 align="center">Easy to use automatic portfolio builder for every GitHub user!</h4>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://codeclimate.com/github/arifszn/gitprofile/maintainability">
|
||||
<img src="https://api.codeclimate.com/v1/badges/c60f42d7d0b61bd33e98/maintainability" />
|
||||
</a>
|
||||
<br/>
|
||||
<a href="#arifszn"><img src="https://arifszn.github.io/assets/img/drop-shadow.png" width="60%" alt="Shadow"/></a>
|
||||
<a href="https://github.com/arifszn/gitprofile/issues">
|
||||
<img src="https://img.shields.io/github/issues/arifszn/gitprofile"/>
|
||||
</a>
|
||||
<a href="https://github.com/arifszn/gitprofile/stargazers">
|
||||
<img src="https://img.shields.io/github/stars/arifszn/gitprofile"/>
|
||||
</a>
|
||||
<a href="https://github.com/arifszn/gitprofile/blob/main/package-lock.json">
|
||||
<img src="https://img.shields.io/snyk/vulnerabilities/github/arifszn/gitprofile"/>
|
||||
</a>
|
||||
<a href="https://github.com/arifszn/gitprofile/blob/main/CONTRIBUTING.md">
|
||||
<img src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat"/>
|
||||
</a>
|
||||
<a href="https://github.com/arifszn/gitprofile/blob/main/LICENSE">
|
||||
<img src="https://img.shields.io/github/license/arifszn/gitprofile"/>
|
||||
</a>
|
||||
<a href="https://www.buymeacoffee.com/arifszn">
|
||||
<img src="https://img.shields.io/badge/sponsor-buy%20me%20a%20coffee-yellow?logo=buymeacoffee"/>
|
||||
</a>
|
||||
<a href="https://twitter.com/arif_szn">
|
||||
<img src="https://img.shields.io/twitter/follow/arif_szn?style=social"/>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://arifszn.github.io/gitprofile">View Demo</a>
|
||||
·
|
||||
<a href="https://github.com/arifszn/gitprofile/issues">Report Bug</a>
|
||||
·
|
||||
<a href="https://github.com/arifszn/gitprofile/discussions">Request Feature</a>
|
||||
</p>
|
||||
</p>
|
||||
|
||||
**ezProfile** is an easy-to-customize personal dev portfolio builder that is created with React.js. When you manage the code in a GitHub repository, it will automatically render a webpage with the owner's profile information, including a photo, bio, and repositories. Also, it includes space to highlight your details, job history, education history, skills, and recent blog posts.
|
||||
<p align="center">
|
||||
<a href="https://arifszn.github.io/gitprofile">
|
||||
<img src="https://arifszn.github.io/assets/img/hosted/gitprofile/preview.gif" alt="Preview" width="60%"/>
|
||||
</a>
|
||||
<br/>
|
||||
<a href="#arifszn"><img src="https://arifszn.github.io/assets/img/drop-shadow.png" width="50%" alt="Shadow"/></a>
|
||||
</p>
|
||||
|
||||
It's all possible using [GitHub API](https://developer.github.com/v3/) (for automatically populating your website with content) and [Article-api](https://github.com/arifszn/article-api) (for fetching recent blog posts).
|
||||
**GitProfile** is an easy to use portfolio builder where you can create a portfolio page automatically by just providing your GitHub username. It is built using React.js on top of Vite.js. But it's not necessary to have knowledge on these to get you started. You can make your own copy with zero coding experience.
|
||||
|
||||
✓ [21 Themes](#themes)\
|
||||
✓ [Google Analytics](#google-analytics)\
|
||||
✓ [Meta Tags](#meta-tags)\
|
||||
✓ [Avatar and Bio](#avatar-and-bio)\
|
||||
✓ [Social Links](#social-links)\
|
||||
✓ [Skills](#skills)\
|
||||
✓ [Experience](#experience)\
|
||||
✓ [Education](#education)\
|
||||
✓ [Projects](#projects)\
|
||||
**Features:**
|
||||
|
||||
✓ [Easy to Setup](#-installation--setup)
|
||||
✓ [30 Themes](#themes)
|
||||
✓ [Google Analytics](#google-analytics)
|
||||
✓ [Hotjar](#hotjar)
|
||||
✓ [SEO](#seo)
|
||||
✓ [Avatar and Bio](#avatar-and-bio)
|
||||
✓ [Social Links](#social-links)
|
||||
✓ [Skills](#skills)
|
||||
✓ [Experience](#experience)
|
||||
✓ [Education](#education)
|
||||
✓ [Projects](#projects)
|
||||
✓ [Blog Posts](#blog-posts)
|
||||
|
||||
To view a live example, **[click here](https://arifszn.github.io/ezprofile)**.
|
||||
To view a live example, **[click here](https://arifszn.github.io/gitprofile)**.
|
||||
|
||||
Or try it **[online](https://stackblitz.com/edit/gitprofile)**.
|
||||
|
||||
## 🛠 Installation & Set Up
|
||||
## 🛠 Installation & Setup
|
||||
|
||||
These instructions will get you a copy of the project up and running on your local machine.
|
||||
There are two ways to use **GitProfile**. Use either one.
|
||||
|
||||
You'll need [Git](https://git-scm.com) and [Node.js](https://nodejs.org/en/download/) (which comes with [npm](http://npmjs.com)) installed on your computer.
|
||||
- Forking this repo
|
||||
- Installing as package
|
||||
|
||||
### Forking this repo
|
||||
|
||||
1. **[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo)** the repo so you have your own project to customize. A "fork" is a copy of a repository.
|
||||
These instructions will get you a copy of the project and deploy your portfolio online!
|
||||
|
||||
2. Once you've found a home for your forked repository, **[clone](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository-from-github/cloning-a-repository)** it.
|
||||
- **Fork repo:** Click [here](https://github.com/arifszn/gitprofile/fork) to fork the repo so you have your own project to customize. A "fork" is a copy of a repository.
|
||||
- **Rename repo:**
|
||||
- If you want to host your portfolio at `https://<USERNAME>.github.io`, rename your forked repository to `username.github.io` in GitHub, where `username` is your GitHub username (or organization name).
|
||||
- If you want to host your portfolio at `https://<USERNAME>.github.io/<REPO>` (e.g. `https://<USERNAME>.github.io/portfolio`), rename your forked repository to `<REPO>` (e.g. `portfolio`) in GitHub.
|
||||
- **Enable workflows:** Go to your repo's **Actions** page and enable workflows.
|
||||
|
||||

|
||||
|
||||
- **Base Value:** Open `vite.config.js`, and change `base`'s value.
|
||||
|
||||
- If you are deploying to `https://<USERNAME>.github.io`, set `base` to `'/'`.
|
||||
|
||||
- If you are deploying to `https://<USERNAME>.github.io/<REPO>` (e.g. `https://<USERNAME>.github.io/portfolio`), then set `base` to `'/<REPO>/'` (e.g. `'/portfolio/'`).
|
||||
|
||||
```js
|
||||
// vite.config.js
|
||||
{
|
||||
base: '/',
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
- **First Commit:** Now commit to your **main** branch with your changes. The CI/CD pipeline will publish your page at the `gh-pages` branch automatically.
|
||||
- **Change deploy branch:** Go to your repo's **Settings** ➜ **Pages** ➜ **Source** and change the branch to `gh-pages` and click **save**.
|
||||
|
||||
Your portfolio website will be live by now. Any time you commit a change to the **main** branch, the website will be automatically updated.
|
||||
|
||||
If you see only `README` at your website, be sure to change your GitHub Page's source to `gh-pages` branch (see [how to](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site)). Also, if you face any issue rendering the website, double-check the `base` value in the `vite.config.js`.
|
||||
|
||||
As this is a vite project, you can also host your website to Netlify, Vercel, Heroku, or other popular services. Please refer to this [doc](https://vitejs.dev/guide/static-deploy.html) for a detailed deployment guide to other services.
|
||||
|
||||
### Installing as package
|
||||
|
||||
You can also use **GitProfile** by installing as an NPM package. First Install **GitProfile** via <a href="https://www.npmjs.com/package/@arifszn/gitprofile">NPM</a>.
|
||||
|
||||
3. Change into your new directory.
|
||||
```sh
|
||||
cd ezprofile
|
||||
npm install @arifszn/gitprofile
|
||||
```
|
||||
|
||||
4. Install dependencies
|
||||
Or via <a href="https://yarnpkg.com/package/@arifszn/gitprofile">Yarn</a>.
|
||||
|
||||
```sh
|
||||
npm install
|
||||
yarn add @arifszn/gitprofile
|
||||
```
|
||||
|
||||
5. Start the development server
|
||||
```sh
|
||||
npm start
|
||||
Then, import the package, import and style and provide the config.
|
||||
|
||||
```js
|
||||
import GitProfile from '@arifszn/gitprofile';
|
||||
import '@arifszn/gitprofile/dist/style.css';
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<GitProfile
|
||||
config={{
|
||||
github: {
|
||||
username: 'arifszn',
|
||||
},
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
```
|
||||
|
||||
List of all config [here](#-customization).
|
||||
|
||||
**If you face any problems or have any questions, open an issue [here](https://github.com/arifszn/gitprofile/issues).**
|
||||
|
||||
## 🎨 Customization
|
||||
|
||||
All the magic happens in the file <code>src/config.js</code>. Open it and modify it according to your preference.
|
||||
|
||||
These are the default values:
|
||||
|
||||
<details>
|
||||
<summary>config.js</summary>
|
||||
All the magic happens in the file `gitprofile.config.js`. Open it and modify it according to your preference.
|
||||
|
||||
```js
|
||||
// config.js
|
||||
module.exports = {
|
||||
// gitprofile.config.js
|
||||
|
||||
const config = {
|
||||
github: {
|
||||
username: 'arifszn', // Your GitHub org/user name. (Required)
|
||||
sortBy: 'stars', // stars | updated
|
||||
limit: 8, // How many projects to display.
|
||||
exclude: {
|
||||
forks: false, // Forked projects will not be displayed if set to true.
|
||||
projects: [] // These projects will not be displayed. example: ['my-project1', 'my-project2']
|
||||
}
|
||||
projects: [], // These projects will not be displayed. example: ['my-project1', 'my-project2']
|
||||
},
|
||||
},
|
||||
social: {
|
||||
linkedin: '',
|
||||
twitter: '',
|
||||
facebook: '',
|
||||
instagram: '',
|
||||
dribbble: '',
|
||||
behance: '',
|
||||
medium: '',
|
||||
devto: '',
|
||||
dev: '',
|
||||
website: '',
|
||||
email: ''
|
||||
phone: '',
|
||||
email: '',
|
||||
},
|
||||
skills: [
|
||||
'JavaScript',
|
||||
'React.js',
|
||||
],
|
||||
skills: ['JavaScript', 'React.js'],
|
||||
experiences: [
|
||||
{
|
||||
company: 'Company name 1',
|
||||
position: 'Software Engineer',
|
||||
from: 'July 2019',
|
||||
to: 'Present'
|
||||
to: 'Present',
|
||||
},
|
||||
{
|
||||
company: 'Company name 2',
|
||||
position: 'Jr. Software Engineer',
|
||||
from: 'January 2019',
|
||||
to: ' June 2019'
|
||||
}
|
||||
to: ' June 2019',
|
||||
},
|
||||
],
|
||||
education: [
|
||||
{
|
||||
institution: 'Institution name 1',
|
||||
degree: 'Bachelor of Science',
|
||||
degree: 'ABC',
|
||||
from: '2015',
|
||||
to: '2019'
|
||||
to: '2019',
|
||||
},
|
||||
{
|
||||
institution: 'Institution name 2',
|
||||
degree: 'Higher Secondary Certificate (HSC)',
|
||||
degree: 'XYZ',
|
||||
from: '2012',
|
||||
to: '2014',
|
||||
}
|
||||
},
|
||||
],
|
||||
// Display blog posts from your medium or dev account. (Optional)
|
||||
blog: {
|
||||
// Display blog posts from your medium or dev.to account. (Optional)
|
||||
source: 'dev.to', // medium | dev.to
|
||||
source: 'dev', // medium | dev
|
||||
username: 'arifszn',
|
||||
limit: 5 // How many posts to display. Max is 10.
|
||||
limit: 5, // How many posts to display. Max is 10.
|
||||
},
|
||||
googleAnalytics: {
|
||||
// GA3 tracking id/GA4 tag id
|
||||
id: '' // UA-XXXXXXXXX-X | G-XXXXXXXXXX
|
||||
id: '', // UA-XXXXXXXXX-X | G-XXXXXXXXXX
|
||||
},
|
||||
hotjar: {
|
||||
id: '',
|
||||
snippetVersion: 6,
|
||||
},
|
||||
themeConfig: {
|
||||
default: 'light',
|
||||
defaultTheme: 'light',
|
||||
|
||||
// Hides the theme change switch
|
||||
// Useful if you want to support a single color mode
|
||||
disableSwitch: false,
|
||||
|
||||
// Should we use the prefers-color-scheme media-query,
|
||||
// using user system preferences, instead of the hardcoded default
|
||||
// Should use the prefers-color-scheme media-query,
|
||||
// using user system preferences, instead of the hardcoded defaultTheme
|
||||
respectPrefersColorScheme: true,
|
||||
|
||||
// Available themes. To remove any theme, exclude from here.
|
||||
@@ -169,122 +257,161 @@ module.exports = {
|
||||
'wireframe',
|
||||
'black',
|
||||
'luxury',
|
||||
'dracula'
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
</details>
|
||||
'dracula',
|
||||
'cmyk',
|
||||
'autumn',
|
||||
'business',
|
||||
'acid',
|
||||
'lemonade',
|
||||
'night',
|
||||
'coffee',
|
||||
'winter',
|
||||
'procyon',
|
||||
],
|
||||
|
||||
// Custom theme
|
||||
customTheme: {
|
||||
primary: '#fc055b',
|
||||
secondary: '#219aaf',
|
||||
accent: '#e8d03a',
|
||||
neutral: '#2A2730',
|
||||
'base-100': '#E3E3ED',
|
||||
'--rounded-box': '3rem',
|
||||
'--rounded-btn': '3rem',
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### Themes
|
||||
|
||||
There are 21 themes available that can be selected from the dropdown.
|
||||
There are 30 themes available that can be selected from the dropdown.
|
||||
|
||||
The default theme can be specified.
|
||||
|
||||
```js
|
||||
// config.js
|
||||
// gitprofile.config.js
|
||||
module.exports = {
|
||||
// ...
|
||||
themeConfig: {
|
||||
default: 'light',
|
||||
defaultTheme: 'light',
|
||||
// ...
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||

|
||||
<p align="center">
|
||||
<img src="https://arifszn.github.io/assets/img/hosted/gitprofile/theme-dropdown.png" alt="Theme Dropdown" width="50%">
|
||||
</p>
|
||||
|
||||
Here are some screenshots of different themes.\
|
||||
<br/>
|
||||
\
|
||||
<br/>
|
||||
\
|
||||
<br/>
|
||||
\
|
||||
<br/>
|
||||
\
|
||||
<br/>
|
||||
\
|
||||
<br/>
|
||||

|
||||
You can create your own custom theme by modifying these values. Theme `procyon` will have the custom styles.
|
||||
|
||||
```js
|
||||
// gitprofile.config.js
|
||||
module.exports = {
|
||||
// ...
|
||||
themeConfig: {
|
||||
customTheme: {
|
||||
primary: '#fc055b',
|
||||
secondary: '#219aaf',
|
||||
accent: '#e8d03a',
|
||||
neutral: '#2A2730',
|
||||
'base-100': '#E3E3ED',
|
||||
'--rounded-box': '3rem',
|
||||
'--rounded-btn': '3rem',
|
||||
},
|
||||
// ...
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
<p align="center">
|
||||
<img src="https://arifszn.github.io/assets/img/hosted/gitprofile/themes.png" alt="Themes">
|
||||
</p>
|
||||
|
||||
### Google Analytics
|
||||
|
||||
ezFolio supports both GA3 and GA4. If you do not want to use Google Analytics, keep the <code>id</code> empty.
|
||||
**GitProfile** supports both GA3 and GA4. If you do not want to use Google Analytics, keep the `id` empty.
|
||||
|
||||
```js
|
||||
// config.js
|
||||
// gitprofile.config.js
|
||||
module.exports = {
|
||||
// ...
|
||||
googleAnalytics: {
|
||||
id: ''
|
||||
id: '',
|
||||
},
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
Besides tracking visitors, ezFolio will track click events on projects and blog posts, and send them to Google Analytics.\
|
||||
<br/>
|
||||

|
||||
Besides tracking visitors, it will track `click events` on projects and blog posts, and send them to Google Analytics.
|
||||
|
||||
### Hotjar
|
||||
|
||||
### Meta Tags
|
||||
**GitProfile** supports hotjar. If you do not want to use Hotjar, keep the `id` empty.
|
||||
|
||||
Meta tags will be auto-generated from configs dynamically. However, you can also manually add meta tags in <code>public\index.html</code>
|
||||
```js
|
||||
// gitprofile.config.js
|
||||
module.exports = {
|
||||
// ...
|
||||
hotjar: {
|
||||
id: '',
|
||||
snippetVersion: 6,
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### SEO
|
||||
|
||||
Meta tags will be auto-generated from configs dynamically. However, you can also manually add meta tags in `public/index.html`.
|
||||
|
||||
### Avatar and Bio
|
||||
|
||||
Your github avatar and bio will be displayed here.\
|
||||
<br/>
|
||||

|
||||
|
||||
Your avatar and bio will be fetched from GitHub automatically.
|
||||
|
||||
### Social Links
|
||||
|
||||
ezProfile supports linking your social media services you're using, including LinkedIn, Twitter, Facebook, Dribbble, Behance, Medium, dev.to, personal website, and email.
|
||||
You can link your social media services you're using, including LinkedIn, Twitter, Facebook, Instagram, Dribbble, Behance, Medium, dev, personal website, phone and email.
|
||||
|
||||
```js
|
||||
// config.js
|
||||
// gitprofile.config.js
|
||||
module.exports = {
|
||||
// ...
|
||||
social: {
|
||||
linkedin: 'ariful-alam',
|
||||
twitter: 'arif_swozon',
|
||||
twitter: 'arif_szn',
|
||||
facebook: '',
|
||||
instagram: '',
|
||||
dribbble: '',
|
||||
behance: '',
|
||||
medium: '',
|
||||
devto: '',
|
||||
website: 'https://arifszn.github.io',
|
||||
email: ''
|
||||
dev: '',
|
||||
website: '',
|
||||
phone: '',
|
||||
email: '',
|
||||
},
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
### Skills
|
||||
|
||||
To showcase your skills provide them here.
|
||||
|
||||
```js
|
||||
// config.js
|
||||
// gitprofile.config.js
|
||||
module.exports = {
|
||||
// ...
|
||||
skills: [
|
||||
'JavaScript',
|
||||
'React.js',
|
||||
],
|
||||
}
|
||||
skills: ['JavaScript', 'React.js'],
|
||||
};
|
||||
```
|
||||
|
||||
Empty array will hide the skills section.
|
||||
|
||||
|
||||
### Experience
|
||||
|
||||
Provide your job history in <code>experiences</code>.
|
||||
Provide your job history in `experiences`.
|
||||
|
||||
```js
|
||||
// config.js
|
||||
// gitprofile.config.js
|
||||
module.exports = {
|
||||
// ...
|
||||
experiences: [
|
||||
@@ -292,26 +419,26 @@ module.exports = {
|
||||
company: 'Company name 1',
|
||||
position: 'Software Engineer',
|
||||
from: 'July 2019',
|
||||
to: 'Present'
|
||||
to: 'Present',
|
||||
},
|
||||
{
|
||||
company: 'Company name 2',
|
||||
position: 'Jr. Software Engineer',
|
||||
from: 'January 2019',
|
||||
to: ' June 2019'
|
||||
}
|
||||
to: ' June 2019',
|
||||
},
|
||||
],
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
Empty array will hide the experience section.
|
||||
|
||||
|
||||
### Education
|
||||
|
||||
Provide your education history in <code>education</code>.
|
||||
Provide your education history in `education`.
|
||||
|
||||
```js
|
||||
// config.js
|
||||
// gitprofile.config.js
|
||||
module.exports = {
|
||||
// ...
|
||||
education: [
|
||||
@@ -319,27 +446,26 @@ module.exports = {
|
||||
institution: 'Institution name 1',
|
||||
degree: 'Bachelor of Science',
|
||||
from: '2015',
|
||||
to: '2019'
|
||||
to: '2019',
|
||||
},
|
||||
{
|
||||
institution: 'Institution name 2',
|
||||
degree: 'Higher Secondary Certificate (HSC)',
|
||||
from: '2012',
|
||||
to: '2014',
|
||||
}
|
||||
},
|
||||
],
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
Empty array will hide the education section.
|
||||
|
||||
|
||||
### Projects
|
||||
|
||||
Your public repo from github will be displayed here automatically. You can limit how many projects do you want to be displayed. Also, you can hide forked or specific repo.
|
||||
Your public repo from GitHub will be displayed here automatically. You can limit how many projects do you want to be displayed. Also, you can hide forked or specific repo.
|
||||
|
||||
```js
|
||||
// config.js
|
||||
// gitprofile.config.js
|
||||
module.exports = {
|
||||
// ...
|
||||
github: {
|
||||
@@ -348,73 +474,43 @@ module.exports = {
|
||||
limit: 8,
|
||||
exclude: {
|
||||
forks: false,
|
||||
projects: ['my-project1', 'my-project2']
|
||||
}
|
||||
projects: ['my-project1', 'my-project2'],
|
||||
},
|
||||
},
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
### Blog Posts
|
||||
|
||||
If you have [medium](https://medium.com) or [dev.to](https://dev.to) account, you can show your recent blog posts in here just by providing your medium/dev.to username. You can limit how many posts to display (Max is <code>10</code>).
|
||||
If you have [medium](https://medium.com) or [dev](https://dev.to) account, you can show your recent blog posts in here just by providing your medium/dev username. You can limit how many posts to display (Max is `10`).
|
||||
|
||||
```js
|
||||
// config.js
|
||||
// gitprofile.config.js
|
||||
module.exports = {
|
||||
// ...
|
||||
blog: {
|
||||
source: 'dev.to',
|
||||
source: 'dev',
|
||||
username: 'arifszn',
|
||||
limit: 5
|
||||
limit: 5,
|
||||
},
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||

|
||||
|
||||
The posts are fetched by [Article-api](https://github.com/arifszn/article-api).
|
||||
|
||||
|
||||
## 🚀 Deploy
|
||||
|
||||
Once you are done with your setup and have completed all steps above, you need to put your website online! The fastest approach is to use [GitHub Pages](https://pages.github.com) which is completely free.
|
||||
|
||||
**1. Github Pages:**
|
||||
- Rename your forked repository to <code>username.github.io</code> in github, where <code>username</code> is your GitHub username (or organization name).
|
||||
- Open <code>package.json</code>, and change <code>homepage</code>'s value to <code>https://username.github.io</code>.
|
||||
|
||||
```js
|
||||
// package.json
|
||||
{
|
||||
// ...
|
||||
"homepage": "https://username.github.io",
|
||||
}
|
||||
```
|
||||
|
||||
- Run <code>npm run deploy</code>.
|
||||
- If you see only <code>README</code> at <code>username.github.io</code>, be sure to change your GitHub Page's source to <code>gh-pages</code> branch. See [how to](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site).
|
||||
|
||||
Your personal portfolio will be live at <code>username.github.io</code>. For more info, visit [here](https://create-react-app.dev/docs/deployment/#github-pages).
|
||||
|
||||
<br/>
|
||||
|
||||
**2. Other:** You can also host your website to Netlify, Vercel, Heroku, or other popular services. Please refer to this [doc](https://create-react-app.dev/docs/deployment) for a detailed deployment guide.
|
||||
|
||||
|
||||
## 📢 Please Read
|
||||
|
||||
I intend to keep my works open source. Please do not discourage me by claiming this work by copying it as your own or removing the footer notice.
|
||||

|
||||
|
||||
The posts are fetched by [blog.js](https://github.com/arifszn/blog.js).
|
||||
|
||||
## 💖 Support
|
||||
|
||||
If you are using this project and happy with it or just want to encourage me to continue creating stuff, you can do it by just starring and sharing the project.
|
||||
<p>You can show your support by starring this project.</p>
|
||||
<a href="https://github.com/arifszn/gitprofile/stargazers">
|
||||
<img src="https://img.shields.io/github/stars/arifszn/gitprofile?style=social" alt="Github Star">
|
||||
</a>
|
||||
|
||||
## 💡 Contribute
|
||||
|
||||
## 💡 Contributing
|
||||
|
||||
Any contributors who want to make this project better can make contributions, which will be greatly appreciated. To contribute, clone this repo locally and commit your code to a new branch. Feel free to create an issue or make a pull request.
|
||||
To contribute, see the [Contributing guide](https://github.com/arifszn/gitprofile/blob/main/CONTRIBUTING.md).
|
||||
|
||||
## 📄 License
|
||||
|
||||
ezProfile is licensed under the [Apache-2.0 License](https://github.com/arifszn/ezprofile/blob/main/LICENSE).
|
||||
[Apache-2.0 License](https://github.com/arifszn/gitprofile/blob/main/LICENSE)
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
module.exports = {
|
||||
style: {
|
||||
postcss: {
|
||||
plugins: [
|
||||
require('tailwindcss'),
|
||||
require('autoprefixer'),
|
||||
],
|
||||
},
|
||||
},
|
||||
}
|
||||
148
gitprofile.config.js
Normal file
@@ -0,0 +1,148 @@
|
||||
// gitprofile.config.js
|
||||
|
||||
const config = {
|
||||
github: {
|
||||
username: 'arifszn', // Your GitHub org/user name. (Required)
|
||||
sortBy: 'stars', // stars | updated
|
||||
limit: 10, // How many projects to display.
|
||||
exclude: {
|
||||
forks: false, // Forked projects will not be displayed if set to true.
|
||||
projects: [], // These projects will not be displayed. example: ['my-project1', 'my-project2']
|
||||
},
|
||||
},
|
||||
social: {
|
||||
linkedin: 'ariful-alam',
|
||||
twitter: 'arif_szn',
|
||||
facebook: '',
|
||||
instagram: '',
|
||||
dribbble: '',
|
||||
behance: '',
|
||||
medium: 'arifszn',
|
||||
dev: 'arifszn',
|
||||
website: 'https://arifszn.github.io',
|
||||
phone: '',
|
||||
email: 'arifulalamszn@gmail.com',
|
||||
},
|
||||
skills: [
|
||||
'PHP',
|
||||
'Laravel',
|
||||
'JavaScript',
|
||||
'React.js',
|
||||
'Node.js',
|
||||
'Nest.js',
|
||||
'MySQL',
|
||||
'Git',
|
||||
'Docker',
|
||||
'PHPUnit',
|
||||
'CSS',
|
||||
'Antd',
|
||||
'Tailwind',
|
||||
'Bootstrap',
|
||||
],
|
||||
experiences: [
|
||||
{
|
||||
company: 'Monstarlab Bangladesh',
|
||||
position: 'Backend Engineer II',
|
||||
from: 'September 2021',
|
||||
to: 'Present',
|
||||
},
|
||||
{
|
||||
company: 'My Offer 360 Degree',
|
||||
position: 'Web Application Developer',
|
||||
from: 'July 2019',
|
||||
to: 'August 2021',
|
||||
},
|
||||
],
|
||||
education: [
|
||||
{
|
||||
institution: 'American International University-Bangladesh',
|
||||
degree: 'Bachelor of Science',
|
||||
from: '2015',
|
||||
to: '2019',
|
||||
},
|
||||
{
|
||||
institution: 'Cantonment College, Jessore',
|
||||
degree: 'Higher Secondary Certificate (HSC)',
|
||||
from: '2012',
|
||||
to: '2014',
|
||||
},
|
||||
{
|
||||
institution: 'Chowgacha Shahadat Pilot High School',
|
||||
degree: 'Secondary School Certificate (SSC)',
|
||||
from: '2007',
|
||||
to: '2012',
|
||||
},
|
||||
],
|
||||
// Display blog posts from your medium or dev account. (Optional)
|
||||
blog: {
|
||||
source: 'dev', // medium | dev
|
||||
username: 'arifszn',
|
||||
limit: 3, // How many posts to display. Max is 10.
|
||||
},
|
||||
googleAnalytics: {
|
||||
// GA3 tracking id/GA4 tag id UA-XXXXXXXXX-X | G-XXXXXXXXXX
|
||||
id: 'G-WLLB5E14M6', // Please remove this and use your own tag id or keep it empty
|
||||
},
|
||||
hotjar: {
|
||||
id: '2617601', // Please remove this and use your own id or keep it empty
|
||||
snippetVersion: 6,
|
||||
},
|
||||
themeConfig: {
|
||||
defaultTheme: 'corporate',
|
||||
|
||||
// Hides the switch in the navbar
|
||||
// Useful if you want to support a single color mode
|
||||
disableSwitch: false,
|
||||
|
||||
// Should use the prefers-color-scheme media-query,
|
||||
// using user system preferences, instead of the hardcoded defaultTheme
|
||||
respectPrefersColorScheme: false,
|
||||
|
||||
// Available themes. To remove any theme, exclude from here.
|
||||
themes: [
|
||||
'light',
|
||||
'dark',
|
||||
'cupcake',
|
||||
'bumblebee',
|
||||
'emerald',
|
||||
'corporate',
|
||||
'synthwave',
|
||||
'retro',
|
||||
'cyberpunk',
|
||||
'valentine',
|
||||
'halloween',
|
||||
'garden',
|
||||
'forest',
|
||||
'aqua',
|
||||
'lofi',
|
||||
'pastel',
|
||||
'fantasy',
|
||||
'wireframe',
|
||||
'black',
|
||||
'luxury',
|
||||
'dracula',
|
||||
'cmyk',
|
||||
'autumn',
|
||||
'business',
|
||||
'acid',
|
||||
'lemonade',
|
||||
'night',
|
||||
'coffee',
|
||||
'winter',
|
||||
'procyon',
|
||||
],
|
||||
|
||||
// Custom theme
|
||||
customTheme: {
|
||||
primary: '#fc055b',
|
||||
secondary: '#219aaf',
|
||||
accent: '#e8d03a',
|
||||
neutral: '#2A2730',
|
||||
'base-100': '#E3E3ED',
|
||||
'--rounded-box': '3rem',
|
||||
'--rounded-btn': '3rem',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
15
index.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
||||
<link rel="manifest" href="/manifest.json" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Portfolio</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.jsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
31
library.config.js
Normal file
@@ -0,0 +1,31 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import tailwind from 'tailwindcss';
|
||||
import autoprefixer from 'autoprefixer';
|
||||
import tailwindConfig from './tailwind.config.js';
|
||||
import path from 'path';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
css: {
|
||||
postcss: {
|
||||
plugins: [tailwind(tailwindConfig), autoprefixer],
|
||||
},
|
||||
},
|
||||
build: {
|
||||
lib: {
|
||||
entry: path.resolve(__dirname, 'src/components/GitProfile.jsx'),
|
||||
name: 'GitProfile',
|
||||
fileName: (format) => `gitprofile.${format}.js`,
|
||||
},
|
||||
rollupOptions: {
|
||||
external: ['react', 'react-dom'],
|
||||
output: {
|
||||
globals: {
|
||||
react: 'React',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
46118
package-lock.json
generated
164
package.json
@@ -1,80 +1,90 @@
|
||||
{
|
||||
"name": "ezprofile",
|
||||
"version": "1.0.0",
|
||||
"description": "Kickstart your personal portfolio with Github Api and blog",
|
||||
"homepage": "https://arifszn.github.io/ezprofile",
|
||||
"private": true,
|
||||
"license": "Apache-2.0",
|
||||
"author": "arifszn",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/arifszn/ezprofile.git"
|
||||
"name": "@arifszn/gitprofile",
|
||||
"description": "Create an automatic portfolio based on GitHub profile",
|
||||
"version": "2.0.8",
|
||||
"license": "Apache-2.0",
|
||||
"author": "arifszn",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/arifszn/gitprofile.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/arifszn/gitprofile/issues"
|
||||
},
|
||||
"files": [
|
||||
"dist/gitprofile.es.js",
|
||||
"dist/gitprofile.umd.js",
|
||||
"dist/style.css",
|
||||
"types"
|
||||
],
|
||||
"main": "./dist/gitprofile.umd.js",
|
||||
"module": "./dist/gitprofile.es.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./dist/gitprofile.es.js",
|
||||
"require": "./dist/gitprofile.umd.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@craco/craco": "^6.2.0",
|
||||
"@reduxjs/toolkit": "^1.6.1",
|
||||
"@testing-library/jest-dom": "^5.11.4",
|
||||
"@testing-library/react": "^11.1.0",
|
||||
"@testing-library/user-event": "^12.1.10",
|
||||
"article-api": "^1.0.5",
|
||||
"axios": "^0.21.1",
|
||||
"daisyui": "^1.12.1",
|
||||
"gh-pages": "^3.2.3",
|
||||
"moment": "^2.29.1",
|
||||
"prop-types": "^15.7.2",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-helmet-async": "^1.1.0",
|
||||
"react-icons": "^4.2.0",
|
||||
"react-redux": "^7.2.4",
|
||||
"react-scripts": "4.0.3",
|
||||
"sass": "^1.38.0",
|
||||
"web-vitals": "^1.0.1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "craco start",
|
||||
"build": "craco build",
|
||||
"test": "craco test",
|
||||
"eject": "react-scripts eject",
|
||||
"predeploy": "npm run build",
|
||||
"deploy": "gh-pages -d build"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"react-app",
|
||||
"react-app/jest"
|
||||
]
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer": "^9.8.6",
|
||||
"postcss": "^7.0.36",
|
||||
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.7"
|
||||
},
|
||||
"keywords": [
|
||||
"personal-site",
|
||||
"template",
|
||||
"portfolio",
|
||||
"personal-website",
|
||||
"portfolio-website",
|
||||
"portfolio-site",
|
||||
"portfolio-template",
|
||||
"portfolio-page",
|
||||
"developer-portfolio",
|
||||
"portfolio-project",
|
||||
"github-portfolio",
|
||||
"react-portfolio",
|
||||
"github-api"
|
||||
]
|
||||
"./dist/style.css": "./dist/style.css"
|
||||
},
|
||||
"typings": "./types/index.d.ts",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"build:library": "vite build --config library.config.js",
|
||||
"lint": "eslint --ext .js,.jsx .",
|
||||
"lint:fix": "eslint --ext .js,.jsx --fix .",
|
||||
"prettier": "prettier --check './**/*.{js,jsx,ts,tsx,css,md,json}'",
|
||||
"prettier:fix": "prettier --write './**/*.{js,jsx,ts,tsx,css,md,json}'"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@arifszn/blog-js": "^2.0.0",
|
||||
"@vitejs/plugin-react": "^2.0.0",
|
||||
"autoprefixer": "^10.4.4",
|
||||
"axios": "^0.27.2",
|
||||
"daisyui": "^2.11.0",
|
||||
"date-fns": "^2.28.0",
|
||||
"eslint": "^8.11.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"eslint-plugin-react": "^7.29.4",
|
||||
"postcss": "^8.4.12",
|
||||
"prettier": "^2.6.0",
|
||||
"prop-types": "^15.8.1",
|
||||
"react-helmet-async": "^1.2.3",
|
||||
"react-hotjar": "^5.0.0",
|
||||
"react-icons": "^4.3.1",
|
||||
"tailwindcss": "^3.0.23",
|
||||
"vite": "^3.0.1"
|
||||
},
|
||||
"keywords": [
|
||||
"git-profile",
|
||||
"gitprofile",
|
||||
"gitportfolio",
|
||||
"personal-site",
|
||||
"template",
|
||||
"portfolio",
|
||||
"resume",
|
||||
"cv",
|
||||
"personal-website",
|
||||
"portfolio-website",
|
||||
"portfolio-site",
|
||||
"portfolio-template",
|
||||
"portfolio-page",
|
||||
"developer-portfolio",
|
||||
"portfolio-project",
|
||||
"github-portfolio",
|
||||
"tailwind-portfolio",
|
||||
"vite-portfolio",
|
||||
"projects",
|
||||
"open-source",
|
||||
"git",
|
||||
"react-portfolio",
|
||||
"github",
|
||||
"github-api"
|
||||
]
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 434 B After Width: | Height: | Size: 655 B |
|
Before Width: | Height: | Size: 767 B After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@@ -1,18 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/apple-touch-icon.png" />
|
||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||
<title>Portfolio</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
BIN
public/logo.png
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 20 KiB |
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"short_name": "ezProfile",
|
||||
"short_name": "GitProfile",
|
||||
"name": "Personal Portfolio",
|
||||
"icons": [
|
||||
{
|
||||
|
||||
179
src/App.js
@@ -1,179 +0,0 @@
|
||||
import axios from "axios";
|
||||
import { Fragment, useCallback, useEffect, useState } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import AvatarCard from "./components/AvatarCard";
|
||||
import ErrorPage from "./components/ErrorPage";
|
||||
import ThemeChanger from "./components/ThemeChanger";
|
||||
import config from "./config";
|
||||
import moment from 'moment';
|
||||
import { setLoading } from "./store/slices/loadingSlice";
|
||||
import { setProfile } from "./store/slices/profileSlice";
|
||||
import Details from "./components/Details";
|
||||
import Skill from "./components/Skill";
|
||||
import Experience from "./components/Experience";
|
||||
import Education from "./components/Education";
|
||||
import Project from "./components/Project";
|
||||
import { setRepo } from "./store/slices/repoSlice";
|
||||
import Blog from "./components/Blog";
|
||||
import MetaTags from "./components/MetaTags";
|
||||
|
||||
function App() {
|
||||
const dispatch = useDispatch();
|
||||
const theme = useSelector(state => state.theme);
|
||||
|
||||
const [error, setError] = useState(null);
|
||||
const [rateLimit, setRateLimit] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (theme) {
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
}
|
||||
}, [theme])
|
||||
|
||||
const loadData = useCallback(() => {
|
||||
axios.get(`https://api.github.com/users/${config.github.username}`)
|
||||
.then(response => {
|
||||
let data = response.data;
|
||||
|
||||
let profileData = {
|
||||
avatar: data.avatar_url,
|
||||
name: data.name ? data.name : '',
|
||||
bio: data.bio ? data.bio : '',
|
||||
location: data.location ? data.location : '',
|
||||
company: data.company ? data.company : ''
|
||||
}
|
||||
|
||||
dispatch(setProfile(profileData));
|
||||
})
|
||||
.then(() => {
|
||||
let excludeRepo = ``;
|
||||
|
||||
config.github.exclude.projects.forEach(project => {
|
||||
excludeRepo += `+-repo:${config.github.username}/${project}`;
|
||||
});
|
||||
|
||||
let query = `user:${config.github.username}+fork:${!config.github.exclude.forks}${excludeRepo}`;
|
||||
|
||||
let url = `https://api.github.com/search/repositories?q=${query}&sort=${config.github.sortBy}&per_page=${config.github.limit}&type=Repositories`;
|
||||
|
||||
axios.get(url, {
|
||||
headers: {
|
||||
'Content-Type': 'application/vnd.github.v3+json'
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
let data = response.data;
|
||||
|
||||
dispatch(setRepo(data.items));
|
||||
})
|
||||
.catch((error) => {
|
||||
handleError(error);
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
handleError(error);
|
||||
})
|
||||
.finally(() => {
|
||||
dispatch(setLoading(false));
|
||||
});
|
||||
}, [dispatch])
|
||||
|
||||
useEffect(() => {
|
||||
loadData();
|
||||
}, [loadData])
|
||||
|
||||
const handleError = (error) => {
|
||||
console.error('Error:', error);
|
||||
try {
|
||||
setRateLimit({
|
||||
remaining: error.response.headers['x-ratelimit-remaining'],
|
||||
reset: moment(new Date(error.response.headers['x-ratelimit-reset'] * 1000)).fromNow(),
|
||||
});
|
||||
|
||||
if (error.response.status === 403) {
|
||||
setError(403);
|
||||
} else if (error.response.status === 404) {
|
||||
setError(404);
|
||||
} else {
|
||||
setError(500);
|
||||
}
|
||||
} catch (error2) {
|
||||
setError(500);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<MetaTags/>
|
||||
<div className="fade-in h-screen">
|
||||
|
||||
{
|
||||
error ? (
|
||||
<ErrorPage
|
||||
status={`${error}`}
|
||||
title={(error === 404) ? 'The Github Username is Incorrect' : (
|
||||
error === 403 ? 'Too Many Request.' : `Ops!!`
|
||||
)}
|
||||
subTitle={
|
||||
(error === 404) ? (
|
||||
<p>
|
||||
Please provide correct github username in <code>src\config.js</code>
|
||||
</p>
|
||||
) : (
|
||||
error === 403 ? (
|
||||
<p>
|
||||
Oh no, you hit the{' '}
|
||||
<a
|
||||
href="https://developer.github.com/v3/rate_limit/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
rate limit
|
||||
</a>
|
||||
! Try again later{rateLimit && ` ${rateLimit.reset}`}.
|
||||
</p>
|
||||
) : `Something went wrong`
|
||||
)
|
||||
}
|
||||
/>
|
||||
) : (
|
||||
<Fragment>
|
||||
<div className="p-4 lg:p-10 min-h-full bg-base-200">
|
||||
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6 rounded-box">
|
||||
<div className="col-span-1">
|
||||
<div className="grid grid-cols-1 gap-6">
|
||||
{
|
||||
!config.themeConfig.disableSwitch && (
|
||||
<ThemeChanger />
|
||||
)
|
||||
}
|
||||
<AvatarCard />
|
||||
<Details />
|
||||
<Skill />
|
||||
<Experience />
|
||||
<Education />
|
||||
</div>
|
||||
</div>
|
||||
<div className="lg:col-span-2 col-span-1">
|
||||
<div className="grid grid-cols-1 gap-6">
|
||||
<Project />
|
||||
<Blog />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/* DO NOT REMOVE/MODIFY THE FOOTER */}
|
||||
<footer className="p-4 footer bg-base-200 text-base-content footer-center">
|
||||
<div>
|
||||
<p className="font-mono text-sm">Made with <a className="text-primary" href="https://github.com/arifszn/ezprofile" target="_blank" rel="noreferrer">ezProfile</a> and ❤️</p>
|
||||
</div>
|
||||
</footer>
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
8
src/App.jsx
Normal file
@@ -0,0 +1,8 @@
|
||||
import config from '../gitprofile.config';
|
||||
import GitProfile from './components/GitProfile';
|
||||
|
||||
function App() {
|
||||
return <GitProfile config={config} />;
|
||||
}
|
||||
|
||||
export default App;
|
||||
@@ -1,8 +0,0 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import App from './App';
|
||||
|
||||
test('renders learn react link', () => {
|
||||
render(<App />);
|
||||
const linkElement = screen.getByText(/learn react/i);
|
||||
expect(linkElement).toBeInTheDocument();
|
||||
});
|
||||
92
src/assets/index.css
Normal file
@@ -0,0 +1,92 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
* {
|
||||
scrollbar-width: thin;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
||||
-moz-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
@media screen and (min-width: 966px) {
|
||||
::-webkit-scrollbar,
|
||||
.scroller {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #888;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
||||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
||||
sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
||||
monospace;
|
||||
}
|
||||
|
||||
.text-base-content-important {
|
||||
color: hsla(var(--bc) / var(--tw-text-opacity)) !important;
|
||||
}
|
||||
|
||||
svg {
|
||||
vertical-align: unset;
|
||||
}
|
||||
|
||||
.z-hover {
|
||||
transition: all ease-in-out 0.3s !important;
|
||||
}
|
||||
|
||||
.z-hover:hover,
|
||||
.z-hover:focus,
|
||||
.z-hover:active {
|
||||
transition: transform 0.3s !important;
|
||||
-ms-transform: scale(1.01) !important;
|
||||
-webkit-transform: scale(1.01) !important;
|
||||
transform: scale(1.01) !important;
|
||||
}
|
||||
|
||||
.pb-0-important {
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.fade-in {
|
||||
opacity: 1;
|
||||
animation-name: fadeIn;
|
||||
animation-iteration-count: 1;
|
||||
animation-timing-function: ease-in;
|
||||
animation-duration: 1s;
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes fadeIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
import { useSelector } from "react-redux";
|
||||
import { fallbackImage, skeleton } from "../helpers/utils";
|
||||
import LazyImage from "./LazyImage";
|
||||
|
||||
const AvatarCard = () => {
|
||||
const profile = useSelector(state => state.profile);
|
||||
const loading = useSelector(state => state.loading);
|
||||
|
||||
return (
|
||||
<div className="card shadow-lg compact bg-base-100">
|
||||
<div className="grid place-items-center py-8">
|
||||
{
|
||||
loading ? (
|
||||
<div className="avatar opacity-90">
|
||||
<div className="mb-8 rounded-full w-32 h-32">
|
||||
{
|
||||
skeleton({
|
||||
width: 'w-full',
|
||||
height: 'h-full',
|
||||
shape: '',
|
||||
})
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div className="avatar opacity-90">
|
||||
<div className="mb-8 rounded-full w-32 h-32 ring ring-primary ring-offset-base-100 ring-offset-2">
|
||||
{
|
||||
<LazyImage
|
||||
src={profile.avatar ? profile.avatar : fallbackImage}
|
||||
alt={profile.name}
|
||||
placeholder={
|
||||
skeleton({
|
||||
width: 'w-full',
|
||||
height: 'h-full',
|
||||
shape: '',
|
||||
})
|
||||
}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
<div className="text-center mx-auto md:mx-8">
|
||||
<h5 className="font-bold text-2xl">
|
||||
{
|
||||
loading ? (
|
||||
skeleton({ width: 'w-48', height: 'h-8' })
|
||||
) : <span className="opacity-70">{profile.name}</span>
|
||||
}
|
||||
</h5>
|
||||
<div className="mt-3 text-base-content text-opacity-60">
|
||||
{
|
||||
loading ? (
|
||||
skeleton({ width: 'w-48', height: 'h-5' })
|
||||
) : profile.bio
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default AvatarCard;
|
||||
@@ -1,197 +0,0 @@
|
||||
import { getDevtoArticle, getMediumArticle } from "article-api";
|
||||
import moment from "moment";
|
||||
import { Fragment, useEffect, useState } from "react";
|
||||
import { CgHashtag } from 'react-icons/cg';
|
||||
import { useSelector } from "react-redux";
|
||||
import config from "../config";
|
||||
import { ga, skeleton } from "../helpers/utils";
|
||||
import LazyImage from "./LazyImage";
|
||||
|
||||
const displaySection = () => {
|
||||
if (
|
||||
typeof config.blog !== 'undefined' &&
|
||||
typeof config.blog.source !== 'undefined' &&
|
||||
typeof config.blog.username !== 'undefined' &&
|
||||
config.blog.source &&
|
||||
config.blog.username
|
||||
) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const Blog = () => {
|
||||
const [articles, setArticles] = useState(null);
|
||||
const loading = useSelector(state => state.loading);
|
||||
|
||||
useEffect(() => {
|
||||
if (displaySection()) {
|
||||
if (config.blog.source === 'medium') {
|
||||
getMediumArticle({
|
||||
user: config.blog.username
|
||||
})
|
||||
.then(res => {
|
||||
setArticles(res);
|
||||
});
|
||||
} else if (config.blog.source === 'dev.to') {
|
||||
getDevtoArticle({
|
||||
user: config.blog.username
|
||||
})
|
||||
.then(res => {
|
||||
setArticles(res);
|
||||
});
|
||||
}
|
||||
}
|
||||
}, [])
|
||||
|
||||
const renderSkeleton = () => {
|
||||
let array = [];
|
||||
for (let index = 0; index < config.blog.limit; index++) {
|
||||
array.push((
|
||||
<div className="card shadow-lg compact bg-base-100" key={index}>
|
||||
<div className="p-8 h-full w-full">
|
||||
<div className="flex items-center flex-col md:flex-row">
|
||||
<div className="avatar mb-5 md:mb-0">
|
||||
<div className="w-24 h-24 mask mask-squircle">
|
||||
{
|
||||
skeleton({
|
||||
width: 'w-full',
|
||||
height: 'h-full',
|
||||
shape: '',
|
||||
})
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<div className="flex items-start px-4">
|
||||
<div className="w-full">
|
||||
<h2>
|
||||
{skeleton({ width: 'w-full', height: 'h-8', className: 'mb-2 mx-auto md:mx-0' })}
|
||||
</h2>
|
||||
{skeleton({ width: 'w-24', height: 'h-3', className: 'mx-auto md:mx-0' })}
|
||||
<div className="mt-3">
|
||||
{skeleton({ width: 'w-full', height: 'h-4', className: 'mx-auto md:mx-0' })}
|
||||
</div>
|
||||
<div className="mt-4 flex items-center flex-wrap justify-center md:justify-start">
|
||||
{skeleton({ width: 'w-32', height: 'h-4', className: "md:mr-2 mx-auto md:mx-0" })}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
const renderArticles = () => {
|
||||
return articles && articles.slice(0, config.blog.limit).map((article, index) => (
|
||||
<div
|
||||
className="card shadow-lg compact bg-base-100 cursor-pointer"
|
||||
key={index}
|
||||
onClick={() => {
|
||||
try {
|
||||
if (config.googleAnalytics.id) {
|
||||
ga.event({
|
||||
action: "Click Blog Post",
|
||||
params: {
|
||||
post: article.title
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
window.open(article.link, '_blank')
|
||||
}}
|
||||
>
|
||||
<div className="p-8 h-full w-full">
|
||||
<div className="flex items-center flex-col md:flex-row">
|
||||
<div className="avatar mb-5 md:mb-0 opacity-90">
|
||||
<div className="w-24 h-24 mask mask-squircle">
|
||||
<LazyImage
|
||||
src={article.thumbnail}
|
||||
alt={'thumbnail'}
|
||||
placeholder={
|
||||
skeleton({
|
||||
width: 'w-full',
|
||||
height: 'h-full',
|
||||
shape: '',
|
||||
})
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<div className="flex items-start px-4">
|
||||
<div className="text-center md:text-left w-full">
|
||||
<h2 className="font-semibold text-base-content opacity-60">{article.title}</h2>
|
||||
<p className="opacity-50 text-xs">
|
||||
{moment(article.publishedAt).fromNow()}
|
||||
</p>
|
||||
<p className="mt-3 text-base-content text-opacity-60 text-sm">
|
||||
{article.description}
|
||||
</p>
|
||||
<div className="mt-4 flex items-center flex-wrap justify-center md:justify-start">
|
||||
{
|
||||
article.categories.map((category, index2) => (
|
||||
<div key={index2} className="flex text-sm mr-3 items-center opacity-50 font-bold font-mono">
|
||||
<CgHashtag />
|
||||
<span>{category}</span>
|
||||
</div>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
}
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
{
|
||||
displaySection() && (
|
||||
<div className="col-span-1 lg:col-span-2">
|
||||
<div className="grid grid-cols-2 gap-6">
|
||||
<div className="col-span-2">
|
||||
<div className="card compact bg-base-100 shadow-sm">
|
||||
<div className="card-body">
|
||||
<ul className="menu row-span-3 bg-base-100 text-base-content">
|
||||
<li>
|
||||
<div className="pb-0-important mx-4 flex items-center justify-between">
|
||||
<h5 className="card-title">
|
||||
{
|
||||
(loading || !articles) ? skeleton({ width: 'w-28', height: 'h-8' }) : (
|
||||
<span className="opacity-70">Recent Posts</span>
|
||||
)
|
||||
}
|
||||
</h5>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<div className="grid grid-cols-1 gap-6">
|
||||
{(loading || !articles) ? renderSkeleton() : renderArticles()}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
|
||||
export default Blog;
|
||||
@@ -1,233 +0,0 @@
|
||||
import { MdLocationOn, MdMail } from 'react-icons/md';
|
||||
import { AiFillGithub, AiFillMediumSquare } from 'react-icons/ai';
|
||||
import { SiTwitter } from 'react-icons/si';
|
||||
import { GrLinkedinOption } from 'react-icons/gr';
|
||||
import { CgDribbble } from 'react-icons/cg';
|
||||
import { FaBehanceSquare, FaBuilding, FaDev, FaFacebook, FaGlobe } from 'react-icons/fa';
|
||||
import { useSelector } from 'react-redux';
|
||||
import config from '../config';
|
||||
import { skeleton } from '../helpers/utils';
|
||||
|
||||
const Details = () => {
|
||||
const profile = useSelector(state => state.profile);
|
||||
const loading = useSelector(state => state.loading);
|
||||
|
||||
const renderSkeleton = () => {
|
||||
let array = [];
|
||||
for (let index = 0; index < 4; index++) {
|
||||
array.push((
|
||||
<li key={index}>
|
||||
<span>
|
||||
{skeleton({ width: 'w-6', height: 'h-4', className: 'mr-2' })}
|
||||
{skeleton({ width: 'w-32', height: 'h-4' })}
|
||||
</span>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="card shadow-lg compact bg-base-100">
|
||||
<div className="card-body">
|
||||
<ul className="menu row-span-3 bg-base-100 text-base-content text-opacity-60">
|
||||
{
|
||||
loading ? renderSkeleton() : (
|
||||
<>
|
||||
{
|
||||
profile && profile.location && (
|
||||
<li>
|
||||
<span>
|
||||
<MdLocationOn className="mr-2" />
|
||||
{profile.location}
|
||||
</span>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
{
|
||||
profile && profile.company && (
|
||||
<li>
|
||||
<span>
|
||||
<FaBuilding className="mr-2" />
|
||||
{profile.company}
|
||||
</span>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
<li>
|
||||
<span>
|
||||
<AiFillGithub className="mr-2" />
|
||||
<a
|
||||
href={`https://github.com/${config.github.username}`}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="text-base-content-important"
|
||||
>
|
||||
{config.github.username}
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
{
|
||||
typeof config.social.linkedin !== 'undefined' && config.social.linkedin && (
|
||||
<li>
|
||||
<span>
|
||||
<GrLinkedinOption className="mr-2" />
|
||||
<a
|
||||
href={`https://www.linkedin.com/in/${config.social.linkedin}`}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="text-base-content-important"
|
||||
>
|
||||
{config.social.linkedin}
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
{
|
||||
typeof config.social.twitter !== 'undefined' && config.social.twitter && (
|
||||
<li>
|
||||
<span>
|
||||
<SiTwitter className="mr-2" />
|
||||
<a
|
||||
href={`https://twitter.com/${config.social.twitter}`}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="text-base-content-important"
|
||||
>
|
||||
{config.social.twitter}
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
{
|
||||
typeof config.social.dribbble !== 'undefined' && config.social.dribbble && (
|
||||
<li>
|
||||
<span>
|
||||
<CgDribbble className="mr-2" />
|
||||
<a
|
||||
href={`https://dribbble.com/${config.social.dribbble}`}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="text-base-content-important"
|
||||
>
|
||||
{config.social.dribbble}
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
{
|
||||
typeof config.social.behance !== 'undefined' && config.social.behance && (
|
||||
<li>
|
||||
<span>
|
||||
<FaBehanceSquare className="mr-2" />
|
||||
<a
|
||||
href={`https://www.behance.net/${config.social.behance}`}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="text-base-content-important"
|
||||
>
|
||||
{config.social.behance}
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
{
|
||||
typeof config.social.facebook !== 'undefined' && config.social.facebook && (
|
||||
<li>
|
||||
<span>
|
||||
<FaFacebook className="mr-2" />
|
||||
<a
|
||||
href={`https://www.facebook.com/${config.social.facebook}`}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="text-base-content-important"
|
||||
>
|
||||
{config.social.facebook}
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
{
|
||||
typeof config.social.medium !== 'undefined' && config.social.medium && (
|
||||
<li>
|
||||
<span>
|
||||
<AiFillMediumSquare className="mr-2" />
|
||||
<a
|
||||
href={`https://medium.com/@${config.social.medium}`}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="text-base-content-important"
|
||||
>
|
||||
{config.social.medium}
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
{
|
||||
typeof config.social.devto !== 'undefined' && config.social.devto && (
|
||||
<li>
|
||||
<span>
|
||||
<FaDev className="mr-2" />
|
||||
<a
|
||||
href={`https://dev.to/${config.social.devto}`}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="text-base-content-important"
|
||||
>
|
||||
{config.social.devto}
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
{
|
||||
typeof config.social.website !== 'undefined' && config.social.website && (
|
||||
<li>
|
||||
<span>
|
||||
<FaGlobe className="mr-2" />
|
||||
<a
|
||||
href={`${config.social.website}`}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="text-base-content-important"
|
||||
>
|
||||
{config.social.website}
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
{
|
||||
typeof config.social.email !== 'undefined' && config.social.email && (
|
||||
<li>
|
||||
<span>
|
||||
<MdMail className="mr-2" />
|
||||
<a
|
||||
href={`mailto:${config.social.email}`}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="text-base-content-important"
|
||||
>
|
||||
{config.social.email}
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
</>
|
||||
)
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Details;
|
||||
@@ -1,88 +0,0 @@
|
||||
import { useSelector } from "react-redux";
|
||||
import config from "../config";
|
||||
import { GoPrimitiveDot } from 'react-icons/go';
|
||||
import { skeleton } from "../helpers/utils";
|
||||
|
||||
const Education = () => {
|
||||
const loading = useSelector(state => state.loading);
|
||||
|
||||
const renderSkeleton = () => {
|
||||
let array = [];
|
||||
for (let index = 0; index < 2; index++) {
|
||||
array.push((
|
||||
<li key={index}>
|
||||
<span>
|
||||
{skeleton({ width: 'w-2', height: 'h-2', className: "mr-2" })}
|
||||
<div className="w-full">
|
||||
<div className="block justify-between">
|
||||
<div>
|
||||
{skeleton({ width: 'w-9/12', height: 'h-4', className: "mb-2" })}
|
||||
</div>
|
||||
<div>
|
||||
{skeleton({ width: 'w-6/12', height: 'h-4', className: "mb-2" })}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
{skeleton({ width: 'w-6/12', height: 'h-3' })}
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{
|
||||
(typeof config.education !== 'undefined' && config.education.length !== 0) && (
|
||||
<div className="card shadow-lg compact bg-base-100">
|
||||
<div className="card-body">
|
||||
<ul className="menu row-span-3 bg-base-100 text-base-content">
|
||||
<li>
|
||||
<div className="pb-0-important mx-5">
|
||||
<h5 className="card-title">
|
||||
{
|
||||
loading ? skeleton({width: 'w-32', height: 'h-8'}) : (
|
||||
<span className="opacity-70">Education</span>
|
||||
)
|
||||
}
|
||||
</h5>
|
||||
</div>
|
||||
</li>
|
||||
{
|
||||
loading ? renderSkeleton() : (
|
||||
config.education.map((item, index) => (
|
||||
<li key={index}>
|
||||
<span>
|
||||
<GoPrimitiveDot className="mr-2 opacity-40"/>
|
||||
<div>
|
||||
<div className="block justify-between">
|
||||
<div className="font-medium opacity-70">
|
||||
{item.institution}
|
||||
</div>
|
||||
<div className="opacity-50">
|
||||
{item.from} - {item.to}
|
||||
</div>
|
||||
</div>
|
||||
<div className="opacity-70">
|
||||
{item.degree}
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
</li>
|
||||
))
|
||||
)
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default Education;
|
||||
@@ -1,27 +0,0 @@
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const ErrorPage = (props) => {
|
||||
return (
|
||||
<div className="min-w-screen min-h-screen bg-base-200 flex items-center p-5 lg:p-20 overflow-hidden relative">
|
||||
<div className="flex-1 min-h-full min-w-full rounded-3xl bg-base-100 shadow-xl p-10 lg:p-20 text-gray-800 relative md:flex items-center text-center md:text-left">
|
||||
<div className="w-full">
|
||||
<div className="mb-10 md:mb-20 mt-10 md:mt-20 text-gray-600 font-light">
|
||||
<h1 className="font-black uppercase text-3xl lg:text-5xl text-primary mb-10">{props.status}</h1>
|
||||
<p className="text-lg pb-2 text-base-content">{props.title}</p>
|
||||
<p className="text-base-content text-opacity-60">{props.subTitle}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="w-64 md:w-96 h-96 md:h-full bg-accent bg-opacity-10 absolute -top-64 md:-top-96 right-20 md:right-32 rounded-full pointer-events-none -rotate-45 transform"></div>
|
||||
<div className="w-96 h-full bg-secondary bg-opacity-10 absolute -bottom-96 right-64 rounded-full pointer-events-none -rotate-45 transform"></div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
ErrorPage.propTypes = {
|
||||
status: PropTypes.string.isRequired,
|
||||
title: PropTypes.string.isRequired,
|
||||
subTitle: PropTypes.string.isRequired
|
||||
}
|
||||
|
||||
export default ErrorPage;
|
||||
@@ -1,86 +0,0 @@
|
||||
import { useSelector } from "react-redux";
|
||||
import config from "../config";
|
||||
import { GoPrimitiveDot } from 'react-icons/go';
|
||||
import { skeleton } from "../helpers/utils";
|
||||
|
||||
const Experience = () => {
|
||||
const loading = useSelector(state => state.loading);
|
||||
|
||||
const renderSkeleton = () => {
|
||||
let array = [];
|
||||
for (let index = 0; index < 2; index++) {
|
||||
array.push((
|
||||
<li key={index}>
|
||||
<span>
|
||||
{skeleton({ width: 'w-2', height: 'h-2', className: "mr-2" })}
|
||||
<div className="w-full">
|
||||
<div className="block justify-between">
|
||||
<div>
|
||||
{skeleton({ width: 'w-9/12', height: 'h-4', className: "mb-2" })}
|
||||
</div>
|
||||
<div>
|
||||
{skeleton({ width: 'w-6/12', height: 'h-4', className: "mb-2" })}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
{skeleton({ width: 'w-6/12', height: 'h-3' })}
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{
|
||||
(typeof config.experiences !== 'undefined' && config.experiences.length !== 0) && (
|
||||
<div className="card shadow-lg compact bg-base-100">
|
||||
<div className="card-body">
|
||||
<ul className="menu row-span-3 bg-base-100 text-base-content">
|
||||
<li>
|
||||
<div className="pb-0-important mx-5">
|
||||
<h5 className="card-title">
|
||||
{loading ? skeleton({width: 'w-32', height: 'h-8'}) : (
|
||||
<span className="opacity-70">Experience</span>
|
||||
)}
|
||||
</h5>
|
||||
</div>
|
||||
</li>
|
||||
{
|
||||
loading ? renderSkeleton() : (
|
||||
config.experiences.map((experience, index) => (
|
||||
<li key={index}>
|
||||
<span>
|
||||
<GoPrimitiveDot className="mr-2 opacity-40"/>
|
||||
<div>
|
||||
<div className="block justify-between">
|
||||
<div className="font-medium opacity-70">
|
||||
{experience.company}
|
||||
</div>
|
||||
<div className="opacity-50">
|
||||
{experience.from} - {experience.to}
|
||||
</div>
|
||||
</div>
|
||||
<div className="opacity-70">
|
||||
{experience.position}
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
</li>
|
||||
))
|
||||
)
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default Experience;
|
||||
304
src/components/GitProfile.jsx
Normal file
@@ -0,0 +1,304 @@
|
||||
import axios from 'axios';
|
||||
import { Fragment, useCallback, useEffect, useState } from 'react';
|
||||
import HeadTagEditor from './head-tag-editor';
|
||||
import ErrorPage from './error-page';
|
||||
import ThemeChanger from './theme-changer';
|
||||
import AvatarCard from './avatar-card';
|
||||
import Details from './details';
|
||||
import Skill from './skill';
|
||||
import Experience from './experience';
|
||||
import Education from './education';
|
||||
import Project from './project';
|
||||
import Blog from './blog';
|
||||
import {
|
||||
genericError,
|
||||
getInitialTheme,
|
||||
noConfigError,
|
||||
notFoundError,
|
||||
setupHotjar,
|
||||
tooManyRequestError,
|
||||
sanitizeConfig,
|
||||
skeleton,
|
||||
} from '../helpers/utils';
|
||||
import { HelmetProvider } from 'react-helmet-async';
|
||||
import PropTypes from 'prop-types';
|
||||
import '../assets/index.css';
|
||||
import { formatDistance } from 'date-fns';
|
||||
|
||||
const GitProfile = ({ config }) => {
|
||||
const [error, setError] = useState(
|
||||
typeof config === 'undefined' && !config ? noConfigError : null
|
||||
);
|
||||
const [sanitizedConfig] = useState(
|
||||
typeof config === 'undefined' && !config ? null : sanitizeConfig(config)
|
||||
);
|
||||
const [theme, setTheme] = useState(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [profile, setProfile] = useState(null);
|
||||
const [repo, setRepo] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (sanitizedConfig) {
|
||||
setTheme(getInitialTheme(sanitizedConfig.themeConfig));
|
||||
setupHotjar(sanitizedConfig.hotjar);
|
||||
loadData();
|
||||
}
|
||||
}, [sanitizedConfig]);
|
||||
|
||||
useEffect(() => {
|
||||
theme && document.documentElement.setAttribute('data-theme', theme);
|
||||
}, [theme]);
|
||||
|
||||
const loadData = useCallback(() => {
|
||||
axios
|
||||
.get(`https://api.github.com/users/${sanitizedConfig.github.username}`)
|
||||
.then((response) => {
|
||||
let data = response.data;
|
||||
|
||||
let profileData = {
|
||||
avatar: data.avatar_url,
|
||||
name: data.name ? data.name : '',
|
||||
bio: data.bio ? data.bio : '',
|
||||
location: data.location ? data.location : '',
|
||||
company: data.company ? data.company : '',
|
||||
};
|
||||
|
||||
setProfile(profileData);
|
||||
})
|
||||
.then(() => {
|
||||
let excludeRepo = ``;
|
||||
|
||||
sanitizedConfig.github.exclude.projects.forEach((project) => {
|
||||
excludeRepo += `+-repo:${sanitizedConfig.github.username}/${project}`;
|
||||
});
|
||||
|
||||
let query = `user:${
|
||||
sanitizedConfig.github.username
|
||||
}+fork:${!sanitizedConfig.github.exclude.forks}${excludeRepo}`;
|
||||
|
||||
let url = `https://api.github.com/search/repositories?q=${query}&sort=${sanitizedConfig.github.sortBy}&per_page=${sanitizedConfig.github.limit}&type=Repositories`;
|
||||
|
||||
axios
|
||||
.get(url, {
|
||||
headers: {
|
||||
'Content-Type': 'application/vnd.github.v3+json',
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
let data = response.data;
|
||||
|
||||
setRepo(data.items);
|
||||
})
|
||||
.catch((error) => {
|
||||
handleError(error);
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
handleError(error);
|
||||
})
|
||||
.finally(() => {
|
||||
setLoading(false);
|
||||
});
|
||||
}, [setLoading]);
|
||||
|
||||
const handleError = (error) => {
|
||||
console.error('Error:', error);
|
||||
try {
|
||||
let reset = formatDistance(
|
||||
new Date(error.response.headers['x-ratelimit-reset'] * 1000),
|
||||
new Date(),
|
||||
{
|
||||
addSuffix: true,
|
||||
}
|
||||
);
|
||||
|
||||
if (error.response.status === 403) {
|
||||
setError(tooManyRequestError(reset));
|
||||
} else if (error.response.status === 404) {
|
||||
setError(notFoundError);
|
||||
} else {
|
||||
setError(genericError);
|
||||
}
|
||||
} catch (error2) {
|
||||
setError(genericError);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<HelmetProvider>
|
||||
{sanitizedConfig && (
|
||||
<HeadTagEditor
|
||||
profile={profile}
|
||||
theme={theme}
|
||||
googleAnalytics={sanitizedConfig.googleAnalytics}
|
||||
social={sanitizedConfig.social}
|
||||
/>
|
||||
)}
|
||||
<div className="fade-in h-screen">
|
||||
{error ? (
|
||||
<ErrorPage
|
||||
status={`${error.status}`}
|
||||
title={error.title}
|
||||
subTitle={error.subTitle}
|
||||
/>
|
||||
) : (
|
||||
sanitizedConfig && (
|
||||
<Fragment>
|
||||
<div className="p-4 lg:p-10 min-h-full bg-base-200">
|
||||
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6 rounded-box">
|
||||
<div className="col-span-1">
|
||||
<div className="grid grid-cols-1 gap-6">
|
||||
{!sanitizedConfig.themeConfig.disableSwitch && (
|
||||
<ThemeChanger
|
||||
theme={theme}
|
||||
setTheme={setTheme}
|
||||
loading={loading}
|
||||
themeConfig={sanitizedConfig.themeConfig}
|
||||
/>
|
||||
)}
|
||||
<AvatarCard profile={profile} loading={loading} />
|
||||
<Details
|
||||
profile={profile}
|
||||
loading={loading}
|
||||
github={sanitizedConfig.github}
|
||||
social={sanitizedConfig.social}
|
||||
/>
|
||||
<Skill
|
||||
loading={loading}
|
||||
skills={sanitizedConfig.skills}
|
||||
/>
|
||||
<Experience
|
||||
loading={loading}
|
||||
experiences={sanitizedConfig.experiences}
|
||||
/>
|
||||
<Education
|
||||
loading={loading}
|
||||
education={sanitizedConfig.education}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="lg:col-span-2 col-span-1">
|
||||
<div className="grid grid-cols-1 gap-6">
|
||||
<Project
|
||||
repo={repo}
|
||||
loading={loading}
|
||||
github={sanitizedConfig.github}
|
||||
googleAnalytics={sanitizedConfig.googleAnalytics}
|
||||
/>
|
||||
<Blog
|
||||
loading={loading}
|
||||
googleAnalytics={sanitizedConfig.googleAnalytics}
|
||||
blog={sanitizedConfig.blog}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* The below attribution notice shall be
|
||||
included in all copies or substantial portions of the Software. */}
|
||||
{/* DO NOT REMOVE/MODIFY THE BELOW FOOTER. */}
|
||||
{/* SEE 4(C) SECTION OF THE LICENSE FOR MORE DETAILS. */}
|
||||
{/* https://github.com/arifszn/gitprofile/blob/main/LICENSE */}
|
||||
<footer className="p-4 footer bg-base-200 text-base-content footer-center">
|
||||
<div className="card compact bg-base-100 shadow">
|
||||
<a
|
||||
className="card-body"
|
||||
href="https://github.com/arifszn/gitprofile"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
<div>
|
||||
{loading ? (
|
||||
skeleton({ width: 'w-52', height: 'h-6' })
|
||||
) : (
|
||||
<p className="font-mono text-sm">
|
||||
Made with{' '}
|
||||
<span className="text-primary">GitProfile</span> and
|
||||
❤️
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</footer>
|
||||
</Fragment>
|
||||
)
|
||||
)}
|
||||
</div>
|
||||
</HelmetProvider>
|
||||
);
|
||||
};
|
||||
|
||||
GitProfile.propTypes = {
|
||||
config: PropTypes.shape({
|
||||
github: PropTypes.shape({
|
||||
username: PropTypes.string.isRequired,
|
||||
sortBy: PropTypes.oneOf(['stars', 'updated']),
|
||||
limit: PropTypes.number,
|
||||
exclude: PropTypes.shape({
|
||||
forks: PropTypes.bool,
|
||||
projects: PropTypes.array,
|
||||
}),
|
||||
}).isRequired,
|
||||
social: PropTypes.shape({
|
||||
linkedin: PropTypes.string,
|
||||
twitter: PropTypes.string,
|
||||
facebook: PropTypes.string,
|
||||
instagram: PropTypes.string,
|
||||
dribbble: PropTypes.string,
|
||||
behance: PropTypes.string,
|
||||
medium: PropTypes.string,
|
||||
dev: PropTypes.string,
|
||||
website: PropTypes.string,
|
||||
phone: PropTypes.string,
|
||||
email: PropTypes.string,
|
||||
}),
|
||||
skills: PropTypes.array,
|
||||
experiences: PropTypes.arrayOf(
|
||||
PropTypes.shape({
|
||||
company: PropTypes.string,
|
||||
position: PropTypes.string,
|
||||
from: PropTypes.string,
|
||||
to: PropTypes.string,
|
||||
})
|
||||
),
|
||||
education: PropTypes.arrayOf(
|
||||
PropTypes.shape({
|
||||
institution: PropTypes.string,
|
||||
degree: PropTypes.string,
|
||||
from: PropTypes.string,
|
||||
to: PropTypes.string,
|
||||
})
|
||||
),
|
||||
blog: PropTypes.shape({
|
||||
source: PropTypes.string,
|
||||
username: PropTypes.string,
|
||||
limit: PropTypes.number,
|
||||
}),
|
||||
googleAnalytics: PropTypes.shape({
|
||||
id: PropTypes.string,
|
||||
}),
|
||||
hotjar: PropTypes.shape({
|
||||
id: PropTypes.string,
|
||||
snippetVersion: PropTypes.number,
|
||||
}),
|
||||
themeConfig: PropTypes.shape({
|
||||
defaultTheme: PropTypes.string,
|
||||
disableSwitch: PropTypes.bool,
|
||||
respectPrefersColorScheme: PropTypes.bool,
|
||||
themes: PropTypes.array,
|
||||
customTheme: PropTypes.shape({
|
||||
primary: PropTypes.string,
|
||||
secondary: PropTypes.string,
|
||||
accent: PropTypes.string,
|
||||
neutral: PropTypes.string,
|
||||
'base-100': PropTypes.string,
|
||||
'--rounded-box': PropTypes.string,
|
||||
'--rounded-btn': PropTypes.string,
|
||||
}),
|
||||
}),
|
||||
}).isRequired,
|
||||
};
|
||||
|
||||
export default GitProfile;
|
||||
@@ -1,30 +0,0 @@
|
||||
import { useState, Fragment, useEffect } from 'react';
|
||||
|
||||
const LazyImage = ({ placeholder, src, alt, ...rest }) => {
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
const imageToLoad = new Image();
|
||||
imageToLoad.src = src;
|
||||
|
||||
imageToLoad.onload = () => {
|
||||
setLoading(false);
|
||||
}
|
||||
}, [src])
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
{
|
||||
loading ? placeholder : (
|
||||
<img
|
||||
src={src}
|
||||
alt={alt}
|
||||
{...rest}
|
||||
/>
|
||||
)
|
||||
}
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
|
||||
export default LazyImage;
|
||||
@@ -1,62 +0,0 @@
|
||||
import React, { Fragment } from 'react';
|
||||
import { Helmet } from "react-helmet-async";
|
||||
import { useSelector } from 'react-redux';
|
||||
import config from '../config';
|
||||
import { isThemeDarkish } from '../helpers/utils';
|
||||
|
||||
const MetaTags = () => {
|
||||
const profile = useSelector(state => state.profile);
|
||||
const theme = useSelector(state => state.theme);
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
{
|
||||
profile && (
|
||||
<Helmet>
|
||||
{
|
||||
config.googleAnalytics.id && (
|
||||
<script async src={`https://www.googletagmanager.com/gtag/js?id=${config.googleAnalytics.id}`}></script>
|
||||
)
|
||||
}
|
||||
{
|
||||
config.googleAnalytics.id && (
|
||||
<script>
|
||||
{
|
||||
`
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', '${config.googleAnalytics.id}');
|
||||
`
|
||||
}
|
||||
</script>
|
||||
)
|
||||
}
|
||||
<title>Portfolio of {profile.name}</title>
|
||||
<meta name="theme-color" content={isThemeDarkish(theme) ? '#000000' : '#ffffff'}/>
|
||||
|
||||
<meta name="description" content={profile.bio} />
|
||||
|
||||
<meta itemprop="name" content={`Portfolio of ${profile.name}`} />
|
||||
<meta itemprop="description" content={profile.bio} />
|
||||
<meta itemprop="image" content={profile.avatar} />
|
||||
|
||||
<meta property="og:url" content={typeof config.social.website !== 'undefined' ? config.social.website : ''} />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content={`Portfolio of ${profile.name}`} />
|
||||
<meta property="og:description" content={profile.bio} />
|
||||
<meta property="og:image" content={profile.avatar} />
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:title" content={`Portfolio of ${profile.name}`} />
|
||||
<meta name="twitter:description" content={profile.bio} />
|
||||
<meta name="twitter:image" content={profile.avatar} />
|
||||
</Helmet>
|
||||
)
|
||||
}
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
|
||||
export default MetaTags;
|
||||
@@ -1,158 +0,0 @@
|
||||
import { Fragment } from "react";
|
||||
import { useSelector } from "react-redux";
|
||||
import { ga, languageColor, skeleton } from "../helpers/utils";
|
||||
import { AiOutlineStar, AiOutlineFork } from 'react-icons/ai';
|
||||
import config from "../config";
|
||||
|
||||
const Project = () => {
|
||||
const loading = useSelector(state => state.loading);
|
||||
const repo = useSelector(state => state.repo);
|
||||
|
||||
const renderSkeleton = () => {
|
||||
let array = [];
|
||||
for (let index = 0; index < config.github.limit; index++) {
|
||||
array.push((
|
||||
<div className="card shadow-lg compact bg-base-100" key={index}>
|
||||
<div className="flex justify-between flex-col p-8 h-full w-full">
|
||||
<div>
|
||||
<div className="flex items-center">
|
||||
<span>
|
||||
<h5 className="card-title text-lg">
|
||||
{skeleton({ width: 'w-32', height: 'h-8' })}
|
||||
</h5>
|
||||
</span>
|
||||
</div>
|
||||
<div className="mb-5 mt-1">
|
||||
{skeleton({ width: 'w-full', height: 'h-4', className: 'mb-2' })}
|
||||
{skeleton({ width: 'w-full', height: 'h-4' })}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex justify-between">
|
||||
<div className="flex flex-grow">
|
||||
<span className="mr-3 flex items-center">
|
||||
{skeleton({ width: 'w-12', height: 'h-4' })}
|
||||
</span>
|
||||
<span className="flex items-center">
|
||||
{skeleton({ width: 'w-12', height: 'h-4' })}
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<span className="flex items-center">
|
||||
{skeleton({ width: 'w-12', height: 'h-4' })}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
const renderProjects = () => {
|
||||
return repo.map((item, index) => (
|
||||
<div
|
||||
className="card shadow-lg compact bg-base-100 cursor-pointer"
|
||||
key={index}
|
||||
onClick={() => {
|
||||
try {
|
||||
if (config.googleAnalytics.id) {
|
||||
ga.event({
|
||||
action: "Click project",
|
||||
params: {
|
||||
project: item.name
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
window.open(item.html_url, '_blank')
|
||||
}}
|
||||
>
|
||||
<div className="flex justify-between flex-col p-8 h-full w-full">
|
||||
<div>
|
||||
<div className="flex items-center opacity-60">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" className="inline-block w-5 h-5 mr-2 stroke-current"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"></path></svg>
|
||||
<span>
|
||||
<h5 className="card-title text-lg">
|
||||
{item.name}
|
||||
</h5>
|
||||
</span>
|
||||
</div>
|
||||
<p className="mb-5 mt-1 text-base-content text-opacity-60 text-sm">
|
||||
{item.description}
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex justify-between text-sm text-base-content text-opacity-60">
|
||||
<div className="flex flex-grow">
|
||||
<span className="mr-3 flex items-center">
|
||||
<AiOutlineStar className="mr-0.5" />
|
||||
<span>{item.stargazers_count}</span>
|
||||
</span>
|
||||
<span className="flex items-center">
|
||||
<AiOutlineFork className="mr-0.5" />
|
||||
<span>{item.forks_count}</span>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<span className="flex items-center">
|
||||
<div className="w-3 h-3 rounded-full mr-1 opacity-60" style={{ backgroundColor: languageColor(item.language) }} />
|
||||
<span>{item.language}</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
));
|
||||
}
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<div className="col-span-1 lg:col-span-2">
|
||||
<div className="grid grid-cols-2 gap-6">
|
||||
<div className="col-span-2">
|
||||
<div className="card compact bg-base-100 shadow-sm">
|
||||
<div className="card-body">
|
||||
<ul className="menu row-span-3 bg-base-100 text-base-content">
|
||||
<li>
|
||||
<div className="pb-0-important mx-4 flex items-center justify-between">
|
||||
<h5 className="card-title">
|
||||
{
|
||||
loading ? skeleton({ width: 'w-28', height: 'h-8' }) : (
|
||||
<span className="opacity-70">My Projects</span>
|
||||
)
|
||||
}
|
||||
</h5>
|
||||
{
|
||||
loading ? skeleton({ width: 'w-10', height: 'h-5' }) : (
|
||||
<a
|
||||
href={`https://github.com/${config.github.username}?tab=repositories`}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="opacity-50"
|
||||
>
|
||||
See All
|
||||
</a>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
{(loading || !repo) ? renderSkeleton() : renderProjects()}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
|
||||
export default Project;
|
||||
@@ -1,48 +0,0 @@
|
||||
import { useSelector } from "react-redux";
|
||||
import config from "../config";
|
||||
import { skeleton } from "../helpers/utils";
|
||||
|
||||
const Skill = () => {
|
||||
const loading = useSelector(state => state.loading);
|
||||
|
||||
const renderSkeleton = () => {
|
||||
let array = [];
|
||||
for (let index = 0; index < 12; index++) {
|
||||
array.push((
|
||||
<div key={index}>
|
||||
{skeleton({ width: 'w-16', height: 'h-4', className: 'm-1' })}
|
||||
</div>
|
||||
))
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{
|
||||
(typeof config.skills !== 'undefined' && config.skills.length !== 0) && (
|
||||
<div className="card shadow-lg compact bg-base-100">
|
||||
<div className="card-body">
|
||||
<div className="p-3 flow-root">
|
||||
<div className="-m-1 flex flex-wrap">
|
||||
{
|
||||
loading ? renderSkeleton() : (
|
||||
config.skills.map((skill, index) => (
|
||||
<div key={index} className="m-1 text-xs inline-flex items-center font-bold leading-sm uppercase px-3 py-1 badge-primary bg-opacity-75 rounded-full">
|
||||
{skill}
|
||||
</div>
|
||||
))
|
||||
)
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default Skill;
|
||||
@@ -1,73 +0,0 @@
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import { setTheme } from '../store/slices/themeSlice';
|
||||
import config from '../config';
|
||||
import { skeleton } from '../helpers/utils';
|
||||
import { AiOutlineControl } from 'react-icons/ai';
|
||||
|
||||
const ThemeChanger = () => {
|
||||
const dispatch = useDispatch();
|
||||
const theme = useSelector(state => state.theme);
|
||||
const loading = useSelector(state => state.loading);
|
||||
|
||||
const changeTheme = (e, selectedTheme) => {
|
||||
e.preventDefault();
|
||||
dispatch(setTheme(selectedTheme));
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="card overflow-visible shadow-lg compact bg-base-100">
|
||||
<div className="flex-row items-center space-x-4 flex pl-8 pr-2 py-4">
|
||||
<div className="flex-1">
|
||||
<h5 className="card-title">
|
||||
{
|
||||
loading ? skeleton({ width: 'w-20', height: 'h-8' }) : (
|
||||
<span className="opacity-70">Theme</span>
|
||||
)
|
||||
}
|
||||
</h5>
|
||||
<span className="text-base-content text-opacity-40 capitalize text-sm">
|
||||
{loading ? skeleton({ width: 'w-16', height: 'h-5' }) : (theme === config.themeConfig.default ? 'Default' : theme)}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex-0">
|
||||
{
|
||||
loading ? skeleton({ width: 'w-14 md:w-28', height: 'h-10', className: 'mr-6' }) : (
|
||||
<div title="Change Theme" className="dropdown dropdown-end">
|
||||
<div tabIndex={0} className="btn btn-ghost m-1 normal-case opacity-50">
|
||||
<AiOutlineControl className="inline-block w-5 h-5 stroke-current md:mr-2"/>
|
||||
<span className="hidden md:inline">
|
||||
Change Theme
|
||||
</span>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1792 1792" className="inline-block w-4 h-4 ml-1 fill-current">
|
||||
<path d="M1395 736q0 13-10 23l-466 466q-10 10-23 10t-23-10l-466-466q-10-10-10-23t10-23l50-50q10-10 23-10t23 10l393 393 393-393q10-10 23-10t23 10l50 50q10 10 10 23z" />
|
||||
</svg>
|
||||
</div>
|
||||
<div tabIndex={0} className="mt-16 overflow-y-auto shadow-2xl top-px dropdown-content h-96 w-52 rounded-b-box bg-base-200 text-base-content">
|
||||
<ul className="p-4 menu compact">
|
||||
{
|
||||
config.themeConfig.themes.map((item, index) => (
|
||||
<li key={index}>
|
||||
<a
|
||||
href="/"
|
||||
onClick={(e) => changeTheme(e, item)}
|
||||
className={`${theme === item ? 'active' : ''}`}
|
||||
>
|
||||
<span className="opacity-60 capitalize">
|
||||
{item === config.themeConfig.default ? 'Default' : item}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default ThemeChanger;
|
||||
62
src/components/avatar-card/index.jsx
Normal file
@@ -0,0 +1,62 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import { fallbackImage, skeleton } from '../../helpers/utils';
|
||||
import LazyImage from '../lazy-image';
|
||||
|
||||
const AvatarCard = ({ profile, loading }) => {
|
||||
return (
|
||||
<div className="card shadow-lg compact bg-base-100">
|
||||
<div className="grid place-items-center py-8">
|
||||
{loading || !profile ? (
|
||||
<div className="avatar opacity-90">
|
||||
<div className="mb-8 rounded-full w-32 h-32">
|
||||
{skeleton({
|
||||
width: 'w-full',
|
||||
height: 'h-full',
|
||||
shape: '',
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div className="avatar opacity-90">
|
||||
<div className="mb-8 rounded-full w-32 h-32 ring ring-primary ring-offset-base-100 ring-offset-2">
|
||||
{
|
||||
<LazyImage
|
||||
src={profile.avatar ? profile.avatar : fallbackImage}
|
||||
alt={profile.name}
|
||||
placeholder={skeleton({
|
||||
width: 'w-full',
|
||||
height: 'h-full',
|
||||
shape: '',
|
||||
})}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<div className="text-center mx-auto px-8">
|
||||
<h5 className="font-bold text-2xl">
|
||||
{loading || !profile ? (
|
||||
skeleton({ width: 'w-48', height: 'h-8' })
|
||||
) : (
|
||||
<span className="text-base-content opacity-70">
|
||||
{profile.name}
|
||||
</span>
|
||||
)}
|
||||
</h5>
|
||||
<div className="mt-3 text-base-content text-opacity-60 font-mono">
|
||||
{loading || !profile
|
||||
? skeleton({ width: 'w-48', height: 'h-5' })
|
||||
: profile.bio}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
AvatarCard.propTypes = {
|
||||
profile: PropTypes.object,
|
||||
loading: PropTypes.bool.isRequired,
|
||||
};
|
||||
|
||||
export default AvatarCard;
|
||||
225
src/components/blog/index.jsx
Normal file
@@ -0,0 +1,225 @@
|
||||
import { Fragment, useEffect, useState } from 'react';
|
||||
import { ga, skeleton } from '../../helpers/utils';
|
||||
import LazyImage from '../lazy-image';
|
||||
import PropTypes from 'prop-types';
|
||||
import { AiOutlineContainer } from 'react-icons/ai';
|
||||
import { getDevPost, getMediumPost } from '@arifszn/blog-js';
|
||||
import { formatDistance } from 'date-fns';
|
||||
|
||||
const displaySection = (blog) => {
|
||||
if (blog?.source && blog?.username) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
const Blog = ({ loading, blog, googleAnalytics }) => {
|
||||
const [articles, setArticles] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (displaySection(blog)) {
|
||||
if (blog.source === 'medium') {
|
||||
getMediumPost({
|
||||
user: blog.username,
|
||||
}).then((res) => {
|
||||
setArticles(res);
|
||||
});
|
||||
} else if (blog.source === 'dev') {
|
||||
getDevPost({
|
||||
user: blog.username,
|
||||
}).then((res) => {
|
||||
setArticles(res);
|
||||
});
|
||||
}
|
||||
}
|
||||
}, []);
|
||||
|
||||
const renderSkeleton = () => {
|
||||
let array = [];
|
||||
for (let index = 0; index < blog.limit; index++) {
|
||||
array.push(
|
||||
<div className="card shadow-lg compact bg-base-100" key={index}>
|
||||
<div className="p-8 h-full w-full">
|
||||
<div className="flex items-center flex-col md:flex-row">
|
||||
<div className="avatar mb-5 md:mb-0">
|
||||
<div className="w-24 h-24 mask mask-squircle">
|
||||
{skeleton({
|
||||
width: 'w-full',
|
||||
height: 'h-full',
|
||||
shape: '',
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<div className="flex items-start px-4">
|
||||
<div className="w-full">
|
||||
<h2>
|
||||
{skeleton({
|
||||
width: 'w-full',
|
||||
height: 'h-8',
|
||||
className: 'mb-2 mx-auto md:mx-0',
|
||||
})}
|
||||
</h2>
|
||||
{skeleton({
|
||||
width: 'w-24',
|
||||
height: 'h-3',
|
||||
className: 'mx-auto md:mx-0',
|
||||
})}
|
||||
<div className="mt-3">
|
||||
{skeleton({
|
||||
width: 'w-full',
|
||||
height: 'h-4',
|
||||
className: 'mx-auto md:mx-0',
|
||||
})}
|
||||
</div>
|
||||
<div className="mt-4 flex items-center flex-wrap justify-center md:justify-start">
|
||||
{skeleton({
|
||||
width: 'w-32',
|
||||
height: 'h-4',
|
||||
className: 'md:mr-2 mx-auto md:mx-0',
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return array;
|
||||
};
|
||||
|
||||
const renderArticles = () => {
|
||||
return articles && articles.length ? (
|
||||
articles.slice(0, blog.limit).map((article, index) => (
|
||||
<a
|
||||
className="card shadow-lg compact bg-base-100 cursor-pointer"
|
||||
key={index}
|
||||
href={article.link}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
|
||||
try {
|
||||
if (googleAnalytics?.id) {
|
||||
ga.event({
|
||||
action: 'Click Blog Post',
|
||||
params: {
|
||||
post: article.title,
|
||||
},
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
window?.open(article.link, '_blank');
|
||||
}}
|
||||
>
|
||||
<div className="p-8 h-full w-full">
|
||||
<div className="flex items-center flex-col md:flex-row">
|
||||
<div className="avatar mb-5 md:mb-0 opacity-90">
|
||||
<div className="w-24 h-24 mask mask-squircle">
|
||||
<LazyImage
|
||||
src={article.thumbnail}
|
||||
alt={'thumbnail'}
|
||||
placeholder={skeleton({
|
||||
width: 'w-full',
|
||||
height: 'h-full',
|
||||
shape: '',
|
||||
})}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<div className="flex items-start px-4">
|
||||
<div className="text-center md:text-left w-full">
|
||||
<h2 className="font-semibold text-base-content opacity-60">
|
||||
{article.title}
|
||||
</h2>
|
||||
<p className="text-base-content opacity-50 text-xs">
|
||||
{formatDistance(article.publishedAt, new Date(), {
|
||||
addSuffix: true,
|
||||
})}
|
||||
</p>
|
||||
<p className="mt-3 text-base-content text-opacity-60 text-sm">
|
||||
{article.description}
|
||||
</p>
|
||||
<div className="mt-4 flex items-center flex-wrap justify-center md:justify-start">
|
||||
{article.categories.map((category, index2) => (
|
||||
<div
|
||||
className="py-2 px-4 text-xs leading-3 rounded-full bg-base-300 mr-1 mb-1 opacity-50 text-base-content"
|
||||
key={index2}
|
||||
>
|
||||
#{category}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
))
|
||||
) : (
|
||||
<div className="text-center mb-6">
|
||||
<AiOutlineContainer className="mx-auto h-12 w-12 opacity-30" />
|
||||
<p className="mt-1 text-sm opacity-50 text-base-content">
|
||||
No recent post
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
{displaySection(blog) && (
|
||||
<div className="col-span-1 lg:col-span-2">
|
||||
<div className="grid grid-cols-2 gap-6">
|
||||
<div className="col-span-2">
|
||||
<div
|
||||
className={`card compact ${
|
||||
loading || (articles && articles.length)
|
||||
? 'bg-gradient-to-br to-base-200 from-base-100 shadow'
|
||||
: 'bg-base-100 shadow-lg'
|
||||
}`}
|
||||
>
|
||||
<div className="card-body">
|
||||
<div className="mx-3 mb-2">
|
||||
<h5 className="card-title">
|
||||
{loading ? (
|
||||
skeleton({ width: 'w-28', height: 'h-8' })
|
||||
) : (
|
||||
<span className="text-base-content opacity-70">
|
||||
Recent Posts
|
||||
</span>
|
||||
)}
|
||||
</h5>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<div className="grid grid-cols-1 gap-6">
|
||||
{loading || !articles
|
||||
? renderSkeleton()
|
||||
: renderArticles()}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</Fragment>
|
||||
);
|
||||
};
|
||||
|
||||
Blog.propTypes = {
|
||||
loading: PropTypes.bool.isRequired,
|
||||
blog: PropTypes.object.isRequired,
|
||||
googleAnalytics: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
export default Blog;
|
||||
219
src/components/details/index.jsx
Normal file
@@ -0,0 +1,219 @@
|
||||
import { MdLocationOn, MdMail } from 'react-icons/md';
|
||||
import {
|
||||
AiFillGithub,
|
||||
AiFillInstagram,
|
||||
AiFillMediumSquare,
|
||||
} from 'react-icons/ai';
|
||||
import { SiTwitter } from 'react-icons/si';
|
||||
import { GrLinkedinOption } from 'react-icons/gr';
|
||||
import { CgDribbble } from 'react-icons/cg';
|
||||
import { RiPhoneFill } from 'react-icons/ri';
|
||||
import { Fragment } from 'react';
|
||||
import {
|
||||
FaBehanceSquare,
|
||||
FaBuilding,
|
||||
FaDev,
|
||||
FaFacebook,
|
||||
FaGlobe,
|
||||
} from 'react-icons/fa';
|
||||
import PropTypes from 'prop-types';
|
||||
import { skeleton } from '../../helpers/utils';
|
||||
|
||||
const ListItem = ({ icon, title, value, link, skeleton = false }) => {
|
||||
return (
|
||||
<a
|
||||
href={link}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="flex justify-start py-2 px-1 items-center"
|
||||
>
|
||||
<span className="w-2 m-2">{icon}</span>
|
||||
<div className="flex-grow font-medium px-2">{title}</div>
|
||||
<div
|
||||
className={`${
|
||||
skeleton ? 'flex-grow' : ''
|
||||
} text-sm font-normal text-right mr-2 ml-3 ${link ? 'truncate' : ''}`}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
wordBreak: 'break-word',
|
||||
}}
|
||||
>
|
||||
{value}
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
);
|
||||
};
|
||||
|
||||
const isCompanyMention = (company) => {
|
||||
return company.startsWith('@') && !company.includes(' ');
|
||||
};
|
||||
|
||||
const companyLink = (company) => {
|
||||
return `https://github.com/${company.substring(1)}`;
|
||||
};
|
||||
|
||||
const Details = ({ profile, loading, social, github }) => {
|
||||
const renderSkeleton = () => {
|
||||
let array = [];
|
||||
for (let index = 0; index < 4; index++) {
|
||||
array.push(
|
||||
<ListItem
|
||||
key={index}
|
||||
skeleton={true}
|
||||
icon={skeleton({ width: 'w-4', height: 'h-4' })}
|
||||
title={skeleton({ width: 'w-24', height: 'h-4' })}
|
||||
value={skeleton({ width: 'w-full', height: 'h-4' })}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return array;
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="card shadow-lg compact bg-base-100">
|
||||
<div className="card-body">
|
||||
<div className="text-base-content text-opacity-60">
|
||||
{loading || !profile ? (
|
||||
renderSkeleton()
|
||||
) : (
|
||||
<Fragment>
|
||||
{profile.location && (
|
||||
<ListItem
|
||||
icon={<MdLocationOn className="mr-2" />}
|
||||
title="Based in:"
|
||||
value={profile.location}
|
||||
/>
|
||||
)}
|
||||
{profile.company && (
|
||||
<ListItem
|
||||
icon={<FaBuilding className="mr-2" />}
|
||||
title="Company:"
|
||||
value={profile.company}
|
||||
link={
|
||||
isCompanyMention(profile.company)
|
||||
? companyLink(profile.company)
|
||||
: null
|
||||
}
|
||||
/>
|
||||
)}
|
||||
<ListItem
|
||||
icon={<AiFillGithub className="mr-2" />}
|
||||
title="GitHub:"
|
||||
value={github.username}
|
||||
link={`https://github.com/${github.username}`}
|
||||
/>
|
||||
{social?.twitter && (
|
||||
<ListItem
|
||||
icon={<SiTwitter className="mr-2" />}
|
||||
title="Twitter:"
|
||||
value={social.twitter}
|
||||
link={`https://twitter.com/${social.twitter}`}
|
||||
/>
|
||||
)}
|
||||
{social?.linkedin && (
|
||||
<ListItem
|
||||
icon={<GrLinkedinOption className="mr-2" />}
|
||||
title="LinkedIn:"
|
||||
value={social.linkedin}
|
||||
link={`https://www.linkedin.com/in/${social.linkedin}`}
|
||||
/>
|
||||
)}
|
||||
{social?.dribbble && (
|
||||
<ListItem
|
||||
icon={<CgDribbble className="mr-2" />}
|
||||
title="Dribbble:"
|
||||
value={social.dribbble}
|
||||
link={`https://dribbble.com/${social.dribbble}`}
|
||||
/>
|
||||
)}
|
||||
{social?.behance && (
|
||||
<ListItem
|
||||
icon={<FaBehanceSquare className="mr-2" />}
|
||||
title="Behance:"
|
||||
value={social.behance}
|
||||
link={`https://www.behance.net/${social.behance}`}
|
||||
/>
|
||||
)}
|
||||
{social?.facebook && (
|
||||
<ListItem
|
||||
icon={<FaFacebook className="mr-2" />}
|
||||
title="Facebook:"
|
||||
value={social.facebook}
|
||||
link={`https://www.facebook.com/${social.facebook}`}
|
||||
/>
|
||||
)}
|
||||
{social?.instagram && (
|
||||
<ListItem
|
||||
icon={<AiFillInstagram className="mr-2" />}
|
||||
title="Instagram:"
|
||||
value={social.instagram}
|
||||
link={`https://www.instagram.com/${social.instagram}`}
|
||||
/>
|
||||
)}
|
||||
{social?.medium && (
|
||||
<ListItem
|
||||
icon={<AiFillMediumSquare className="mr-2" />}
|
||||
title="Medium:"
|
||||
value={social.medium}
|
||||
link={`https://medium.com/@${social.medium}`}
|
||||
/>
|
||||
)}
|
||||
{social?.dev && (
|
||||
<ListItem
|
||||
icon={<FaDev className="mr-2" />}
|
||||
title="Dev:"
|
||||
value={social.dev}
|
||||
link={`https://dev.to/${social.dev}`}
|
||||
/>
|
||||
)}
|
||||
{social?.website && (
|
||||
<ListItem
|
||||
icon={<FaGlobe className="mr-2" />}
|
||||
title="Website:"
|
||||
value={social.website}
|
||||
link={social.website}
|
||||
/>
|
||||
)}
|
||||
{social?.phone && (
|
||||
<ListItem
|
||||
icon={<RiPhoneFill className="mr-2" />}
|
||||
title="Phone:"
|
||||
value={social.phone}
|
||||
link={`tel:${social.phone}`}
|
||||
/>
|
||||
)}
|
||||
{social?.email && (
|
||||
<ListItem
|
||||
icon={<MdMail className="mr-2" />}
|
||||
title="Email:"
|
||||
value={social.email}
|
||||
link={`mailto:${social.email}`}
|
||||
/>
|
||||
)}
|
||||
</Fragment>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Details.propTypes = {
|
||||
profile: PropTypes.object,
|
||||
loading: PropTypes.bool.isRequired,
|
||||
social: PropTypes.object.isRequired,
|
||||
github: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
ListItem.propTypes = {
|
||||
icon: PropTypes.node,
|
||||
title: PropTypes.node,
|
||||
value: PropTypes.node,
|
||||
link: PropTypes.string,
|
||||
skeleton: PropTypes.bool,
|
||||
};
|
||||
|
||||
export default Details;
|
||||
93
src/components/education/index.jsx
Normal file
@@ -0,0 +1,93 @@
|
||||
import { skeleton } from '../../helpers/utils';
|
||||
import { Fragment } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const ListItem = ({ time, degree, institution }) => (
|
||||
<li className="mb-5 ml-4">
|
||||
<div
|
||||
className="absolute w-2 h-2 bg-base-300 rounded-full border border-base-300 mt-1.5"
|
||||
style={{ left: '-4.5px' }}
|
||||
></div>
|
||||
<div className="my-0.5 text-xs">{time}</div>
|
||||
<h3 className="font-semibold">{degree}</h3>
|
||||
<div className="mb-4 font-normal">{institution}</div>
|
||||
</li>
|
||||
);
|
||||
|
||||
const Education = ({ loading, education }) => {
|
||||
const renderSkeleton = () => {
|
||||
let array = [];
|
||||
for (let index = 0; index < 2; index++) {
|
||||
array.push(
|
||||
<ListItem
|
||||
key={index}
|
||||
time={skeleton({
|
||||
width: 'w-5/12',
|
||||
height: 'h-4',
|
||||
})}
|
||||
degree={skeleton({
|
||||
width: 'w-6/12',
|
||||
height: 'h-4',
|
||||
className: 'my-1.5',
|
||||
})}
|
||||
institution={skeleton({ width: 'w-6/12', height: 'h-3' })}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return array;
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
{education?.length !== 0 && (
|
||||
<div className="card shadow-lg compact bg-base-100">
|
||||
<div className="card-body">
|
||||
<div className="mx-3">
|
||||
<h5 className="card-title">
|
||||
{loading ? (
|
||||
skeleton({ width: 'w-32', height: 'h-8' })
|
||||
) : (
|
||||
<span className="text-base-content opacity-70">
|
||||
Education
|
||||
</span>
|
||||
)}
|
||||
</h5>
|
||||
</div>
|
||||
<div className="text-base-content text-opacity-60">
|
||||
<ol className="relative border-l border-base-300 border-opacity-30 my-2 mx-4">
|
||||
{loading ? (
|
||||
renderSkeleton()
|
||||
) : (
|
||||
<Fragment>
|
||||
{education.map((item, index) => (
|
||||
<ListItem
|
||||
key={index}
|
||||
time={`${item.from} - ${item.to}`}
|
||||
degree={item.degree}
|
||||
institution={item.institution}
|
||||
/>
|
||||
))}
|
||||
</Fragment>
|
||||
)}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
Education.propTypes = {
|
||||
loading: PropTypes.bool.isRequired,
|
||||
education: PropTypes.array.isRequired,
|
||||
};
|
||||
|
||||
ListItem.propTypes = {
|
||||
time: PropTypes.node,
|
||||
degree: PropTypes.node,
|
||||
institution: PropTypes.node,
|
||||
};
|
||||
|
||||
export default Education;
|
||||
31
src/components/error-page/index.jsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const ErrorPage = (props) => {
|
||||
return (
|
||||
<div className="min-w-screen min-h-screen bg-base-200 flex items-center p-5 lg:p-20 overflow-hidden relative">
|
||||
<div className="flex-1 min-h-full min-w-full rounded-3xl bg-base-100 shadow-xl p-10 lg:p-20 text-gray-800 relative md:flex items-center text-center md:text-left">
|
||||
<div className="w-full">
|
||||
<div className="mb-10 md:mb-20 mt-10 md:mt-20 text-gray-600 font-light">
|
||||
<h1 className="font-black uppercase text-3xl lg:text-5xl text-primary mb-10">
|
||||
{props.status}
|
||||
</h1>
|
||||
<p className="text-lg pb-2 text-base-content">{props.title}</p>
|
||||
<div className="text-base-content text-opacity-60">
|
||||
{props.subTitle}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="w-64 md:w-96 h-96 md:h-full bg-accent bg-opacity-10 absolute -top-64 md:-top-96 right-20 md:right-32 rounded-full pointer-events-none -rotate-45 transform"></div>
|
||||
<div className="w-96 h-full bg-secondary bg-opacity-10 absolute -bottom-96 right-64 rounded-full pointer-events-none -rotate-45 transform"></div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
ErrorPage.propTypes = {
|
||||
status: PropTypes.string.isRequired,
|
||||
title: PropTypes.string.isRequired,
|
||||
subTitle: PropTypes.node.isRequired,
|
||||
};
|
||||
|
||||
export default ErrorPage;
|
||||
93
src/components/experience/index.jsx
Normal file
@@ -0,0 +1,93 @@
|
||||
import { skeleton } from '../../helpers/utils';
|
||||
import { Fragment } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const ListItem = ({ time, position, company }) => (
|
||||
<li className="mb-5 ml-4">
|
||||
<div
|
||||
className="absolute w-2 h-2 bg-base-300 rounded-full border border-base-300 mt-1.5"
|
||||
style={{ left: '-4.5px' }}
|
||||
></div>
|
||||
<div className="my-0.5 text-xs">{time}</div>
|
||||
<h3 className="font-semibold">{position}</h3>
|
||||
<div className="mb-4 font-normal">{company}</div>
|
||||
</li>
|
||||
);
|
||||
|
||||
const Experience = ({ experiences, loading }) => {
|
||||
const renderSkeleton = () => {
|
||||
let array = [];
|
||||
for (let index = 0; index < 2; index++) {
|
||||
array.push(
|
||||
<ListItem
|
||||
key={index}
|
||||
time={skeleton({
|
||||
width: 'w-5/12',
|
||||
height: 'h-4',
|
||||
})}
|
||||
position={skeleton({
|
||||
width: 'w-6/12',
|
||||
height: 'h-4',
|
||||
className: 'my-1.5',
|
||||
})}
|
||||
company={skeleton({ width: 'w-6/12', height: 'h-3' })}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return array;
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
{experiences?.length !== 0 && (
|
||||
<div className="card shadow-lg compact bg-base-100">
|
||||
<div className="card-body">
|
||||
<div className="mx-3">
|
||||
<h5 className="card-title">
|
||||
{loading ? (
|
||||
skeleton({ width: 'w-32', height: 'h-8' })
|
||||
) : (
|
||||
<span className="text-base-content opacity-70">
|
||||
Experience
|
||||
</span>
|
||||
)}
|
||||
</h5>
|
||||
</div>
|
||||
<div className="text-base-content text-opacity-60">
|
||||
<ol className="relative border-l border-base-300 border-opacity-30 my-2 mx-4">
|
||||
{loading ? (
|
||||
renderSkeleton()
|
||||
) : (
|
||||
<Fragment>
|
||||
{experiences.map((experience, index) => (
|
||||
<ListItem
|
||||
key={index}
|
||||
time={`${experience.from} - ${experience.to}`}
|
||||
position={experience.position}
|
||||
company={experience.company}
|
||||
/>
|
||||
))}
|
||||
</Fragment>
|
||||
)}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
ListItem.propTypes = {
|
||||
time: PropTypes.node,
|
||||
position: PropTypes.node,
|
||||
company: PropTypes.node,
|
||||
};
|
||||
|
||||
Experience.propTypes = {
|
||||
experiences: PropTypes.array.isRequired,
|
||||
loading: PropTypes.bool.isRequired,
|
||||
};
|
||||
|
||||
export default Experience;
|
||||
60
src/components/head-tag-editor/index.jsx
Normal file
@@ -0,0 +1,60 @@
|
||||
import { Fragment } from 'react';
|
||||
import { Helmet } from 'react-helmet-async';
|
||||
import PropTypes from 'prop-types';
|
||||
import { isDarkishTheme } from '../../helpers/utils';
|
||||
|
||||
const HeadTagEditor = ({ profile, theme, googleAnalytics, social }) => {
|
||||
return (
|
||||
<Fragment>
|
||||
{profile && (
|
||||
<Helmet>
|
||||
{googleAnalytics?.id && (
|
||||
<script
|
||||
async
|
||||
src={`https://www.googletagmanager.com/gtag/js?id=${googleAnalytics.id}`}
|
||||
></script>
|
||||
)}
|
||||
{googleAnalytics?.id && (
|
||||
<script>
|
||||
{`window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', '${googleAnalytics.id}');`}
|
||||
</script>
|
||||
)}
|
||||
<title>Portfolio of {profile.name}</title>
|
||||
<meta
|
||||
name="theme-color"
|
||||
content={isDarkishTheme(theme) ? '#000000' : '#ffffff'}
|
||||
/>
|
||||
|
||||
<meta name="description" content={profile.bio} />
|
||||
|
||||
<meta itemProp="name" content={`Portfolio of ${profile.name}`} />
|
||||
<meta itemProp="description" content={profile.bio} />
|
||||
<meta itemProp="image" content={profile.avatar} />
|
||||
|
||||
<meta property="og:url" content={social?.website || ''} />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content={`Portfolio of ${profile.name}`} />
|
||||
<meta property="og:description" content={profile.bio} />
|
||||
<meta property="og:image" content={profile.avatar} />
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:title" content={`Portfolio of ${profile.name}`} />
|
||||
<meta name="twitter:description" content={profile.bio} />
|
||||
<meta name="twitter:image" content={profile.avatar} />
|
||||
</Helmet>
|
||||
)}
|
||||
</Fragment>
|
||||
);
|
||||
};
|
||||
|
||||
HeadTagEditor.propTypes = {
|
||||
profile: PropTypes.object,
|
||||
theme: PropTypes.string,
|
||||
googleAnalytics: PropTypes.object.isRequired,
|
||||
social: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
export default HeadTagEditor;
|
||||
29
src/components/lazy-image/index.jsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import { useState, Fragment, useEffect } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const LazyImage = ({ placeholder, src, alt, ...rest }) => {
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
const imageToLoad = new Image();
|
||||
imageToLoad.src = src;
|
||||
|
||||
imageToLoad.onload = () => {
|
||||
setLoading(false);
|
||||
};
|
||||
}, [src]);
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
{loading ? placeholder : <img src={src} alt={alt} {...rest} />}
|
||||
</Fragment>
|
||||
);
|
||||
};
|
||||
|
||||
LazyImage.propTypes = {
|
||||
placeholder: PropTypes.node,
|
||||
alt: PropTypes.string,
|
||||
src: PropTypes.string,
|
||||
};
|
||||
|
||||
export default LazyImage;
|
||||
181
src/components/project/index.jsx
Normal file
@@ -0,0 +1,181 @@
|
||||
import { Fragment } from 'react';
|
||||
import { AiOutlineStar, AiOutlineFork } from 'react-icons/ai';
|
||||
import PropTypes from 'prop-types';
|
||||
import { ga, languageColor, skeleton } from '../../helpers/utils';
|
||||
|
||||
const Project = ({ repo, loading, github, googleAnalytics }) => {
|
||||
const renderSkeleton = () => {
|
||||
let array = [];
|
||||
for (let index = 0; index < github.limit; index++) {
|
||||
array.push(
|
||||
<div className="card shadow-lg compact bg-base-100" key={index}>
|
||||
<div className="flex justify-between flex-col p-8 h-full w-full">
|
||||
<div>
|
||||
<div className="flex items-center">
|
||||
<span>
|
||||
<h5 className="card-title text-lg">
|
||||
{skeleton({ width: 'w-32', height: 'h-8' })}
|
||||
</h5>
|
||||
</span>
|
||||
</div>
|
||||
<div className="mb-5 mt-1">
|
||||
{skeleton({
|
||||
width: 'w-full',
|
||||
height: 'h-4',
|
||||
className: 'mb-2',
|
||||
})}
|
||||
{skeleton({ width: 'w-full', height: 'h-4' })}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex justify-between">
|
||||
<div className="flex flex-grow">
|
||||
<span className="mr-3 flex items-center">
|
||||
{skeleton({ width: 'w-12', height: 'h-4' })}
|
||||
</span>
|
||||
<span className="flex items-center">
|
||||
{skeleton({ width: 'w-12', height: 'h-4' })}
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<span className="flex items-center">
|
||||
{skeleton({ width: 'w-12', height: 'h-4' })}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return array;
|
||||
};
|
||||
|
||||
const renderProjects = () => {
|
||||
return repo.map((item, index) => (
|
||||
<a
|
||||
className="card shadow-lg compact bg-base-100 cursor-pointer"
|
||||
href={item.html_url}
|
||||
key={index}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
|
||||
try {
|
||||
if (googleAnalytics?.id) {
|
||||
ga.event({
|
||||
action: 'Click project',
|
||||
params: {
|
||||
project: item.name,
|
||||
},
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
window?.open(item.html_url, '_blank');
|
||||
}}
|
||||
>
|
||||
<div className="flex justify-between flex-col p-8 h-full w-full">
|
||||
<div>
|
||||
<div className="flex items-center opacity-60">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
className="text-base-content inline-block w-5 h-5 mr-2 stroke-current"
|
||||
>
|
||||
<path
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="2"
|
||||
d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"
|
||||
></path>
|
||||
</svg>
|
||||
<span>
|
||||
<h5 className="card-title text-lg text-base-content">
|
||||
{item.name}
|
||||
</h5>
|
||||
</span>
|
||||
</div>
|
||||
<p className="mb-5 mt-1 text-base-content text-opacity-60 text-sm">
|
||||
{item.description}
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex justify-between text-sm text-base-content text-opacity-60">
|
||||
<div className="flex flex-grow">
|
||||
<span className="mr-3 flex items-center">
|
||||
<AiOutlineStar className="mr-0.5" />
|
||||
<span>{item.stargazers_count}</span>
|
||||
</span>
|
||||
<span className="flex items-center">
|
||||
<AiOutlineFork className="mr-0.5" />
|
||||
<span>{item.forks_count}</span>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<span className="flex items-center">
|
||||
<div
|
||||
className="w-3 h-3 rounded-full mr-1 opacity-60"
|
||||
style={{ backgroundColor: languageColor(item.language) }}
|
||||
/>
|
||||
<span>{item.language}</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
));
|
||||
};
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<div className="col-span-1 lg:col-span-2">
|
||||
<div className="grid grid-cols-2 gap-6">
|
||||
<div className="col-span-2">
|
||||
<div className="card compact bg-gradient-to-br to-base-200 from-base-100 shadow">
|
||||
<div className="card-body">
|
||||
<div className="mx-3 flex items-center justify-between mb-2">
|
||||
<h5 className="card-title">
|
||||
{loading ? (
|
||||
skeleton({ width: 'w-28', height: 'h-8' })
|
||||
) : (
|
||||
<span className="text-base-content opacity-70">
|
||||
My Projects
|
||||
</span>
|
||||
)}
|
||||
</h5>
|
||||
{loading ? (
|
||||
skeleton({ width: 'w-10', height: 'h-5' })
|
||||
) : (
|
||||
<a
|
||||
href={`https://github.com/${github.username}?tab=repositories`}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="text-base-content opacity-50"
|
||||
>
|
||||
See All
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
{loading || !repo ? renderSkeleton() : renderProjects()}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Fragment>
|
||||
);
|
||||
};
|
||||
|
||||
Project.propTypes = {
|
||||
repo: PropTypes.array,
|
||||
loading: PropTypes.bool.isRequired,
|
||||
github: PropTypes.object.isRequired,
|
||||
googleAnalytics: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
export default Project;
|
||||
60
src/components/skill/index.jsx
Normal file
@@ -0,0 +1,60 @@
|
||||
import { skeleton } from '../../helpers/utils';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const Skill = ({ loading, skills }) => {
|
||||
const renderSkeleton = () => {
|
||||
let array = [];
|
||||
for (let index = 0; index < 12; index++) {
|
||||
array.push(
|
||||
<div key={index}>
|
||||
{skeleton({ width: 'w-16', height: 'h-4', className: 'm-1' })}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return array;
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
{skills?.length !== 0 && (
|
||||
<div className="card shadow-lg compact bg-base-100">
|
||||
<div className="card-body">
|
||||
<div className="mx-3">
|
||||
<h5 className="card-title">
|
||||
{loading ? (
|
||||
skeleton({ width: 'w-32', height: 'h-8' })
|
||||
) : (
|
||||
<span className="text-base-content opacity-70">
|
||||
Tech Stack
|
||||
</span>
|
||||
)}
|
||||
</h5>
|
||||
</div>
|
||||
<div className="p-3 flow-root">
|
||||
<div className="-m-1 flex flex-wrap justify-center">
|
||||
{loading
|
||||
? renderSkeleton()
|
||||
: skills.map((skill, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className="m-1 text-xs inline-flex items-center font-bold leading-sm px-3 py-1 badge-primary bg-opacity-90 rounded-full"
|
||||
>
|
||||
{skill}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
Skill.propTypes = {
|
||||
loading: PropTypes.bool.isRequired,
|
||||
skills: PropTypes.array.isRequired,
|
||||
};
|
||||
|
||||
export default Skill;
|
||||
98
src/components/theme-changer/index.jsx
Normal file
@@ -0,0 +1,98 @@
|
||||
import { AiOutlineControl } from 'react-icons/ai';
|
||||
import { skeleton } from '../../helpers/utils';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const ThemeChanger = ({ theme, setTheme, loading, themeConfig }) => {
|
||||
const changeTheme = (e, selectedTheme) => {
|
||||
e.preventDefault();
|
||||
document.querySelector('html').setAttribute('data-theme', selectedTheme);
|
||||
|
||||
typeof window !== 'undefined' &&
|
||||
localStorage.setItem('gitprofile-theme', selectedTheme);
|
||||
|
||||
setTheme(selectedTheme);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="card overflow-visible shadow-lg compact bg-base-100">
|
||||
<div className="flex-row items-center space-x-4 flex pl-6 pr-2 py-4">
|
||||
<div className="flex-1">
|
||||
<h5 className="card-title">
|
||||
{loading ? (
|
||||
skeleton({ width: 'w-20', height: 'h-8', className: 'mb-1' })
|
||||
) : (
|
||||
<span className="text-base-content opacity-70">Theme</span>
|
||||
)}
|
||||
</h5>
|
||||
<span className="text-base-content text-opacity-40 capitalize text-sm">
|
||||
{loading
|
||||
? skeleton({ width: 'w-16', height: 'h-5' })
|
||||
: theme === themeConfig.defaultTheme
|
||||
? 'Default'
|
||||
: theme}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex-0">
|
||||
{loading ? (
|
||||
skeleton({
|
||||
width: 'w-14 md:w-28',
|
||||
height: 'h-10',
|
||||
className: 'mr-6',
|
||||
})
|
||||
) : (
|
||||
<div title="Change Theme" className="dropdown dropdown-end">
|
||||
<div
|
||||
tabIndex={0}
|
||||
className="btn btn-ghost m-1 normal-case opacity-50 text-base-content"
|
||||
>
|
||||
<AiOutlineControl className="inline-block w-5 h-5 stroke-current md:mr-2" />
|
||||
<span className="hidden md:inline">Change Theme</span>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 1792 1792"
|
||||
className="inline-block w-4 h-4 ml-1 fill-current"
|
||||
>
|
||||
<path d="M1395 736q0 13-10 23l-466 466q-10 10-23 10t-23-10l-466-466q-10-10-10-23t10-23l50-50q10-10 23-10t23 10l393 393 393-393q10-10 23-10t23 10l50 50q10 10 10 23z" />
|
||||
</svg>
|
||||
</div>
|
||||
<div
|
||||
tabIndex={0}
|
||||
className="mt-16 overflow-y-auto shadow-2xl top-px dropdown-content max-h-96 w-52 rounded-b-box bg-base-200 text-base-content"
|
||||
>
|
||||
<ul className="p-4 menu compact">
|
||||
{[
|
||||
themeConfig.defaultTheme,
|
||||
...themeConfig.themes.filter(
|
||||
(item) => item !== themeConfig.defaultTheme
|
||||
),
|
||||
].map((item, index) => (
|
||||
<li key={index}>
|
||||
{/* eslint-disable-next-line */}
|
||||
<a
|
||||
onClick={(e) => changeTheme(e, item)}
|
||||
className={`${theme === item ? 'active' : ''}`}
|
||||
>
|
||||
<span className="opacity-60 capitalize">
|
||||
{item === themeConfig.defaultTheme ? 'Default' : item}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
ThemeChanger.propTypes = {
|
||||
theme: PropTypes.string,
|
||||
setTheme: PropTypes.func.isRequired,
|
||||
loading: PropTypes.bool.isRequired,
|
||||
themeConfig: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
export default ThemeChanger;
|
||||
124
src/config.js
@@ -1,124 +0,0 @@
|
||||
// config.js
|
||||
module.exports = {
|
||||
github: {
|
||||
username: 'arifszn', // Your GitHub org/user name. (Required)
|
||||
sortBy: 'stars', // stars | updated
|
||||
limit: 8, // How many projects to display.
|
||||
exclude: {
|
||||
forks: false, // Forked projects will not be displayed if set to true.
|
||||
projects: [] // These projects will not be displayed. example: ['my-project1', 'my-project2']
|
||||
}
|
||||
},
|
||||
social: {
|
||||
linkedin: 'ariful-alam',
|
||||
twitter: 'arif_swozon',
|
||||
facebook: '',
|
||||
dribbble: '',
|
||||
behance: '',
|
||||
medium: '',
|
||||
devto: '',
|
||||
website: 'https://arifszn.github.io',
|
||||
email: 'contact@arifszn.com'
|
||||
},
|
||||
skills: [
|
||||
'PHP',
|
||||
'Laravel',
|
||||
'JavaScript',
|
||||
'React.js',
|
||||
'Vue.js',
|
||||
'Node.js',
|
||||
'Jquery',
|
||||
'MySQL',
|
||||
'Git',
|
||||
'CSS',
|
||||
'Antd',
|
||||
'Tailwind',
|
||||
'Bootstrap',
|
||||
],
|
||||
experiences: [
|
||||
{
|
||||
company: 'Monstarlab Bangladesh',
|
||||
position: 'Software Engineer',
|
||||
from: 'September 2021',
|
||||
to: 'Present'
|
||||
},
|
||||
{
|
||||
company: 'Orangetoolz - My Offer 360 Degree',
|
||||
position: 'Jr. Full Stack Engineer',
|
||||
from: 'July 2019',
|
||||
to: 'August 2021'
|
||||
},
|
||||
{
|
||||
company: 'Techvillage',
|
||||
position: 'Jr. Software Engineer',
|
||||
from: 'January 2019',
|
||||
to: ' June 2019'
|
||||
}
|
||||
],
|
||||
education: [
|
||||
{
|
||||
institution: 'American International University-Bangladesh',
|
||||
degree: 'Bachelor of Science',
|
||||
from: '2015',
|
||||
to: '2019'
|
||||
},
|
||||
{
|
||||
institution: 'Cantonment College, Jessore',
|
||||
degree: 'Higher Secondary Certificate (HSC)',
|
||||
from: '2012',
|
||||
to: '2014',
|
||||
},
|
||||
{
|
||||
institution: 'Chowgacha Shahadat Pilot High School',
|
||||
degree: 'Secondary School Certificate (SSC)',
|
||||
from: '2007',
|
||||
to: '2012'
|
||||
}
|
||||
],
|
||||
blog: {
|
||||
// Display blog posts from your medium or dev.to account. (Optional)
|
||||
source: 'dev.to', // medium | dev.to
|
||||
username: 'arifszn',
|
||||
limit: 3 // How many posts to display. Max is 10.
|
||||
},
|
||||
googleAnalytics: {
|
||||
// GA3 tracking id/GA4 tag id
|
||||
id: '' // UA-XXXXXXXXX-X | G-XXXXXXXXXX
|
||||
},
|
||||
themeConfig: {
|
||||
default: 'light',
|
||||
|
||||
// Hides the switch in the navbar
|
||||
// Useful if you want to support a single color mode
|
||||
disableSwitch: false,
|
||||
|
||||
// Should we use the prefers-color-scheme media-query,
|
||||
// using user system preferences, instead of the hardcoded default
|
||||
respectPrefersColorScheme: true,
|
||||
|
||||
// Available themes. To remove any theme, exclude from here.
|
||||
themes: [
|
||||
'light',
|
||||
'dark',
|
||||
'cupcake',
|
||||
'bumblebee',
|
||||
'emerald',
|
||||
'corporate',
|
||||
'synthwave',
|
||||
'retro',
|
||||
'cyberpunk',
|
||||
'valentine',
|
||||
'halloween',
|
||||
'garden',
|
||||
'forest',
|
||||
'aqua',
|
||||
'lofi',
|
||||
'pastel',
|
||||
'fantasy',
|
||||
'wireframe',
|
||||
'black',
|
||||
'luxury',
|
||||
'dracula'
|
||||
]
|
||||
}
|
||||
}
|
||||
1434
src/data/colors.json
Normal file
@@ -1,70 +0,0 @@
|
||||
import config from "../config";
|
||||
import colors from './colors.json';
|
||||
|
||||
export const getThemeValue = () => {
|
||||
if (config.themeConfig.disableSwitch) {
|
||||
return config.themeConfig.default;
|
||||
}
|
||||
|
||||
if (localStorage.hasOwnProperty('ezprofileTheme')) {
|
||||
let theme = localStorage.getItem('ezprofileTheme');
|
||||
return theme;
|
||||
}
|
||||
|
||||
if (config.themeConfig.respectPrefersColorScheme && !config.themeConfig.disableSwitch) {
|
||||
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : config.themeConfig.default;
|
||||
}
|
||||
|
||||
return config.themeConfig.default;
|
||||
}
|
||||
|
||||
export const skeleton = ({width = null, height = null, style = {}, shape = 'rounded-full', className = null}) => {
|
||||
return <div className={`bg-base-300 animate-pulse ${shape}${className ? ` ${className}` : ''}${width ? ` ${width}` : ''}${height ? ` ${height}` : ''}`} style={style}/>;
|
||||
}
|
||||
|
||||
export const languageColor = (language) => {
|
||||
if (typeof colors[language] !== 'undefined') {
|
||||
return colors[language].color;
|
||||
} else {
|
||||
return 'gray';
|
||||
}
|
||||
}
|
||||
|
||||
export const fallbackImage = (
|
||||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="
|
||||
)
|
||||
|
||||
export const ga = {
|
||||
// initialize google analytic
|
||||
initialize: (id) => {
|
||||
try {
|
||||
window.gtag('js', new Date());
|
||||
window.gtag('config', id);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
},
|
||||
// log specific events happening
|
||||
event: ({ action, params }) => {
|
||||
try {
|
||||
window.gtag('event', action, params);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const isThemeDarkish = (theme) => {
|
||||
if (
|
||||
theme === 'dark' ||
|
||||
theme === 'halloween' ||
|
||||
theme === 'forest' ||
|
||||
theme === 'black' ||
|
||||
theme === 'luxury' ||
|
||||
theme === 'dracula'
|
||||
) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
226
src/helpers/utils.jsx
Normal file
@@ -0,0 +1,226 @@
|
||||
import colors from '../data/colors.json';
|
||||
import { hotjar } from 'react-hotjar';
|
||||
|
||||
export const getInitialTheme = (themeConfig) => {
|
||||
if (themeConfig.disableSwitch) {
|
||||
return themeConfig.defaultTheme;
|
||||
}
|
||||
|
||||
if (
|
||||
typeof window !== 'undefined' &&
|
||||
!(localStorage.getItem('gitprofile-theme') === null) &&
|
||||
themeConfig.themes.includes(localStorage.getItem('gitprofile-theme'))
|
||||
) {
|
||||
let theme = localStorage.getItem('gitprofile-theme');
|
||||
|
||||
return theme;
|
||||
}
|
||||
|
||||
if (themeConfig.respectPrefersColorScheme && !themeConfig.disableSwitch) {
|
||||
return typeof window !== 'undefined' &&
|
||||
window.matchMedia('(prefers-color-scheme: dark)').matches
|
||||
? 'dark'
|
||||
: themeConfig.defaultTheme;
|
||||
}
|
||||
|
||||
return themeConfig.defaultTheme;
|
||||
};
|
||||
|
||||
export const skeleton = ({
|
||||
width = null,
|
||||
height = null,
|
||||
style = {},
|
||||
shape = 'rounded-full',
|
||||
className = null,
|
||||
}) => {
|
||||
return (
|
||||
<div
|
||||
className={`bg-base-300 animate-pulse ${shape}${
|
||||
className ? ` ${className}` : ''
|
||||
}${width ? ` ${width}` : ''}${height ? ` ${height}` : ''}`}
|
||||
style={style}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export const languageColor = (language) => {
|
||||
if (typeof colors[language] !== 'undefined') {
|
||||
return colors[language].color;
|
||||
} else {
|
||||
return 'gray';
|
||||
}
|
||||
};
|
||||
|
||||
export const fallbackImage =
|
||||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==';
|
||||
|
||||
export const ga = {
|
||||
// initialize google analytic
|
||||
initialize: (id) => {
|
||||
try {
|
||||
if (typeof window !== 'undefined') {
|
||||
window.gtag('js', new Date());
|
||||
window.gtag('config', id);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
},
|
||||
// log specific events happening
|
||||
event: ({ action, params }) => {
|
||||
try {
|
||||
window?.gtag('event', action, params);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export const isDarkishTheme = (theme) => {
|
||||
return ['dark', 'halloween', 'forest', 'black', 'luxury', 'dracula'].includes(
|
||||
theme
|
||||
);
|
||||
};
|
||||
|
||||
export const setupHotjar = (hotjarConfig) => {
|
||||
if (hotjarConfig?.id) {
|
||||
let snippetVersion = hotjarConfig?.snippetVersion || 6;
|
||||
|
||||
hotjar.initialize(hotjarConfig.id, snippetVersion);
|
||||
}
|
||||
};
|
||||
|
||||
export const sanitizeConfig = (config) => {
|
||||
const customTheme = config?.themeConfig?.customTheme || {
|
||||
primary: '#fc055b',
|
||||
secondary: '#219aaf',
|
||||
accent: '#e8d03a',
|
||||
neutral: '#2A2730',
|
||||
'base-100': '#E3E3ED',
|
||||
'--rounded-box': '3rem',
|
||||
'--rounded-btn': '3rem',
|
||||
};
|
||||
|
||||
const themes = config?.themeConfig?.themes || [
|
||||
'light',
|
||||
'dark',
|
||||
'cupcake',
|
||||
'bumblebee',
|
||||
'emerald',
|
||||
'corporate',
|
||||
'synthwave',
|
||||
'retro',
|
||||
'cyberpunk',
|
||||
'valentine',
|
||||
'halloween',
|
||||
'garden',
|
||||
'forest',
|
||||
'aqua',
|
||||
'lofi',
|
||||
'pastel',
|
||||
'fantasy',
|
||||
'wireframe',
|
||||
'black',
|
||||
'luxury',
|
||||
'dracula',
|
||||
'cmyk',
|
||||
'autumn',
|
||||
'business',
|
||||
'acid',
|
||||
'lemonade',
|
||||
'night',
|
||||
'coffee',
|
||||
'winter',
|
||||
'procyon',
|
||||
];
|
||||
|
||||
return {
|
||||
github: {
|
||||
username: config?.github?.username || '',
|
||||
sortBy: config?.github?.sortBy || 'stars',
|
||||
limit: config?.github?.limit || 8,
|
||||
exclude: {
|
||||
forks: config?.github?.exclude?.forks || false,
|
||||
projects: config?.github?.exclude?.projects || [],
|
||||
},
|
||||
},
|
||||
social: {
|
||||
linkedin: config?.social?.linkedin,
|
||||
twitter: config?.social?.twitter,
|
||||
facebook: config?.social?.facebook,
|
||||
instagram: config?.social?.instagram,
|
||||
dribbble: config?.social?.dribbble,
|
||||
behance: config?.social?.behance,
|
||||
medium: config?.social?.medium,
|
||||
dev: config?.social?.dev,
|
||||
website: config?.social?.website,
|
||||
phone: config?.social?.phone,
|
||||
email: config?.social?.email,
|
||||
},
|
||||
skills: config?.skills || [],
|
||||
experiences: config?.experiences || [],
|
||||
education: config?.education || [],
|
||||
blog: {
|
||||
source: config?.blog?.source,
|
||||
username: config?.blog?.username,
|
||||
limit: config?.blog?.limit || 5,
|
||||
},
|
||||
googleAnalytics: {
|
||||
id: config?.googleAnalytics?.id,
|
||||
},
|
||||
hotjar: {
|
||||
id: config?.hotjar?.id,
|
||||
snippetVersion: config?.hotjar?.snippetVersion || 6,
|
||||
},
|
||||
themeConfig: {
|
||||
defaultTheme: config?.themeConfig?.defaultTheme || themes[0],
|
||||
disableSwitch: config?.themeConfig?.disableSwitch || false,
|
||||
respectPrefersColorScheme:
|
||||
config?.themeConfig?.respectPrefersColorScheme || false,
|
||||
themes: themes,
|
||||
customTheme: customTheme,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export const noConfigError = {
|
||||
status: 500,
|
||||
title: 'No Config is provided.',
|
||||
subTitle: 'Pass the required config as prop.',
|
||||
};
|
||||
|
||||
export const tooManyRequestError = (reset) => {
|
||||
return {
|
||||
status: 429,
|
||||
title: 'Too Many Requests.',
|
||||
subTitle: (
|
||||
<p>
|
||||
Oh no, you hit the{' '}
|
||||
<a
|
||||
href="https://developer.github.com/v3/rate_limit/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
rate limit.
|
||||
</a>
|
||||
! Try again later{` ${reset}`}.
|
||||
</p>
|
||||
),
|
||||
};
|
||||
};
|
||||
|
||||
export const notFoundError = {
|
||||
status: 404,
|
||||
title: 'The Github Username is Incorrect.',
|
||||
subTitle: (
|
||||
<p>
|
||||
Please provide correct github username in <code>config</code>.
|
||||
</p>
|
||||
),
|
||||
};
|
||||
|
||||
export const genericError = {
|
||||
status: 500,
|
||||
title: 'Ops!!',
|
||||
subTitle: 'Something went wrong.',
|
||||
};
|
||||
21
src/index.js
@@ -1,21 +0,0 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import './index.scss';
|
||||
import App from './App';
|
||||
import { Provider } from 'react-redux';
|
||||
import reportWebVitals from './reportWebVitals';
|
||||
import { store } from './store/store';
|
||||
import { HelmetProvider } from 'react-helmet-async';
|
||||
|
||||
ReactDOM.render(
|
||||
<React.StrictMode>
|
||||
<Provider store={store}>
|
||||
<HelmetProvider>
|
||||
<App/>
|
||||
</HelmetProvider>
|
||||
</Provider>
|
||||
</React.StrictMode>,
|
||||
document.getElementById('root')
|
||||
);
|
||||
|
||||
reportWebVitals();
|
||||
@@ -1,86 +0,0 @@
|
||||
@use "sass:meta";
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
|
||||
-moz-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
@media screen and (min-width: 966px) {
|
||||
::-webkit-scrollbar, .scroller {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #888;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
||||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
||||
sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
--z-primary: red;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
||||
monospace;
|
||||
}
|
||||
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
.text-base-content-important {
|
||||
color: hsla(var(--bc) / var(--tw-text-opacity)) !important;
|
||||
}
|
||||
|
||||
svg {
|
||||
vertical-align: unset
|
||||
}
|
||||
|
||||
.z-hover {
|
||||
transition: all ease-in-out 0.3s !important;
|
||||
}
|
||||
|
||||
.z-hover:hover,
|
||||
.z-hover:focus,
|
||||
.z-hover:active {
|
||||
transition: transform 0.3s !important;
|
||||
-ms-transform: scale(1.01) !important;
|
||||
-webkit-transform: scale(1.01) !important;
|
||||
transform: scale(1.01) !important;
|
||||
}
|
||||
|
||||
.pb-0-important {
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.fade-in {
|
||||
opacity: 1;
|
||||
animation-name: fadeIn;
|
||||
animation-iteration-count: 1;
|
||||
animation-timing-function: ease-in;
|
||||
animation-duration: 1s;
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes fadeIn {
|
||||
from { opacity: 0; }
|
||||
to { opacity: 1; }
|
||||
}
|
||||
9
src/main.jsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import App from './App';
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root')).render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>
|
||||
);
|
||||
@@ -1,13 +0,0 @@
|
||||
const reportWebVitals = onPerfEntry => {
|
||||
if (onPerfEntry && onPerfEntry instanceof Function) {
|
||||
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
|
||||
getCLS(onPerfEntry);
|
||||
getFID(onPerfEntry);
|
||||
getFCP(onPerfEntry);
|
||||
getLCP(onPerfEntry);
|
||||
getTTFB(onPerfEntry);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export default reportWebVitals;
|
||||
@@ -1,5 +0,0 @@
|
||||
// jest-dom adds custom jest matchers for asserting on DOM nodes.
|
||||
// allows you to do things like:
|
||||
// expect(element).toHaveTextContent(/react/i)
|
||||
// learn more: https://github.com/testing-library/jest-dom
|
||||
import '@testing-library/jest-dom';
|
||||
@@ -1,19 +0,0 @@
|
||||
import { createSlice } from '@reduxjs/toolkit';
|
||||
|
||||
const initialState = true;
|
||||
|
||||
export const loadingSlice = createSlice({
|
||||
name: 'loading',
|
||||
initialState: initialState,
|
||||
reducers: {
|
||||
setLoading: (state, action) => {
|
||||
state = action.payload;
|
||||
|
||||
return state;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
export const { setLoading } = loadingSlice.actions;
|
||||
|
||||
export default loadingSlice.reducer;
|
||||
@@ -1,19 +0,0 @@
|
||||
import { createSlice } from '@reduxjs/toolkit';
|
||||
|
||||
const initialState = null;
|
||||
|
||||
export const profileSlice = createSlice({
|
||||
name: 'profile',
|
||||
initialState: initialState,
|
||||
reducers: {
|
||||
setProfile: (state, action) => {
|
||||
state = action.payload;
|
||||
|
||||
return state;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
export const { setProfile } = profileSlice.actions;
|
||||
|
||||
export default profileSlice.reducer;
|
||||
@@ -1,19 +0,0 @@
|
||||
import { createSlice } from '@reduxjs/toolkit';
|
||||
|
||||
const initialState = null;
|
||||
|
||||
export const repoSlice = createSlice({
|
||||
name: 'repo',
|
||||
initialState: initialState,
|
||||
reducers: {
|
||||
setRepo: (state, action) => {
|
||||
state = action.payload;
|
||||
|
||||
return state;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
export const { setRepo } = repoSlice.actions;
|
||||
|
||||
export default repoSlice.reducer;
|
||||
@@ -1,23 +0,0 @@
|
||||
import { createSlice } from '@reduxjs/toolkit';
|
||||
import { getThemeValue } from '../../helpers/utils';
|
||||
|
||||
const initialState = getThemeValue();
|
||||
|
||||
export const themeSlice = createSlice({
|
||||
name: 'theme',
|
||||
initialState: initialState,
|
||||
reducers: {
|
||||
setTheme: (state, action) => {
|
||||
state = action.payload;
|
||||
|
||||
document.querySelector('html').setAttribute('data-theme', state);
|
||||
localStorage.setItem('ezprofileTheme', state);
|
||||
|
||||
return state;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
export const { setTheme } = themeSlice.actions;
|
||||
|
||||
export default themeSlice.reducer;
|
||||
@@ -1,16 +0,0 @@
|
||||
import { combineReducers, configureStore } from '@reduxjs/toolkit';
|
||||
import loadingSlice from './slices/loadingSlice';
|
||||
import profileSlice from './slices/profileSlice';
|
||||
import repoSlice from './slices/repoSlice';
|
||||
import themeSlice from './slices/themeSlice';
|
||||
|
||||
const rootReducer = combineReducers({
|
||||
profile: profileSlice,
|
||||
theme: themeSlice,
|
||||
loading: loadingSlice,
|
||||
repo: repoSlice,
|
||||
})
|
||||
|
||||
export const store = configureStore({
|
||||
reducer: rootReducer
|
||||
})
|
||||
@@ -1,16 +1,16 @@
|
||||
module.exports = {
|
||||
purge: ['./src/**/*.{js,jsx,ts,tsx}', './public/index.html'],
|
||||
darkMode: false, // or 'media' or 'class'
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
variants: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [
|
||||
require('daisyui')
|
||||
import config from './gitprofile.config';
|
||||
|
||||
export default {
|
||||
content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [require('daisyui')],
|
||||
daisyui: {
|
||||
logs: false,
|
||||
themes: [
|
||||
...config.themeConfig.themes,
|
||||
{ procyon: config.themeConfig.customTheme },
|
||||
],
|
||||
daisyui: {
|
||||
logs: false
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
270
types/index.d.ts
vendored
Normal file
@@ -0,0 +1,270 @@
|
||||
// Type definitions for GitProfile
|
||||
// Project https://github.com/arifszn/gitprofile
|
||||
// Author: Ariful Alam <arifulalamszn@gmail.com>
|
||||
|
||||
import { Component } from 'react';
|
||||
|
||||
export interface Github {
|
||||
/**
|
||||
* GitHub org/user name
|
||||
*/
|
||||
username: string;
|
||||
|
||||
/**
|
||||
* stars | updated
|
||||
*/
|
||||
sortBy?: string;
|
||||
|
||||
/**
|
||||
* How many projects to display
|
||||
*/
|
||||
limit?: number;
|
||||
|
||||
/**
|
||||
* Exclude projects option
|
||||
*/
|
||||
exclude?: {
|
||||
/**
|
||||
* Forked projects will not be displayed if set to true
|
||||
*/
|
||||
forks?: boolean;
|
||||
|
||||
/**
|
||||
* These projects will not be displayed
|
||||
*
|
||||
* example: ['my-project1', 'my-project2']
|
||||
*/
|
||||
projects?: Array<string>;
|
||||
};
|
||||
}
|
||||
|
||||
export interface Social {
|
||||
/**
|
||||
* LinkedIn
|
||||
*/
|
||||
linkedin?: string;
|
||||
|
||||
/**
|
||||
* Twitter
|
||||
*/
|
||||
twitter?: string;
|
||||
|
||||
/**
|
||||
* Facebook
|
||||
*/
|
||||
facebook?: string;
|
||||
|
||||
/**
|
||||
* Instagram
|
||||
*/
|
||||
instagram?: string;
|
||||
|
||||
/**
|
||||
* Dribbble
|
||||
*/
|
||||
dribbble?: string;
|
||||
|
||||
/**
|
||||
* Behance
|
||||
*/
|
||||
behance?: string;
|
||||
|
||||
/**
|
||||
* Medium
|
||||
*/
|
||||
medium?: string;
|
||||
|
||||
/**
|
||||
* dev
|
||||
*/
|
||||
dev?: string;
|
||||
|
||||
/**
|
||||
* Website
|
||||
*/
|
||||
website?: string;
|
||||
|
||||
/**
|
||||
* Phone
|
||||
*/
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* Email
|
||||
*/
|
||||
email?: string;
|
||||
}
|
||||
|
||||
export interface Blog {
|
||||
/**
|
||||
* medium | dev
|
||||
*/
|
||||
source?: string;
|
||||
|
||||
/**
|
||||
* Username
|
||||
*/
|
||||
username?: string;
|
||||
|
||||
/**
|
||||
* How many posts to display
|
||||
*
|
||||
* Max is 10
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export interface GoogleAnalytics {
|
||||
/**
|
||||
* GA3 tracking id/GA4 tag id UA-XXXXXXXXX-X | G-XXXXXXXXXX
|
||||
*/
|
||||
id?: string;
|
||||
}
|
||||
|
||||
export interface Hotjar {
|
||||
/**
|
||||
* Hotjar id
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* Snippet Version
|
||||
*/
|
||||
snippetVersion?: number;
|
||||
}
|
||||
|
||||
export interface CustomTheme {
|
||||
/**
|
||||
* Primary color
|
||||
*/
|
||||
primary?: string;
|
||||
|
||||
/**
|
||||
* Secondary color
|
||||
*/
|
||||
secondary?: string;
|
||||
|
||||
/**
|
||||
* Accent color
|
||||
*/
|
||||
accent?: string;
|
||||
|
||||
/**
|
||||
* Neutral color
|
||||
*/
|
||||
neutral?: string;
|
||||
|
||||
/**
|
||||
* Base color of page
|
||||
*/
|
||||
'base-100'?: string;
|
||||
|
||||
/**
|
||||
* Border radius of rounded-box
|
||||
*/
|
||||
'--rounded-box'?: string;
|
||||
|
||||
/**
|
||||
* Border radius of rounded-btn
|
||||
*/
|
||||
'--rounded-btn'?: string;
|
||||
}
|
||||
|
||||
export interface ThemeConfig {
|
||||
/**
|
||||
* Default theme
|
||||
*/
|
||||
defaultTheme?: string;
|
||||
|
||||
/**
|
||||
* Hides the switch in the navbar
|
||||
*/
|
||||
disableSwitch?: boolean;
|
||||
|
||||
/**
|
||||
* Should use the prefers-color-scheme media-query
|
||||
*/
|
||||
respectPrefersColorScheme?: boolean;
|
||||
|
||||
/**
|
||||
* Available themes
|
||||
*/
|
||||
themes?: Array<string>;
|
||||
|
||||
/**
|
||||
* Custom theme
|
||||
*/
|
||||
customTheme?: CustomTheme;
|
||||
}
|
||||
|
||||
export interface Experience {
|
||||
company?: string;
|
||||
position?: string;
|
||||
from?: string;
|
||||
to?: string;
|
||||
}
|
||||
|
||||
export interface Education {
|
||||
institution?: string;
|
||||
degree?: string;
|
||||
from?: string;
|
||||
to?: string;
|
||||
}
|
||||
|
||||
export interface Config {
|
||||
/**
|
||||
* GitHub Config
|
||||
*/
|
||||
github: Github;
|
||||
|
||||
/**
|
||||
* Social links
|
||||
*/
|
||||
social?: Social;
|
||||
|
||||
/**
|
||||
* Skill list
|
||||
*/
|
||||
skills?: Array<string>;
|
||||
|
||||
/**
|
||||
* Experience list
|
||||
*/
|
||||
experiences?: Array<Experience>;
|
||||
|
||||
/**
|
||||
* Education list
|
||||
*/
|
||||
education?: Array<Education>;
|
||||
|
||||
/**
|
||||
* Blog config
|
||||
*/
|
||||
blog?: Blog;
|
||||
|
||||
/**
|
||||
* Google Analytics config
|
||||
*/
|
||||
googleAnalytics?: GoogleAnalytics;
|
||||
|
||||
/**
|
||||
* Hotjar config
|
||||
*/
|
||||
hotjar?: Hotjar;
|
||||
|
||||
/**
|
||||
* Theme config
|
||||
*/
|
||||
themeConfig?: ThemeConfig;
|
||||
}
|
||||
|
||||
export interface GitProfileProps {
|
||||
/**
|
||||
* Config values
|
||||
*/
|
||||
config: Config;
|
||||
}
|
||||
|
||||
declare class GitProfile extends Component<GitProfileProps> {}
|
||||
|
||||
export default GitProfile;
|
||||
18
vite.config.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import tailwind from 'tailwindcss';
|
||||
import autoprefixer from 'autoprefixer';
|
||||
import tailwindConfig from './tailwind.config.js';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
// If you are deploying to https://<USERNAME>.github.io/, set base to '/'.
|
||||
// If you are deploying to https://<USERNAME>.github.io/<REPO>/, for example your repository is at https://github.com/<USERNAME>/<REPO>, then set base to '/<REPO>/'.
|
||||
base: '/gitprofile/',
|
||||
plugins: [react()],
|
||||
css: {
|
||||
postcss: {
|
||||
plugins: [tailwind(tailwindConfig), autoprefixer],
|
||||
},
|
||||
},
|
||||
});
|
||||