Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1b47a7c
add media query for mobile for hiding navbar and adjusting cards
gabriellaberko Sep 2, 2025
8123c5f
add media queries for responsive layout
gabriellaberko Sep 2, 2025
f7c74c1
add footer and document title
gabriellaberko Sep 2, 2025
c24ca36
styling cards and adding media query for wide screen
gabriellaberko Sep 2, 2025
451df14
add logo, text and minor styling
gabriellaberko Sep 3, 2025
5775aa2
changes in color and minor styling
gabriellaberko Sep 5, 2025
bcbce74
Remove images
gabriellaberko Sep 5, 2025
ac2289e
add Netlify link in README-file and add some more margins
gabriellaberko Sep 5, 2025
7391aaf
change values in media queries
gabriellaberko Sep 5, 2025
5703328
change card title font size
gabriellaberko Sep 5, 2025
7b8e138
add HTML skeleton for a signup form
gabriellaberko Sep 8, 2025
3c38eab
add form section content, text field alignment and link primary CTA t…
gabriellaberko Sep 8, 2025
aa1101f
styling sign up form
gabriellaberko Sep 8, 2025
2b07d2a
add custom styling to checkboxes and radio buttons in the form
gabriellaberko Sep 9, 2025
9677869
add values to checkboxes/radio buttons + validation on the form
gabriellaberko Sep 9, 2025
fbfda10
refactor css code for buttons and add hover effect
gabriellaberko Sep 9, 2025
cba8a38
add new font
gabriellaberko Sep 9, 2025
d1d574d
add image and blob in intro section and make them responsive
gabriellaberko Sep 9, 2025
1d51034
refactor/clean code
gabriellaberko Sep 10, 2025
379804b
fix minor typo error for the signup form button
gabriellaberko Sep 12, 2025
ee6d9be
add paragraph to form section
gabriellaberko Sep 12, 2025
8779c70
remove intro section image on small screens
gabriellaberko Sep 12, 2025
906dd62
remove default focus on text field in form and set purple border color
gabriellaberko Sep 12, 2025
b51fb31
add hamburger menu on small screens
gabriellaberko Sep 15, 2025
b1121cc
make nav links visible when hamburger menu icon is clicked
gabriellaberko Sep 15, 2025
b9dd138
update function for hamburger menu so that is works to expand and col…
gabriellaberko Sep 15, 2025
066df10
add function to change menu icon when expanding/collapsing hamburger …
gabriellaberko Sep 15, 2025
e793f7a
change logo position from hero content to navbar for smaller screens
gabriellaberko Sep 15, 2025
4f81e17
add minor styling for navbar and clean up code
gabriellaberko Sep 15, 2025
4de7f60
clean code
gabriellaberko Sep 16, 2025
647d80d
add modals to cards that open on card button click
gabriellaberko Sep 16, 2025
6ffbfb7
add social links to modal
gabriellaberko Sep 16, 2025
d72eac2
minor styling changes to the modal
gabriellaberko Sep 16, 2025
0cbfc69
clean code and remove introduction image
gabriellaberko Sep 17, 2025
452b3b6
change some margins
gabriellaberko Sep 17, 2025
25f56bb
change layout of hamburger menu from top to side
gabriellaberko Sep 17, 2025
e1f23db
correct typo
gabriellaberko Sep 17, 2025
bb57135
clean code in javascript file
gabriellaberko Sep 19, 2025
e3b70b7
remove margin from cross icon in modal
gabriellaberko Sep 19, 2025
19d15e3
fix card alignments on wide screen and clean code
gabriellaberko Sep 19, 2025
b57fbb5
add a div around events button with the margin to prevent clickable a…
gabriellaberko Sep 20, 2025
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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# js-project-business-site
# js-project-business-site
Link to site: https://sportlinksite.netlify.app/
7 changes: 7 additions & 0 deletions burger-menu-black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions burger-menu-cross-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions burger-menu-white.svg
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 group-run.jpeg
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 hero-modified.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
265 changes: 265 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,265 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SportLink</title>
<link rel="stylesheet" href="style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Libre+Franklin:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>

