Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
eacb625
Set up basic project structure
Galane-dev Feb 10, 2026
ffc2019
Merge pull request #2 from Galane-dev/project/structure
Galane-dev Feb 10, 2026
458e403
Created basic local storage service
Galane-dev Feb 10, 2026
6a85e5e
Merge pull request #5 from Galane-dev/feature/local-storage
Galane-dev Feb 10, 2026
de29e6c
Added basic user model
Galane-dev Feb 10, 2026
a8683a4
Added models for chat, and message
Galane-dev Feb 10, 2026
eae0b37
Added session manager for log in and log out
Galane-dev Feb 10, 2026
20bbbcb
Merge pull request #7 from Galane-dev/feature/models
Galane-dev Feb 10, 2026
02314d3
added html for landing page
Galane-dev Feb 10, 2026
fbb8eb6
Added html code for landing page
Galane-dev Feb 10, 2026
122ce4e
Implemented auth functionality
Galane-dev Feb 11, 2026
5d93d12
Merge pull request #9 from Galane-dev/page/landing-page
Galane-dev Feb 11, 2026
e9f0173
added redirect to main page after login
Galane-dev Feb 11, 2026
2449b55
Merge pull request #11 from Galane-dev/page/landing-page
Galane-dev Feb 11, 2026
b39f107
Added users list and open chat functionality to main page
Galane-dev Feb 11, 2026
06fab54
Added list of users and open chat functionality
Galane-dev Feb 11, 2026
a35bc7d
Added send message functionality
Galane-dev Feb 11, 2026
846527d
Added send message functionality
Galane-dev Feb 11, 2026
5865d5a
Implemented show hide for messages
Galane-dev Feb 11, 2026
585ad2d
Basic HTML structure complete
Galane-dev Feb 11, 2026
5037d41
Added user search
Galane-dev Feb 11, 2026
0dfd80c
Added user search to main page
Galane-dev Feb 11, 2026
21c5ecf
Added online offline checks
Galane-dev Feb 11, 2026
52f3b69
Implemented edit profile functionality
Galane-dev Feb 11, 2026
01b313f
implemented logout functionality
Galane-dev Feb 11, 2026
7936d45
Added logout functionality
Galane-dev Feb 11, 2026
45d1e4d
implemented user side profile
Galane-dev Feb 11, 2026
b301a61
added groups
Galane-dev Feb 12, 2026
f243f3b
Merge pull request #17 from Galane-dev/page/main
Galane-dev Feb 12, 2026
0f13d7e
Added nav section styling
Galane-dev Feb 12, 2026
141e3a0
Added nav section styling
Galane-dev Feb 12, 2026
6b17572
Added chat styling
Galane-dev Feb 12, 2026
e6868d1
Added chat styling
Galane-dev Feb 12, 2026
69e9a50
added user profile edit styling
Galane-dev Feb 12, 2026
1b377cb
Merge pull request #20 from Galane-dev/page/main
Galane-dev Feb 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/images/icons/add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/icons/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/icons/profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/icons/search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/icons/send.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/icons/user.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<title>Authenticate | LocalChat</title>

<link href="./styles/landing-page.css" rel="stylesheet">
</head>
<body>
<main>
<article>
<div id="landing-message">
<img id="logo-image" src="./assets/images/logo.png" alt="logo image">
<h1 id="welcome-heading">Welcome Back...</h1>
<p id="welcome-message">LocalChat is a local chat app<br>
Your data is stored securely in your own <br>computer, no one but you will be able to access the data</p>
</div>
</article>

<!--The login form on the side-->
<aside>
<section id="landing-form">
<h3 id="text-logo">Local<span>Chat</span></h3>
<form>
<input id="username-input" name="username-input" type="text" placeholder="Enter username">
<input id="password-input" name="password-input" type="password" placeholder="Enter password">
<button id="submit-button" name="submit-button" type="button">Sign In</button>
</form>

<p id="toggle-question">Don't have an account?</p>
<p id="toggle-action">Sign Up</p>
</section>

</aside>
</main>

<footer></footer>




<script type="module" src="./js/landing-page.js"></script>
</body>
</html>
86 changes: 86 additions & 0 deletions js/landing-page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import LocalStorageService from "./services/local-storage.js";
import SessionManager from "./services/session-manager.js";
import User from "./models/user.js";


console.log(LocalStorageService.getUsers());
let isSignUp=true;
const defaultView=document.getElementById('toggle-action');
let authButton=document.getElementById('submit-button');


function toggleView(){
let heading=document.getElementById('welcome-heading');
let toggleQuestion=document.getElementById('toggle-question');
let toggleView=document.getElementById('toggle-action');
let toggleMessage=document.getElementById('welcome-message');
let submitButton=document.getElementById('submit-button');



if(isSignUp){
heading.textContent='Hey newbie...';
toggleQuestion.textContent='Already have an account?';
toggleMessage.innerHTML='LocalChat is a local chat app.<br>Your data is stored securely in your own <br>computer, no one but you will be able to access the data.';
toggleView.textContent="Sign In";
submitButton.textContent='Sign Up';

}
else{
heading.textContent='Welcome Back...';
toggleQuestion.textContent='Don’t have an account?';
toggleMessage.innerHTML='LocalChat is a local chat app.<br>Your data is stored securely in your own <br>computer, no one but you will be able to access the data.';
toggleView.textContent='Sign Up';
submitButton.textContent='Sign In';

}

isSignUp=!isSignUp;
console.log('done');
}


function authenticate(){
let username=document.getElementById('username-input').value;
let password=document.getElementById('password-input').value;
if(!isSignUp){
if(User.isUserNameUnique(username)){
//Create an account
LocalStorageService.createUser(username,password);
console.log(LocalStorageService.getUsers());
}
else{
alert('Please enter a new username, make it unique');
return;
}
}
//Login
let user=SessionManager.login(username,password);
console.log(user);
if(user){
console.log('logged in as '+ user.username);
//Navigate to the main page
window.location.replace('./pages/main.html');
}
else{
alert('Login failed, ensure you have entered correct credentials');
return;
}
}










function main(){
console.log('Main method test');
defaultView.addEventListener('click',()=>toggleView());
authButton.addEventListener('click', ()=>authenticate());
}

main();
Loading