-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts2.js
More file actions
245 lines (189 loc) · 4.85 KB
/
Copy pathscripts2.js
File metadata and controls
245 lines (189 loc) · 4.85 KB
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
// counter project
// let btn=document.querySelector("#btn")
// let h1= document.querySelector('h1')
// let btn1= document.querySelector('#btn1')
// let a =0;
// btn.addEventListener('click',function(){
// a++;
// h1.innerText=a;
// })
// a=0;
// btn1.addEventListener('click',function(){
// a--;
// h1.innerText=a;
// });
//basic project for js light on offfff
// let bulb= document.querySelector("#bulb")
// let a= document.querySelector("button")
// let count=0;
// a.addEventListener('click',function(){
// if(count==0){
// bulb.style.backgroundColor="yellow"
// console.log("light on ");
// count++;
// }else{
// bulb.style.backgroundColor="transparent"
// console.log("light off");
// count--;
// }
// }
// )
// project one add frinends and remove friends
// var a= document.querySelector("h4");
// var add= document.querySelector("#add");
// var count=0;
// add.addEventListener("click",function(){
// if(count==0){
// a.style.color="green";
// a.innerHTML="Friend";
// count++;
// }else{
// a.style.color="red"
// a.innerHTML="Stranger"
// count--;
// }
// })
// project no 2
// var card= document.querySelector("#card")
// var img= document.querySelector("img")
// card.addEventListener("dblclick",function(){
// console.log("abhiii bahaiiiiiiiiii ");
// })
// var card = document.querySelector("#card");
// card.addEventListener("dblclick", function () {
// console.log("Double Click Working!");
// });
//project 3 random color
// var a= document.querySelector("#box")
// var btn= document.querySelector("button")
// btn.addEventListener("click",function(){
// var c1 =Math.floor(Math.random()*256)
// var c2 =Math.floor(Math.random()*256)
// var c3 =Math.floor(Math.random()*256)
// a.style.backgroundColor=`rgb(${c1},${c2},${c3})`
// })
//project 4
// var arr=[{
// team:"Csk",
// pramary:"gold",
// secondary:"yellow",
// capton: "MSD",
// wintime:"5"
// },
// {
// team:"RCB",
// pramary:"red",
// secondary:"crimson",
// capton: "Virat",
// wintime:"1"
// },
// {
// team:"KKR",
// pramary:"blue",
// secondary:"navy",
// capton: "Rahane",
// wintime:"3"
// },
// {team:"Pbks",
// pramary:"red",
// secondary:"lightgold",
// capton: "sheryas",
// wintime:"0"
// },
// {
// team:"Mi",
// pramary:"skyblue",
// secondary:"lightblue",
// capton: "Hardik",
// wintime:"5"
// },
// {
// team:"Srh",
// pramary:"skyblue",
// secondary:"orange",
// capton: "pat cummins",
// wintime:"2"
// },
// {
// team:"lackhnow",
// pramary:"aqua",
// secondary:"tranparent",
// capton: "Rishabh",
// wintime:"0"
// },
// {
// team:"GT",
// pramary:"pink",
// secondary:"white",
// capton: "Shubhman",
// wintime:"1"
// },
// {
// team:"DC",
// pramary:"lightblue",
// secondary:"lightblue",
// capton: "Axer",
// wintime:"0",
// },
// {
// team:"RR",
// pramary:"pink",
// secondary:"lightpink",
// capton: "Sanju",
// wintime:"1",
// },
// ];
// // var a= Math.floor(Math.random()*arr.length)
// // console.log(arr[a]);
// var main= document.querySelector("main")
// var h1= document. querySelector("h1")
// var btn= document.querySelector("button")
// var h2=document.querySelector("h2")
// var h3=document.querySelector("h3")
// btn.addEventListener("click",function(){
// var a= Math.floor(Math.random()*arr.length)
// h1.innerHTML=arr[a].team
// h1.style.backgroundColor = arr[a].pramary
// main.style.backgroundColor = arr[a].secondary
// h2.innerHTML=arr[a].capton
// h3.innerHTML=arr[a].wintime
// })
//projet no 5
//random paper generate
// var btn= document.querySelector("button")
// var main= document.querySelector("main")
// btn.addEventListener("click",()=>{
// var div = document.createElement("div")
// div.style.height="50px"
// div.style.width="50px"
// var x= Math.random()*100
// var y= Math.random()*100
// var z= Math.random()*100
// var c1= Math.floor(Math.random()*256)
// var c2= Math.floor(Math.random()*256)
// var c3= Math.floor(Math.random()*256)
// div.style.position="absolute"
// div.style.left= x+"%"
// div.style.top= y+"%"
// div.style.rotate=z+"deg"
// div.style.backgroundColor=`rgb(${c1},${c2},${c3})`
// main.appendChild(div)
// })
var btn =document.querySelector("button")
var main= document.querySelector("main")
var arr =["abhi is a greate","i am a ginious frontend devloer","my salary is 4.5lpa","my interview schedule with harsh bhaiyaa"];
btn. addEventListener("click",function(){
var h1= document.createElement("h1")
var a = Math.floor(Math.random()*arr.length)
var x= Math.random()*100
var y= Math.random()*100
var r=Math.random()*180
var scl=Math.random()*3
h1.innerHTML=arr[a]
h1.style.position="absolute"
h1.style.left=x+"%"
h1.style.top=y+"%"
h1.style.rotate=r+"deg"
h1.style.scale=scl
main.appendChild(h1)
})