Skip to content

Commit

Permalink
still touching up, tried adding a delete button
Browse files Browse the repository at this point in the history
  • Loading branch information
dmk14013 committed Apr 18, 2018
1 parent 44fe3c5 commit 1a455ad
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 13 deletions.
14 changes: 12 additions & 2 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,17 @@ img{
}
#addstudent{
width:100%;
padding:5%;
padding:0 5% 5% 5%;
}
button{
color:#151515;
background-color:white;
border-width:0;
border-radius:5px;
}
button:hover{
background-color:#151515;
color:#ffb732;
}
textarea{
height:100px;
Expand Down Expand Up @@ -171,7 +181,7 @@ input, textarea{
border-width:0;
padding:5px;
}
input:focus{
input:focus, textarea:focus, button:focus{
outline:0;
}

Expand Down
39 changes: 28 additions & 11 deletions js/main.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@


var davidBio = 'I\'m a DMD student at UConn working on a concentration in web design. I like sci-fi robots and spaceships, and enjoy building models of them.'


classImg = []
classList = ['Amanda Brickner', 'Daniel Bean', 'David Kerr', 'Emily McAndrew', 'Max Nonken', 'Rachel Sarnie', 'Emily Ruffell']
classTitle = ['', '', '', '', '', '', '']
classBio = ['', '', '', '', '', '', '']
classEmail = ['', '', '', '', '', '', '']
classTitle = ['', '', 'Dork', '', '', '', '']
classBio = ['', '', davidBio, '', '', '', '']
classEmail = ['', '', 'david.m.kerr@uconn.edu', '', '', '', '']


var tupperware = document.querySelector("#content");
Expand Down Expand Up @@ -78,22 +81,25 @@ function createProfile(name, title, bio, email, src){
newDiv.appendChild(createTitle(title));
newDiv.appendChild(createEmail(email));
newDiv.appendChild(createBio(bio));


/*newDiv.appendChild(img);
newDiv.appendChild(name);
newDiv.appendChild(title);
newDiv.appendChild(bio);
newDiv.appendChild(email);*/
/*var newbutton = document.createElement("button");
newbutton.innerHTML = 'Delete';
newDiv.appendChild(newbutton);
newbutton.id = 'deleteDiv';*/

content.appendChild(newDiv);
}

printProfile();



submit.addEventListener("click", function(event){
event.preventDefault();
})



submit.addEventListener("click", function(){
var fname = document.querySelector("#userfname").value;
var lname = document.querySelector("#userlname").value;
Expand All @@ -104,10 +110,21 @@ submit.addEventListener("click", function(){
var email = document.querySelector("#useremail").value;
var bio = document.querySelector("#userbio").value;

createProfile(name, title, bio, email);
if (fname == ''){
alert('Please enter a first name');
}
else if (lname == ''){
alert('Please enter a last name');
}
else{
createProfile(name, title, bio, email);
}

/*document.querySelector("#deleteDiv").addEventListener("click", function(){
newDiv.classList.add("hidden");
})*/

document.getElementById("addstudent").reset();
console.log(classList)
});


Expand Down

0 comments on commit 1a455ad

Please sign in to comment.