-
Notifications
You must be signed in to change notification settings - Fork 1
/
filter.html
136 lines (101 loc) · 3.98 KB
/
filter.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./style/header.css">
<link rel="stylesheet" href="./style/myprof.css">
<link rel="stylesheet" href="./style/notification.css">
<link rel="stylesheet" href="./style/threedotspop.css">
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" />
<style>
.img-wrapper{
flex-wrap: wrap;
height: 400px;
width: 410px;
margin-left: 25px;
margin-bottom: 25px;
}
h1{
font-size: 55px;
margin-left: 25px;
}
</style>
</head>
<body>
<div id="showmydata"></div>
<script type="module">
import { header} from "./components/header.js"
import {filter} from "./components/filterfilter.js"
import {profile} from './components/profile.js'
import {Notification} from './components/notification.js'
import threeDotsPop from "./components/threedotspop.js"
document.body.append(header());
document.body.append(Notification());
document.body.append(profile());
document.body.append(threeDotsPop());
let queryData = JSON.parse(localStorage.getItem("query"))
let showmydata = document.getElementById('showmydata')
showmydata.style.marginTop = "120px"
showmydata.innerHTML = "";
showmydata.style.marginLeft = "20px"
let mydata = document.querySelector('.myinput')
mydata.value = `${queryData[queryData.length-1]}`
console.log(queryData[queryData.length-1])
let h1 = document.createElement("h1")
h1.style.marginBottom = "50px"
h1.innerHTML = `${queryData[queryData.length-1]}`
showmydata.append(h1);
let divWrapper = document.createElement("div")
function displayData(){
for(var i = 0; i < queryData.length-1; i++){
var img = document.createElement("img")
img.src = queryData[i]
img.setAttribute("class","img-wrapper")
// img.style.display = "flex-wrap"
// img.style.gap = "50px"
// img.style.width = "400px"
// img.style.height = "400px"
showmydata.append(img)
}
}
displayData()
mydata.addEventListener('keypress',function(event){
if(event.key == "Enter"){
filter(mydata.value).then((res)=>{
showmydata.style.marginTop = "120px"
showmydata.innerHTML = "";
showmydata.style.marginLeft = "20px"
//console.log(res)
let h1 = document.createElement('h1')
h1.innerHTML = mydata.value
h1.style.marginBottom = "50px"
showmydata.style.marginTop = "150px"
showmydata.append(h1)
showmydata.append(res)
})
// console.log(mydata.value)
}
})
document.getElementById("hamberbur").addEventListener("click", function(){
console.log("hi")
appearDotsDiv()
})
let flag = 0
function appearDotsDiv(){
if(flag==0){
document.querySelector(".dots-div").style.display = "block"
flag = 1
}
else{
document.querySelector(".dots-div").style.display = "none"
flag = 0
}
}
</script>
<script src="./components/menutoggle.js"></script>
<script src="./components/notificationtoggle.js"></script>
</body>
</html>