Skip to content
This repository was archived by the owner on Oct 5, 2024. It is now read-only.

Commit c5b9ee4

Browse files
authoredMar 13, 2024
Merge pull request #27 from TheRedScreen64/nosehad-patch-1
chat page - initial design
2 parents abef6b9 + 559fb05 commit c5b9ee4

File tree

11 files changed

+561
-3
lines changed

11 files changed

+561
-3
lines changed
 

‎frontend/assets/chat.nosehad

+428
Large diffs are not rendered by default.

‎frontend/assets/json/pages-config.json

+8
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,13 @@
2222
"description": "The social media chat app with a new innovative concept: Chat with EVERYONE",
2323
"keywords": ["Radix", "Chat", "App", "Innovative"],
2424
"author": "Noah Nagel"
25+
},
26+
{
27+
"route":"/app/chat",
28+
"static": "/static/chat.nosehad",
29+
"title": "Radix Chat",
30+
"description": "The social media chat app with a new innovative concept: Chat with EVERYONE",
31+
"keywords": ["Radix", "Chat", "App", "Innovative"],
32+
"author": "Noah Nagel"
2533
}
2634
]

‎frontend/assets/login.nosehad

+1-1
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ input[type="file"] {
546546
</div>
547547
</body>
548548
<script type="text/javascript">
549-
cms_loadScript("/static/scripts/message.js");
549+
cms_loadScript("/static/scripts/message_popup.js");
550550
cms_loadScript("/static/scripts/login.js");
551551
</script>
552552
</html>

‎frontend/assets/scripts/chat.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
cms_runOnStartup(() => {
2+
});
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const audio = new Audio("/static/sounds/new_message.mp3");
2+
cms_runOnStartup(() => {
3+
document.addEventListener('animationend', (event) => {
4+
if (event.animationName == "appear") {
5+
event.target.remove();
6+
}
7+
});
8+
document.addEventListener('animationstart', (event) => {
9+
if (event.animationName == "appear") {
10+
try {
11+
audio.play();
12+
}
13+
catch (exception) {
14+
console.log("Failed to play notification sound");
15+
}
16+
}
17+
});
18+
});

‎frontend/html/build.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ mkdir -p assets/scripts
1313
gcc -w -E -x c -P html/pages/login/index.html -o assets/login.nosehad
1414
gcc -w -E -x c -P html/pages/login/login.js -o assets/scripts/login.js
1515

16+
# chat page
17+
gcc -w -E -x c -P html/pages/chat/index.html -o assets/chat.nosehad
18+
gcc -w -E -x c -P html/pages/chat/chat.js -o assets/scripts/chat.js
19+
1620
# landing page
1721
gcc -w -E -x c -P html/pages/landing/index.html -o assets/landing.nosehad
1822

@@ -32,4 +36,4 @@ gcc -w -E -x c -P html/background.svg -o assets/images/background.svg
3236
gcc -w -E -x c -P html/generic/Content/cms.html -o assets/cms.nosehad
3337

3438
# message utility
35-
gcc -w -E -x c -P html/generic/message.js -o assets/scripts/message.js
39+
gcc -w -E -x c -P html/generic/message_popup.js -o assets/scripts/message_popup.js
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* message sound */
2+
const audio = new Audio("/static/sounds/new_message.mp3");
3+
4+
cms_runOnStartup(() => {
5+
/* animated inbox */
6+
document.addEventListener('animationend', (event) => {
7+
if (event.animationName == "appear") {
8+
event.target.remove();
9+
}
10+
});
11+
12+
//document.body.style.animationDuration
13+
document.addEventListener('animationstart', (event) => {
14+
if (event.animationName == "appear") {
15+
//event.target.style.animationDuration = ""
16+
try {
17+
audio.play();
18+
}
19+
catch (exception) {
20+
/// TODO: print message to allow sounds (ask for permission)
21+
console.log("Failed to play notification sound");
22+
}
23+
}
24+
});
25+
});

‎frontend/html/pages/chat/chat.css

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
nav {
2+
position: fixed;
3+
top: 0;
4+
/* left: 0; */
5+
text-align: center;
6+
margin-top:20px;
7+
border: 2px solid PRIMARY_BG_2;
8+
border-radius: 5px;
9+
}
10+
11+
nav a {
12+
padding: 10px;
13+
color: FONT_COLOR;
14+
}
15+
16+
nav a.active {
17+
background-color: SECONDARY_BG;
18+
color:PRIMARY_BUTTON_BG;
19+
border-radius: 5px;
20+
}

‎frontend/html/pages/chat/chat.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
cms_runOnStartup(() => {
2+
3+
});

‎frontend/html/pages/chat/index.html

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<title>Radix Chat - Login</title>
6+
<style>
7+
#include "../../generic/wrapper.css"
8+
#include "chat.css"
9+
</style>
10+
11+
<meta charset="UTF-8">
12+
<meta name="viewport" content="width=device-width, initial-scale=1">
13+
</head>
14+
15+
<body>
16+
<div class="inbox" id="inbox">
17+
</div>
18+
19+
<nav>
20+
<a class="active">Your Feed</a>
21+
<a>Tomorrows's Topic</a>
22+
<a>Private Messages</a>
23+
<a>Personal Preferences</a>
24+
</nav>
25+
26+
<div class="content">
27+
<div class="chat-header"></div>
28+
29+
<div class="chat"></div>
30+
31+
<div class="chat-input">
32+
<input type="text" placeholder="Tell the world...">
33+
<span>
34+
<svg
35+
xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-mic-fill"
36+
viewBox="0 0 16 16">
37+
<path d="M5 3a3 3 0 0 1 6 0v5a3 3 0 0 1-6 0z" />
38+
<path
39+
d="M3.5 6.5A.5.5 0 0 1 4 7v1a4 4 0 0 0 8 0V7a.5.5 0 0 1 1 0v1a5 5 0 0 1-4.5 4.975V15h3a.5.5 0 0 1 0 1h-7a.5.5 0 0 1 0-1h3v-2.025A5 5 0 0 1 3 8V7a.5.5 0 0 1 .5-.5" />
40+
</svg>
41+
</span>
42+
</div>
43+
</div>
44+
</body>
45+
<script type="text/javascript">
46+
cms_loadScript("/static/scripts/message_popup.js");
47+
cms_loadScript("/static/scripts/chat.js");
48+
</script>
49+
50+
</html>

‎frontend/html/pages/login/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ <h1 style="margin-left: 5px;">
105105
</div>
106106
</body>
107107
<script type="text/javascript">
108-
cms_loadScript("/static/scripts/message.js");
108+
cms_loadScript("/static/scripts/message_popup.js");
109109
cms_loadScript("/static/scripts/login.js");
110110
</script>
111111

0 commit comments

Comments
 (0)
This repository has been archived.