mirror of
https://github.com/ianramzy/decentralized-video-chat.git
synced 2025-02-23 00:15:04 +08:00
applied prettier --write
This commit is contained in:
parent
3edf6c1cb0
commit
93b7f9b40b
3
public/chat.html
vendored
3
public/chat.html
vendored
@ -1,9 +1,8 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
<meta charset="UTF-8" />
|
<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" />
|
||||||
|
|
||||||
<title>ZipChat</title>
|
<title>ZipChat</title>
|
||||||
<link rel="shortcut icon" href="/images/logo.svg" />
|
<link rel="shortcut icon" href="/images/logo.svg" />
|
||||||
|
24
public/css/chat.css
vendored
24
public/css/chat.css
vendored
@ -361,23 +361,24 @@ button:hover {
|
|||||||
/* Begin mobile layout */
|
/* Begin mobile layout */
|
||||||
|
|
||||||
@media (max-width: 640px) {
|
@media (max-width: 640px) {
|
||||||
/* @media (min-width: 320px) and (max-width: 480px) { */
|
/* @media (min-width: 320px) and (max-width: 480px) { */
|
||||||
|
|
||||||
html, body {
|
html,
|
||||||
|
body {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#header {
|
#header {
|
||||||
z-index: 5;
|
z-index: 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
#header img {
|
#header img {
|
||||||
width: auto;
|
width: auto;
|
||||||
height: 2rem;
|
height: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
#header p {
|
#header p {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
line-height: 2rem;
|
line-height: 2rem;
|
||||||
@ -485,12 +486,12 @@ button:hover {
|
|||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.buttonContainer:nth-child(3) ,
|
.buttonContainer:nth-child(3),
|
||||||
.buttonContainer:nth-child(5) {
|
.buttonContainer:nth-child(5) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#entire-chat {
|
#entire-chat {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 3rem;
|
top: 3rem;
|
||||||
right: 0;
|
right: 0;
|
||||||
@ -529,21 +530,20 @@ button:hover {
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
height: 2rem;
|
height: 2rem;
|
||||||
margin: .5rem 0;
|
margin: 0.5rem 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.compose input {
|
.compose input {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
height: 2rem;
|
height: 2rem;
|
||||||
line-height: 2rem;
|
line-height: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.compose input::placeholder {
|
.compose input::placeholder {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* End mobile layout */
|
/* End mobile layout */
|
||||||
|
8
public/css/snackbar.css
vendored
8
public/css/snackbar.css
vendored
@ -95,7 +95,6 @@
|
|||||||
/* Mobile Styles Start */
|
/* Mobile Styles Start */
|
||||||
|
|
||||||
@media (max-width: 640px) {
|
@media (max-width: 640px) {
|
||||||
|
|
||||||
.snackbar-container {
|
.snackbar-container {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 5rem;
|
top: 5rem;
|
||||||
@ -110,7 +109,7 @@
|
|||||||
height: auto;
|
height: auto;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
padding: .5rem;
|
padding: 0.5rem;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
line-height: 1.2rem;
|
line-height: 1.2rem;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
@ -122,7 +121,7 @@
|
|||||||
|
|
||||||
.snackbar-container .action {
|
.snackbar-container .action {
|
||||||
width: 15%;
|
width: 15%;
|
||||||
padding: .2rem;
|
padding: 0.2rem;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
border: none;
|
border: none;
|
||||||
@ -136,10 +135,9 @@
|
|||||||
|
|
||||||
.snackbar-pos.bottom-center,
|
.snackbar-pos.bottom-center,
|
||||||
.snackbar-pos.top-center {
|
.snackbar-pos.top-center {
|
||||||
left: calc(10vw - 0.5rem);;
|
left: calc(10vw - 0.5rem);
|
||||||
transform: none;
|
transform: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Mobile Styles End */
|
/* Mobile Styles End */
|
||||||
|
@ -358,8 +358,12 @@ function rePositionLocalVideo() {
|
|||||||
// Get position of remote video
|
// Get position of remote video
|
||||||
var bounds = remoteVideo.position();
|
var bounds = remoteVideo.position();
|
||||||
let localVideo = $("#local-video");
|
let localVideo = $("#local-video");
|
||||||
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
|
if (
|
||||||
bounds.top = $(window).height()*0.75;
|
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
||||||
|
navigator.userAgent
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
bounds.top = $(window).height() * 0.75;
|
||||||
bounds.left += 10;
|
bounds.left += 10;
|
||||||
} else {
|
} else {
|
||||||
bounds.top += 10;
|
bounds.top += 10;
|
||||||
|
@ -9,9 +9,8 @@
|
|||||||
* jquery.ui.mouse.js
|
* jquery.ui.mouse.js
|
||||||
*/
|
*/
|
||||||
(function ($) {
|
(function ($) {
|
||||||
|
|
||||||
// Detect touch support
|
// Detect touch support
|
||||||
$.support.touch = 'ontouchend' in document;
|
$.support.touch = "ontouchend" in document;
|
||||||
|
|
||||||
// Ignore browsers without touch support
|
// Ignore browsers without touch support
|
||||||
if (!$.support.touch) {
|
if (!$.support.touch) {
|
||||||
@ -19,17 +18,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
var mouseProto = $.ui.mouse.prototype,
|
var mouseProto = $.ui.mouse.prototype,
|
||||||
_mouseInit = mouseProto._mouseInit,
|
_mouseInit = mouseProto._mouseInit,
|
||||||
_mouseDestroy = mouseProto._mouseDestroy,
|
_mouseDestroy = mouseProto._mouseDestroy,
|
||||||
touchHandled;
|
touchHandled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simulate a mouse event based on a corresponding touch event
|
* Simulate a mouse event based on a corresponding touch event
|
||||||
* @param {Object} event A touch event
|
* @param {Object} event A touch event
|
||||||
* @param {String} simulatedType The corresponding mouse event
|
* @param {String} simulatedType The corresponding mouse event
|
||||||
*/
|
*/
|
||||||
function simulateMouseEvent (event, simulatedType) {
|
function simulateMouseEvent(event, simulatedType) {
|
||||||
|
|
||||||
// Ignore multi-touch events
|
// Ignore multi-touch events
|
||||||
if (event.originalEvent.touches.length > 1) {
|
if (event.originalEvent.touches.length > 1) {
|
||||||
return;
|
return;
|
||||||
@ -38,25 +36,25 @@
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
var touch = event.originalEvent.changedTouches[0],
|
var touch = event.originalEvent.changedTouches[0],
|
||||||
simulatedEvent = document.createEvent('MouseEvents');
|
simulatedEvent = document.createEvent("MouseEvents");
|
||||||
|
|
||||||
// Initialize the simulated mouse event using the touch event's coordinates
|
// Initialize the simulated mouse event using the touch event's coordinates
|
||||||
simulatedEvent.initMouseEvent(
|
simulatedEvent.initMouseEvent(
|
||||||
simulatedType, // type
|
simulatedType, // type
|
||||||
true, // bubbles
|
true, // bubbles
|
||||||
true, // cancelable
|
true, // cancelable
|
||||||
window, // view
|
window, // view
|
||||||
1, // detail
|
1, // detail
|
||||||
touch.screenX, // screenX
|
touch.screenX, // screenX
|
||||||
touch.screenY, // screenY
|
touch.screenY, // screenY
|
||||||
touch.clientX, // clientX
|
touch.clientX, // clientX
|
||||||
touch.clientY, // clientY
|
touch.clientY, // clientY
|
||||||
false, // ctrlKey
|
false, // ctrlKey
|
||||||
false, // altKey
|
false, // altKey
|
||||||
false, // shiftKey
|
false, // shiftKey
|
||||||
false, // metaKey
|
false, // metaKey
|
||||||
0, // button
|
0, // button
|
||||||
null // relatedTarget
|
null // relatedTarget
|
||||||
);
|
);
|
||||||
|
|
||||||
// Dispatch the simulated event to the target element
|
// Dispatch the simulated event to the target element
|
||||||
@ -68,11 +66,13 @@
|
|||||||
* @param {Object} event The widget element's touchstart event
|
* @param {Object} event The widget element's touchstart event
|
||||||
*/
|
*/
|
||||||
mouseProto._touchStart = function (event) {
|
mouseProto._touchStart = function (event) {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
// Ignore the event if another widget is already being handled
|
// Ignore the event if another widget is already being handled
|
||||||
if (touchHandled || !self._mouseCapture(event.originalEvent.changedTouches[0])) {
|
if (
|
||||||
|
touchHandled ||
|
||||||
|
!self._mouseCapture(event.originalEvent.changedTouches[0])
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,13 +83,13 @@
|
|||||||
self._touchMoved = false;
|
self._touchMoved = false;
|
||||||
|
|
||||||
// Simulate the mouseover event
|
// Simulate the mouseover event
|
||||||
simulateMouseEvent(event, 'mouseover');
|
simulateMouseEvent(event, "mouseover");
|
||||||
|
|
||||||
// Simulate the mousemove event
|
// Simulate the mousemove event
|
||||||
simulateMouseEvent(event, 'mousemove');
|
simulateMouseEvent(event, "mousemove");
|
||||||
|
|
||||||
// Simulate the mousedown event
|
// Simulate the mousedown event
|
||||||
simulateMouseEvent(event, 'mousedown');
|
simulateMouseEvent(event, "mousedown");
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -97,7 +97,6 @@
|
|||||||
* @param {Object} event The document's touchmove event
|
* @param {Object} event The document's touchmove event
|
||||||
*/
|
*/
|
||||||
mouseProto._touchMove = function (event) {
|
mouseProto._touchMove = function (event) {
|
||||||
|
|
||||||
// Ignore event if not handled
|
// Ignore event if not handled
|
||||||
if (!touchHandled) {
|
if (!touchHandled) {
|
||||||
return;
|
return;
|
||||||
@ -107,7 +106,7 @@
|
|||||||
this._touchMoved = true;
|
this._touchMoved = true;
|
||||||
|
|
||||||
// Simulate the mousemove event
|
// Simulate the mousemove event
|
||||||
simulateMouseEvent(event, 'mousemove');
|
simulateMouseEvent(event, "mousemove");
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -115,23 +114,21 @@
|
|||||||
* @param {Object} event The document's touchend event
|
* @param {Object} event The document's touchend event
|
||||||
*/
|
*/
|
||||||
mouseProto._touchEnd = function (event) {
|
mouseProto._touchEnd = function (event) {
|
||||||
|
|
||||||
// Ignore event if not handled
|
// Ignore event if not handled
|
||||||
if (!touchHandled) {
|
if (!touchHandled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Simulate the mouseup event
|
// Simulate the mouseup event
|
||||||
simulateMouseEvent(event, 'mouseup');
|
simulateMouseEvent(event, "mouseup");
|
||||||
|
|
||||||
// Simulate the mouseout event
|
// Simulate the mouseout event
|
||||||
simulateMouseEvent(event, 'mouseout');
|
simulateMouseEvent(event, "mouseout");
|
||||||
|
|
||||||
// If the touch interaction did not move, it should trigger a click
|
// If the touch interaction did not move, it should trigger a click
|
||||||
if (!this._touchMoved) {
|
if (!this._touchMoved) {
|
||||||
|
|
||||||
// Simulate the click event
|
// Simulate the click event
|
||||||
simulateMouseEvent(event, 'click');
|
simulateMouseEvent(event, "click");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unset the flag to allow other widgets to inherit the touch event
|
// Unset the flag to allow other widgets to inherit the touch event
|
||||||
@ -145,14 +142,13 @@
|
|||||||
* original mouse event handling methods.
|
* original mouse event handling methods.
|
||||||
*/
|
*/
|
||||||
mouseProto._mouseInit = function () {
|
mouseProto._mouseInit = function () {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
// Delegate the touch handlers to the widget's element
|
// Delegate the touch handlers to the widget's element
|
||||||
self.element.bind({
|
self.element.bind({
|
||||||
touchstart: $.proxy(self, '_touchStart'),
|
touchstart: $.proxy(self, "_touchStart"),
|
||||||
touchmove: $.proxy(self, '_touchMove'),
|
touchmove: $.proxy(self, "_touchMove"),
|
||||||
touchend: $.proxy(self, '_touchEnd')
|
touchend: $.proxy(self, "_touchEnd"),
|
||||||
});
|
});
|
||||||
|
|
||||||
// Call the original $.ui.mouse init method
|
// Call the original $.ui.mouse init method
|
||||||
@ -163,18 +159,16 @@
|
|||||||
* Remove the touch event handlers
|
* Remove the touch event handlers
|
||||||
*/
|
*/
|
||||||
mouseProto._mouseDestroy = function () {
|
mouseProto._mouseDestroy = function () {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
// Delegate the touch handlers to the widget's element
|
// Delegate the touch handlers to the widget's element
|
||||||
self.element.unbind({
|
self.element.unbind({
|
||||||
touchstart: $.proxy(self, '_touchStart'),
|
touchstart: $.proxy(self, "_touchStart"),
|
||||||
touchmove: $.proxy(self, '_touchMove'),
|
touchmove: $.proxy(self, "_touchMove"),
|
||||||
touchend: $.proxy(self, '_touchEnd')
|
touchend: $.proxy(self, "_touchEnd"),
|
||||||
});
|
});
|
||||||
|
|
||||||
// Call the original $.ui.mouse destroy method
|
// Call the original $.ui.mouse destroy method
|
||||||
_mouseDestroy.call(self);
|
_mouseDestroy.call(self);
|
||||||
};
|
};
|
||||||
|
})(jQuery);
|
||||||
})(jQuery);
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user