Skip to content

Commit ad2749d

Browse files
Merge branch 'main' into patch-1
2 parents fa83ddb + 88d1f75 commit ad2749d

67 files changed

Lines changed: 1483 additions & 9 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Age Calculator/index.html

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<!DOCTYPE html>
2+
23
<html lang="en">
34
<head>
45
<meta charset="UTF-8">
@@ -8,6 +9,16 @@
89
<link rel="stylesheet" type="text/css" href="style.css">
910
</head>
1011
<body>
12+
13+
<html>
14+
15+
<head>
16+
<title></title>
17+
<link rel="stylesheet" type="text/css" href="style.css">
18+
</head>
19+
20+
<body>
21+
1122
<div class="container">
1223
<div class="input">
1324
<input type="date" id="date">
@@ -16,24 +27,22 @@
1627
<div class="output">
1728
<div>
1829
<span id="years">
19-
2030
</span>
2131
<p>YEARS</p>
2232
</div>
2333
<div>
2434
<span id="months">
25-
2635
</span>
2736
<p>MONTHS</p>
2837
</div>
2938
<div>
3039
<span id="days">
31-
3240
</span>
3341
<p>DAYS</p>
3442

3543

3644

45+
3746
</div>
3847

3948
</div>
@@ -44,3 +53,15 @@
4453
<script type="text/javascript" src="script.js"></script>
4554
</body>
4655
</html>
56+
57+
</div>
58+
</div>
59+
<div class="wish" id="wish">
60+
Happy birthday to you !!!
61+
</div>
62+
</div>
63+
<script type="text/javascript" src="script.js"></script>
64+
</body>
65+
66+
</html>
67+
729 KB
Loading
706 KB
Loading
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Split-landing
2+
Try it here https://kryptonanshu.github.io/Split-landing/
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Play station 5</title>
8+
<link rel="stylesheet" href="style.css">
9+
</head>
10+
<body>
11+
<div class="outer" id="outer">
12+
13+
<div class="left" id="left">
14+
<a href="#">Buy Now</a>
15+
</div>
16+
17+
<div class="right" id="right">
18+
<a href="#">Explore Games</a>
19+
</div>
20+
</div>
21+
<script src="script.js"></script>
22+
</body>
23+
</html>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const outer = document.getElementById('outer');
2+
const right = document.getElementById('right');
3+
const left = document.getElementById('left');
4+
5+
left.addEventListener('mouseover',()=>{
6+
outer.classList.add('hover-left');
7+
})
8+
left.addEventListener('mouseleave',()=>{
9+
outer.classList.remove('hover-left');
10+
})
11+
12+
right.addEventListener('mouseover',()=>{
13+
outer.classList.add('hover-right');
14+
})
15+
right.addEventListener('mouseleave',()=>{
16+
outer.classList.remove('hover-right');
17+
})
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@1,600&display=swap');
2+
3+
4+
5+
*{
6+
margin: 0px;
7+
box-sizing: border-box;
8+
}
9+
body{
10+
font-family: 'Nunito Sans', sans-serif;
11+
overflow: hidden;
12+
}
13+
14+
.outer{
15+
display: flex;
16+
align-items: center;
17+
justify-content: center;
18+
height: 100vh;
19+
width: 100vw;
20+
}
21+
.outer.hover-left .left{
22+
width: 75%;
23+
}
24+
25+
.outer.hover-left .right{
26+
width: 25%;
27+
}
28+
29+
.outer.hover-right .right{
30+
width: 75%;
31+
}
32+
.outer.hover-right .left{
33+
width: 25%;
34+
}
35+
36+
37+
/* ----------------------------------------------------------Left (PS5)---------------------------------------------------- */
38+
39+
.left{
40+
height: inherit;
41+
width: 50%;
42+
transition: all 1.3s ease;
43+
background: rgba(80, 60, 240, 0.6);
44+
display: flex;
45+
justify-content: center;
46+
align-items: center;
47+
}
48+
.left::before{
49+
content: '';
50+
position: absolute;
51+
left: 0;
52+
top: 0;
53+
height: inherit;
54+
width: inherit;
55+
background-image: url(./Images/Ps5.png);
56+
background-repeat: no-repeat;
57+
background-size: auto 100%;
58+
background-position: center ;
59+
z-index: -1;
60+
}
61+
62+
63+
/* ---------------------------------------------------Right---------------------------------------------- */
64+
65+
.right{
66+
height: inherit;
67+
width: 50%;
68+
transition: all 1.3s ease;
69+
/* border-left: 2px solid black; */
70+
background: rgb(23 36 26 / 80%);
71+
display: flex;
72+
justify-content: center;
73+
align-items: center;
74+
75+
}
76+
.right::before{
77+
content: '';
78+
position: absolute;
79+
right: 0;
80+
top: 0;
81+
height: inherit;
82+
width: inherit;
83+
background-image: url(./Images/grp2.jpg);
84+
background-repeat: no-repeat;
85+
background-size: auto 100%;
86+
background-position: center;
87+
z-index: -1;
88+
/* background-position: center; */
89+
}
90+
/* ------------------------------------------------------------------------------------------------ */
91+
a{
92+
opacity: 0;
93+
text-decoration: none;
94+
list-style: none;
95+
color: white;
96+
font-size: 30px;
97+
text-transform: uppercase;
98+
padding: 20px 20px;
99+
border: 3px solid white;
100+
transition: all 1.3s ease;
101+
}
102+
103+
104+
.outer.hover-right .right a{
105+
opacity: 1;
106+
}
107+
108+
109+
.outer.hover-left .left a{
110+
opacity: 1;
111+
}

