-
Notifications
You must be signed in to change notification settings - Fork 2
/
ambrosiaJava.js
82 lines (66 loc) · 2.62 KB
/
ambrosiaJava.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
function displayLogin() {
}
var shopList = [];
function addToShopList(){ //adds a new item from the user to the shopping list
currfood = document.getElementById("foodName").value// finds the value that the user typed
shopList.push(currfood); //adds the item to the list
console.log(shopList); //prints to the console to test the function
}
// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
document.getElementById("myBtn").style.display = "block";
} else {
document.getElementById("myBtn").style.display = "none";
}
}
// When the user clicks on the button, scroll to the top of the document
function topFunction() {
document.body.scrollTop = 0; // For Safari
document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
}
function openCategory(evt, categoryName) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById(categoryName).style.display = "block";
evt.currentTarget.className += " active";
}
function openNav() {
document.getElementById("tab").style.width = "20vw";
document.getElementById("main").style.marginLeft = "20vw";
}
function closeNav() {
document.getElementById("tab").style.width = "0";
document.getElementById("main").style.marginLeft= "0";
}
function openLogin() {
document.getElementById('loginForm').style.height='30vw'
document.getElementById('loginForm').style.display='block'
// document.getElementById('loginStatus').style.display='none'
}
function closeLogin() {
document.getElementById('loginForm').style.height='0vw'
document.getElementById('loginForm').style.display='none'
// document.getElementById('loginStatus').style.display='block'
}
function openSignUp() {
document.getElementById('signUpForm').style.height='30vw'
document.getElementById('signUpForm').style.display='block'
// document.getElementById('signUpStatus').style.display='none'
}
function closeSignUp() {
document.getElementById('signUpForm').style.height='0vw'
document.getElementById('signUpForm').style.display='none'
// document.getElementById('signUpStatus').style.display='block'
}
function submitLogin() {
if
}