From 91f6182a88937360773534caf1e63ca69d468d47 Mon Sep 17 00:00:00 2001 From: rosh Date: Sat, 1 Aug 2020 14:26:22 +0530 Subject: [PATCH] first commit --- Style.css | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ movies.js | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ searchmovies.html | 20 +++++++++++++++++++ searchstyle.css | 32 +++++++++++++++++++++++++++++ 4 files changed, 167 insertions(+) create mode 100644 Style.css create mode 100644 movies.js create mode 100644 searchmovies.html create mode 100644 searchstyle.css diff --git a/Style.css b/Style.css new file mode 100644 index 0000000..9919b19 --- /dev/null +++ b/Style.css @@ -0,0 +1,60 @@ + +.login-page{ + width: 360px; + padding: 10% 0 0; + margin: auto; +} + +.form{ + position:relative; + z-index: 1; + background: #ff6666; + max-width: 360px; + margin: 0 auto 100px; + padding: 45px; + text-align: center; +} + +.form input{ + font-family: "Roboto", sans-serif; + outline: 1; + background: #f2f2f2; + width: 100%; + border:0; + margin: 0 0 15px; + padding: 15px; + box-sizing: border-box; + font-size: 14px; +} + +.form button{ + font-family: "Roboto", sans-serif; + text-transform: uppercase; + outline: 0; + background: #ffcc66; + width: 100%; + border: 0; + padding: 15px; + color: #FFFFFF; + font-size: 14; + cursor: pointer; +} + +.form button:hover,.form button:active{ + background:#43A047; +} + +.form .message{ + margin: 15px 0 0; + color: aliceblue; + font-family: "Roboto", sans-serif; + font-size: 14px; +} + +.form .message a{ + color: #f2f2f2; +} + +.form .register-form{ + display: none; +} \ No newline at end of file diff --git a/movies.js b/movies.js new file mode 100644 index 0000000..1dafb68 --- /dev/null +++ b/movies.js @@ -0,0 +1,55 @@ +$(document).ready(function(){ +$('.message a').click(function(){ + $('form').animate({height: "toggle", opacity: "toggle"},"slow"); +}) +}); + +async function submitForm(e, form){ + e.preventDefault(); + + try { + const response = await fetch('https://mkr.thefeathers.in/register', { + method: 'post', + body: JSON.stringify({ + "username": form.formName.value, + "email": form.formEmail.value, + "password": form.formPassword.value, + }) + }); + const data = await response.json(); + //Success code goes here + //window.location = "searchmovies.html"; + alert(JSON.stringify(data)); + $('form').animate({ height: "toggle", opacity: "toggle" }, "slow"); + } + catch (err) { + //Failure + alert('Error'); + } +} + + +async function submitForm1(e, form){ + e.preventDefault(); + + try { + const response = await fetch('https://mkr.thefeathers.in/login', { + method: 'POST', + body: JSON.stringify({ + "username" : document.getElementById('formName1').value, + "password" : document.getElementById('formPassword1').value + }) + }); + const data1 = await response.json(); + //Success code goes here + alert(JSON.stringify(data1)); + window.location = "searchmovies.html"; + } + catch (err) { + //Failure + alert('Error'); + } +} + + + \ No newline at end of file diff --git a/searchmovies.html b/searchmovies.html new file mode 100644 index 0000000..41db625 --- /dev/null +++ b/searchmovies.html @@ -0,0 +1,20 @@ + + + + Search Movies + + + + + + +
+
+
+ + +
+
+
+
+ \ No newline at end of file diff --git a/searchstyle.css b/searchstyle.css new file mode 100644 index 0000000..323f2ee --- /dev/null +++ b/searchstyle.css @@ -0,0 +1,32 @@ +.body{ + margin: 0; + padding: 0; +} + +.header{ + text-align: center; +} + +.search-movies{ + height: 50px; + padding: 10px; + border-radius: 25px; + width: 800px; + outline-width: 0; + display: inline-block; +} + +.form-box button:hover,.form-box button:active{ + background:#43A047; +} + +.search-btn{ + height: 50px; + width: 150px; + background: #ffeb3b; + border: none; + color: #000; + border-radius: 25px; + outline: 0; + cursor: pointer; +}