Commit efb8a719 authored by Alain Takoudjou's avatar Alain Takoudjou

improve sfu design and remove some useless code

parent 32459b4b
body {
font: 14px "Lato", Arial, sans-serif;
}
h1 { h1 {
font-size: 160%; font-size: 160%;
} }
...@@ -10,7 +6,14 @@ h1 { ...@@ -10,7 +6,14 @@ h1 {
display: inline; display: inline;
} }
.signature {
border-top: solid;
padding-top: 0;
border-width: thin;
clear: both;
height: 3.125rem;
text-align: center;
}
body { body {
overflow-x: hidden; overflow-x: hidden;
...@@ -32,3 +35,10 @@ body { ...@@ -32,3 +35,10 @@ body {
*, :after, :before { *, :after, :before {
box-sizing: border-box; box-sizing: border-box;
} }
textarea {
font-family: Metropolis,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
}
\ No newline at end of file
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<title>SFU</title> <title>SFU</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/common.css"> <link rel="stylesheet" href="/common.css">
<link rel="stylesheet" href="/mainpage.css"> <link rel="stylesheet" href="/mainpage.css">
...@@ -10,17 +11,6 @@ ...@@ -10,17 +11,6 @@
<!-- Font Awesome File --> <!-- Font Awesome File -->
<link rel="stylesheet" type="text/css" href="/css/font-awesome.min.css"> <link rel="stylesheet" type="text/css" href="/css/font-awesome.min.css">
</head> </head>
<head>
<title>SFU</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Security-Policy" content="default-src 'self' cdnjs.cloudflare.com; script-src 'self'; style-src 'self' cdnjs.cloudflare.com; font-src 'self'" />
<link rel="stylesheet" href="/common.css">
<link rel="stylesheet" href="/mainpage.css">
<!-- Font Awesome File -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="author" href="https://www.irif.fr/~jch/"/>
</head>
<body> <body>
......
...@@ -5,46 +5,36 @@ ...@@ -5,46 +5,36 @@
display: none; display: none;
} }
.signature {
border-top: solid;
padding-top: 0em;
border-width: thin;
clear: both;
height: 50px;
text-align: center;
}
.navbar-brand { .navbar-brand {
margin-bottom: 80px; margin-bottom: 5rem;
} }
.home { .home {
height: calc(100vh - 50px); height: calc(100vh - 50px);
padding: 30px; padding: 1.875rem;
} }
#public-groups-table tr a{ #public-groups-table tr a{
margin-left: 15px; margin-left: 0.9375rem;
font-weight: 700; font-weight: 700;
} }
a { a {
text-decoration: none; text-decoration: none;
color: #0058e4; color: #0058e4;
} }
a:hover { a:hover {
color: #0a429c; color: #0a429c;
} }
label { label {
display: block; display: block;
} }
@media only screen and (max-device-width: 480px) { @media only screen and (max-device-width: 768px) {
.home { .home {
padding: 10px; padding: 0.625rem;
}
} }
}
\ No newline at end of file
This diff is collapsed.
...@@ -26,14 +26,14 @@ ...@@ -26,14 +26,14 @@
<header> <header>
<nav class="topnav navbar navbar-expand navbar-light fixed-top"> <nav class="topnav navbar navbar-expand navbar-light fixed-top">
<div id="header"> <div id="header">
<div class="colapse" title="Colapse" id="sidebarCollapse"> <div class="colapse" title="Colapse left panel" id="sidebarCollapse">
<svg class="svg-inline--fa fa-align-left fa-w-14" aria-hidden="true" data-prefix="fas" data-icon="align-left" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" data-fa-i2svg=""> <svg class="svg-inline--fa" aria-hidden="true" data-icon="align-left" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
<path fill="currentColor" d="M288 44v40c0 8.837-7.163 16-16 16H16c-8.837 0-16-7.163-16-16V44c0-8.837 7.163-16 16-16h256c8.837 0 16 7.163 16 16zM0 172v40c0 8.837 7.163 16 16 16h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16zm16 312h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm256-200H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16h256c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16z"></path> <path fill="currentColor" d="M288 44v40c0 8.837-7.163 16-16 16H16c-8.837 0-16-7.163-16-16V44c0-8.837 7.163-16 16-16h256c8.837 0 16 7.163 16 16zM0 172v40c0 8.837 7.163 16 16 16h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16zm16 312h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm256-200H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16h256c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16z"></path>
</svg> </svg>
</div> </div>
<h1 id="title" class="header-title"></h1> <h1 id="title" class="header-title"></h1>
</div> </div>
<ul class="nav-menu"> <ul class="nav-menu">
<li> <li>
<button id="presentbutton" class="invisible btn btn-success"> <button id="presentbutton" class="invisible btn btn-success">
...@@ -60,13 +60,13 @@ ...@@ -60,13 +60,13 @@
<li> <li>
<div id="unsharebutton" class="invisible nav-link nav-button nav-cancel"> <div id="unsharebutton" class="invisible nav-link nav-button nav-cancel">
<span><i class="fa fa-window-close-o" aria-hidden="true"></i></span> <span><i class="fa fa-window-close-o" aria-hidden="true"></i></span>
<label>Share Screen</label> <label>Unshare Screen</label>
</div> </div>
</li> </li>
<li> <li>
<div class="nav-button nav-link invisible" id="user"> <div class="nav-button nav-link invisible" id="user">
<span><i class="fa fa-user dropbtn" aria-hidden="true"></i></span> <span><i class="fa fa-user dropbtn" aria-hidden="true"></i></span>
<label>Profile</label> <label>User</label>
</div> </div>
<div id="userDropdown" class="dropdown-content"> <div id="userDropdown" class="dropdown-content">
<div id="statdiv"> <div id="statdiv">
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
</nav> </nav>
</header> </header>
<div class="row full-width" id="mainrow"> <div class="row full-width" id="mainrow">
<div class="coln-left"> <div class="coln-left" id="left">
<div id="chat"> <div id="chat">
<div id="chatbox"> <div id="chatbox">
<div id="box"></div> <div id="box"></div>
...@@ -103,14 +103,13 @@ ...@@ -103,14 +103,13 @@
</div> </div>
</div> </div>
<div id="resizer"></div> <div id="resizer"></div>
<div class="coln-right"> <div class="coln-right" id="right">
<span class="show-video blink" id="switch-video"><i class="fa fa-exchange" aria-hidden="true"></i></span> <span class="show-video blink" id="switch-video"><i class="fa fa-exchange" aria-hidden="true"></i></span>
<div class="video-container no-video" id="video-container"> <div class="video-container no-video" id="video-container">
<div id="peers"></div> <div id="peers"></div>
</div> </div>
<div class="login-container invisible" id="login-container"> <div class="login-container invisible" id="login-container">
<div class="login-box"> <div class="login-box">
<h2>Login to SFU</h2>
<form id="userform" class="userform"> <form id="userform" class="userform">
<label for="username">Username:</label> <label for="username">Username:</label>
<input id="username" type="text" name="username" <input id="username" type="text" name="username"
...@@ -148,7 +147,7 @@ ...@@ -148,7 +147,7 @@
<option>default</option> <option>default</option>
<option>off</option> <option>off</option>
</select> </select>
</div> </div>
<label for="sendselect">Send:</label> <label for="sendselect">Send:</label>
......
...@@ -47,7 +47,6 @@ function getUsername() { ...@@ -47,7 +47,6 @@ function getUsername() {
function showVideo() { function showVideo() {
let video_container = document.getElementById('video-container'); let video_container = document.getElementById('video-container');
//video_container[0].style.display = "block";
video_container.classList.remove('no-video'); video_container.classList.remove('no-video');
} }
...@@ -60,7 +59,6 @@ function hideVideo(force) { ...@@ -60,7 +59,6 @@ function hideVideo(force) {
return; return;
} }
let video_container = document.getElementById('video-container'); let video_container = document.getElementById('video-container');
//video_container.style.display = "";
video_container.classList.add('no-video'); video_container.classList.add('no-video');
} }
...@@ -80,6 +78,8 @@ function setConnected(connected) { ...@@ -80,6 +78,8 @@ function setConnected(connected) {
userbox.classList.remove('invisible'); userbox.classList.remove('invisible');
connectionbox.classList.add('invisible'); connectionbox.classList.add('invisible');
displayUsername(); displayUsername();
displayMessage("Press Present to enable your camera or microphone",
"info");
} else { } else {
resetUsers(); resetUsers();
let userpass = getUserPass(); let userpass = getUserPass();
...@@ -109,7 +109,6 @@ function gotClose(code, reason) { ...@@ -109,7 +109,6 @@ function gotClose(code, reason) {
delUpMediaKind(null); delUpMediaKind(null);
setConnected(false); setConnected(false);
if(code != 1000) { if(code != 1000) {
//displayError('Socket close: Code ' + code, "error");
console.warn('Socket close', code, reason); console.warn('Socket close', code, reason);
} }
} }
...@@ -173,7 +172,7 @@ function setButtonsVisibility() { ...@@ -173,7 +172,7 @@ function setButtonsVisibility() {
setVisibility('presentbutton', permissions.present && !local); setVisibility('presentbutton', permissions.present && !local);
setVisibility('unpresentbutton', local); setVisibility('unpresentbutton', local);
// allow multiple shared documents // allow multiple shared documents
setVisibility('sharebutton', permissions.present && !share); setVisibility('sharebutton', permissions.present);
setVisibility('unsharebutton', share); setVisibility('unsharebutton', share);
setVisibility('mediaoptions', permissions.present); setVisibility('mediaoptions', permissions.present);
...@@ -190,7 +189,6 @@ function setLocalMute(mute) { ...@@ -190,7 +189,6 @@ function setLocalMute(mute) {
localMute = mute; localMute = mute;
muteLocalTracks(localMute); muteLocalTracks(localMute);
let button = document.getElementById('mutebutton'); let button = document.getElementById('mutebutton');
//button.textContent = localMute ? 'Unmute' : 'Mute';
if(localMute) if(localMute)
button.classList.add('muted'); button.classList.add('muted');
else else
...@@ -644,15 +642,20 @@ function resizePeers() { ...@@ -644,15 +642,20 @@ function resizePeers() {
Object.keys(serverConnection.down).length; Object.keys(serverConnection.down).length;
let peers = document.getElementById('peers'); let peers = document.getElementById('peers');
let columns = Math.ceil(Math.sqrt(count)); let columns = Math.ceil(Math.sqrt(count));
peers.style['grid-template-columns'] = `repeat(${columns}, 1fr)`; let rows = "";
if (false) { let size = 100 / columns;
if (peers.offsetWidth < peers.offsetHeight) { // Peers div has padding 10 on top and bottom, remove 20 on offsetHeight
// we change view orientation let max_video_height = Math.trunc((peers.offsetHeight - 30) / columns);
peers.style['grid-template-rows'] = `repeat(${columns}, auto)`; for(let i = 0; i < columns; i++){
} rows += size + "% ";
} else {
peers.style['grid-template-columns'] = `repeat(${columns}, 1fr)`;
} }
peers.style['grid-template-columns'] = `repeat(${columns}, 1fr)`;
peers.style['grid-template-rows'] = rows;
let media_list = document.getElementsByClassName("media");
[].forEach.call(media_list, function (element) {
element.style['max-height'] = max_video_height + "px";
});
} }
/** @type{Object.<string,string>} */ /** @type{Object.<string,string>} */
...@@ -965,19 +968,17 @@ document.getElementById('input').onkeypress = function(e) { ...@@ -965,19 +968,17 @@ document.getElementById('input').onkeypress = function(e) {
function chatResizer(e) { function chatResizer(e) {
e.preventDefault(); e.preventDefault();
let chat = document.getElementById('chat'); let full_width = document.getElementById("mainrow").offsetWidth;
let left = document.getElementById("left");
let right = document.getElementById("right");
let start_x = e.clientX; let start_x = e.clientX;
let start_width = parseFloat( let start_width = parseFloat(left.offsetWidth);
document.defaultView.getComputedStyle(chat).width.replace('px', ''),
);
let inputbutton = document.getElementById('inputbutton');
function start_drag(e) { function start_drag(e) {
let width = start_width + e.clientX - start_x; let left_width = (start_width + e.clientX - start_x) * 100 / full_width;
if(width < 40) left.style.flex = left_width;
inputbutton.style.display = 'none'; right.style.flex = 100 - left_width;
else
inputbutton.style.display = 'inline';
chat.style.width = width + 'px';
} }
function stop_drag(e) { function stop_drag(e) {
document.documentElement.removeEventListener( document.documentElement.removeEventListener(
...@@ -999,26 +1000,32 @@ function chatResizer(e) { ...@@ -999,26 +1000,32 @@ function chatResizer(e) {
document.getElementById('resizer').addEventListener('mousedown', chatResizer, false); document.getElementById('resizer').addEventListener('mousedown', chatResizer, false);
function displayError(message, level) { function displayError(message, level, position, gravity) {
var background = "linear-gradient(to right, #529518, #96c93d)"; var background = "linear-gradient(to right, #e20a0a, #df2d2d)";
if (level === undefined || level === "error") { if (level === "info") {
level = "error"; background = "linear-gradient(to right, #529518, #96c93d)";
background = "linear-gradient(to right, #e20a0a, #df2d2d)"; }
if (level === "warning") {
background = "linear-gradient(to right, #edd800, #c9c200)";
} }
Toastify({ Toastify({
text: message, text: message,
duration: 5000, duration: 4000,
close: true, close: true,
position: 'center', position: position ? position: 'center',
gravity: gravity ? gravity : 'top',
backgroundColor: background, backgroundColor: background,
className: level, className: level,
}).showToast(); }).showToast();
} }
function displayWarning(message) { function displayWarning(message) {
// don't overwrite real errors let level = "warning";
if(!errorTimeout) return displayError(message, level);
return displayError(message); }
function displayMessage(message) {
return displayError(message, "info", "right", "bottom");
} }
document.getElementById('userform').onsubmit = function(e) { document.getElementById('userform').onsubmit = function(e) {
...@@ -1135,7 +1142,6 @@ function start() { ...@@ -1135,7 +1142,6 @@ function start() {
setLocalMute(localMute); setLocalMute(localMute);
//document.getElementById('connectbutton').disabled = false;
let userpass = getUserPass(); let userpass = getUserPass();
if(userpass) if(userpass)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment