forked from om/chatcontrol-live-demo
pick some more typical colors for a chat app
This commit is contained in:
parent
911a58bd6b
commit
5a3bc05a70
24
chatapp.svg
24
chatapp.svg
|
@ -9,6 +9,7 @@
|
|||
viewBox="0 0 300 600"
|
||||
onload="start_chat('Ven')"
|
||||
overflow="auto"
|
||||
style="font-family: sans;"
|
||||
>
|
||||
<defs>
|
||||
<symbol id="kaereste_foto" width="60" height="200">
|
||||
|
@ -100,7 +101,8 @@ function create_link_node(url) {
|
|||
/// *ChatMessages are owned by a Dialog.
|
||||
function TextChatMessage(message_text, is_myself) {
|
||||
let lines = split_text_into_lines(message_text, 28);
|
||||
let bubble_color = (is_myself)? 'white': '#DDFF66';
|
||||
let bubble_color = (is_myself)? '#0084FF': '#E4E6EB';
|
||||
let text_color = (is_myself)? 'white': 'black';
|
||||
let container = document.getElementById('messages');
|
||||
|
||||
// attributes
|
||||
|
@ -111,7 +113,7 @@ function TextChatMessage(message_text, is_myself) {
|
|||
this.draw = function(y_offset, y_shift) {
|
||||
let group = create_svg_node('g', {'transform': `translate(0, ${y_shift})`});
|
||||
|
||||
let x = (is_myself ? 190 : 110);
|
||||
let x = (is_myself ? 195 : 105);
|
||||
let text = create_svg_node('text', {
|
||||
'x': `${x}%`,
|
||||
'font-size': `${line_height}px`,
|
||||
|
@ -125,7 +127,7 @@ function TextChatMessage(message_text, is_myself) {
|
|||
let tspan = create_svg_node('tspan', {
|
||||
'x': `${x}%`,
|
||||
'y': `${y + line_height}`, // important: y is lower text baseline
|
||||
'fill': 'green',
|
||||
'fill': text_color,
|
||||
'width': '5%'
|
||||
});
|
||||
|
||||
|
@ -398,7 +400,7 @@ async function local_message_processing(will_be_flagged) {
|
|||
indicator.data = 'Reporting suspicious content';
|
||||
await wait(1000);
|
||||
text_element.setAttribute('fill', 'white');
|
||||
box.setAttribute('fill', 'blue');
|
||||
box.setAttribute('fill', '#0084FF');
|
||||
}
|
||||
indicator.data = 'encrypting message';
|
||||
await wait(250);
|
||||
|
@ -515,15 +517,15 @@ async function dialog_nabopige() {
|
|||
|
||||
<!-- [right] contact name view -->
|
||||
<g id="contact_name_box">
|
||||
<rect x="300" y="0" width="300" height="50" fill="yellow" />
|
||||
<polyline points="300,20 320,0 320,40" fill="blue" onclick="swipe_viewport()" />
|
||||
<polyline points="560,20 600,20 580,0" fill="blue" onclick="scroll_up()" />
|
||||
<polyline points="560,30 600,30 580,50" fill="blue" onclick="scroll_down()" />
|
||||
<rect x="300" y="0" width="300" height="50" fill="#F5F5F5"/>
|
||||
<polyline points="300,20 320,0 320,40" fill="#0084FF" onclick="swipe_viewport()" />
|
||||
<polyline points="560,20 600,20 580,0" fill="#0084FF" onclick="scroll_up()" />
|
||||
<polyline points="560,30 600,30 580,50" fill="#0084FF" onclick="scroll_down()" />
|
||||
<text x="350" y="30" id="contact_indicator">loading...</text>
|
||||
</g>
|
||||
|
||||
<!-- [right] messages view -->
|
||||
<rect x="300" y="50" width="300" height="450" fill="aqua" />
|
||||
<rect x="300" y="50" width="300" height="450" fill="white" />
|
||||
<g id="messages"></g>
|
||||
|
||||
<!-- [right] message status -->
|
||||
|
@ -537,9 +539,9 @@ async function dialog_nabopige() {
|
|||
<text id="message_submit_button" x="555" y="580" fill="black">SEND</text>
|
||||
|
||||
<!-- [left] contact list -->
|
||||
<rect x="0" y="0" width="300" height="50" fill="yellow" />
|
||||
<rect x="0" y="0" width="300" height="50" fill="#E4E6EB" />
|
||||
<text x="60" y="30">Dine kontakter</text>
|
||||
<rect x="0" y="50" width="300" height="550" style="stroke: green; stroke-width: 10px" fill="aqua" />
|
||||
<rect x="0" y="50" width="300" height="550" style="stroke: green; stroke-width: 0px" fill="white" />
|
||||
|
||||
<text x="15" y="75" onclick="start_chat('Ven')">Ven</text>
|
||||
<text x="15" y="100" onclick="start_chat('Mor')">Mor</text>
|
||||
|
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Loading…
Reference in a new issue