From 067afdb1872e2571c73d59a787e5931e89bb0bac Mon Sep 17 00:00:00 2001 From: AsbjornOlling Date: Tue, 16 Aug 2022 13:04:35 +0200 Subject: [PATCH] move contacts list to left of messages this is the common ui pattern in most chat apps. I think it feels more natural. --- chatapp.svg | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/chatapp.svg b/chatapp.svg index d1f0bc6..7df9cb7 100644 --- a/chatapp.svg +++ b/chatapp.svg @@ -73,7 +73,7 @@ function ChatMessage(message_text, is_myself) { /// Render the chat message on the screen this.draw = function() { let text = document.createElementNS(svgns, 'text'); - let x = (is_myself)?10 :50; + let x = 100 + (is_myself ? 10 : 50); text.setAttribute('x', `${x}%`); lines.forEach(function(line) { @@ -133,9 +133,11 @@ function swipe_viewport() { let coords = svg.getAttribute('viewBox').split(' '); let x = parseInt(coords.shift()); if(x == 0) { + // moving from messages to contacts var step = 5; var end = width; } else { + // moving from contacts to messages var step = -5; var end = 0; } @@ -246,23 +248,23 @@ async function dialog_kaereste() { ]]> - - - -loading... + + + +loading... - - - + + + - - -Dine kontakter - + + +Dine kontakter + -Ven -Mor -Kæreste❤ +Ven +Mor +Kæreste❤