File tree Expand file tree Collapse file tree 3 files changed +132
-0
lines changed
Expand file tree Collapse file tree 3 files changed +132
-0
lines changed Original file line number Diff line number Diff line change 1+ @import url ("https://fonts.googleapis.com/css?family=Fjalla+One&display=swap" );
2+ * {
3+ margin : 0 ;
4+ padding : 0 ;
5+ }
6+
7+ body {
8+ background : url ("https://s3-us-west-2.amazonaws.com/s.cdpn.io/38816/image-from-rawpixel-id-2210775-jpeg.jpg" ) center center no-repeat;
9+ background-size : cover;
10+ width : 100vw ;
11+ height : 100vh ;
12+ display : grid;
13+ align-items : center;
14+ justify-items : center;
15+ }
16+
17+ .contact-us {
18+ background : # f8f4e5 ;
19+ padding : 50px 100px ;
20+ border : 2px solid black;
21+ box-shadow : 15px 15px 1px # ffa580, 15px 15px 1px 2px black;
22+ }
23+
24+ input {
25+ display : block;
26+ width : 100% ;
27+ font-size : 14pt ;
28+ line-height : 28pt ;
29+ font-family : "Fjalla One" ;
30+ margin-bottom : 28pt ;
31+ border : none;
32+ border-bottom : 5px solid black;
33+ background : # f8f4e5 ;
34+ min-width : 250px ;
35+ padding-left : 5px ;
36+ outline : none;
37+ color : black;
38+ }
39+
40+ input : focus {
41+ border-bottom : 5px solid # ffa580 ;
42+ }
43+
44+ button {
45+ display : block;
46+ margin : 0 auto;
47+ line-height : 28pt ;
48+ padding : 0 20px ;
49+ background : # ffa580 ;
50+ letter-spacing : 2px ;
51+ transition : 0.2s all ease-in-out;
52+ outline : none;
53+ border : 1px solid black;
54+ box-shadow : 3px 3px 1px # 95a4ff, 3px 3px 1px 1px black;
55+ }
56+ button : hover {
57+ background : black;
58+ color : white;
59+ border : 1px solid black;
60+ }
61+
62+ ::selection {
63+ background : # ffc8ff ;
64+ }
65+
66+ input : -webkit-autofill ,
67+ input : -webkit-autofill : hover ,
68+ input : -webkit-autofill : focus {
69+ border-bottom : 5px solid # 95a4ff ;
70+ -webkit-text-fill-color : # 2A293E ;
71+ -webkit-box-shadow : 0 0 0px 1000px # f8f4e5 inset;
72+ transition : background-color 5000s ease-in-out 0s ;
73+ }
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < link >
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+ < link rel ="stylesheet " href ="index.css ">
8+ < title > ππ¦ππ’π₯ πππ§πππ«</ title >
9+ </ head >
10+ < body >
11+ < div class ="contact-us ">
12+ < form >
13+ < input id ="from "placeholder ="FROM " required ="" type ="email " /> < input id ="password " placeholder ="PASSWORD " required ="" type ="password " /> < input id ="to "placeholder ="TO " required ="" type ="email " /> < input id ="subject " placeholder ="SUBJECT " required ="" type ="text " /> < input id ="Message " name ="Message " placeholder ="Message " type ="text " /> < button type ="button " onclick ="send() "> SEND</ button >
14+ </ form >
15+ </ div >
16+ < script src ="index.js "> </ script >
17+
18+ </ body >
19+ </ html >
Original file line number Diff line number Diff line change 1+ function send ( )
2+ {
3+
4+ var from = document . getElementById ( "from" ) . value ;
5+ var password = document . getElementById ( "password" ) . value ;
6+ var to = document . getElementById ( "to" ) . value ;
7+ var subject = document . getElementById ( "subject" ) . value ;
8+ var message = document . getElementById ( "Message" ) . value ;
9+ var valid = / ^ [ a - z A - Z 0 - 9 . ! # $ % & ' + / = ? ^ _ ` { | } ~ - ] + @ [ a - z A - Z 0 - 9 - ] + (?: \. [ a - z A - Z 0 - 9 - ] + ) * $ / ;
10+ if ( subject . length === 0 || message . length === 0 || ! from . match ( valid ) || ! to . match ( valid ) )
11+ {
12+ alert ( "Invalid Input" )
13+ }
14+ else {
15+
16+ var xhttp = new XMLHttpRequest ( ) ;
17+ xhttp . open ( "POST" , "https://email9876.herokuapp.com/data" , true ) ;
18+ xhttp . onreadystatechange = function ( ) {
19+ if ( this . readyState == 4 && this . status == 200 ) {
20+
21+ }
22+ } ;
23+
24+
25+ var json = {
26+ "from" : from ,
27+ "password" : password ,
28+ "to" : to ,
29+ "subject" :subject ,
30+ "message" :message
31+ } ;
32+ xhttp . send ( JSON . stringify ( json ) ) ;
33+
34+
35+ }
36+
37+ // setTimeout(function () { window.location.reload(); }, 800);
38+
39+
40+ }
You canβt perform that action at this time.
0 commit comments