Gym Website Using Html And Css With Source Code
Hello friends, all of you are welcome to my new blog post, today we have created a wonderful Gayam website for you in which you can do activities related to Gayam. Friends, this Gayam website is the best project till date, we have done a lot on it. This design is very attractive and beautiful, we have used good colors and fonts in it.
Friends, creating this Gayam website ui is a very easy task, we have created this Gayam website with the help of HTML and CSS but we have also written some code in JavaScript so that if the website is opened on mobile then the JavaScript code works.
Index.html
Friends, in this website we have created many sections which are important, so let us know those sections which we have created in this Gayam website.
Gym Website Navbar:-
Friends, this is the code of Navbar. We have added some buttons and link tags in Navbar and most importantly, the logo of our website which we have added in this Navbar.
hero Section Gym Website:-
This is the main part of our website, that is, when the user comes to our website, he will have to see this page first, so we have designed it very well. In the hero section, we have placed an image on the right and text on the left. and also created a button below the text
Complete Daily
Workout At Home
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Minima
sunt sed tempora neque molestiae corrupti nobis harum ullam eos nam!
Get Started Now
Explore Section Gym Website:-
Friends, this section is also a bit similar to the hero section, but we have placed both the sections the same, so in this section we have placed the image on the left and the text on the right.
Explore Our Fitness
Studio
Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis
esse vitae ratione quos maiores eveniet temporibus illum! Eligendi
amet officia unde sint totam ut optio. Molestiae, illo quia?
Get Started Now
Trainers Section:-
Friends, this is the trainer section in which we have added those people who give training in the gym. We have created only three boxes in it but you can add more boxes in it.
Testimonial And Footer Bar Section:-
That's What Our Super
Client Says
Exelent Training
Lorem ipsum dolor sit amet consectetur adipisicing elit. Excepturi
quas voluptatem ad, repudiandae voluptates odio deleniti
reiciendis in veniam quidem expedita maxime error fugit. Pariatur
quasi sunt aut id. Lorem, ipsum dolor sit amet consectetur
adipisicing elit. Neque, officiis.
Fitness Classes This Summer, Pay Now And Get 25% Discount
Lorem ipsum dolor sit amet consectetur adipisicing elit. Ab maxime
minus praesentium est et veniam voluptate alias excepturi minima
placeat amet nostrum, eligendi, quod cum ducimus nesciunt ipsa eum,
explicabo eaque obcaecati.
Book Now
Gym Website Complete CSS Code
Friends, this is the complete code of CSS with the help of which we have designed the website, without this you cannot give a good look to the website, like if you have to keep the color of the body in the website, what is the color of the text, all this. You can do the work with the help of CSS
Friends, we have made the design of this website very beautiful with the help of CSS, like we have mainly used background: var(–clr-primary); This color has been used as well as background: linear-gradient(to right, #0e0e0e 70%, #142d2a); Mix colors have also been used so that the design of the website looks even better.
@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@200;400;500;700&display=swap");
/* Base */
:root {
--clr-primary: #29a396;
}
*,
*::after,
*::before {
box-sizing: border-box;
padding: 0;
margin: 0;
font-family: "Nunito", sans-serif;
}
html {
scroll-behavior: smooth;
}
body {
width: 100%;
min-height: 100vh;
background: radial-gradient(#111, #071a1a);
color: #fff;
overflow-x: hidden;
}
.container {
width: 80%;
margin: 0 auto;
}
.flex {
display: flex;
align-items: center;
justify-content: center;
column-gap: 60px;
}
.header,
.section {
width: 100%;
padding: 40px 0;
overflow: hidden;
}
.header::after,
.header::before,
.section::after,
.section::before {
content: "";
background: url(https://raw.githubusercontent.com/programmercloud/pgc-gym/main/img/blur-1.png);
position: absolute;
width: 400px;
height: 400px;
background-position: center;
background-repeat: no-repeat;
background-size: contain;
bottom: 0;
}
.header::after {
left: -200px;
}
.header::before {
right: -200px;
}
.mb {
margin-bottom: 30px;
}
.mt {
margin-top: 20px;
}
.section {
background: #1d1f1e;
position: relative;
padding: 80px 0;
}
.section::after {
left: -200px;
}
.section::before {
width: 600px;
right: -200px;
}
.section:nth-child(even) {
background: #141615;
}
.section:nth-child(even)::after,
.section:nth-child(even)::before {
display: none;
}
.primary {
font-size: 35px;
font-weight: 700;
}
.secondary {
font-size: 25px;
font-weight: 700;
}
.tertiary {
font-size: 15px;
}
/* End Base */
/* Menu */
.menu {
width: 100%;
background: linear-gradient(to right, #0e0e0e 70%, #142d2a);
padding: 12px 0;
}
.menu .container {
justify-content: space-between;
}
.mobile-btn {
display: none;
}
.logo {
cursor: pointer;
}
.logo img {
width: 80px;
height: auto;
}
.nav {
list-style: none;
}
.nav-item {
display: inline-block;
margin-right: 30px;
font-size: 18px;
font-weight: 400;
}
.nav-item a {
text-decoration: none;
color: #fff;
}
.nav-item:hover a {
color: #29a396;
transition: 0.3s linear;
}
.nav-item:last-of-type {
margin-right: 0;
}
/* End Menu */
/* Buttons */
.btn {
padding: 10px 28px;
background: var(--clr-primary);
border-radius: 40px;
font-size: 20px;
font-weight: 400;
text-decoration: none;
color: #fff;
display: inline-block;
}
.btn:hover {
transition: 0.3s linear;
box-shadow: var(--clr-primary) 0px 5px 15px;
}
.btn-2 {
font-size: 35px;
text-decoration: none;
color: #ccc;
transition: 0.3s linear;
}
.btn-2:hover {
color: #29a396;
}
/* End Buttons */
/* Header */
.text {
width: 60%;
}
.visual {
width: 40%;
}
.visual img {
width: 100%;
}
.header h1 {
font-size: 70px;
font-weight: 700;
}
.header h1 span {
color: var(--clr-primary);
}
/* End Header */
.section:nth-child(even) .visual {
margin-right: 30px;
}
/* Trainer */
#trainer {
text-align: center;
}
.trainer img {
border-top-left-radius: 80px;
border-top-right-radius: 20px;
border-bottom-right-radius: 80px;
border-bottom-left-radius: 20px;
margin-bottom: 10px;
outline: 2px solid #fff;
padding: 14px;
}
.trainer .mb {
margin-bottom: 10px;
}
/* End Trainer */
/* Testimonial */
#testimonial .visual img {
width: 90%;
display: block;
margin-left: auto;
}
.client {
background: #fff;
color: #000;
padding: 20px 10px;
margin-right: 20px;
text-align: center;
border-radius: 20px;
position: relative;
margin-top: 20px;
}
.client img {
width: 80px;
height: 80px;
border-radius: 50%;
position: absolute;
top: -40px;
left: calc(50% - 40px);
}
.client h2 {
margin: 20px 0 10px 0;
}
/* End Testimonial */
/* Discount */
#discount {
padding: 40px 0;
}
/* End Discount */
/* Footer */
.footer {
padding: 30px 0;
border-top: 1px solid #fff;
text-align: center;
}
/* End Footer */
/* Responsive */
@media (max-width: 768px) {
.flex {
flex-direction: column;
text-align: center;
}
.mobile-btn {
display: block;
font-size: 35px;
cursor: pointer;
position: absolute;
right: 20px;
top: 12px;
}
.menu.active .nav-item {
display: block;
margin: 30px 0;
}
.nav,
.menu .btn {
display: none;
}
.menu.active .nav,
.menu.active .btn {
display: block;
}
.menu.active {
padding: 30px 0;
width: 100%;
transition: all 0.8s ease;
}
.text,
.visual {
width: 100%;
margin-bottom: 20px;
}
.text h1 {
font-size: 45px;
}
.primary {
font-size: 28px;
}
.secondary {
font-size: 22px;
}
.tertiary {
font-size: 14px;
}
.trainer {
margin-bottom: 20px;
}
.client {
margin-bottom: 50px;
}
#discount .visual img {
width: 70%;
margin-bottom: 30px;
}
}
@media (max-width: 530px) {
.header::after,
.header::before,
.section::after,
.section::before {
display: none;
}
.primary {
font-size: 25px;
}
.secondary {
font-size: 20px;
}
.tertiary {
font-size: 12px;
}
.text h1 {
font-size: 34px;
}
.btn,
.btn-2 {
font-size: 16px;
}
}
/* End Responsive */
.youtube {
position: fixed;
bottom: 40px;
right: 70px;
text-decoration: none;
padding: 8px 12px;
background: rgba(0,0,0,0.6);
border-radius: 6px;
box-shadow: 0 2px 2px 3px rgba(0, 0, 0, 0.2);
color: #fff;
}
.youtube p {
font-size: 22px;
}
Gym Website Javascript Code
//Js
document.querySelector(".mobile-btn").addEventListener("click", function () {
document.querySelector(".menu").classList.toggle("active");
});