Portfolio Page
Contributed by Harrison
Portfolio Page
The portfolio is a personal website designed to showcase the professional profile and work of an individual, enabling visitors to learn about their skills, experience, and recent projects, as well as facilitating communication and networking opportunities. Below, we will describe each section in detail for how to make this portfolio from scratch.
View in New Tab
Code Usage
How to build
Desktop Nav
The desktop nav is the menu that will display at the top of the screen. There are four buttons that can let user navigate through each sections.
-
Fixed position of the header:
- Using
position: fixed,top: 0,left: 0,right: 0,z-index: 999can make the header be fixed and not cover any contents when user scroll down or up.
- Using
-
The location of name logo and navigation:
- Using
display: flexandjustify-content: space-aroundto evenly distribute the horizontal space of the navigation bar, creating some spacing and leaving equal empty space on both sides to achieve a centered alignment effect.
- Using
-
The transition effect:
- Using
transition: all 300ms ease, any changes to these elements will be animated over a duration of300 millisecondswith aneasetiming function.
- Using
-
Style of nav-links (the navigation menu with four sections):
- When a user hovers over a link for the
nav-links, the link text will have a white underline with a slight offset from the baseline to improve its visual appearance. Thetext-decoration-skip-ink: autoallows the browser to automatically adjust the positioning of the underline to avoid overlapping with adjacent characters. We usetext-underline-offset: 8pxto set the space between the underline and the text.
- When a user hovers over a link for the
-
Responsive layout:
- When the screen width is 1024 pixels or less (
@media screen and (max-width: 1024px)), thedesktop-navelement will be hidden by usingdisplay: none.
- When the screen width is 1024 pixels or less (
Hamburger Nav
The hamburger nav is the menu that will display at the top right of the screen when the screen becomes small. There are four buttons that can let user navigate through each sections when we click the hamburger icon button.
-
Fixed position of the header:
- Using
position: fixed,top: 0,left: 0,right: 0,z-index: 999can make the header be fixed and not cover any contents when user scroll down or up.
- Using
-
Position of the hamburger menu:
- The
.hamburger-menuclass is applied to a container element. It's set toposition: relative, which establishes a positioning context for its child elements. This means thatmenu-linksandhamburger-iconcan be positioned relative to this container. As a result, Themenu-linkscan useposition: absolute,top: 200%, andright: -120%to place it precisely.
- The
-
Style of menu-links (dropdown list of the hamburger menu):
- When a user hovers over a link for the
menu-links, the link text will have a white underline with a slight offset from the baseline to improve its visual appearance. Thetext-decoration-skip-ink: autoallows the browser to automatically adjust the positioning of the underline to avoid overlapping with adjacent characters. We usetext-underline-offset: 8pxto set the space between the underline and the text.
- When a user hovers over a link for the
-
Responsive layout:
- When the screen width is 1024 pixels or less (
@media screen and (max-width: 1024px)), thehamburger-navelement will be shown by usingdisplay: flexand thedesktop-navelement will be hidden by usingdisplay: none.
- When the screen width is 1024 pixels or less (
-
Switch the menu icon and the menu link:
- When
currentSrcis equal tomenuIconSrc, it switches to the close menu icon and displays the menu links. Otherwise, it switches back to the open menu icon and hides the menu links.
- When
-
Close the menu link when scrolling and clicking other places of the screen:
- When the user scrolls, it will close the menu by setting the
overflowof the menu links tohiddenand setting the menuIcon source back to the regular menu icon.
- When the user scrolls, it will close the menu by setting the
Profile section
The profile section is the welcome mat of the portfolio, providing key introductory information, a way to access the individual's resume, and links to their social profiles for networking and further exploration of their professional background.
-
Style of menu-links (dropdown list of the hamburger menu):
-
min-height: fit-contentcan make the minimum height of the section based on its content. If the content is taller than the defined 96%, the section will expand to fit the content. -
box-sizing: border-boxincludes the padding and border in the section's total width and height calculations. This ensures that the section's defined height includes its padding.
-
-
Style of profile section:
- The
#profileelement is set todisplay: flexto center its child elements horizontally, and the.section__pic-containerhas a fixed height and width with vertical centering. The styles for#socials-containerare used to create a flex container for aligning and spacing social media icons. The icons are horizontally centered within the container, and there's a 16px gap between them.
- The
-
Style of buttons (btn-container):
- The styles for
.btn-containerare used to create a flex container for aligning and spacing buttons or content. The buttons or content are horizontally centered within the container, and there's a16px gapbetween them, providing some spacing.
- The styles for
-
Responsive layout:
-
When the screen width is 1024 pixels or less (
@media screen and (max-width: 1024px)), usingdisplay: block, the elements inside theprofile sectionwill be displayed as block-level elements, taking up the full width of their parent container and stacking on top of each other. -
When the screen width is 768 pixels or less (
@media screen and (max-width: 768px)),flex-wrap: wrapfor the.btn-containerclass allows the buttons inside it to wrap onto a new line if the container's width is insufficient to display all the buttons in a single row. This can help with responsive design and accommodating various screen sizes.
-
About section
The about section is to provide visitors with a more in-depth understanding of the person, including his or her professional background, education, and a brief biography. It's a way for visitors to connect on a more personal level with the portfolio owner.
-
Style of section-container (about section container without the title) and about-container (the container of experience and education boxes):
- Using
display: flexfor thesection-containerandabout-containercan make their child elements put in the same horizontal.
- Using
-
Style of about-details-container (the container of experience and education boxes and the introduction):
- Using
display: flex,justify-content: center, andflex-direction: columnin.about-details-containerto center its child elements vertically and arrange them in a column layout.
- Using
-
Position of the arrow:
- Using
position: relativein#aboutelement andposition: absoluteandright: -80pxin.arrowelement to allow the arrow to be positioned relative to it. The.arrowelements are then absolutely positioned to the right of their normal position within the#aboutelement by 80px.
- Using
-
Responsive layout:
-
When the screen width is 1280 pixels or less (
@media screen and (max-width: 1280px)), usingflex-wrap: wrapin.about-containerselement to make its child elements wrap to the next line when there's not enough horizontal space, allowing for a more responsive layout on smaller screens. -
When the screen width is 1024 pixels or less (
@media screen and (max-width: 1024px)), usingheight: fit-contentinsectionelement and.section-containercan make the element's type based on its content. This can be useful for creating flexible layouts where the height of the elements adjusts automatically based on the content they contain. -
When the screen width is 768 pixels or less (
@media screen and (max-width: 768px)), usingflex-wrap: wrapin.about-containerselement and.btn-containerelement to make its child elements wrap to the next line when there's not enough horizontal space, allowing for a more responsive layout on smaller screens.
-
Experience section
Experience section provides insights into individual's skills and proficiency in various programming languages and tools.
-
Style of experience-details-container (two boxes of the experience list):
- Using
display: flexfor the.experience-details-containercan center its child elements both horizontally and vertically, and it arranges them in a column layout.
- Using
-
Style of article-container (experience list):
- Using
display: flexandjustify-content: space-aroundto evenly distribute the horizontal space both within the container and inside each article.flex-direction: rowsets the direction of the main axis of the flex container to be horizontal. It ensures that the flex items are arranged in rows from left to right.flex-wrap: wrapallows the articles to wrap onto the next line when there's not enough horizontal space.
- Using
-
Position of the arrow:
- Using
position: relativein#experienceelement andposition: absoluteandright: -80pxin.arrowelement to allow the arrow to be positioned relative to it. The.arrowelements are then absolutely positioned to the right of their normal position within the#experienceelement by 80px.
- Using
-
Responsive layout:
- When the screen width is 768 pixels or less (
@media screen and (max-width: 768px)), we will set the font size for.experience-sub-titlesmaller.
- When the screen width is 768 pixels or less (
Projects section
The projects section is to showcase and highlight the recent projects or works of the person. It provides images, titles, and links for each project, making it easy for visitors to explore and learn more about the portfolio owner's work.
-
Style of the three boxes of the projects (about-containers and experience-details-container):
- Using
display: flexfor them can center its child elements both horizontally and vertically, and it arranges them in a column layout (flex-direction: column).
- Using
-
Style of project pictures (article-container):
- Using
display: flexandjustify-content: space-aroundto evenly distribute the horizontal space both within the container and inside each article.flex-direction: rowsets the direction of the main axis of the flex container to be horizontal. It ensures that the flex items are arranged in rows from left to right.flex-wrap: wrapallows the articles to wrap onto the next line when there's not enough horizontal space.
- Using
-
Style of buttons (btn-container):
- The styles for
.btn-containerare used to create a flex container for aligning and spacing buttons or content. The buttons or content are horizontally centered within the container, and there's a16px gapbetween them, providing some spacing.
- The styles for
-
Position of the arrow:
- Using
position: relativein#projectselement andposition: absoluteandright: -80pxin.arrowelement to allow the arrow to be positioned relative to it. The.arrowelements are then absolutely positioned to the right of their normal position within the#projectselement by 80px.
- Using
-
Responsive layout:
- When the screen width is 1280 pixels or less (
@media screen and (max-width: 1280px)), usingheight: fit-contentin#projectselement can make the element's type based on its content. This can be useful for creating flexible layouts where the height of the elements adjusts automatically based on the content they contain.
- When the screen width is 1280 pixels or less (
Contact section
The contact section is to facilitate communication between visitors and the portfolio owner. It provides contact information and a form for sending messages, making it easy for individuals to get in touch with the owner for inquiries or other purposes.
-
Style of the contact-info-upper-container and contact-info-container (mail and linkedIn):
- Using
display: flexto wrap the contact information section in a flexible container. Usingjustify-content: centerto horizontally center the content.
- Using
-
Style of the col-25 and col-75 (labels and the input boxes):
-
Using
width: 25%to set the.col-25to the width of the left column to 25% andwidth: 75%to set the.col-75to the width of the right column to 75%. This division is used to place labels on the left and form elements (input, textarea) on the right. -
Using
float: leftto float the element to the left within its container. In this case, both the left and right columns are floated, allowing them to display side by side.
-
-
Responsive layout:
-
When the screen width is 1280 pixels or less (
@media screen and (max-width: 1280px)), usingheight: fit-contentin#contactelement can make the element's type based on its content. This can be useful for creating flexible layouts where the height of the elements adjusts automatically based on the content they contain. -
When the screen width is 768 pixels or less (
@media screen and (max-width: 768px)), usingwidth: 100%to set.col-25,.col-75, and.message-btn. In this case, it can fit the width of the screen and show correctly.
-
Footer section
The footer section appears at the bottom of the webpage and provides essential links for site navigation and copyright information to inform visitors about the rights and ownership of the website's content. It helps users find their way around the site and understand its legal and ownership context.
-
Style of footer:
- Using
display: flexfor it can center its child elements both horizontally and vertically, and it arranges them in a column layout (flex-direction: column).
- Using
-
Style of nav-links (the navigation menu with four sections):
- When a user hovers over a link for the
nav-links, the link text will have a white underline with a slight offset from the baseline to improve its visual appearance. Thetext-decoration-skip-ink: autoallows the browser to automatically adjust the positioning of the underline to avoid overlapping with adjacent characters. We usetext-underline-offset: 8pxto set the space between the underline and the text.
- When a user hovers over a link for the
-
Responsive layout:
-
When the screen width is 768 pixels or less (
@media screen and (max-width: 768px)), usingheight: fit-contentinfooter navelement can make the element's type based on its content. This can be useful for creating flexible layouts where the height of the elements adjusts automatically based on the content they contain. -
When the screen width is 768 pixels or less (
@media screen and (max-width: 768px)), usingflex-direction: columnin.nav-linkselement can arrange the navigation links in a column layout
-
Version
| Version | Editor | Author | Date | Description |
|---|---|---|---|---|
| v1.0 | Hsiangwen Cheng | Hsiangwen Cheng | 25.10.2023 | version 1 |