<body>
<header class="hero">
<img
class="hero-image"
src="./hero-modified.jpeg"
alt="group of running people"
>
<nav class="navbar" id="nav">
<div
class="menu-icon"
id="menuIcon">
<img
class="hamburger-icon"
id="hamburgerIcon"
src="./burger-menu-white.svg"
alt="hamburger menu icon">
<img
class="cross-icon hidden"
id="crossIcon"
src="./burger-menu-cross-white.svg"
alt="cross menu icon">
</div>
<ul class="nav-links" id="links">
<li><a href="#">Home</a></li>
<li><a href="#events">Events</a></li>
<li><a href="#">About</a></li>
</ul>
</nav>
<div class="hero-content">
<img
class="logo"
src="./logo.png"
alt="logo">
<div>
<img
class="hamburger-logo"
id="hamburgerLogo"
src="./logo.png"
alt="logo">
</div>
<p>All the city's free social workouts—gathered in one place so you can stay active and make
friends along the way.</p>
<a href="#form">
<button class="primary-cta">
Sign up!
</button>
</a>
</div>
</header>
<main>
<section class="introduction">
<h1>Bored of working out solo? We've got you!</h1>
<p>Staying active doesn't have to be boring—or solo. Our platform brings together the city's free social sports
events so you can find activities that fit your schedule, your energy, and your mood. Whether you're into
early
morning run clubs, yoga sessions in the park, or high-energy group workouts, everything is in one place. Join,
and connect with like-minded people who love to move.</p>
Comment on lines +67 to +71

Choose a reason for hiding this comment

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

I just wonder why this text is written on multiple lines when other long texts are not.

</section>
<section class="events-section" id="events">
<h2>Current events</h2>
<section class="card-section">
<div class="modal-overlay hidden" id="modalOverlay">
<img
class="cross-icon"
id="modalCrossIcon"
src="./burger-menu-cross-white.svg" alt="cross menu icon">
<div class="modal" id="modalPopup">
<div class="modal-content" id="modalContent"></div>
<p><b>Connect with the club on social media</b></p>
<div class="social-links">
<a href="#" class="fa fa-facebook"></a>
<a href="#" class="fa fa-instagram"></a>
</div>
</div>
</div>
<div class="card" id="card">
<h3 class="card-title">Thursday Run Club</h3>
<img
src="./group-run.jpeg"
alt="group of runners"
>
<div class="card-description">
<div class="location-date-box">
<p>📍 Mariatorget, Stockholm <br> 🕐 18.00 every Thursday</p>
</div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do il dolore eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
<button class="card-button">Read more</button>
</div>
<div class="card">
<h3 class="card-title">Vinyasa Flow Mornings</h3>
<img
src="./yoga-session.jpeg"
alt="group yoga session in park"
>
<div class="card-description">
<div class="location-date-box">
<p>📍 Vasaparken, Stockholm <br> 🕐 11.00 every Saturday</p>
</div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do il dolore eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
<button class="card-button">Read more</button>
</div>
<div class="card">
<h3 class="card-title">Tuesday Run Club - Cruisers (Slow)</h3>
<img
src="./group-run.jpeg"
alt="group of runners"
>
<div class="card-description">
<div class="location-date-box">
<p>📍 Mariatorget, Stockholm <br> 🕐 18.30 every Tuesday</p>
</div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do il dolore eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
<button class="card-button">Read more</button>
</div>
<div class="card">
<h3 class="card-title">Stretch & Mobility</h3>
<img
src="./yoga-in-park.jpeg"
alt="group yoga session in park"
>
<div class="card-description">
<div class="location-date-box">
<p>📍 Tantolunden, Stockholm <br> 🕐 12.00 every Saturday and Sunday</p>
</div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do il dolore eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
<button class="card-button">Read more</button>
</div>
</section>
<div class="button-wrapper">
<a href="">
<button class="events-button">
More events
</button>
</div>
</a>
</section>
<section class="form-section" id="form">
<h2>Sign up to not miss out on new events!</h2>
<p>Sign up to get the latest social sports events straight to your inbox. Pick the activities you love and your skill level, and we'll make sure you get updates on new events that match your interests and pace.</p>
<form
class="sign-up-form"
action="https://httpbin.org/anything"
method="POST"
>
<fieldset>
<legend>Newsletter Sign up</legend>
<label class="text-field">
<span>First name</span>
<input
type="text"
name="first-name"
placeholder="Emma"
required
>
</label>
<label class="text-field">
<span>Last name</span>
<input
type="text"
name="last-name"
placeholder="Andersson"
required
>
</label>
<label class="text-field">
<span>Email</span>
<input
type="email"
name="email"
placeholder="example@example.com"
required
>
</label>
<p>What are you interested in?</p>
<label class="checkbox">Running
<input
type="checkbox"
name="interest"
value="running"
checked
>
<span class="custom-checkbox"></span>
</label>
<label class="checkbox">Cycling
<input
type="checkbox"
name="interest"
value="cycling"
>
<span class="custom-checkbox"></span>
</label>
<label class="checkbox">Yoga
<input
type="checkbox"
name="interest"
value="yoga"
>
<span class="custom-checkbox"></span>
</label>
<label class="checkbox">Mobility
<input
type="checkbox"
name="interest"
value="mobility"
>
<span class="custom-checkbox"></span>
</label>
<p>What is your skill level?</p>
<label class="radio-button">Beginner
<input
type="radio"
name="skill-level"
value="beginner"
checked
>
<span class="custom-radio-button"></span>
</label>
<label class="radio-button">Intermediate
<input
type="radio"
name="skill-level"
value="intermediate"
>
<span class="custom-radio-button"></span>
</label>
<label class="radio-button">Advanced
<input
type="radio"
name="skill-level"
value="advanced"
>
<span class="custom-radio-button"></span>
</label>
<button class="submit-button" type="submit">
Sign me up!
</button>
</fieldset>
</form>
</section>
</main>
<script src="script.js"></script>
<footer>
<p>© Copyright</p>
</footer>
</body>

