This repository has been archived by the owner on Dec 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from cedricouellet/develop
Color picker, text limit, change default scheme, error message now has error level
- Loading branch information
Showing
8 changed files
with
312 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,89 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link id="favicon" rel="shortcut icon" href="icon/favicon.ico" type="image/x-icon" /> | ||
<head> | ||
<meta charset="UTF-8"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> | ||
<link id="favicon" rel="shortcut icon" href="icon/favicon.ico" type="image/x-icon"/> | ||
<link | ||
rel="stylesheet" | ||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" | ||
integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" | ||
crossorigin="anonymous" | ||
rel="stylesheet" | ||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" | ||
integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" | ||
crossorigin="anonymous" | ||
/> | ||
<link rel="stylesheet" href="css/common.css" /> | ||
<link rel="stylesheet" href="css/chat.css" /> | ||
<link rel="stylesheet" href="css/common.css"/> | ||
<link rel="stylesheet" href="css/chat.css"/> | ||
<script src="/socket.io/socket.io.min.js" defer></script> | ||
<script src="js/BrowserNotifier.js" defer></script> | ||
<script src="js/NotificationDisplayer.js" defer></script> | ||
<script src="js/chat.js" defer></script> | ||
<script src="js/Picker.js" defer></script> | ||
<title>NoChat - Chat</title> | ||
</head> | ||
</head> | ||
|
||
<body> | ||
<div id="container"> | ||
<header id="header"> | ||
<body> | ||
<div id="container"> | ||
<header id="header"> | ||
<h1>NoChat <i class="fas fa-comment-dots"></i></h1> | ||
<a href="index.html" class="btn">Leave</a> | ||
</header> | ||
<div id="main"> | ||
<div id="sidebar" class="scrollbars"> | ||
<h3><i class="fas fa-cog"></i> Settings</h3> | ||
<div> | ||
<ul class="sidebarItems"> | ||
<li> | ||
<input id="notification-checkbox" type="checkbox"/> | ||
<label for="notification-checkbox">Alerts</label> | ||
<br> | ||
<br> | ||
</li> | ||
</header> | ||
<div id="main"> | ||
<div id="sidebar" class="scrollbar"> | ||
<h3 id="settings-toggler"><i class="fas fa-cog"></i> Settings</h3> | ||
<ul id="settings-container" class="sidebar-item"> | ||
<li> | ||
<input id="notification-checkbox" type="checkbox"/> | ||
<label for="notification-checkbox">Alerts</label> | ||
</li> | ||
<li> | ||
<input type="color" value="#2d3142" class="picker" id="primary-color"> | ||
<label for="primary-color">Primary</label> | ||
</li> | ||
<li> | ||
<input type="color" value="#4f5d75" class="picker" id="secondary-color"> | ||
<label for="secondary-color">Secondary</label> | ||
</li> | ||
<li> | ||
<input type="color" value="#F43E4D" class="picker" id="accent-color"> | ||
<label for="accent-color">Accent</label> | ||
</li> | ||
<li> | ||
<input type="color" value="#F5515F" class="picker" id="accent-hover-color"> | ||
<label for="accent-hover-color">Hover</label> | ||
<br> | ||
<br> | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
<h3><i class="fas fa-user-friends"></i> Users</h3> | ||
<ul id="users" class="sidebarItems"></ul> | ||
<h3 id="users-toggler"><i class="fas fa-user-friends"></i> Users</h3> | ||
<ul id="users-container" class="sidebar-item"></ul> | ||
</div> | ||
<div id="messages" class="scrollbars"></div> | ||
</div> | ||
<div id="form-container"> | ||
<div id="messages" class="scrollbar"></div> | ||
</div> | ||
<div id="form-container"> | ||
<form id="form"> | ||
<input | ||
id="message-input" | ||
type="text" | ||
placeholder="Enter your message..." | ||
autocomplete="off" | ||
required | ||
/> | ||
<button id="send-btn" class="btn"> | ||
Send <i class="fas fa-share"></i> | ||
</button> | ||
<!-- Satisfy linter --> | ||
<label for="message-input"></label> | ||
<input | ||
id="message-input" | ||
type="text" | ||
placeholder="Enter your message..." | ||
autocomplete="off" | ||
required/> | ||
<div id="char-count"></div> | ||
<button id="send-btn" class="btn"> | ||
Send <i class="fas fa-share"></i> | ||
</button> | ||
</form> | ||
</div> | ||
</div> | ||
|
||
<div class="bottom"> | ||
<div class="bottom"> | ||
<a class="git" href="https://github.com/cedricouellet/no-chat"> | ||
<i class="fab fa-github"></i> | ||
https://github.com/cedricouellet/no-chat | ||
<i class="fab fa-github"></i> | ||
https://github.com/cedricouellet/no-chat | ||
</a> | ||
<div class="copyright"> | ||
Copyright © 2022 NoChat Devs | ||
Copyright © 2022 NoChat Devs | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** Color Picker Manager for chat webpage */ | ||
|
||
// Get root element | ||
const root = document.documentElement; | ||
|
||
// Get all pickers | ||
const pickerList = Array.from(document.getElementsByClassName("picker")); | ||
|
||
// Apply event listeners | ||
pickerList.forEach(picker => { | ||
picker.addEventListener("input", applyColor); | ||
}); | ||
|
||
/** | ||
* Apply a color to the given CSS variable | ||
* @param {Event} e event that triggered the color change | ||
*/ | ||
function applyColor(e) { | ||
root.style.setProperty(`--${e.target.id}`, e.target.value); | ||
} | ||
|
||
// Explanation: | ||
//<input type="color" value="#ff0000" class="picker" id="primary-color"> | ||
|
Oops, something went wrong.