Form Validation/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## Form Validation in javascript
2+
3+
### Tech Stack
4+
- Html
5+
- Css
6+
- Javascript

Form Validation/index.html

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title></title>
5+
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.3/css/all.css" integrity="sha384-SZXxX4whJ79/gErwcOYf+zWLeJdY/qpuqC4cAa9rOGUstPomtqpuNWT9wdPEn2fk" crossorigin="anonymous">
6+
<link rel="stylesheet" type="text/css" href="style.css">
7+
</head>
8+
<body>
9+
<div class="container">
10+
<div class="header">
11+
<h2>CREATE ACCOUNT</h2>
12+
</div>
13+
<form class="form" id="form">
14+
<div class="form-control ">
15+
<label >Username</label>
16+
<input type="text" placeholder="beautyndbeast" id="username">
17+
<i class="fas fa-check-circle"></i>
18+
<i class="fas fa-exclamation-circle"></i>
19+
<small>Error Message</small>
20+
</div>
21+
<div class="form-control ">
22+
<label >Email</label>
23+
<input type="email" placeholder="dead@gmail.com" id="email">
24+
<i class="fas fa-check-circle"></i>
25+
<i class="fas fa-exclamation-circle"></i>
26+
<small>Error Message</small>
27+
</div>
28+
<div class="form-control">
29+
<label >Password</label>
30+
<input type="password" placeholder="password nahi batate " id="password">
31+
<i class="fas fa-check-circle"></i>
32+
<i class="fas fa-exclamation-circle"></i>
33+
<small>Error Message</small>
34+
</div>
35+
<div class="form-control">
36+
<label >Confirm Password</label>
37+
<input type="password" placeholder="yeh bhi nahi batate " id="confirm">
38+
<i class="fas fa-check-circle"></i>
39+
<i class="fas fa-exclamation-circle"></i>
40+
<small>Error Message</small>
41+
</div>
42+
<button>Submit</button>
43+
</form>
44+
</div>
45+
<script type="text/javascript" src="script.js"></script>
46+
47+
</body>
48+
</html>

Form Validation/script.js

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
const form=document.getElementById("form");
2+
const username=document.getElementById("username");
3+
const email=document.getElementById("email");
4+
const password=document.getElementById("password");
5+
const confirm=document.getElementById("confirm");
6+
form.addEventListener("submit",(e)=>{
7+
e.preventDefault();
8+
checkInputs();
9+
});
10+
function checkInputs(){
11+
// to prevent from spaces we use trim
12+
const usernamevalue=username.value.trim();
13+
const emailvalue=email.value.trim();
14+
const passwordvalue=password.value.trim();
15+
const confirmvalue=confirm.value.trim();
16+
if(usernamevalue === ''){
17+
// add error class
18+
setError(username,"This field cannot be blank !!!!!!");
19+
20+
}
21+
else{
22+
// add success class
23+
setSuccess(username);
24+
25+
}
26+
if(emailvalue === ''){
27+
// add error class
28+
setError(email,"This field cannot be blank !!!!!!");
29+
30+
}
31+
else if (!isemail(emailvalue)){
32+
setError(email,"Check the email dude !!!!!!");
33+
34+
35+
}
36+
else{
37+
// add success class
38+
setSuccess(email);
39+
40+
}
41+
if(passwordvalue === ''){
42+
// add error class
43+
setError(password,"This field cannot be blank !!!!!!");
44+
45+
}else if(passwordvalue.length<=4){
46+
setError(password,"Password is too small!!")
47+
}
48+
else{
49+
// add success class
50+
setSuccess(password);
51+
52+
}
53+
if(confirmvalue === ''){
54+
// add error class
55+
setError(confirm,"This field cannot be blank !!!!!!");
56+
57+
}else if(passwordvalue !== confirmvalue){
58+
setError(confirm,"Dude ! Password and Confirm Password must be same.")
59+
}
60+
else{
61+
// add success class
62+
setSuccess(confirm);
63+
64+
}
65+
}
66+
67+
68+
function setError(input,msg){
69+
const formControl=input.parentElement;
70+
const small=formControl.querySelector("small");
71+
small.innerText=msg;
72+
// add error class
73+
formControl.className="form-control error";
74+
}
75+
function setSuccess(input){
76+
const formControl=input.parentElement;
77+
formControl.className="form-control success";
78+
79+
}
80+
81+
function isemail(email){
82+
return /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(email);
83+
84+
}

0 commit comments

Comments
 (0)