</html>
Binary file added intro-image-2.jpg
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 intro-image.jpg
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 logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
const hamburgerIcon = document.getElementById("hamburgerIcon");
const crossIcon = document.getElementById("crossIcon");
const navBar = document.getElementById("nav");
const navLinks = document.getElementById("links");
const cardButtons = document.querySelectorAll(".card-button");
const cardButton = document.querySelector(".card-button");
const cards = document.querySelectorAll(".card");
const card = document.querySelector(".card");
const modalOverlay = document.getElementById("modalOverlay");
const modal = document.getElementById("modal");
const modalContent = document.getElementById("modalContent")
const modalCrossIcon = document.getElementById("modalCrossIcon");

function expandCollapseHamburgerMenu() {
if (navLinks.style.display === "block") {
navLinks.style.display = "none";
navBar.style.backgroundColor = "transparent";
} else {
navLinks.style.display = "block";
navBar.style.backgroundColor = "rgba(33, 32, 23, 0.817)";
}
}

/* add/remove the CSS for the class hidden (which is display: none) to the different menu icons */

Choose a reason for hiding this comment

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

Good explanation! it helps to understand what the code does:)

function changeMenuIcon() {
hamburgerIcon.classList.toggle("hidden");
crossIcon.classList.toggle("hidden");
};

menuIcon.addEventListener("click", () => {
expandCollapseHamburgerMenu();
changeMenuIcon();
});


function openCloseModal() {
modalOverlay.classList.toggle("hidden");
};

function showCardInModal(clickedButton) {
// find the card which button was clicked
const clickedCard = clickedButton.closest(".card");

// copy its inner HTML into modal-content
modalContent.innerHTML = clickedCard.innerHTML;

// remove the card's inital ("read more") button
modalContent.querySelector(".card-button").remove();
};

/* call the funtions on click for every of the card buttons */
cardButtons.forEach((cardButton) => {
cardButton.addEventListener("click", () => {
openCloseModal(cardButton);
showCardInModal(cardButton);
});
});

modalCrossIcon.onclick = () => {
openCloseModal();
};
Loading