forked from dinesh0085/Shemrush-Clone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.js
227 lines (178 loc) · 7.26 KB
/
data.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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
data=[
{img:"https://www.semrush.com/company/static/images/trusted-providers_website-traffic-data.c9045de1e1c29f83613e81d5fd389e47.svg",
atag:"Website traffic data",
ptag:"Website traffic spikes & decline in any industry. Shifts in user behaviour."
},
{img:"https://www.semrush.com/company/static/images/trusted-providers_online-search-volume-trends.bf67ec775a5f5e45eee68b83b1ffc593.svg",
atag:"Website traffic data",
ptag:"Website traffic spikes & decline in any industry. Shifts in user behaviour."
},
{img:"https://www.semrush.com/company/static/images/trusted-providers_advertising-data.e4e5fd6480b87dfac6086ca4d4645067.svg",
atag:"Website traffic data",
ptag:"Website traffic spikes & decline in any industry. Shifts in user behaviour."
},
{img:"https://www.semrush.com/company/static/images/trusted-providers_social-media-data.dbda8c86bc5cfaf951f18188f2fe1396.svg",
atag:"Website traffic data",
ptag:"Website traffic spikes & decline in any industry. Shifts in user behaviour."
},
{img:"https://www.semrush.com/company/static/images/trusted-providers_brand-mentions.d8ff2e52f1de079737b729a3f4191691.svg",
atag:"Website traffic data",
ptag:"Website traffic spikes & decline in any industry. Shifts in user behaviour."
},
]
let selecttype=document.getElementById("dataproviderdiv")
function append(){
data.forEach(element => {
// console.log(data)
let atag=document.createElement("a")
atag.href="#"
atag.setAttribute("id","atagg")
let selectdiv=document.createElement("div")
selectdiv.setAttribute("class","selectdiv")
let imgdiv=document.createElement("div")
imgdiv.setAttribute("class","imgdiv")
let img=document.createElement("img")
img.setAttribute("class","selectimg")
img.src=element.img
let heading_div=document.createElement("div")
heading_div.setAttribute("class","heading_div_a")
let heading=document.createElement("h1")
heading.setAttribute("class","aselect")
heading.innerText=element.atag
let heading_div_p=document.createElement("div")
heading_div_p.setAttribute("class","heading_div_p")
let heading_div_ptag=document.createElement("p")
heading_div_ptag.setAttribute("class","pselect")
heading_div_ptag.innerText=element.ptag
heading_div_p.append(heading_div_ptag)
heading_div.append(heading)
imgdiv.append(img)
selectdiv.append(imgdiv,heading_div,heading_div_p)
// document.getElementById("atagg")
// atag.append(selectdiv)
selecttype.append(selectdiv)
});
}
append()
// .......................
let dataArray=[
{
atag:"USA TODAY",
ptag:"Dawn Gilbertson",
img:"https://www.semrush.com/company/static/images/trusted-provider_usa-today.e4482a2d4979e4d814e65814dfccac3b.webp",
p2tag:"Copyright © Gannett Co., Inc."
},
{
atag:"USA TODAY",
ptag:"Dawn Gilbertson",
img:"https://www.semrush.com/company/static/images/trusted-provider_usa-today.e4482a2d4979e4d814e65814dfccac3b.webp",
p2tag:"Copyright © Gannett Co., Inc."
},
{
atag:"USA TODAY",
ptag:"Dawn Gilbertson",
img:"https://www.semrush.com/company/static/images/trusted-provider_usa-today.e4482a2d4979e4d814e65814dfccac3b.webp",
p2tag:"Copyright © Gannett Co., Inc."
},
{
atag:"USA TODAY",
ptag:"Dawn Gilbertson",
img:"https://www.semrush.com/company/static/images/trusted-provider_usa-today.e4482a2d4979e4d814e65814dfccac3b.webp",
p2tag:"Copyright © Gannett Co., Inc."
},
{
atag:"USA TODAY",
ptag:"Dawn Gilbertson",
img:"https://www.semrush.com/company/static/images/trusted-provider_usa-today.e4482a2d4979e4d814e65814dfccac3b.webp",
p2tag:"Copyright © Gannett Co., Inc."
},
{
atag:"USA TODAY",
ptag:"Dawn Gilbertson",
img:"https://www.semrush.com/company/static/images/trusted-provider_usa-today.e4482a2d4979e4d814e65814dfccac3b.webp",
p2tag:"Copyright © Gannett Co., Inc."
},
]
let arrowdiv=document.querySelector("#arrowchangeid")
let buttn1=document.querySelector(".bttnarow1");
let arrowdivnum=0;
buttn1.addEventListener("click",function(){
console.log("bjhb")
if(arrowdivnum==0){
arrowdivnum=dataArray.length-1;
console.log(dataArray)
}else{
arrowdivnum--;
}
img.src=dataArray[arrowdivnum]
});
let buttn2=document.querySelector(".bttnarow2");
buttn2.addEventListener("click",function(){
console.log("bjhwb")
if(arrowdivnum==dataArray.length-1){
arrowdivnum=0;
console.log(dataArray)
}else{
arrowdivnum++;
}
arrowdiv=dataArray[arrowdivnum]
});
data3=[{
img:"https://cdn-company2.semrush.com/dpp/cover_preview/f373643004234a29bd8fad3c3acce343.png",
atag:"Digital Market Shifts in the Fashion Industry in 2021"
},
{
img:"https://cdn-company2.semrush.com/dpp/cover_preview/20802407a71c42daba4577ed58743eed.png",
atag:"Digital Market Shifts in the Fashion Industry in 2021"
},
{
img:"https://cdn-company2.semrush.com/dpp/cover_preview/9fd93308ed804435821f0682292f9e6e.png",
atag:"Digital Market Shifts in the Fashion Industry in 2021"
},
{
img:"https://cdn-company2.semrush.com/dpp/cover_preview/7146b992830c4ceb889ee586cf0d6e24.jpg",
atag:"Digital Market Shifts in the Fashion Industry in 2021"
},
{
img:"https://cdn-company2.semrush.com/dpp/cover_preview/f373643004234a29bd8fad3c3acce343.png",
atag:"Digital Market Shifts in the Fashion Industry in 2021"
},
{
img:"https://cdn-company2.semrush.com/dpp/cover_preview/f373643004234a29bd8fad3c3acce343.png",
atag:"Digital Market Shifts in the Fashion Industry in 2021"
},]
let bottomdiv=document.getElementById("bottomdiv")
function append2(){
data3.forEach(element => {
// console.log(data)
// let atag=document.createElement("a")
// atag.href="#"
// atag.setAttribute("id","atagg")
let selectdiv=document.createElement("div")
selectdiv.setAttribute("class","selectdiv2")
let imgdiv=document.createElement("div")
imgdiv.setAttribute("class","imgdiv2")
let img=document.createElement("img")
img.setAttribute("class","selectimg2")
img.src=element.img
let heading_div=document.createElement("div")
heading_div.setAttribute("class","heading_div_a2")
let heading=document.createElement("a")
heading.href="#"
heading.setAttribute("class","aselect3")
heading.innerText=element.atag
// let heading_div_p=document.createElement("div")
// heading_div_p.setAttribute("class","heading_div_p")
// let heading_div_ptag=document.createElement("p")
// heading_div_ptag.setAttribute("class","pselect")
// heading_div_ptag.innerText=element.ptag
// heading_div_p.append(heading_div_ptag)
heading_div.append(heading)
imgdiv.append(img)
selectdiv.append(imgdiv,heading_div)
// document.getElementById("atagg")
// atag.append(selectdiv)
bottomdiv.append(selectdiv)
});
}
append2()