diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..325cf7b Binary files /dev/null and b/.DS_Store differ diff --git a/public/.DS_Store b/public/.DS_Store new file mode 100644 index 0000000..55a8014 Binary files /dev/null and b/public/.DS_Store differ diff --git a/public/EventFeed.html b/public/EventFeed.html new file mode 100644 index 0000000..f168e67 --- /dev/null +++ b/public/EventFeed.html @@ -0,0 +1,279 @@ + + + + + + VoluntYOU | Official Homepage + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+ + +
+ + +
+ +
+ +
+ +
+
+
+ +
+ Facebook Icon +
+ +
+ Instagram Icon +
+ +
+ Email Icon +
+ +
+ Linkedin Icon +
+ +
+ + +
+
+ Copyright 2021 Julianna Schneider. All Rights Reserved. Patent Pending. + Registered + Domestic Nonprofit + Corporation. +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/EventInformation.html b/public/EventInformation.html new file mode 100644 index 0000000..332a1f8 --- /dev/null +++ b/public/EventInformation.html @@ -0,0 +1,265 @@ + + + + + + VoluntYOU | Official Homepage + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Event Name

+ + + + + + +
+
+
+

+
Date and Time:
+
Address:
+
+ + + + +
+ +
+ +
+
+
+ +
+ Facebook Icon +
+ +
+ Instagram Icon +
+ +
+ Email Icon +
+ +
+ Linkedin Icon +
+ +
+ + +
+
+ Copyright 2021 Julianna Schneider. All Rights Reserved. Patent Pending. + Registered + Domestic Nonprofit + Corporation. +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/css/main.css b/public/css/main.css index 11bdbbb..bc2715a 100644 --- a/public/css/main.css +++ b/public/css/main.css @@ -116,3 +116,10 @@ label.btn.selected::before { background-color: #b1873f!important; border-color: #b1873f!important; } + +@media(min-width:992px){ + #requestBtn{ + width: 40%; + + } +} \ No newline at end of file diff --git a/public/css/nav.css b/public/css/nav.css index bf69da9..c7d3756 100644 --- a/public/css/nav.css +++ b/public/css/nav.css @@ -6,4 +6,7 @@ .dropdown-divider { color: rgba(211,211,211,1) !important; +} +ul.category-dropdown li:hover{ + cursor: pointer; } \ No newline at end of file diff --git a/public/css/profile.css b/public/css/profile.css new file mode 100644 index 0000000..758a103 --- /dev/null +++ b/public/css/profile.css @@ -0,0 +1,5 @@ +@media (min-width: 992px) { + .LogOutBtn { + display:none; + } +} \ No newline at end of file diff --git a/public/index.html b/public/index.html index 73bd449..8c83acb 100644 --- a/public/index.html +++ b/public/index.html @@ -98,6 +98,21 @@ --> +
+ +
@@ -388,7 +403,7 @@

Ready to try it out?

- + + + + diff --git a/public/js/EventFeed.js b/public/js/EventFeed.js new file mode 100644 index 0000000..b4cbc4e --- /dev/null +++ b/public/js/EventFeed.js @@ -0,0 +1,220 @@ +var currentDate = new Date(); +console.log(currentDate); +const options = { + month: 'numeric', + day: 'numeric', + year: 'numeric', +}; +currentDate.toLocaleDateString(options); +console.log(currentDate); +const db = firebase.firestore(); +const collectionRef = db.collection('Events'); +var str; + + +$(document).ready(function () { + displayAll(); + _addEventListeners(); +}); + +// catch error +const displayError = (err) => { + if (!firebase.auth().currentUser) { + window.location.href = "login.html"; + return; + } + str = '

Could not display results.

'; + document.getElementById('event-list').innerHTML = str; + console.error(err); +} +//function to insert event html onto the page +const display = (doc,str) => { + var date = doc.data()['Time'].toDate(); + // date = Date.parse(date); + // console.log(date); + str += `
  • ` + '' + doc.data()['Event Title'] + '' + + '

    ' + date.toLocaleString() + '

    ' + '
  • ' + '
    '; + return str; + +} + + + +// function that displays all events +const displayAll = () => { + + str = `'; + // console.log(str); + document.getElementById('event-list').innerHTML = str; + + }).catch(err => { + displayError(err); + }); + + +} + +//function that dsplays outdoor events +const displayOutdoorEvents = () => { + str = `'; + // console.log(str); + document.getElementById('event-list').innerHTML = str; + }).catch((err) => { + displayError(err); + }) +} + +//function that dsplays indoor events +const displayIndoorEvents = () => { + str = `'; + // console.log(str); + document.getElementById('event-list').innerHTML = str; + }).catch((err) => { + displayError(err); + }) +} + +//function that dsplays events involving animals +const displayAnimalEvents = () => { + str = `'; + // console.log(str); + document.getElementById('event-list').innerHTML = str; + }).catch((err) => { + displayError(err); + }) +} + + +//function that dsplays events involving medical health care +const displayMedicalEvents = () => { + str = `'; + // console.log(str); + document.getElementById('event-list').innerHTML = str; + }).catch((err) => { + displayError(err); + }) +} + +//function that dsplays events involving the elderly +const displayElderlyEvents = () => { + str = `'; + // console.log(str); + document.getElementById('event-list').innerHTML = str; + }).catch((err) => { + displayError(err); + }) +} + +//function that dsplays events involving children +const displayChildrenEvents = () => { + str = `'; + // console.log(str); + document.getElementById('event-list').innerHTML = str; + }).catch((err) => { + displayError(err); + }) +} + +//function that dsplays events involving Learning Disabilities +const displayLearningDisabilityEvents = () => { + str = `'; + // console.log(str); + document.getElementById('event-list').innerHTML = str; + }).catch((err) => { + displayError(err); + }) +} + + + +//function that dsplays events involving Physical Disabilities +const displayPhysicalDisabilityEvents = () => { + str = `'; + // console.log(str); + document.getElementById('event-list').innerHTML = str; + }).catch((err) => { + displayError(err); + }) +} + +//function that dsplays events involving Huanitarian Aid +const displayHumanitarianAidEvents = () => { + str = `'; + // console.log(str); + document.getElementById('event-list').innerHTML = str; + }).catch((err) => { + displayError(err); + }) +} + +const _addEventListeners = function(){ + var listBody = document.getElementById('event-list'); + // console.log(events); + listBody.addEventListener('click', (event)=>{ + if(event.target.classList.contains("eventTitles")){ + const title = event.target.getAttribute("data-attribute") + console.log(title); + localStorage.setItem("title",title); + window.location.href = "EventInformation.html"; + + } + + + }) + +} \ No newline at end of file diff --git a/public/js/EventInformation.js b/public/js/EventInformation.js new file mode 100644 index 0000000..f00c3a6 --- /dev/null +++ b/public/js/EventInformation.js @@ -0,0 +1,35 @@ +const db = firebase.firestore(); +const collectionRef = db.collection('Events'); + + +$(document).ready(function () { + var eventName = document.getElementById('event-name'); + const title = localStorage.getItem("title"); + console.log(title); + eventName.innerText = title; + getInformation(title); + +}); + +const getInformation = function (title) { + collectionRef.where('Event Title', "==", title).get().then((snapshot) => { + var doc = snapshot.docs[0]; + displayInformation(doc); + }).catch((err) => { + console.log(err); + }) +} +const displayInformation = (doc)=>{ + var eventDuration = document.getElementById('event-duration'); + var eventDescription = document.getElementById('event-description'); + var eventDate = document.getElementById('event-date'); + var eventAddress = document.getElementById('event-address'); + const duration = doc.data()['Total Hours']; + const description = doc.data()['Description'] + const date = doc.data()['Time'].toDate(); + const address = doc.data()['Address']; + eventDuration.innerText = duration+ ' Total Hours'; + eventDescription.innerText = description; + eventDate.innerText = date.toLocaleString(); + eventAddress.innerText = address; +} \ No newline at end of file diff --git a/public/js/appdisp.js b/public/js/appdisp.js index f6ba6bd..61f71b5 100644 --- a/public/js/appdisp.js +++ b/public/js/appdisp.js @@ -55,4 +55,37 @@ for (btn of document.getElementsByTagName("label")) { throw UndefinedCycler; } } -} \ No newline at end of file +} + +//Display Profile in Nav dropdown only if user is logged in + + + $(document).ready(function(){ + const profileLi = document.getElementById("hiddenProfileLi"); + const loginLi = document.getElementById("login-nav-dropdown"); + const signinLi = document.getElementById("signup-nav-dropdown"); + const logoutLi = document.getElementById("hiddenLogOutLi"); + const eventLi = document.getElementById("hiddenEventFeedLi"); + firebase.auth().onAuthStateChanged((user) => { + if (user) { + // console.log('Hi jane'); + profileLi.hidden = false; + logoutLi.hidden = false; + loginLi.hidden = true; + signinLi.hidden = true; + eventLi.hidden= false; + } else { + } + }) + //Log out + document.querySelectorAll(".LogOutBtn").forEach((button)=>{ + button.addEventListener("click", e => { + firebase.auth().signOut().then(() => { + window.location.href = "index.html"; + }).catch((error) => { + window.alert("An error occured " + error.message); + }); + } + ); + }); + }); diff --git a/public/js/login.js b/public/js/login.js index 7a80d19..2ee3019 100644 --- a/public/js/login.js +++ b/public/js/login.js @@ -1 +1,30 @@ -console.log(firebase.auth()) \ No newline at end of file +//console.log(firebase.auth()) + +const userEmail = document.getElementById('email'); +const userPassword = document.getElementById('pswd'); +const btnLogin = document.getElementById('btnLogin'); +//Firebase Login +btnLogin.addEventListener('click', e => { + const email = userEmail.value; + const password = userPassword.value; + const auth = firebase.auth(); + //Checking if all fields have been populated + // if (email != "" && password != "") { + const promise = auth.signInWithEmailAndPassword(email, password); + promise.catch(function (error) { + const errorCode = error.code; + const errorMessage = error.message; + window.alert("Error: " + errorMessage); + console.log(errorCode); + userEmail.value=''; + userPassword.value=''; + + }); + + // } + // else { + // window.alert("Please fill out all fields."); + // } +}); + + diff --git a/public/js/profile.js b/public/js/profile.js new file mode 100644 index 0000000..ad3697d --- /dev/null +++ b/public/js/profile.js @@ -0,0 +1,144 @@ +$(document).ready(function() { +firebase.auth().onAuthStateChanged((user) => { + if (user) { + var uid = user.uid; + console.log(uid); + getUser(uid); + } else { + window.location.href = "registration.html"; + } +}) +}); + + +//Log Out +//document.querySelector + +$(document).ready(function(){ +document.querySelectorAll(".LogOutBtn").forEach((button)=>{ +button.addEventListener("click", e => { + firebase.auth().signOut().then(() => { + window.location.href = "index.html"; + }).catch((error) => { + window.alert("An error occured " + error.message); + }); +} +); +}); +}); + +//Get Current user UID +function getUser(id) { + db.collection("Volunteers").where("userUID", "==", id).get().then((snapshot) => { + snapshot.docs.forEach(doc => { + console.log(Object.keys(doc.data())); + // const docObj = Object.keys(doc.data()); + renderProfile(doc,id); + }) + }); +} +const profileInfo = document.getElementById("Profile"); +profileInfo.classList.add("m-3"); +const Skills = document.getElementById("Skills"); + +//Render current user's profile info +function renderProfile(doc,uid) { + + let idElement = document.createElement("div"); + let name = document.createElement("h3"); + let age = document.createElement("p"); + let skills = document.createElement("p"); + let hours = document.createElement("p"); + let events = document.createElement("p"); + //let userRating = document.createElement("img"); + + const rating = doc.data()["User Rating"]; + idElement.setAttribute("data-id", doc.id); + name.textContent = doc.data().Name; + name.classList.add('mb-3'); + age.textContent = doc.data().Age + " years old";; + skills.textContent = doc.data().Skills; + hours.textContent = doc.data()["Total Hours"] + " Total Hours"; + skills.classList.add("pt-3"); + skills.style.fontSize = "1rem"; + // console.log(docObj.Age); + events.textContent = doc.data()["Total Events"] + " Total Events"; + idElement.append(name, age, hours, events); + profileInfo.appendChild(idElement); + Skills.appendChild(skills); + console.log("rating"); + //Check user rating to display corresponding image + if (rating == 1|| !rating) { + const curr = document.getElementById("gray1"); + curr.setAttribute("src", "res/img/general/InvolvementLevel/color-1.png"); + //curr.style.display = "none"; + } + else if (rating == 2) { + const curr = document.getElementById("gray2"); + curr.setAttribute("src", "res/img/general/InvolvementLevel/color-2.png"); + } + else if (rating == 3) { + const curr = document.getElementById("gray3"); + curr.setAttribute("src", "res/img/general/InvolvementLevel/color-3.png"); + } + else if (rating == 4) { + const curr = document.getElementById("gray4"); + curr.setAttribute("src", "res/img/general/InvolvementLevel/color-4.png"); + } + + //Edit Profile + const editBtn = document.getElementById("EditBtn"); + const field1 = document.getElementById("editName"); + const editNameLabel = document.getElementById("editNameLabel"); + const field2 = document.getElementById("editAge"); + const editAgeLabel = document.getElementById("editAgeLabel"); + const field3 = document.getElementById("editSkills"); + const saveBtn = document.getElementById("SaveBtn"); + editBtn.addEventListener("click", evt => { + console.log('clicked'); + editBtn.text = "Cancel"; + field1.setAttribute('value', doc.data().Name); + field2.setAttribute('value', doc.data().Age); + field3.value = doc.data().Skills; + field1.hidden = false; + editNameLabel.hidden = false; + field2.hidden = false; + editAgeLabel.hidden = false; + field3.hidden = false; + saveBtn.hidden = false; + profileInfo.style.display = 'none'; + Skills.style.display = 'none'; + + editBtn.addEventListener('click', function(){ + window.location.href = "profile.html"; + }) + + saveBtn.addEventListener('click', function(e){ + const updatedName = field1.value; + const updatedAge = field2.value; + const updatedSkills = field3.value; + console.log(updatedName); + let nameRef = db.collection("Volunteers").doc(uid); + nameRef.update({ + "Name" : updatedName, + "Age": updatedAge, + "Skills": updatedSkills + }).then(function(r){ + window.location.href="profile.html"; + }).catch(function(e){ + Window.alert("Error "+e+" Could not update your profile"); + }) + }) + + +// saveBtn.addEventListener('click',e=>{ +// const nameRef = doc(db ,"Volunteers",name); +// await firebase.firestore.updateDoc(nameRef,{ +// "Name" : field1.value +// }); +// }); + + }); + + +} diff --git a/public/js/registration.js b/public/js/registration.js new file mode 100644 index 0000000..44d9f97 --- /dev/null +++ b/public/js/registration.js @@ -0,0 +1,71 @@ + +const userEmail = document.getElementById('Email'); +const userPassword = document.getElementById('Pswd'); +const checkUserPassword = document.getElementById('rePswd'); +const btnSignIn = document.getElementById('btnSignIn'); +const checkbox = document.getElementById('privacyCheckBox'); +const auth = firebase.auth(); + +//Firebase new user sign in +btnSignIn.addEventListener('click', e => { + const email = userEmail.value; + const password = userPassword.value; + const checkPassword = checkUserPassword.value; + //checking to make sure all fields have been filled + // if (email != "" && password != "") { + //checking if the re-entered password matches the first password + if (password === checkPassword) { + //checking if the user has accepted the privacy policy + if (checkbox.checked) { + firebase.auth().createUserWithEmailAndPassword(email, password) + .then(() => { + // Signed in + window.alert('Signed In Successfully'); + // var user = userCredential.user; + // console.log("user"+user); + + // const currUser = firebase.auth().currentUser.uid; + // console.log(firebase.auth().currentUser.uid); + const user = auth.currentUser.uid; + console.log(user); + var volunteerRef = db.collection('Volunteers').doc(auth.currentUser.uid); + volunteerRef.set({ + "Age": 0, + "Name": "Enter Name", + "Skills": "Edit your profile to enter your skills.", + "Total Events": 0, + "Total Hours": 0, + "User Rating": [1], + "userUID": user + }) + .then(() => { + + console.log("Document successfully written!"); + window.location.href = "profile.html"; + }) + .catch((error) => { + console.log("Error writing document: ", error); + }) + + // Add a new document in collection + + }).catch((error) => { + var errorCode = error.code; + var errorMessage = error.message; + window.alert('Error: ' + errorMessage); + console.log(errorCode); + }); + } + else { + window.alert("Please read and accept our Privacy Policy before signing in"); + } + } + else { + window.alert("Passwords do not match"); + } + + // } + // else { + // window.alert("Please fill out all fields."); + // } +}); diff --git a/public/login.html b/public/login.html index 64a4e10..afc9cdb 100644 --- a/public/login.html +++ b/public/login.html @@ -1,41 +1,276 @@ - + - VoluntYOU | Login + VoluntYOU | Login + + + + + + + + + + + + + - + + + + + + + +
    +
    +
    +
    +
    + +
    + +
    +

    Login

    + +
    + + +
    + + +
    +
    + + +
    Valid
    +
    +
    + + +
    + +
    + +
    +
    +
    +
    +
    + + +
    +
    +
    + +
    + Facebook Icon +
    + +
    + Instagram Icon +
    + +
    + Email Icon +
    + +
    + Linkedin Icon +
    + +
    + +
    +
    + Copyright 2021 Julianna Schneider. All Rights Reserved. Patent Pending. Registered + Domestic Nonprofit + Corporation. +
    + +
    + https://firebase.google.com/docs/web/setup#available-libraries --> - + + + + + + + + + + + + + + + diff --git a/public/profile.html b/public/profile.html new file mode 100644 index 0000000..61ae072 --- /dev/null +++ b/public/profile.html @@ -0,0 +1,264 @@ + + + + + VOLUNT YOU| Volunteer Profile + + + + + + + + + + + + + + + + + + +
    +
    +
    + Profile Image +
    +
    +
    +
    + + + + + + +
    +
    + +
    +
    Log Out
    +
    + +
    +
    +
    +

    My Involvement Level

    +
    +
    +
    + + +
    + + + + + +
    + +
    +
    +

    My Skills

    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    + Facebook Icon +
    + +
    + Instagram Icon +
    + +
    + Email Icon +
    + +
    + Linkedin Icon +
    + +
    + + +
    +
    + Copyright 2021 Julianna Schneider. All Rights Reserved. Patent Pending. + Registered + Domestic Nonprofit + Corporation. +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/registration.html b/public/registration.html new file mode 100644 index 0000000..f915bea --- /dev/null +++ b/public/registration.html @@ -0,0 +1,251 @@ + + + + + + VoluntYOU | Register + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + +
    +
    +

    Sign Up

    + +
    + + +
    + +
    +
    + + + +
    +
    +
    + + +
    + + +
    +
    +
    +
    +
    + + +
    +
    +
    + +
    + Facebook Icon +
    + +
    + Instagram Icon +
    + +
    + Email Icon +
    + +
    + Linkedin Icon +
    + +
    + + +
    +
    + Copyright 2021 Julianna Schneider. All Rights Reserved. Patent Pending. Registered + Domestic Nonprofit + Corporation. +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/res/img/general/InvolvementLevel/color-1.png b/public/res/img/general/InvolvementLevel/color-1.png new file mode 100644 index 0000000..5fbe3a1 Binary files /dev/null and b/public/res/img/general/InvolvementLevel/color-1.png differ diff --git a/public/res/img/general/InvolvementLevel/color-3.png b/public/res/img/general/InvolvementLevel/color-3.png new file mode 100644 index 0000000..ca2cef2 Binary files /dev/null and b/public/res/img/general/InvolvementLevel/color-3.png differ diff --git a/public/res/img/general/InvolvementLevel/color-4.png b/public/res/img/general/InvolvementLevel/color-4.png new file mode 100644 index 0000000..7671c93 Binary files /dev/null and b/public/res/img/general/InvolvementLevel/color-4.png differ diff --git a/public/res/img/general/InvolvementLevel/gray-1.png b/public/res/img/general/InvolvementLevel/gray-1.png new file mode 100644 index 0000000..88875a4 Binary files /dev/null and b/public/res/img/general/InvolvementLevel/gray-1.png differ diff --git a/public/res/img/general/InvolvementLevel/gray-2.png b/public/res/img/general/InvolvementLevel/gray-2.png new file mode 100644 index 0000000..5047596 Binary files /dev/null and b/public/res/img/general/InvolvementLevel/gray-2.png differ diff --git a/public/res/img/general/InvolvementLevel/gray-3.png b/public/res/img/general/InvolvementLevel/gray-3.png new file mode 100644 index 0000000..52d5697 Binary files /dev/null and b/public/res/img/general/InvolvementLevel/gray-3.png differ diff --git a/public/res/img/general/InvolvementLevel/gray-4.png b/public/res/img/general/InvolvementLevel/gray-4.png new file mode 100644 index 0000000..e567202 Binary files /dev/null and b/public/res/img/general/InvolvementLevel/gray-4.png differ diff --git a/public/res/img/general/account.png b/public/res/img/general/account.png new file mode 100644 index 0000000..c4ba0d5 Binary files /dev/null and b/public/res/img/general/account.png differ diff --git a/public/test.html b/public/test.html new file mode 100644 index 0000000..73bd449 --- /dev/null +++ b/public/test.html @@ -0,0 +1,448 @@ + + + + + + VoluntYOU | Official Homepage + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + +
    +
    +
    + + VoluntYou Logo + +
    + Download on the App Store + Download on the App Store +
    + +
    +
    +
    + + +
    +
    +
    + +
    + +
    + +
    +
    +

    Volunteers

    +
    +
    +
    +
    + Volunteer Profile Page +
    +
    +
    +
    +
    +
    + + + + + + + + + + + +
    +
    +
    +
    +

    The Volunteer Profile is your home base. It’s where + VoluntYOU keeps + track of your aggregate statistics, such as the + total hours you’ve spent volunteering and total number of events you’ve attended. It’s also where + you can edit the + information you share with community service organizations, such as your relevant skillset, when + you request to attend + their events.

    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +

    CSOs

    +
    +
    +
    +
    + CSO Profile Page +
    +
    +
    +
    +
    +
    + + + + + + + + + + + +
    +
    +
    +
    +

    The CSO Profile is your main platform for connecting with + volunteers on VoluntYOU. By providing a mission statement, + location, and contact information, you share your purpose with a community of like-minded helpers. +

    +
    +
    +
    + + +
    +
    +
    +
    + +
    +

    Academic Institutions

    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + +
    +
    +
    +
    +

    Through the student roster, you review requests from VoluntYOU + volunteers who would like to register as part of your + academic institution. The requests you approve appear under the “Create PDF Report” button and are + included in + VoluntYOU’s auto-generated student report. +

    +
    +
    +
    + + +
    +
    +
    +
    + +
    + +
    + +
    + + +
    + +
    +
    +

    Ready to try it out?

    + Download on the App Store +
    +
    + +
    +
    +
    + +
    + Facebook Icon +
    + +
    + Instagram Icon +
    + +
    + Email Icon +
    + +
    + Linkedin Icon +
    + +
    + + +
    +
    + Copyright 2021 Julianna Schneider. All Rights Reserved. Patent Pending. Registered + Domestic Nonprofit + Corporation. +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file