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>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<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>
|
||||
<link rel="shortcut icon" href="/images/logo.svg" />
|
||||
|
6
public/css/chat.css
vendored
6
public/css/chat.css
vendored
@ -363,7 +363,8 @@ button:hover {
|
||||
@media (max-width: 640px) {
|
||||
/* @media (min-width: 320px) and (max-width: 480px) { */
|
||||
|
||||
html, body {
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-size: 1em;
|
||||
@ -529,7 +530,7 @@ button:hover {
|
||||
bottom: 0;
|
||||
width: 80%;
|
||||
height: 2rem;
|
||||
margin: .5rem 0;
|
||||
margin: 0.5rem 0;
|
||||
padding: 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
@ -543,7 +544,6 @@ button:hover {
|
||||
.compose input::placeholder {
|
||||
color: white;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* End mobile layout */
|
8
public/css/snackbar.css
vendored
8
public/css/snackbar.css
vendored
@ -95,7 +95,6 @@
|
||||
/* Mobile Styles Start */
|
||||
|
||||
@media (max-width: 640px) {
|
||||
|
||||
.snackbar-container {
|
||||
position: fixed;
|
||||
top: 5rem;
|
||||
@ -110,7 +109,7 @@
|
||||
height: auto;
|
||||
margin: 0;
|
||||
margin-top: 1rem;
|
||||
padding: .5rem;
|
||||
padding: 0.5rem;
|
||||
word-wrap: break-word;
|
||||
line-height: 1.2rem;
|
||||
font-size: 1rem;
|
||||
@ -122,7 +121,7 @@
|
||||
|
||||
.snackbar-container .action {
|
||||
width: 15%;
|
||||
padding: .2rem;
|
||||
padding: 0.2rem;
|
||||
border-radius: 10px;
|
||||
display: inline-block;
|
||||
border: none;
|
||||
@ -136,10 +135,9 @@
|
||||
|
||||
.snackbar-pos.bottom-center,
|
||||
.snackbar-pos.top-center {
|
||||
left: calc(10vw - 0.5rem);;
|
||||
left: calc(10vw - 0.5rem);
|
||||
transform: none;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Mobile Styles End */
|
||||
|
@ -358,7 +358,11 @@ function rePositionLocalVideo() {
|
||||
// Get position of remote video
|
||||
var bounds = remoteVideo.position();
|
||||
let localVideo = $("#local-video");
|
||||
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
|
||||
if (
|
||||
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
||||
navigator.userAgent
|
||||
)
|
||||
) {
|
||||
bounds.top = $(window).height() * 0.75;
|
||||
bounds.left += 10;
|
||||
} else {
|
||||
|
@ -9,9 +9,8 @@
|
||||
* jquery.ui.mouse.js
|
||||
*/
|
||||
(function ($) {
|
||||
|
||||
// Detect touch support
|
||||
$.support.touch = 'ontouchend' in document;
|
||||
$.support.touch = "ontouchend" in document;
|
||||
|
||||
// Ignore browsers without touch support
|
||||
if (!$.support.touch) {
|
||||
@ -29,7 +28,6 @@
|
||||
* @param {String} simulatedType The corresponding mouse event
|
||||
*/
|
||||
function simulateMouseEvent(event, simulatedType) {
|
||||
|
||||
// Ignore multi-touch events
|
||||
if (event.originalEvent.touches.length > 1) {
|
||||
return;
|
||||
@ -38,7 +36,7 @@
|
||||
event.preventDefault();
|
||||
|
||||
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
|
||||
simulatedEvent.initMouseEvent(
|
||||
@ -68,11 +66,13 @@
|
||||
* @param {Object} event The widget element's touchstart event
|
||||
*/
|
||||
mouseProto._touchStart = function (event) {
|
||||
|
||||
var self = this;
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
@ -83,13 +83,13 @@
|
||||
self._touchMoved = false;
|
||||
|
||||
// Simulate the mouseover event
|
||||
simulateMouseEvent(event, 'mouseover');
|
||||
simulateMouseEvent(event, "mouseover");
|
||||
|
||||
// Simulate the mousemove event
|
||||
simulateMouseEvent(event, 'mousemove');
|
||||
simulateMouseEvent(event, "mousemove");
|
||||
|
||||
// Simulate the mousedown event
|
||||
simulateMouseEvent(event, 'mousedown');
|
||||
simulateMouseEvent(event, "mousedown");
|
||||
};
|
||||
|
||||
/**
|
||||
@ -97,7 +97,6 @@
|
||||
* @param {Object} event The document's touchmove event
|
||||
*/
|
||||
mouseProto._touchMove = function (event) {
|
||||
|
||||
// Ignore event if not handled
|
||||
if (!touchHandled) {
|
||||
return;
|
||||
@ -107,7 +106,7 @@
|
||||
this._touchMoved = true;
|
||||
|
||||
// Simulate the mousemove event
|
||||
simulateMouseEvent(event, 'mousemove');
|
||||
simulateMouseEvent(event, "mousemove");
|
||||
};
|
||||
|
||||
/**
|
||||
@ -115,23 +114,21 @@
|
||||
* @param {Object} event The document's touchend event
|
||||
*/
|
||||
mouseProto._touchEnd = function (event) {
|
||||
|
||||
// Ignore event if not handled
|
||||
if (!touchHandled) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Simulate the mouseup event
|
||||
simulateMouseEvent(event, 'mouseup');
|
||||
simulateMouseEvent(event, "mouseup");
|
||||
|
||||
// Simulate the mouseout event
|
||||
simulateMouseEvent(event, 'mouseout');
|
||||
simulateMouseEvent(event, "mouseout");
|
||||
|
||||
// If the touch interaction did not move, it should trigger a click
|
||||
if (!this._touchMoved) {
|
||||
|
||||
// Simulate the click event
|
||||
simulateMouseEvent(event, 'click');
|
||||
simulateMouseEvent(event, "click");
|
||||
}
|
||||
|
||||
// Unset the flag to allow other widgets to inherit the touch event
|
||||
@ -145,14 +142,13 @@
|
||||
* original mouse event handling methods.
|
||||
*/
|
||||
mouseProto._mouseInit = function () {
|
||||
|
||||
var self = this;
|
||||
|
||||
// Delegate the touch handlers to the widget's element
|
||||
self.element.bind({
|
||||
touchstart: $.proxy(self, '_touchStart'),
|
||||
touchmove: $.proxy(self, '_touchMove'),
|
||||
touchend: $.proxy(self, '_touchEnd')
|
||||
touchstart: $.proxy(self, "_touchStart"),
|
||||
touchmove: $.proxy(self, "_touchMove"),
|
||||
touchend: $.proxy(self, "_touchEnd"),
|
||||
});
|
||||
|
||||
// Call the original $.ui.mouse init method
|
||||
@ -163,18 +159,16 @@
|
||||
* Remove the touch event handlers
|
||||
*/
|
||||
mouseProto._mouseDestroy = function () {
|
||||
|
||||
var self = this;
|
||||
|
||||
// Delegate the touch handlers to the widget's element
|
||||
self.element.unbind({
|
||||
touchstart: $.proxy(self, '_touchStart'),
|
||||
touchmove: $.proxy(self, '_touchMove'),
|
||||
touchend: $.proxy(self, '_touchEnd')
|
||||
touchstart: $.proxy(self, "_touchStart"),
|
||||
touchmove: $.proxy(self, "_touchMove"),
|
||||
touchend: $.proxy(self, "_touchEnd"),
|
||||
});
|
||||
|
||||
// Call the original $.ui.mouse destroy method
|
||||
_mouseDestroy.call(self);
|
||||
};
|
||||
|
||||
})(jQuery);
|
Loading…
x
Reference in New Issue
Block a user