main
|
App
| - SpeedDialNavbar
| - HomePage
| - PortfolioPage
| | - PortfolioCarousel
| | - PortfolioSlideshow
| | - Running
| | - Engineering
| | - Music
| | - Writing
| | | - TypewriterText
| | - Lego
Type | Name |
---|---|
Language | TypeScript |
Framework | React |
Build tool | Vite |
Additional tools | |
---|---|
Tailwind CSS | Easier styling than pure CSS |
Material UI | Library of nicely designed UI components |
Swiper | Provides the fancy carousel/slideshow components |
Motion | Toolkit for building animations |
- Install NPM
- Run
npm install
- Run
npm run dev
- In a browser, open the URL
http://localhost:5173/
TailwindCSS is really handy for styling because it provides predefined CSS classes that apply styling for you. You can look through their website to find the class names, but it's honestly easier to ask ChatGPT.
Example: "What's the tailwind class for adding margin above the element?"
All text can be found inside the HTML content of the corresponding *.tsx
file
For example, to change the text on the Running page, look for it in Running.tsx
Let's say we're adding a new Contact page.
- Create a new folder in
pages/
calledcontact
- Create the contact component file in that folder. File should be something like
pages/contact/ContactPage.tsx
- In
App.tsx
, add a new<Route />
element forContactPage
. Thepath
parameter is the browser URL path. - In
SpeedDialNavbar.tsx
, add a new item for Contact tonavItems
(icons can be found here) - Build out the
ContactPage.tsx
component, and you should see it when you run the application
To remove a page, follow the steps in reverse, deleting instead of creating.
Let's say we're adding a new Lego page.
-
Create a new folder in
pages/portfolio/
calledlego
-
Create the lego component file in that folder. File should be something like
pages/portfolio/lego/Lego.tsx
-
In
const/projects.ts
, add a title for Lego toProjectTitles
, and an item for it to theprojects
variable -
In
PortfolioPage.tsx
...a. Add a ref entry to the
projectRefs
variableb. Add a
<div />
element forLego
. Follow the existing examples.c. You can change the order of the projects on the page by rearranging the
divs
npm run build
Built project can be found in the ./dist/
folder.
If you get stuck on any of these steps, ChatGPT should be able to help out pretty effectively. If that doesn't work, feel free to reach out.
-
Create a new GitHub account (or use an existing one)
-
Download and install GitHub Desktop
a. Assuming you're on Mac, unzip the downloaded file and drag the
GitHub Desktop
application to theApplications
folder -
Run GitHub Desktop and sign in
-
Use default options to Configure Git
- In a browser, open
https://github.com/erk-experimental/rafael.git
- Click the green
Code
button, thenDownload Zip
- Unzip the file and move the folder to anywhere on your computer
- In GitHub Desktop, click
add existing repository from local drive
- For
local path
, choose the folder you just downloaded - Click
add repository
. There will be an error. - In the error message, click
create a repository
- The repository name is important, you must set it to:
<your-github-username>.github.io
For example, if your github username is good-name
, the repository name must be good-name.github.io
.
- Leave all options at their defaults, and create repository
- At the top, click
Publish repository
- Uncheck "keep this code private" (it must be public for GitHub Pages to work)
- Publish it
Now if you open up GitHub and login, you should be able to see the new repository.
- Open your new repository on GitHub in the browser
- At the top of the page, open the
Actions
tab - There should be a workflow called "Initial commit". If it's still in progress, wait for it to finish
- Once it's done, open the
Settings
tab - In the left sidebar, click on
Pages
- Under
Branch
, click the dropdown. There should be an option calledgh-pages
. Click that, then clicksave
- Wait for a bit as GitHub spins up the website. You'll know it's ready when a message appears saying "Your site is live at..." (you might have to refresh the page to see this)
- IMPORTANT: The URL it gives you should be
http://<your-github-username>.github.io/
. If you see a URL with more text appended after thegithub.io/
, you likely didn't name your repository correctly. Rename the repository and make sure to follow the format detailed in the section above. - All done! Congrats!