-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
247 lines (217 loc) · 6.53 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
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
245
246
247
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CheatSheet Clone 🙂</title>
<link rel="stylesheet" href="prism.css" />
<link rel="stylesheet" href="style.css" />
<link rel="icon" type="svg/icon" href="/copy.png" />
</head>
<body>
<nav>
<span class="logo"><img src="copy.png" alt="" /></span>
<div class="content center">CheatSheet Clone 🙂</div>
</nav>
<div class="container">
<ol>
<li>
<h1>HTML:</h1>
<p>This boilerplate code is for you can copy and enjoy!</p>
<pre
contenteditable="true"
class="language-html"
><code><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>(Title Name)</title>
</head>
<body>
<p>Game CheatSheet Code For You so Enjoy!</p>
</body>
</html></code></pre>
</li>
<li>
<h1>CSS:</h1>
<p>This boilerplate code is for you can copy and enjoy!</p>
<pre contenteditable="true" class="language-css">
<code>
<style>
.iphone.iphoneCam {
background-image: none;
background-color: #050007;
}
.iphone .inner {
background-image: url("Images/Backgrounds/image.jpg");
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.iphone .inner .top {
background-color: #262626b0;
border-top-left-radius: 40px;
border-top-right-radius: 40px;
}
.iphone .inner .top .right .using {
border-radius: 50%;
width: 5px;
height: 5px;
background-color: #4be640;
position: relative;
left: 5px;
top: -2px;
}
.iphone .inner .content .top {
display: flex;
justify-content: center;
background-color: #262626b0;
border-radius: 0;
height: 100px;
gap: 130px;
width: 100%;
}
.iphone .inner .content .top > * {
margin-top: 10px;
cursor: pointer;
}
.iphone .inner .content .bottom {
background-color: #262626b0;
border-bottom-left-radius: 40px;
border-bottom-right-radius: 40px;
height: 180px;
position: relative;
top: 184%;
width: 100%;
}
.iphone .inner .content .bottom .mode {
display: flex;
justify-content: center;
gap: 30px;
font-family: 'Compact';
position: relative;
bottom: 20px;
}
</style>
</code>
</pre>
</li>
<li>
<h1>JavaScript:</h1>
<p>This boilerplate code is for you can copy and enjoy!</p>
<pre
contenteditable="true"
class="language-js"
><code><span contenteditable="false">🤩Challenge Game Time 👍</span>
<!--
write a program that works out whether if a given year is a leap year or not?
A normal year has 365 days, leap years have 366, with an extra day in February. -->
var year = 2020;
debugger;
if(year % 4 === 0){
if(year % 100 === 0){
if(year % 400 === 0){
console.log("The year " + year + " is a leap year");
}else{
console.log("The year " + year + " is not a leap year");
}
}else{
console.log("The year " + year + " is a leap year");
}
}else{
console.log("The year " + year + " is not a leap year");
}
What is truthy and falsy values in Javascript?
we have total 5 falsy values in javascript
👉 0,"",undefined,null,NaN,false** is false anyway
if(score = 5){
console.log("OMG, we loss the game 😭");
}else{
console.log("Yay, We won the game 😀");
}
<!-- 2️⃣Conditional (ternary) operator
The conditional (ternary) operator is the only JavaScript operator
that takes three operands -->
var age = 17;
if(age >= 18){
console.log("you are eligible to vote");
}else
console.log("you are not eligible to vote");
}
var age = 18;
console.log((age >= 18) ? "you can vote" : "you can't vote");
<!--
3️⃣ switch Statement
Evaluates an expression, matching the expression's value to a
case clause, and executes statements associated with that case.
1st without break statment
Find the Area of circle, triangle and rectangle? -->
var area = "square" ;
var PI = 3.142, l=5, b=4, r=3;
if(area == "circle"){
console.log("the area of the circle is : " + PI*r**2);
}else if(area == "triangle"){
console.log("the area of the triangle is : " + (l*b)/2);
}else if(area == "rectangle"){
console.log("the area of the rectangle is : " + (l*b));
}else{
console.log("please enter valid data");
}
var area = "dsfsad" ;
var PI = 3.142, l=5, b=4, r=3;
switch(area){
case 'circle':
console.log("the area of the circle is : " + PI*r**2);
break;
case 'triangle':
console.log("the area of the triangle is : " + (l*b)/2);
break;
case 'rectangle':
console.log("the area of the rectangle is : " + (l*b));
break;
default:
console.log("please enter valid data");
}
<!-- 🤗break
Terminates the current loop, switch, or label
statement and transfers
program control to the statement following the terminated statement.
🤗continue
Terminates execution of the statements in the current iteration of the
current or labeled loop, and continues execution of the loop with the
next iteration.
4️⃣ While Loop Statement
The while statement creates a loop that executes a specified statement
as long as the test condition evaluates to true. -->
var num=20;
block scope
while(num <= 10){
console.log(num); infinte loop
num++;
}
5️⃣ Do-While Loop Statement
var num = 20;
do{
debugger;
console.log(num); infinte loop
num++;
}while(num <= 10);
6️⃣ For Loop
for(var num = 0; num <= 10; num++){
debugger;
console.log(num);
}
</code></pre>
</li>
</ol>
</div>
<footer>
<div>
Copyright © <a href="#">Hamza Zaidi</a>
<a href="/">CheatSheet Clone</a> 2022
</div>
</footer>
<script src="prism.js"></script>
</body>
</html>