Skip to content

Commit

Permalink
+Adding Projects Page
Browse files Browse the repository at this point in the history
  • Loading branch information
CalGrimes committed Jun 18, 2021
1 parent 30155fd commit d8d4116
Show file tree
Hide file tree
Showing 11 changed files with 263 additions and 37 deletions.
Binary file modified .vs/CalGrimes-Blog-Postings/v16/.suo
Binary file not shown.
10 changes: 10 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"ExpandedNodes": [
"",
"\\projects",
"\\_includes",
"\\_includes\\layouts"
],
"SelectedNode": "\\index.njk",
"PreviewInSolutionExplorer": false
}
Binary file modified .vs/slnx.sqlite
Binary file not shown.
2 changes: 1 addition & 1 deletion _includes/layouts/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


{#- Read more about `eleventy-navigation` at https://www.11ty.dev/docs/plugins/navigation/ #}
<nav class="navbar navbar-expand-lg navbar-light ">
<nav class="navbar navbar-expand-lg navbar-light navbar-links">
<h1 class="home">
<a class="navbar-brand" href="{{ '/' | url }}">
<img class="logo" src="\img\logo\CG_BlogLogo.png"></img>
Expand Down
2 changes: 1 addition & 1 deletion archive.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: layouts/home.njk
permalink: /posts/
eleventyNavigation:
key: Blog Archive
order: 2
order: 3
---

<div class="row">
Expand Down
2 changes: 1 addition & 1 deletion contact/contact.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: layouts/home.njk
eleventyNavigation:
key: Contact
order: 3
order: 5
---

<div class="container">
Expand Down
185 changes: 153 additions & 32 deletions css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
--gray: #C0C0C0;
--darkgray: #333;
--navy: #17050F;
--silvergrey: #c0c0c0;
--white: #fff;
--lightrose: #ec8282;
--softorange: #DCAE96;
Expand Down Expand Up @@ -41,12 +40,13 @@ p,
}

a[href] {
color: black;
color: var(--navy);
}

a[href]:visited {
color: var(--navy);
}
a[href].btnGit {
color:white;
background-color: var(--darkgray);
}

