-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added prettier, formatted all files using prettier
- Loading branch information
1 parent
0c9e4b8
commit fcbf052
Showing
13 changed files
with
162 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Ignore artifacts: | ||
build | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"tabWidth": 2, | ||
"printWidth": 80, | ||
"proseWrap": "never", | ||
"trailingComma": "all", | ||
"singleQuote": false, | ||
"semi": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
# CV PDF Generator | ||
|
||
The CV PDF Generator is a React app used to build a CV and export it as a PDF. | ||
|
||
## How To Run | ||
|
||
1. Add your picture in `src/assets/profile.jpeg` | ||
2. Fill out your information in `data.json` | ||
3. Adapt CSS or scale in `pdf.ts` if needed | ||
4. Run the following commands in the terminal | ||
|
||
```sh | ||
npm install | ||
npm install | ||
# Starts the vite server | ||
npm run dev | ||
# Generate the pdf | ||
npm run pdf | ||
``` | ||
|
||
## Built With | ||
|
||
- React + Vite | ||
- Puppeteer for PDF generation | ||
- Puppeteer for PDF generation |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
.profile__header__image img { | ||
height: 150px; | ||
overflow: hidden; | ||
} | ||
|
||
.profile__header__image__circular img { | ||
border-radius: 9999px; | ||
} | ||
|
||
.profile__header__image__border img { | ||
border: 3px solid var(--red); | ||
} | ||
.profile__header__image img { | ||
height: 150px; | ||
overflow: hidden; | ||
} | ||
|
||
.profile__header__image__circular img { | ||
border-radius: 9999px; | ||
} | ||
|
||
.profile__header__image__border img { | ||
border: 3px solid var(--red); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
import useProfilePicture from "../../../hooks/useProfilePicture"; | ||
import clsx from "clsx"; | ||
import "./ProfileImage.css"; | ||
|
||
type ImageOptions = { | ||
circular?: boolean; | ||
border?: boolean; | ||
}; | ||
|
||
const ProfileImage = (options: ImageOptions = {}) => { | ||
const profilePicture = useProfilePicture(); | ||
|
||
const profilePictureClasses = clsx( | ||
"profile__header__image", | ||
{ profile__header__image__circular: options.circular }, | ||
{ profile__header__image__border: options.border } | ||
); | ||
|
||
return ( | ||
<> | ||
{profilePicture && ( | ||
<div className={profilePictureClasses}> | ||
<img src={profilePicture} alt="Profile" /> | ||
</div> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export default ProfileImage; | ||
import useProfilePicture from "../../../hooks/useProfilePicture"; | ||
import clsx from "clsx"; | ||
import "./ProfileImage.css"; | ||
|
||
type ImageOptions = { | ||
circular?: boolean; | ||
border?: boolean; | ||
}; | ||
|
||
const ProfileImage = (options: ImageOptions = {}) => { | ||
const profilePicture = useProfilePicture(); | ||
|
||
const profilePictureClasses = clsx( | ||
"profile__header__image", | ||
{ profile__header__image__circular: options.circular }, | ||
{ profile__header__image__border: options.border }, | ||
); | ||
|
||
return ( | ||
<> | ||
{profilePicture && ( | ||
<div className={profilePictureClasses}> | ||
<img src={profilePicture} alt="Profile" /> | ||
</div> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export default ProfileImage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
import { useState, useEffect } from 'react'; | ||
|
||
const useProfilePicture = (): string | null => { | ||
const [profilePicture, setProfilePicture] = useState<string | null>(null); | ||
|
||
useEffect(() => { | ||
const loadProfilePicture = async () => { | ||
const extensions = ['png', 'jpeg', 'jpg', 'gif', 'webp', 'svg']; | ||
for (const extension of extensions) { | ||
try { | ||
const module = await import(`../assets/profile.${extension}`); | ||
setProfilePicture(module.default); | ||
break; | ||
} catch (error) { | ||
// Ignore error and try next extension | ||
} | ||
} | ||
}; | ||
|
||
loadProfilePicture(); | ||
}, []); | ||
|
||
return profilePicture; | ||
}; | ||
|
||
export default useProfilePicture; | ||
import { useState, useEffect } from "react"; | ||
|
||
const useProfilePicture = (): string | null => { | ||
const [profilePicture, setProfilePicture] = useState<string | null>(null); | ||
|
||
useEffect(() => { | ||
const loadProfilePicture = async () => { | ||
const extensions = ["png", "jpeg", "jpg", "gif", "webp", "svg"]; | ||
for (const extension of extensions) { | ||
try { | ||
const module = await import(`../assets/profile.${extension}`); | ||
setProfilePicture(module.default); | ||
break; | ||
} catch (error) { | ||
// Ignore error and try next extension | ||
} | ||
} | ||
}; | ||
|
||
loadProfilePicture(); | ||
}, []); | ||
|
||
return profilePicture; | ||
}; | ||
|
||
export default useProfilePicture; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.