Skip to content

Commit

Permalink
icons
Browse files Browse the repository at this point in the history
  • Loading branch information
strukturart committed Jul 22, 2024
1 parent 02489d0 commit d273222
Show file tree
Hide file tree
Showing 64 changed files with 6,244 additions and 117 deletions.
17 changes: 17 additions & 0 deletions application/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,23 @@ img.myMarker {
filter: hue-rotate(120deg);
}

div#description {
margin: 50px 0px 50px 0;
}

div#description div {
margin: 0 10px 10px 0;
}

div#description h2 {
margin: 0 0px 20px 0;
}

div#description div img {
max-width: 30px;
margin: 0 10px 0px 0;
}

/*/////////////////
///BOTTOM BAR////
////////////////*/
Expand Down
141 changes: 103 additions & 38 deletions application/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ let delete_addressbook_item = (userIdToDelete) => {
.setItem("addressbook", addressbook)
.then((e) => {
side_toaster("deleted", 3000);
console.log(e);
m.redraw();
})
.catch((error) => {
Expand Down Expand Up @@ -783,9 +782,6 @@ let connect_to_peer = function (id) {
}
getIceServers()
.then(() => {
//clear chat data
console.log("succesfull downloaded ice servers");

chat_data = [];

status.current_room = id;
Expand Down Expand Up @@ -813,13 +809,6 @@ let connect_to_peer = function (id) {
document.querySelector(".loading-spinner").style.display = "none";
});

chat_data.push({
id: "no-other-user-online",
nickname: settings.nickname,
content: "no other user online",
datetime: new Date(),
});

document.querySelector(".loading-spinner").style.display = "none";

m.redraw();
Expand Down Expand Up @@ -907,8 +896,6 @@ let create_peer = function () {
chat_data.push(noOtherUserOnlineElement);
}

bottom_bar("", "", "<img src='assets/image/option.svg'>");

m.redraw();
focus_last_article();
document.querySelector(".loading-spinner").style.display = "none";
Expand Down Expand Up @@ -1281,8 +1268,9 @@ var about_page = {
return m(
"div",
{
class: "page",
oncreate: () => {
class: "page about-page",
oncreate: ({ dom }) => {
dom.focus();
top_bar("", "", "");

if (status.notKaiOS)
Expand All @@ -1292,20 +1280,81 @@ var about_page = {
[
m(
"div",
{ class: "item scroll", id: "about-text", tabindex: 0 },
{ class: "item scroll", id: "about-text" },
"With flop you can communicate directly with another person/machine (p2p). To do this you need a stable internet connection and you must know the other person's ID. When you start a chat you can share your ID via the options menu. Multiple people can also join the chat, the IDs of the other participants are automatically shared."
),

m("div", { id: "description" }, [
m("h2", {}, "Icons"),
m(
"div",
{ class: "flex width-100 item" },
m.trust(
"<img src='assets/image/no-monster.svg'> no other user online"
)
),

m(
"div",
{ class: "flex width-100 item" },
m.trust("<img src='assets/image/monster.svg'>user online")
),

m(
"div",
{ class: "flex width-100 item" },
m.trust("<img src='assets/image/pencil.svg'>write")
),

m(
"div",
{ class: "flex width-100 item" },
m.trust("<img src='assets/image/send.svg'>send")
),

m(
"div",
{ class: "flex width-100 item" },
m.trust("<img src='assets/image/plus.svg'>open new chat")
),

m(
"div",
{ class: "flex width-100 item" },
m.trust("<img src='assets/image/option.svg'>option")
),

m(
"div",
{ class: "flex width-100" },
m.trust("<img src='assets/image/record.svg'>audio message")
),

m(
"div",
{ class: "flex width-100 item" },
m.trust(
"<img src='assets/image/record-live.svg'>recording audio message"
)
),
]),

m(
"div",
{ class: "item scroll", id: "about-text", tabindex: 1 },
{ class: "item scroll", id: "about-text" },
m.trust(
"The code of the software is freely available: <a href='https://github.com/strukturart/flop'>gitHub</a>"
)
),
m(
"div",
{ class: "item scroll", id: "about-text", tabindex: 2 },
{
class: "item scroll",
id: "about-text",
oncreate: () => {
setTabindex();
},
},
m.trust(
"<strong>License</strong><br><br>mithrilJS MIT<br>peerJS MIT<br>flop MIT"
)
Expand Down Expand Up @@ -1843,7 +1892,7 @@ var start = {
},
},
m.trust(
"flop is a webRTC chat app with which you can communicate directly with someone (p2p). You can currently exchange text, images and your position with your chat partner. To create a peer, press enter.<br><br>"
"flop is a webRTC chat app with which you can communicate directly with someone (p2p). You can currently exchange text, images, audio and your position with your chat partner. To create a peer, press enter.<br><br>"
)
),
m(
Expand Down Expand Up @@ -2003,10 +2052,14 @@ var chat = {
} catch (e) {}
},
oncreate: () => {
top_bar("<img src='assets/image/no-monster.svg'>", "", "");
top_bar(
"<img class='users' title='0' 'src='assets/image/no-monster.svg'>",
"",
""
);
if (status.notKaiOS)
top_bar(
"<img src='assets/image/no-monster.svg'>",
"<img class='users' title='0' src='assets/image/no-monster.svg'>",
"",
"<img src='assets/image/back.svg'>"
);
Expand All @@ -2029,33 +2082,41 @@ var chat = {
userId: settings.custom_peer_id,
});

if (status.notKaiOS && status.userOnline > 0) {
if (!status.notKaiOS && status.userOnline > 0)
top_bar(
"<img class='users' title='" +
status.userOnline +
"' src='assets/image/monster.svg'>",
"",
""
);

if (status.notKaiOS && status.userOnline > 0)
top_bar(
"<img class='users' title='" +
status.userOnline +
"' src='assets/image/monster.svg'>",
"",
"<img src='assets/image/back.svg'>"
);
} else {
if (status.notKaiOS)
top_bar(
"<img src='assets/image/no-monster.svg'>",
"",
"<img src='assets/image/back.svg'>"
);
}
} else {
status.userOnline = 0;
if (status.notKaiOS) {

if (status.notKaiOS && status.userOnline == 0)
top_bar(
"<img src='assets/image/no-monster.svg'>",
"<img class='users' title='" +
status.userOnline +
"' src='assets/image/no-monster.svg'>",
"",
"<img src='assets/image/back.svg'>"
);
} else {
top_bar("<img src='assets/image/no-monster.svg'>", "", "");
}

if (!status.notKaiOS && status.userOnline == 0)
top_bar(
"<img class='users' title='" +
status.userOnline +
"' src='assets/image/no-monster.svg'>",
"",
""
);
}
}, 3000);
},
Expand Down Expand Up @@ -2634,7 +2695,6 @@ document.addEventListener("DOMContentLoaded", function (e) {
}

if (route == "/open_peer_menu") {
console.log(status.addressbook_in_focus);
if (status.addressbook_in_focus == "") {
let prp = prompt("Enter the chat id");
if (prp != null) {
Expand Down Expand Up @@ -2719,6 +2779,11 @@ document.addEventListener("DOMContentLoaded", function (e) {
});
}

if (status.notKaiOS) {
if (route.startsWith("/chat" && status.action == "write")) {
}
}

if (document.activeElement.classList.contains("input-parent")) {
document.activeElement.children[0].focus();
}
Expand Down
2 changes: 1 addition & 1 deletion application/manifest.webapp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version":"0.1.0.43",
"version":"0.1.0.44",
"name":"flop",
"id":"flop",
"description": "Flop P2P Messenger is a decentralized messaging application that facilitates direct communication between users without relying on central servers. The app supports the exchange of text messages, audio messages, and location sharing, making it a versatile tool for staying connected. By using peer-to-peer (P2P) technology, Flop ensures that messages are transmitted directly between users, offering a seamless and reliable communication experience.",
Expand Down
2 changes: 1 addition & 1 deletion application/manifest.webmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
],

"b2g_features": {
"version": "0.3118",
"version": "0.3122",
"id": "flop",
"subtitle": "flop p2p messenger app",
"core": true,
Expand Down
Loading

0 comments on commit d273222

Please sign in to comment.