-
Notifications
You must be signed in to change notification settings - Fork 0
Added bootstrap navbar and carousel #3
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,10 +12,15 @@ | |
| <body> | ||
| <header> | ||
| <h1>Contact Watts Ecology</h1> | ||
| <nav> | ||
| <ul> | ||
| <li><a href="index.html">Home</a></li> | ||
| <li><a href="contact.html">Contact</a></li> | ||
| <!-- Bootstrap Navbar --> | ||
| <nav class="navbar navbar-expand-lg navbar-light bg-light" > | ||
| <ul class="navbar-nav flex-row"> | ||
| <li class="nav-item"> | ||
| <a class="nav-link" href="index.html">Home</a> | ||
| </li> | ||
| <li class="nav-item active"> | ||
| <a class="nav-link" href="contact.html">Contact</a> | ||
| </li> | ||
| </ul> | ||
| </nav> | ||
| </header> | ||
|
|
@@ -32,7 +37,7 @@ <h2>Get in Touch</h2> | |
| <label for="name" class="col-sm-2 col-form-label">Name:</label> | ||
| <div class="col-sm-10"> | ||
| <input type="text" class="form-control" id="name" name="name" required> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="form-group row"> | ||
|
|
@@ -42,7 +47,7 @@ <h2>Get in Touch</h2> | |
| </div> | ||
| </div> | ||
|
|
||
| <!-- Button triggers the sendEmail function instead of submitting the form --> | ||
| <!-- Button triggers the sendEmail function instead of submitting the form --> | ||
| <div class="form-group row"> | ||
| <div class="col-sm-12 text-right"> <!-- Use the text-right class to align the button to the right --> | ||
| <button type="submit" class="btn btn-primary" onclick="sendEmail()">Send Email</button> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code Review:
Suggestions for Improvement:
Ensuring readability, consistency, and following best practices will help maintain code quality and reduce the risk of bugs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code Review Comments:
By making these enhancements and ensuring best coding practices, you can improve the maintainability and robustness of your code. |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,11 +44,6 @@ section { | |
| margin-bottom: 20px; | ||
| } | ||
|
|
||
| /* Styles for the entire gallery section */ | ||
| .gallery-section { | ||
| max-width: 1200px; | ||
| } | ||
|
|
||
| /* Sets the gallery section to block layout, limits its maximum width, automatically centers it on the page, and adds padding. */ | ||
| .gallery { | ||
| display: grid; | ||
|
|
@@ -91,4 +86,30 @@ section { | |
| /* Adds additional bottom margin to the gallery heading for spacing. */ | ||
| .gallery h2 { | ||
| margin-bottom: 20px; | ||
| } | ||
|
|
||
| /* Darkens the carousel caption text */ | ||
| .carousel-caption { | ||
| background-color: rgba(0, 0, 0, 0.5); /* Dark semi-transparent background */ | ||
| color: white; /* White text color */ | ||
| text-align: center; /* Center-align text */ | ||
| padding: 20px !important; /* Add padding for better readability */ | ||
| position: absolute; | ||
| bottom: 0px !important; | ||
| left: 0px !important; | ||
| right: 0px !important; | ||
| } | ||
|
|
||
| /* Centers the carousel horizontally */ | ||
| #galleryCarousel { | ||
| display: block; /* Ensures the carousel is displayed as a block element */ | ||
| margin: 0 auto; /* Center the carousel horizontally */ | ||
| max-width: 1200px; | ||
| } | ||
|
|
||
| /* Reduces the font size of the carousel caption on mobile devices */ | ||
| @media (max-width: 768px) { | ||
| .carousel-caption { | ||
| font-size: 10px; /* Adjust the font size as needed */ | ||
| } | ||
| } | ||
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,10 +12,15 @@ | |
| <body> | ||
| <header> | ||
| <h1>Welcome to Watts Ecology</h1> | ||
| <nav> | ||
| <ul> | ||
| <li><a href="index.html">Home</a></li> | ||
| <li><a href="contact.html">Contact</a></li> | ||
| <!-- Bootstrap Navbar --> | ||
| <nav class="navbar navbar-expand-lg navbar-light bg-light" > | ||
| <ul class="navbar-nav flex-row"> | ||
| <li class="nav-item active"> | ||
| <a class="nav-link" href="index.html">Home</a> | ||
| </li> | ||
| <li class="nav-item"> | ||
| <a class="nav-link" href="contact.html">Contact</a> | ||
| </li> | ||
| </ul> | ||
| </nav> | ||
| </header> | ||
|
|
@@ -42,16 +47,37 @@ <h2>Our Services</h2> | |
| <section class="gallery-section"> | ||
| <h2>Gallery</h2> | ||
| <p>Explore some of our recent findings and snapshots from the field:</p> | ||
| <div class="gallery"> | ||
| <div class="image-container"> | ||
| <img src="images/common-pip.jpg" alt="A common pipistrelle Bat in its natural habitat" | ||
| class="responsive-image"> | ||
| </div> | ||
| <div class="image-container"> | ||
| <img src="images/great-crested-newt.jpg" alt="A Great Crested Newt in its natural habitat" | ||
| class="responsive-image"> | ||
| <div id="galleryCarousel" class="carousel slide" data-ride="carousel"> | ||
| <ol class="carousel-indicators"> | ||
| <li data-target="#galleryCarousel" data-slide-to="0" class="active"></li> | ||
| <li data-target="#galleryCarousel" data-slide-to="1"></li> | ||
| <!-- Add more carousel indicators as needed --> | ||
| </ol> | ||
| <div class="carousel-inner"> | ||
| <div class="carousel-item active"> | ||
| <img src="images/common-pip.jpg" alt="A common pipistrelle Bat in its natural habitat" class="d-block w-100"> | ||
| <div class="carousel-caption"> | ||
| <h5>Common Pipistrelle Bat</h5> | ||
| <p>This bat thrives in a variety of habitats and is commonly found across the UK.</p> | ||
| </div> | ||
| </div> | ||
| <div class="carousel-item"> | ||
| <img src="images/great-crested-newt.jpg" alt="A Great Crested Newt in its natural habitat" class="d-block w-100"> | ||
| <div class="carousel-caption"> | ||
| <h5>Great Crested Newt</h5> | ||
| <p>An important indicator of healthy wetland ecosystems.</p> | ||
| </div> | ||
| </div> | ||
| <!-- Add more carousel items as needed --> | ||
| </div> | ||
| <!-- Add more images as needed --> | ||
| <a class="carousel-control-prev" href="#galleryCarousel" role="button" data-slide="prev"> | ||
| <span class="carousel-control-prev-icon" aria-hidden="true"></span> | ||
| <span class="sr-only">Previous</span> | ||
| </a> | ||
| <a class="carousel-control-next" href="#galleryCarousel" role="button" data-slide="next"> | ||
| <span class="carousel-control-next-icon" aria-hidden="true"></span> | ||
| <span class="sr-only">Next</span> | ||
| </a> | ||
| </div> | ||
| </section> | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here are some suggestions based on the code patch provided:
By addressing these points, you can enhance the efficiency, accessibility, and user experience of your webpage. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here are some suggestions for the code patch:
Overall, the changes seem to enhance the user interface by using Bootstrap components like the Navbar and Carousel effectively. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review:
Improvements:
sendEmail()function in a separate JavaScript file rather than using inline JS for better separation of concerns.aria-labelfor elements like buttons for better screen reader support.Bugs/Risks:
<span class="sr-only">(current)</span>from the Contact link, as it is placed on an active list item (<li>). This could potentially confuse users relying on screen readers.Security:
Code Structure:
Styling:
By addressing these points, you can improve the code's quality, maintainability, and user experience.