rtc

minimal webrtc client
git clone https://git.ce9e.org/rtc.git

commit
eb81bcc4cf8a6e49e470bdfd674ae88be89a43c1
parent
6ee6ad92613b1acd073a3b00e2add2220e4f104e
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2020-03-26 10:31
refine syles

Diffstat

M www/common.css 4 ++--
M www/rtc/rtc.css 15 ++++++++++-----
M www/rtc/rtc.js 5 +----

3 files changed, 13 insertions, 11 deletions


diff --git a/www/common.css b/www/common.css

@@ -3,8 +3,8 @@
    3     3 }
    4     4 
    5     5 body {
    6    -1 	margin: 0 auto;
    7    -1 	padding: 1em;
   -1     6 	padding: 0;
   -1     7 	margin: 0;
    8     8 }
    9     9 
   10    10 input,

diff --git a/www/rtc/rtc.css b/www/rtc/rtc.css

@@ -1,7 +1,6 @@
    1     1 body {
    2     2 	display: grid;
    3     3 	grid-template-rows: 12em minmax(12em, auto);
    4    -1 	grid-gap: 1em;
    5     4 	height: 100vh;
    6     5 }
    7     6 
@@ -9,6 +8,8 @@ body {
    9     8 	display: grid;
   10     9 	grid-template-rows: 1fr min-content;
   11    10 	grid-gap: 1em;
   -1    11 	padding: 1em;
   -1    12 	background: #f8f8f8;
   12    13 }
   13    14 
   14    15 .rtc-controls {
@@ -24,8 +25,7 @@ body {
   24    25 	flex-grow: 1;
   25    26 	flex-shrink: 1;
   26    27 	/* video may overflow */
   27    -1 	/* overflow: hidden; */
   28    -1 	min-height: 5em;
   -1    28 	overflow: hidden;
   29    29 }
   30    30 
   31    31 .rtc-videos video {
@@ -42,8 +42,9 @@ video.mirrored {
   42    42 	grid-template-rows: 1fr min-content;
   43    43 	grid-gap: 1em;
   44    44 	padding: 1em;
   45    -1 	border: 1px solid #aaa;
   46    45 	min-width: 18em;
   -1    46 	border: 0 solid #ccc;
   -1    47 	border-top-width: 1px;
   47    48 }
   48    49 
   49    50 .chat-history {
@@ -69,6 +70,10 @@ video.mirrored {
   69    70 @media (min-width: 40em) {
   70    71 	body {
   71    72 		grid-template-columns: 3fr minmax(min-content, 1fr);
   72    -1 		grid-template-rows: calc(100vh - 2em);
   -1    73 		grid-template-rows: 100vh;
   -1    74 	}
   -1    75 	.chat {
   -1    76 		border-top-width: 0;
   -1    77 		border-left-width: 1px;
   73    78 	}
   74    79 }

diff --git a/www/rtc/rtc.js b/www/rtc/rtc.js

@@ -204,11 +204,8 @@
  204   204 	var addChatMsg = function(msg) {
  205   205 		var li = document.createElement('li');
  206   206 		li.textContent = msg;
  207    -1 		var scrolledToBottom = history.scrollTop + history.offsetHeight === history.scrollHeight;
  208   207 		history.append(li);
  209    -1 		if (scrolledToBottom) {
  210    -1 			history.scrollTop = history.scrollHeight;
  211    -1 		}
   -1   208 		history.scrollTop = history.scrollHeight;
  212   209 	};
  213   210 
  214   211 	patch.listen(room, function(data) {