Skip to content

Commit

Permalink
still testing smile
Browse files Browse the repository at this point in the history
  • Loading branch information
dmk14013 committed Apr 19, 2018
1 parent 1bc9bbe commit ef043e9
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 51 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@



<div id="password" class="">
<div id="password" class="hidden">
<!-- some webcam video link -->
<h1>How 'bout a smile?</h1>
<p>Smile for the camera to enter the page</p>
<smile-to-unlock api-key="1fd73c6345e449ee8f8b0febc33cf300"></smile-to-unlock>
</div>


<div id="tupperware" class="hidden">
<div id="tupperware" class="">
<div id="content" clss="clearfix">
<header>
<h1>Scripting for the Web Roster</h1>
Expand Down
109 changes: 60 additions & 49 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,7 @@ function Student(name, title, email, bio, img){
printProfile(this.name, this.title, this.email, this.bio, this.img)
}

var david = new Student('David Kerr', 'Dork', 'david.m.kerr@uconn.edu', '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.', 'https://vignette.wikia.nocookie.net/gundam/images/5/5e/Gundam_Exia_LOL.jpg/revision/latest?cb=20101019165531');
var emilyR = new Student('Emily Ruffell', 'Can you read for the class?', 'reviveVine@vine4ever.com', 'What up, I\'m Emily, I\'m twenty-three and I never fucking learned how to read.', 'https://files.slack.com/files-pri/T040V7VBL-FA9KYBBL4/emilyr.png')

classList = ['Amanda Brickner', 'Daniel Bean', 'David Kerr', 'Emily McAndrew', 'Max Nonken', 'Rachel Sarnie', 'Emily Ruffell'];


var tupperware = document.querySelector('#content');
var smile = document.querySelector('#password');


var locker = document.querySelector('smile-to-unlock');
locker.start();

locker.addEventListener('userSmiled', function (ev) {
// --> Add the code to show the free content here <--
smile.classList.remove('hidden');
tupperware.classList.add('hidden');


locker.end(); // End the locker so the camera is shutdown
})


function addImage(src = 'https://www.sparklabs.com/forum/styles/comboot/theme/images/default_avatar.jpg'){
Expand Down Expand Up @@ -86,47 +66,78 @@ function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}

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



submit.addEventListener('click', function(){
var fname = document.querySelector('#userfname').value;
var lname = document.querySelector('#userlname').value;

fname = capitalizeFirstLetter(fname);
lname = capitalizeFirstLetter(lname);
document.addEventListener("DOMContentLoaded", function() {

var name = (fname + ' ' + lname);
var locker = document.querySelector('smile-to-unlock');
locker.start();

var title = document.querySelector('#usertitle').value;
title = capitalizeFirstLetter(title);
var email = document.querySelector('#useremail').value;
var bio = document.querySelector('#userbio').value;
var img = document.querySelector('#userimg').value;
locker.addEventListener('userSmiled', function (ev) {
// --> Add the code to show the free content here <--
smile.classList.remove('hidden');
tupperware.classList.add('hidden');

if (img == ''){
img = 'https://www.sparklabs.com/forum/styles/comboot/theme/images/default_avatar.jpg';
}

if (fname == ''){
alert('Please enter a first name');
}
else if (lname == ''){
alert('Please enter a last name');
}
else{
var newStudent = new Student(name, title, email, bio, img);
}
locker.end(); // End the locker so the camera is shutdown
})


var david = new Student('David Kerr', 'Dork', 'david.m.kerr@uconn.edu', '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.', 'https://vignette.wikia.nocookie.net/gundam/images/5/5e/Gundam_Exia_LOL.jpg/revision/latest?cb=20101019165531');
var emilyR = new Student('Emily Ruffell', 'Can you read for the class?', 'reviveVine@vine4ever.com', 'What up, I\'m Emily, I\'m twenty-three and I never fucking learned how to read.', 'https://files.slack.com/files-pri/T040V7VBL-FA9KYBBL4/emilyr.png')
var max = new Student('Max Nonken', 'Adventure Seeker', 'max.nonken@uconn.edu', 'I’m just trying to live everyday to the fullest.', 'https://files.slack.com/files-pri/T040V7VBL-FA9TQ4PQA/max.jpg')
classList = ['Amanda Brickner', 'Daniel Bean', 'David Kerr', 'Emily McAndrew', 'Max Nonken', 'Rachel Sarnie', 'Emily Ruffell'];


var tupperware = document.querySelector('#content');
var smile = document.querySelector('#password');


document.getElementById('addstudent').reset();
});



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



submit.addEventListener('click', function(){
var fname = document.querySelector('#userfname').value;
var lname = document.querySelector('#userlname').value;

fname = capitalizeFirstLetter(fname);
lname = capitalizeFirstLetter(lname);

var name = (fname + ' ' + lname);

var title = document.querySelector('#usertitle').value;
title = capitalizeFirstLetter(title);
var email = document.querySelector('#useremail').value;
var bio = document.querySelector('#userbio').value;
var img = document.querySelector('#userimg').value;

if (img == ''){
img = 'https://www.sparklabs.com/forum/styles/comboot/theme/images/default_avatar.jpg';
}

if (fname == ''){
alert('Please enter a first name');
}
else if (lname == ''){
alert('Please enter a last name');
}
else{
var newStudent = new Student(name, title, email, bio, img);
}


document.getElementById('addstudent').reset();
});


});


0 comments on commit ef043e9

Please sign in to comment.