@Vandesm14/

Chatter(Dummy site)

HTML, CSS, JS

Testing what i can do with html

fork
loading
Files
  • index.html
  • app.js
  • create.css
  • create.html
  • database.js
  • friends.css
  • friends.html
  • games.css
  • games.html
  • home.css
  • home.html
  • home.js
  • login.js
  • loginstyle.css
  • profile.css
  • profile.html
  • server.js
  • settings.css
  • settings.html
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
<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width">
	<title>Chattr - Dummy site</title>
	<link href="loginstyle.css" rel="stylesheet" type="text/css" />
  <link href="login.js" rel="script" type="text/css" />
</head>

<body>

	<div class="container">
		<script src="login.js">	</script>
		<script src="database.js"></script>
    

		<div class="background">
			<h1 class="top_text">Chattr</h1>
			<div class="top_background"> i</div>
		</div>



		<div id="Log_In">
			<form autocomplete='off' onsubmit="myFunction()">
				<input id="Login" type="text" name="UserName" placeholder="Username">
        <input id="Password" type="password" name="" placeholder="Password">
        <input onclick="myFunction(); return false;" id="login_button" type="submit" name="submit_button" value="Login"> 
      
      </form>
    </div>
      </div>
      <form autocomplete='off'>
        <input id="Register" type="text" name="" placeholder="Username" >
        <input id="Email" type="email" name="" placeholder="Email">
        <input id="Password1" type="password" name="" placeholder="Password">
        <input id="Password2" type="password" name="" placeholder="Re-enter password">
        <input id="RegisterButton" type="submit" name="" value="Register">
      

      <div id="Login_Background"> </div>
      <div id="Desc_Background"> </div>
      <div id="Desc1_Background"> </div>
      <div id="Desc2_Background"> </div>

      <h2 id="NoAccountText"> No account? Register here for free!</h2>
      </form>

      <p id="Description"> Welcome to Chattr, a free online website where you can chat, create large groups, or even play and design games all in a safe online enviorment, for the price of nothing. If you have any questions or concerns you may email us at [email protected] <p>
      

      <script>
        const API_URL = "https://router.bluestar3211231.repl.co"
        var loginButton = document.getElementsByName("submit_button")
        var login = document.getElementById("Login")
        var password = document.getElementById("Password")
        var uestring;
        var uE=false;

        function fetch_params(url, params) {
          url = new URL(url);
          url.search = new URLSearchParams(params);
          return fetch(url);
        }

        function myFunction(){
          stringafy()

        
			fetch_params(API_URL + "/api-endpoint", {"name": login.value, "password": password.value, "Userexsists": uestring}).then(function(res) {
				console.log(res);
        return res.text();
			}).then(function(the_result) {
				console.log('Last');
				alert(the_result);
        console.log('Result: ' + the_result);
			}).catch(function(e) {console.log(e)});
		}

function stringafy(){
  if(uE==true){
    uestring = "true"
  } else if(uE==false){
    uestring = "false"
  }
}

        /*
          var loginButton = document.getElementsByName("submit_button")
          var login = document.getElementById("Login")
          var password = document.getElementById("Password")
          //block_1//
          
          fetch('')
         var loginData = [
           
           ["Bluestar3211231", "133703Ig"], ["xXDarknessPooperXx", "xXDarknessPooperXx"]
           ]
         login.value = loginData[0][0]
         function myFunction(){
            if(login.value == loginData[0][0] && password.value == loginData[0][1] || login.value == loginData[1][0] && password.value == loginData[1][1]){
              console.log("User has entered username correctly")
              console.log(location.href)
              location.href = "https://chatterdummy-site.bluestar3211231.repl.co/home.html"
              console.log(location.href)
              return false;
            } else {
              console.log("Incorrect")
              
            }
          }*/
      </script>
    
  </body>
</html>
result
console