Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ian Chow Portfolio Page #75

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 81 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,88 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Your Name - Portfolio</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body class="light-mode">
<header class="light-mode">
<nav>
<div class="menu-icon" onclick="toggleMenu()">
<div class="bar"></div>
<div class="bar"></div>
<div class="bar"></div>
</div>
<div class="menu-links">
<ul class="nav-links">
<li>
<a href="#about" class="navigation" class="light-mode"
>About Me</a
>
</li>
<li>
<a
href="#portfolio"
class="navigation light-mode"
class="light-mode"
>Portfolio</a
>
</li>
<li>
<a href="#contact" class="navigation" class="light-mode"
>Contact</a
>
</li>
</ul>
</div>
</nav>
</header>

<link href="styles.css" rel="stylesheet" />
<button onclick="toggleMode()">Light/Dark Mode</button>

<title>Rocket Academy</title>
</head>
<body>
<h1>Hello, world!</h1>
<section id="about">
<h1>About Me</h1>
<p>
Welcome to my portfolio website. I'm a passionate web developer with a
love for creating beautiful and functional websites.
</p>
</section>

<section id="portfolio">
<h1>Portfolio</h1>
<div class="project">
<h3>Project 1: Forkify App</h3>
<img src="recipe-page.png" alt="Project 1" />

<p>
A recipe app called Forkify that has over 100,000 recipes that you can
search!
</p>
<a href="https://forkify-ianchow9898.netlify.app/?" class="no-dark-mode"
>Visit my Forkify App!</a
>
</div>

<div class="project">
<h3>Project 2: Mapty App</h3>
<img src="mapty-app.png" alt="Project 2" />
<p>A map website to log your own workouts!</p>
<a href="https://mapty.netlify.app/">Visit my Mapty App!</a>
</div>
<!-- Add more projects as needed -->
</section>

<section id="contact">
<h1>Contact</h1>
<p>
If you'd like to get in touch with me, please feel free to reach out at
ianchow9898@gmail.com
</p>
</section>

<footer>
<p>&copy;Copyright by Ian Chow</p>
</footer>
<script src="script.js"></script>
</body>
</html>
Binary file added mapty-app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added recipe-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 70 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// function toggleMenu() {
// const menuLinks = document.querySelector(".menu-links");
// menuLinks.classList.toggle("show-menu");
// }

// const menuIcon = document.querySelector(".menu-icon");

// // Show/hide menu on click
// menuIcon.addEventListener("click", toggleMenu);

// // Hide menu when a link is clicked (optional)
// const navLinks = document.querySelectorAll(".nav-links a");
// navLinks.forEach((link) => {
// link.addEventListener("click", () => {
// const navLinks = document.querySelector(".nav-links");
// navLinks.classList.remove("show-menu");
// });
// });

// // Show menu icon on smaller screens
// window.addEventListener("resize", () => {
// if (window.innerWidth <= 768) {
// menuIcon.style.display = "block";
// } else {
// menuIcon.style.display = "none";
// const navLinks = document.querySelector(".nav-links");
// navLinks.classList.remove("show-menu");
// }
// });

// Light and Dark Mode
function toggleMode() {
const body = document.body;
const header = document.querySelector("header");
const navigationLinks = document.querySelectorAll("a:not(.no-dark-mode)");

if (body.classList.contains("dark-mode")) {
// Switch to light mode
body.classList.remove("dark-mode");
body.style.backgroundColor = "var(--background-light)";
body.style.color = "var(--text-light)";
} else {
// Switch to dark mode
body.classList.add("dark-mode");
body.style.backgroundColor = "var(--background-dark)";
body.style.color = "var(--text-dark)";
}
if (header.classList.contains("dark-mode")) {
// Switch to light mode
header.classList.remove("dark-mode");
header.style.backgroundColor = "var(--background-light)";
header.style.color = "var(--text-light)";
} else {
// Switch to dark mode
header.classList.add("dark-mode");
header.style.backgroundColor = "var(--background-dark)";
header.style.color = "var(--text-dark)";
}

// Loop through each navigation link (excluding those with no-dark-mode class) and toggle the class
navigationLinks.forEach((link) => {
if (link.classList.contains("dark-mode")) {
link.classList.remove("dark-mode");
link.style.color = "var(--text-light)";
} else {
link.classList.add("dark-mode");
link.style.color = "var(--text-nav-dark)";
}
});
}
78 changes: 77 additions & 1 deletion styles.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,79 @@
/* Reset some default browser styles */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the flex? :)

/* html,
body,
h1,
h2,
p,
ul,
li {
margin: 0;
padding: 0;
} */

:root {
--background-light: #f4f4f4;
--background-dark: #333;
--text-light: #333;
--text-dark: #1a0f0f;
--text-nav-dark: #fff;
}

/* Apply a background color and font to the entire page */
body {
background-color: white;
font-family: Arial, sans-serif;
background-color: var(--background-light);
color: var(--text-light);
line-height: 1.6;
margin: 0;
padding: 0;
text-align: center; /* center both inline/inline-block and block-level elements */
}

/* Style the header and navigation menu */
header {
background-color: var(--background-light);
color: var(--text-light);
padding: 20px;
text-align: center;
}

nav ul {
list-style: none;
}

nav li {
display: inline;
margin-right: 20px;
}

nav a {
text-decoration: none;
color: var(--text-light);
font-weight: bold;
}

/* Style the main sections */
section {
padding: 20px;
margin: 20px;
background-color: #fff;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

/* Style the individual projects in the portfolio section */
.project {
margin-bottom: 20px;
}

.project img {
max-width: 50%;
height: auto;
}

/* Style the footer */
footer {
background-color: #333;
color: #fff;
text-align: center;
padding: 10px;
}