-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.html
112 lines (80 loc) · 3.04 KB
/
index.html
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My Store</title>
<script src="./include/prodbs.js"></script>
<link href="style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" />
</head>
<body>
<div class="container">
<div class="header"><a href="#"><img src="./logo2.jpg" alt="not found" name="Insert_logo" width="20%" height="90" id="Insert_logo" style="background-color: #8090AB; display:block;" /></a>
</div>
<div class="button">
<button id="btn001" type="button">Sign Up!</button>
<button id="btn002" type="button" class="fas fa-shopping-cart fa-2x"></button>
</div>
<!-----search bar----->
<form class="srcbartn" action="search.html" >
<input type="text" id="srch001" placeholder="Product Search.." name="search" onclick="listFunction()" onkeyup="searchFunction()" autocomplete = "off">
<button type="submit" ><i class="fa fa-search"></i></button>
<ul id="productline"></ul>
</form>
<script>
function listFunction(){
var prdlin = document.getElementById("productline");
var allist = "" ;
for (i = 0 ; i < prodb.length ; i++)
{
allist += "<li id= 'liid" + i + "'><a href='product.html'>" + prodb[i].pname + "</a><li>" ;
}
prdlin.innerHTML += allist;
var onclikoff = document.getElementById("srch001");
onclikoff.removeAttribute("onclick");
}
function searchFunction(){
var input, filter, i, txtValue ;
input = document.getElementById("srch001");
filter = input.value.toUpperCase();
for (i = 0; i < prodb.length; i++) {
var idname = "liid" + i ;
var iddom = document.getElementById (idname);
txtValue = prodb[i].pname;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
iddom.style.display = "";
} else {
iddom.style.display = "none";
}
}
}
</script>
<!----- End search bar----->
<div class="content">
<h1>Welcome To Your Shop</h1><br/>
<h2>Featured Products</h2>
</div>
<!-------- products --------------->
<section class="products">
<div class="card">
<img src="./img/toy1.jpg" class="primg0" alt="unavailable" >
<h1>Plashy toy</h1>
<p><button onclick="document.location='product.html'">Go to Product</button></p>
</div>
<div class="card">
<img src="./img/toy2.jpg" class="primg0" alt="unavailable" >
<h1>Teddy Bear</h1>
<p><button onclick="document.location='product.html'">Go to Product</button></p>
</div>
<div class="card">
<img src="./img/gun1.jpg" class="primg0" alt="unavailable" >
<h1>Toy Gun</h1>
<p><button onclick="document.location='product.html'">Go to Product</button></p>
</div>
</section>
<!--------End Products -------->
<div class="footer">
</div>
</div>
</body>
</html>