main {
padding: 1rem;
Expand Down Expand Up @@ -181,6 +181,8 @@ header {
text-decoration: underline;
}



/* Footer */
footer > .container {
background-color: var(--softorange);
Expand Down Expand Up @@ -226,6 +228,7 @@ footer > .container {
text-underline-position: from-font;
text-underline-offset: 0;
text-decoration-thickness: 1px;
color: var(--black);
}

.postlist-item-active .postlist-link {
Expand All @@ -240,18 +243,46 @@ footer > .container {

/* Tags */
.post-tag {
display: inline-flex;
align-items: center;
justify-content: center;
display: inline-block;
text-transform: uppercase;
font-size: 0.6875em; /* 11px /16 */
padding: 0.09090909090909em 0.3636363636364em; /* 1px 4px /11 */
margin-left: 0.8em; /* 8px /10 */
border: 1px solid var(--gray);
border-radius: 0.25em; /* 3px /12 */
font-size: 0.625em; /* 10px /16 */
padding: 6px 6px;
margin-bottom: 0.5em;
background-color: var(--lightrose);
color: var(--white);
border-radius: 0.4em;
text-decoration: none;
line-height: 1.8;
background-color: var(--silvergrey);
transition: 1s;
}

.post-tag:hover {
text-decoration: none;
background-color: var(--darkgray);
transition: 1s;
}

.news-tag {
color: white;
display: inline-block;
text-transform: uppercase;
font-size: 0.625em; /* 10px /16 */
padding: 6px 6px;
margin-bottom: 0.5em;
background-color: var(--lightrose);
border-radius: 0.4em;
text-decoration: none;
transition: 1s;
}

.news-tag:hover {
text-decoration: none;
background-color: var(--lightrose);
transition: 1s;
}

a[href].post-tag,
a[href].post-tag:visited {
color: #fff;
}

a[href].post-tag,
Expand Down Expand Up @@ -302,34 +333,124 @@ a[href].direct-link:visited {
font-size: 18px;
}

.btnGit {
background-color: var(--silvergrey);
}
/* contact page form */

a[href].btnGit:hover,
a[href].btnGit:focus {
background-color: var(--lightgray);
.form-signin {
width: 100%;
max-width: 330px;
padding: 15px;
margin: 30px auto;
}

/* Forms */
.form-control {
background-color: #dbf5f7;
border: black solid 2px;
transition: 0.4s;
.form-signin .checkbox {
font-weight: 400;
}
}

/* Type */
.main-text {
font-size: 18px;
}

/* contact page form */

.form-signin {
width: 100%;
max-width: 330px;
padding: 15px;
margin: 30px auto;
}

.form-control button {
border: 2px solid var(--darkgray);
width: 100%;
padding: 5px;
background-color: var(--darkgray);
color: white;
.form-signin .checkbox {
font-weight: 400;
}

.form-signin .form-control {
position: relative;
box-sizing: border-box;
height: auto;
padding: 10px;
font-size: 16px;
}

.form-signin .form-control:focus {
z-index: 2;
}

.top-contact-form-input {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}

.middle-contact-form-input {
margin-bottom: -1px;
border-radius: 0;
}

.bottom-contact-form-input {
margin-bottom: 20px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
/* javascript forms */
.form-control {
background-color: var(--lightrose);
border: black solid 2px;
transition: 0.4s;
color: var(--darkgray);
}

.form-control input {
background-color: white;
}

.form-control textarea {
background-color: white;
}

.form-control:hover {
box-shadow: 0 0px 20px black;
}

.form-control label input {
border: 1px solid var(--darkgray);
border-radius: 4px;
font-size: 18px;
padding: 5px;
padding-bottom: 10px;
}

.form-control label input.success {
border: 2px solid rgb(1, 211, 1);
box-shadow: 0 0px 7px rgb(1, 211, 1);
}

.form-control label input.error {
border: 2px solid red;
box-shadow: 0 0px 7px red;
}

.form-control button {
border: 2px solid var(--darkgray);
width: 100%;
padding: 5px;
background-color: var(--darkgray);
color: white;
}

.form-control button:hover {
background-color: white;
color: var(--darkgray);
box-shadow: 0 0px 30px var(--darkgray);
}
/* Countdown timer */
.timer {
display: flex;
}

.countdown-el {
font-size: 1.5rem;
padding: 0.5rem;
text-align: center;
}
Binary file added img/projectImg/black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ eleventyNavigation:
<p>Welcome to my blog.</p>
This blog is used to document my completed and ongoing projects.
<hr class="my-4"></hr>
<p>If you would like to visit my GitHub portfolio, please click the button below.</p>
<a class="btn btn-lg btnGit" href="https://github.com/CalGrimes1/" role="button">Visit GitHub portfolio</a>
<p>If you would like to visit my online web developers profile, please click the button below.</p>
<a class="btn btn-lg btnGit" href="https://calgrimes1.github.io/calgrimes/" role="button">Visit online portfolio</a>
</div>
<div class="container main-text">
<br>
Expand Down
46 changes: 46 additions & 0 deletions js/projects.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Index
// LIVE ON WEBSITE
// 1. Tip Calculate
// 2. Form Validation
// 3. Simple form
// 4. Simple calculator 1
// 5. Countdown Timer

//1. Tip Calculate starts here
function calculateTip() {
var billAmt = document.getElementById("billamt").value;
var serviceQual = document.getElementById("serviceQual").value;
var numOfPeople = document.getElementById("peopleamt").value;
//validate input
if (billAmt === "" || serviceQual == 0) {
alert("Please enter values");
return;
}
//Check to see if this input is empty or less than or equal to 1
if (numOfPeople === "" || numOfPeople <= 1) {
numOfPeople = 1;
document.getElementById("each").style.display = "none";
} else {
document.getElementById("each").style.display = "block";
}
//Calculate tip
var total = (billAmt * serviceQual) / numOfPeople;
//round to two decimal places
total = Math.round(total * 100) / 100;
//next line allows us to always have two digits after decimal point
total = total.toFixed(2);
//Display the tip
document.getElementById("totalTip").style.display = "block";
document.getElementById("tip").innerHTML = total;

}
//Hide the tip amount on load
document.getElementById("totalTip").style.display = "none";
document.getElementById("each").style.display = "none";
//click to call function
document.getElementById("calculate").onclick = function () {
calculateTip();
};
// Tip Calculate ends here

// ---------------------------------------------------------------------------------------
49 changes: 49 additions & 0 deletions projects/projects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
layout: layouts/home.njk
title: Projects
templateClass: tmpl-post
eleventyNavigation:
key: Projects
order: 2
---
<!-- JavaScript Projects starts here -->
<div class="text-center">
<h1>JavaScript Projects</h1>
<hr>
</div>
<div class="row">
<!-- Tip Calculator Starts here -->
<div class="col-lg-4">
<form class="form-control form-signin">
<h2>Tip Calculator</h2>
<p>Enter your bill amount and select the percentage of tip you would like to give. If there is only one person paying, you can either leave the number of people blank or enter 1.</p>
<hr>
<label>Bill amount<br>
<span>£ </span><input id="billamt" type="text" placeholder="Bill amount">
</label>
<label>How much tip would you like to give?<br>
<select id="serviceQual">
<option disabled selected value="0">Choose an percentage</option>
<option value="0.05">5&#37;</option>
<option value="0.1">10&#37;</option>
<option value="0.15">15&#37;</option>
<option value="0.3">30&#37;</option>
<option value="0.4">40&#37;</option>
<option value="0.5">50&#37;</option>
</select>
</label>
<label>How many people are sharing the bill?
<input id="peopleamt" type="text" placeholder="Number of People">
</label>
<button class="btn" type="button" id="calculate">Calculate!</button>
<!--calculator end-->
<div id="totalTip">
<h5 id="each">You will each pay a tip of:</h5>
<h2><sup>£</sup><span id="tip">0.00</span> </h2>
</div>
</form>
</div>
</div>
<!-- Tip Calculator Ends here -->
<!-- JavaScript Projects ends here -->
<script src="/js/projects.js"></script>

0 comments on commit d8d4116

Please sign in to comment.