Updated responsetory structure and some more features
This commit is contained in:
parent
4d7eadf2c5
commit
3c1927df60
47 changed files with 1436 additions and 362771 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,2 +1,5 @@
|
|||
js/**/*.js*
|
||||
generated/
|
||||
node_modules/
|
||||
auth/certs/
|
||||
.idea/
|
||||
|
|
4
.gitmodules
vendored
4
.gitmodules
vendored
|
@ -1,3 +1,3 @@
|
|||
[submodule "asm/libs/opus"]
|
||||
path = asm/libs/opus
|
||||
[submodule "asm/libraries/opus"]
|
||||
path = asm/libraries/opus
|
||||
url = https://github.com/xiph/opus.git
|
||||
|
|
27
animates/A.html
Normal file
27
animates/A.html
Normal file
|
@ -0,0 +1,27 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=windows-1251">
|
||||
<script type="text/javascript" src="https://adsterra.com/libs/header_index/jquery-2.2.4.min.js"></script>
|
||||
<script type="text/javascript" src="https://adsterra.com/libs/header_index/pixi.min.js"></script>
|
||||
<script type="text/javascript" src="https://adsterra.com/libs/header_index/animationFrame.js?ver=201703051115"></script>
|
||||
<script type="text/javascript" src="https://adsterra.com/libs/header_index/nodes.js?ver=201703051115"></script>
|
||||
</head>
|
||||
<style>body {
|
||||
margin: 0;
|
||||
background-color: transparent;
|
||||
}</style>
|
||||
<body>
|
||||
<header>
|
||||
<script>
|
||||
Nodes.multipleInit([{
|
||||
"post_name": "ADSTERRA",
|
||||
"drawnImage": "TeaSpeak32b.png", //https://orig00.deviantart.net/45aa/f/2015/323/9/9/letter_a_by_hillygon-d9h8c6a.jpg | TeaSpeak32b.png
|
||||
"linkTitle": "ADSTERRA",
|
||||
"particleDensity": "5",
|
||||
"particleWidth": "0.4",
|
||||
"particleHeight": "0.4"
|
||||
}]);
|
||||
</script>
|
||||
</header>
|
||||
</body>
|
||||
</html>
|
BIN
animates/TeaSpeak32b.png
Normal file
BIN
animates/TeaSpeak32b.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 45 KiB |
442
animates/animation.js
Normal file
442
animates/animation.js
Normal file
File diff suppressed because one or more lines are too long
BIN
animates/fabric-letter-z-black.jpg
Normal file
BIN
animates/fabric-letter-z-black.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 325 KiB |
File diff suppressed because it is too large
Load diff
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
Binary file not shown.
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
Subproject commit 655cc54c564b84ef2827f0b2152ce3811046201e
|
||||
Subproject commit 19966ccd4b743026d895c179ede04d436f65eca0
|
251
auth/auth.php
Normal file
251
auth/auth.php
Normal file
|
@ -0,0 +1,251 @@
|
|||
<?php
|
||||
|
||||
$GLOBALS["COOKIE_NAME_USER_DATA"] = "user_data";
|
||||
$GLOBALS["COOKIE_NAME_USER_SIGN"] = "user_sign";
|
||||
|
||||
$host = gethostname();
|
||||
$localhost = false;
|
||||
if($host == "WolverinDEV")
|
||||
$localhost = true;
|
||||
|
||||
|
||||
/*
|
||||
openssl genrsa -des3 -out forum_private.pem 2048
|
||||
openssl rsa -in forum_private.pem -outform PEM -pubout -out forum_public.pem
|
||||
openssl rsa -in forum_private.pem -out private_unencrypted.pem -outform PEM #Export the private key as unencripted
|
||||
*/
|
||||
function authPath()
|
||||
{
|
||||
if (file_exists("auth")) {
|
||||
error_log("DEBUG MODE!");
|
||||
return "auth/";
|
||||
} else return "";
|
||||
}
|
||||
|
||||
function mainPath()
|
||||
{
|
||||
global $localhost;
|
||||
if ($localhost) {
|
||||
return "../";
|
||||
} else return "";
|
||||
}
|
||||
|
||||
function remoteAddress()
|
||||
{
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
|
||||
$ip = $_SERVER['HTTP_CLIENT_IP'];
|
||||
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
} else {
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
return $ip;
|
||||
}
|
||||
|
||||
/** @return \XF\App */
|
||||
function getXF()
|
||||
{
|
||||
if (isset($GLOBALS["XF_APP"])) return $GLOBALS["XF_APP"];
|
||||
|
||||
if (file_exists("/var/www/forum.teaspeak"))
|
||||
$dir = "/var/www/forum.teaspeak";
|
||||
else if (file_exists(__DIR__ . "/xf"))
|
||||
$dir = __DIR__ . "/xf";
|
||||
else if (file_exists(__DIR__ . "/auth/xf"))
|
||||
$dir = __DIR__ . "/auth/xf";
|
||||
else
|
||||
die("Could not resolve XF");
|
||||
require($dir . '/src/XF.php');
|
||||
|
||||
XF::start($dir);
|
||||
return ($GLOBALS["XF_APP"] = XF::setupApp('XF\Pub\App'));
|
||||
}
|
||||
|
||||
function milliseconds()
|
||||
{
|
||||
$mt = explode(' ', microtime());
|
||||
return ((int)$mt[1]) * 1000 + ((int)round($mt[0] * 1000));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $user \XF\Entity\User
|
||||
* @return array
|
||||
*/
|
||||
function generateUserData($user)
|
||||
{
|
||||
$user_data = array();
|
||||
|
||||
$user_data["user_id"] = $user->user_id;
|
||||
$user_data["user_name"] = $user->username;
|
||||
$user_data["user_group"] = $user->user_group_id;
|
||||
$user_data["user_groups"] = $user->secondary_group_ids;
|
||||
|
||||
$user_data["trophy_points"] = $user->trophy_points;
|
||||
$user_data["register_date"] = $user->register_date;
|
||||
$user_data["is_staff"] = $user->is_staff;
|
||||
$user_data["is_admin"] = $user->is_admin;
|
||||
$user_data["is_super_admin"] = $user->is_super_admin;
|
||||
$user_data["is_banned"] = $user->is_banned;
|
||||
|
||||
$user_data["data_age"] = milliseconds();
|
||||
|
||||
$data = json_encode($user_data);
|
||||
|
||||
|
||||
$file = realpath("./certs/private_unencrypted.pem");
|
||||
$pkeyid = openssl_pkey_get_private("file://" . $file);
|
||||
if (!$pkeyid) die("Could not open private key! Message: " . openssl_error_string() . " (" . $file . ")");
|
||||
if (!openssl_sign($data, $signature, $pkeyid, OPENSSL_ALGO_SHA256)) die("Could not sign user data");
|
||||
openssl_free_key($pkeyid);
|
||||
|
||||
return ["data" => $data, "sign" => base64_encode($signature)];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $username
|
||||
* @param $password
|
||||
*/
|
||||
function checkLogin($username, $password)
|
||||
{
|
||||
$allowedXFGroups = [
|
||||
3, //Administrator
|
||||
6, //Web tester
|
||||
5 //Premium
|
||||
];
|
||||
$app = getXF();
|
||||
|
||||
$response = [];
|
||||
$response["success"] = false;
|
||||
|
||||
if (!isset($username) || !isset($password)) {
|
||||
$response["msg"] = "missing credicals";
|
||||
goto _return;
|
||||
}
|
||||
|
||||
/** @var \XF\Service\User\Login $loginService */
|
||||
$loginService = $app->service('XF:User\Login', $username, "");
|
||||
if (!$loginService->isLoginLimited()) {
|
||||
$error = "";
|
||||
$user = $loginService->validate($password, $error);
|
||||
if ($user) {
|
||||
$response["success"] = true;
|
||||
$allowed = true;
|
||||
foreach ($allowedXFGroups as $id) {
|
||||
foreach ($user->secondary_group_ids as $assigned)
|
||||
if ($assigned == $id) {
|
||||
$allowed = true;
|
||||
break;
|
||||
}
|
||||
$allowed |= $user->user_group_id == $id;
|
||||
if ($allowed) break;
|
||||
}
|
||||
if ($allowed) {
|
||||
$response["allowed"] = true;
|
||||
|
||||
try {
|
||||
/** @var $session XF\Session\Session */
|
||||
$session = $app->session();
|
||||
if (!$session->exists()) {
|
||||
$session->expunge();
|
||||
if (!$session->start(remoteAddress())) {
|
||||
$response["success"] = false;
|
||||
$response["msg"] = "could not create session";
|
||||
goto _return;
|
||||
}
|
||||
}
|
||||
$session->changeUser($user);
|
||||
$session->save();
|
||||
$response["sessionName"] = $session->getCookieName();
|
||||
$response["sessionId"] = $session->getSessionId();
|
||||
$response["user_name"] = $user->username;
|
||||
|
||||
$user_data = generateUserData($user);
|
||||
$response["cookie_name_data"] = $GLOBALS["COOKIE_NAME_USER_DATA"];
|
||||
$response["cookie_name_sign"] = $GLOBALS["COOKIE_NAME_USER_SIGN"];
|
||||
$response["user_data"] = $user_data["data"];
|
||||
$response["user_sign"] = $user_data["sign"];
|
||||
} catch (Exception $error) {
|
||||
die($error);
|
||||
}
|
||||
goto _return;
|
||||
} else {
|
||||
$response["allowed"] = false;
|
||||
}
|
||||
} else {
|
||||
$response["msg"] = $error;
|
||||
}
|
||||
} else {
|
||||
$response["msg"] = "To many login's!";
|
||||
}
|
||||
|
||||
_return:
|
||||
die(json_encode($response));
|
||||
}
|
||||
|
||||
function logout()
|
||||
{
|
||||
$app = getXF();
|
||||
$session = $app->session();
|
||||
$session->expunge();
|
||||
|
||||
global $localhost;
|
||||
if($localhost)
|
||||
header("Location: login.php");
|
||||
else
|
||||
header("Location: https://web.teaspeak.de/");
|
||||
setcookie($session->getCookieName(), '', time() - 3600, '/');
|
||||
setcookie("session", '', time() - 3600, '/');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int 0 = Success | 1 = Invalid coocie | 2 = invalid session
|
||||
*/
|
||||
function testSession()
|
||||
{
|
||||
$app = getXF();
|
||||
if (!isset($_COOKIE[$app->session()->getCookieName()]))
|
||||
return 1;
|
||||
$sessionId = $_COOKIE[$app->session()->getCookieName()];
|
||||
$app->session()->expunge();
|
||||
if (!$app->session()->start(remoteAddress(), $sessionId) || !$app->session()->exists())
|
||||
return 2;
|
||||
return 0;
|
||||
}
|
||||
|
||||
function redirectOnInvalidSession()
|
||||
{
|
||||
$app = getXF();
|
||||
$status = testSession();
|
||||
if ($status != 0) {
|
||||
$type = "undefined";
|
||||
switch ($status) {
|
||||
case 1:
|
||||
$type = "nocookie";
|
||||
break;
|
||||
case 2:
|
||||
$type = "expired";
|
||||
break;
|
||||
default:
|
||||
$type = "unknown";
|
||||
break;
|
||||
}
|
||||
header('Location: ' . authPath() . 'login.php?error=' . $type);
|
||||
setcookie($app->session()->getCookieName(), "", 1);
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET["type"])) {
|
||||
error_log("Got authX request!");
|
||||
var_dump($_GET);
|
||||
var_dump($_POST);
|
||||
if ($_GET["type"] == "login") {
|
||||
checkLogin($_POST["user"], $_POST["pass"]);
|
||||
} else if ($_GET["type"] == "logout") {
|
||||
logout();
|
||||
} else die("unknown type!");
|
||||
} else if(isset($_POST)) {
|
||||
error_log("Got auth> request!");
|
||||
}
|
||||
|
||||
error_log("Got auth request!");
|
80
auth/css/auth.css
Normal file
80
auth/css/auth.css
Normal file
|
@ -0,0 +1,80 @@
|
|||
body{
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
.inner {
|
||||
position: absolute;
|
||||
}
|
||||
.inner-container{
|
||||
width:400px;
|
||||
height:400px;
|
||||
position:absolute;
|
||||
top:calc(50vh - 200px);
|
||||
left:calc(50vw - 200px);
|
||||
overflow:hidden;
|
||||
}
|
||||
.box{
|
||||
position:absolute;
|
||||
height:100%;
|
||||
width:100%;
|
||||
font-family:Helvetica;
|
||||
color:#fff;
|
||||
background:rgba(0,0,0,0.13);
|
||||
padding:30px 0px;
|
||||
text-align: center;
|
||||
}
|
||||
.box h1{
|
||||
text-align:center;
|
||||
margin:30px 0;
|
||||
font-size:30px;
|
||||
}
|
||||
.box input{
|
||||
display:block;
|
||||
width:300px;
|
||||
margin:20px auto;
|
||||
padding:15px;
|
||||
background:rgba(0,0,0,0.2);
|
||||
color:#fff;
|
||||
border:0;
|
||||
}
|
||||
.box input:focus,.box input:active,.box button:focus,.box button:active{
|
||||
outline:none;
|
||||
}
|
||||
.box button {
|
||||
background:#742ECC;
|
||||
border:0;
|
||||
color:#fff;
|
||||
padding:10px;
|
||||
font-size:20px;
|
||||
width:330px;
|
||||
margin:20px auto;
|
||||
display:block;
|
||||
cursor:pointer;
|
||||
}
|
||||
.box button:disabled {
|
||||
background:rgba(0,0,0,0.2);
|
||||
}
|
||||
.box button:active{
|
||||
background:#27ae60;
|
||||
}
|
||||
.box p{
|
||||
font-size:14px;
|
||||
text-align:center;
|
||||
}
|
||||
.box p span{
|
||||
cursor:pointer;
|
||||
color:#666;
|
||||
}
|
||||
|
||||
.box .error {
|
||||
color: darkred;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#login {
|
||||
display: block;
|
||||
}
|
||||
#success {
|
||||
margin-top: 50px;
|
||||
display: none;
|
||||
}
|
8
auth/info.php
Normal file
8
auth/info.php
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: wolverindev
|
||||
* Date: 16.03.18
|
||||
* Time: 17:03
|
||||
*/
|
||||
phpinfo();
|
81
auth/js/auth.js
Normal file
81
auth/js/auth.js
Normal file
|
@ -0,0 +1,81 @@
|
|||
$("#btn_login").click(function () {
|
||||
let _this = $(this);
|
||||
_this.attr("disabled", "true");
|
||||
_this.empty();
|
||||
spawnLoader().appendTo(_this);
|
||||
$("<a></a>").text(" Logging in").appendTo(_this);
|
||||
submitLogin(_this, $("#user").val(), $("#pass").val())
|
||||
});
|
||||
|
||||
function submitLogin(_this, user, pass) {
|
||||
$.ajax({
|
||||
url: "auth.php?type=login",
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {
|
||||
user: user,
|
||||
pass: pass
|
||||
},
|
||||
success: function(result){
|
||||
setTimeout(function () {
|
||||
let data;
|
||||
try {
|
||||
data = JSON.parse(result);
|
||||
} catch(e) {
|
||||
loginFailed("Invalid response: " + result);
|
||||
return;
|
||||
}
|
||||
if(data["success"] == false) {
|
||||
loginFailed(data["msg"]);
|
||||
return;
|
||||
}
|
||||
if(data["allowed"] == false) {
|
||||
loginFailed("You're not allowed for the closed alpha!");
|
||||
return;
|
||||
}
|
||||
$("#login").hide(500);
|
||||
$("#success").show(500);
|
||||
|
||||
document.cookie = data["sessionName"] + "=" + data["sessionId"] + ";path=/";
|
||||
document.cookie = data["cookie_name_data"] + "=" + data["user_data"] + ";path=/";
|
||||
document.cookie = data["cookie_name_sign"] + "=" + data["user_sign"] + ";path=/";
|
||||
console.log(result);
|
||||
|
||||
setTimeout(function () {
|
||||
window.location.href = _this.attr("target");
|
||||
}, 1000 + Math.random() % 1500);
|
||||
}, 500 + Math.random() % 500);
|
||||
},
|
||||
error: function (xhr,status,error) {
|
||||
loginFailed("Invalid request (" + status + ") => " + error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function loginFailed(err = "") {
|
||||
let button = $("#btn_login");
|
||||
button.empty();
|
||||
button.removeAttr("disabled");
|
||||
$("<a></a>").text("Login").appendTo(button);
|
||||
|
||||
let errTag = $(".box .error");
|
||||
if(err !== "") {
|
||||
errTag.text(err).show(500);
|
||||
} else errTag.hide(500);
|
||||
}
|
||||
|
||||
//<i class="fa fa-circle-o-notch fa-spin" id="login-loader"></i>
|
||||
|
||||
function spawnLoader() {
|
||||
let tag = $("<i></i>");
|
||||
tag.addClass("fa fa-circle-o-notch fa-spin");
|
||||
return tag;
|
||||
}
|
||||
|
||||
$("#user").on('keydown', event => {
|
||||
if(event.key == "Enter") $("#pass").focus();
|
||||
});
|
||||
|
||||
$("#pass").on('keydown', event => {
|
||||
if(event.key == "Enter") $("#btn_login").trigger("click");
|
||||
});
|
36
auth/login.php
Normal file
36
auth/login.php
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
include_once('auth.php');
|
||||
$session = testSession();
|
||||
if($session == 0) {
|
||||
header('Location: ' . mainPath() . 'index.php');
|
||||
die();
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="css/auth.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<script src="https://code.jquery.com/jquery-latest.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="inner-container">
|
||||
<div class="box">
|
||||
<h1>Login</h1>
|
||||
<div id="login">
|
||||
<a class="error">some error code</a>
|
||||
<input type="text" placeholder="Username" id="user"/>
|
||||
<input type="password" placeholder="Password" id="pass"/>
|
||||
<button id="btn_login" target="<?php echo mainPath() . "index.php"; ?>">Login</button>
|
||||
<p>Create a account on <a href="//forum.teaspeak.de">forum.teaspeak.de</a></p>
|
||||
</div>
|
||||
<div id="success">
|
||||
<a> Successful logged in!</a><br>
|
||||
<a>You will be redirected in 3 seconds</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="js/auth.js"></script>
|
||||
</body>
|
||||
</html>
|
1
auth/xf
Symbolic link
1
auth/xf
Symbolic link
|
@ -0,0 +1 @@
|
|||
/var/www/html/xforo/
|
1
css/auth.css
Symbolic link
1
css/auth.css
Symbolic link
|
@ -0,0 +1 @@
|
|||
../auth/css/auth.css
|
198
css/loader.css
Normal file
198
css/loader.css
Normal file
|
@ -0,0 +1,198 @@
|
|||
.loader {
|
||||
margin: 0;
|
||||
display: block;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 900;
|
||||
text-align: center; }
|
||||
|
||||
.loader .half {
|
||||
position: fixed;
|
||||
background: #222222;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 50%;
|
||||
height: 100%; }
|
||||
|
||||
.loader .half.right {
|
||||
right: 0; }
|
||||
|
||||
.loader .half.left {
|
||||
left: 0; }
|
||||
|
||||
.bookshelf_wrapper {
|
||||
position: relative;
|
||||
top: 40%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%); }
|
||||
|
||||
.books_list {
|
||||
margin: 0 auto;
|
||||
width: 300px;
|
||||
padding: 0; }
|
||||
|
||||
.book_item {
|
||||
position: absolute;
|
||||
top: -120px;
|
||||
box-sizing: border-box;
|
||||
list-style: none;
|
||||
width: 40px;
|
||||
height: 120px;
|
||||
opacity: 0;
|
||||
background-color: #1e6cc7;
|
||||
border: 5px solid white;
|
||||
transform-origin: bottom left;
|
||||
transform: translateX(300px);
|
||||
animation: travel 2500ms linear infinite; }
|
||||
.book_item.first {
|
||||
top: -140px;
|
||||
height: 140px; }
|
||||
.book_item.first:before, .book_item.first:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 5px;
|
||||
background-color: white; }
|
||||
.book_item.first:after {
|
||||
top: initial;
|
||||
bottom: 10px; }
|
||||
.book_item.second:before, .book_item.second:after, .book_item.fifth:before, .book_item.fifth:after {
|
||||
box-sizing: border-box;
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 17.5px;
|
||||
border-top: 5px solid white;
|
||||
border-bottom: 5px solid white; }
|
||||
.book_item.second:after, .book_item.fifth:after {
|
||||
top: initial;
|
||||
bottom: 10px; }
|
||||
.book_item.third:before, .book_item.third:after {
|
||||
box-sizing: border-box;
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 9px;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 50%;
|
||||
border: 5px solid white; }
|
||||
.book_item.third:after {
|
||||
top: initial;
|
||||
bottom: 10px; }
|
||||
.book_item.fourth {
|
||||
top: -130px;
|
||||
height: 130px; }
|
||||
.book_item.fourth:before {
|
||||
box-sizing: border-box;
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 46px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 17.5px;
|
||||
border-top: 5px solid white;
|
||||
border-bottom: 5px solid white; }
|
||||
.book_item.fifth {
|
||||
top: -100px;
|
||||
height: 100px; }
|
||||
.book_item.sixth {
|
||||
top: -140px;
|
||||
height: 140px; }
|
||||
.book_item.sixth:before {
|
||||
box-sizing: border-box;
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: 31px;
|
||||
left: 0px;
|
||||
width: 100%;
|
||||
height: 5px;
|
||||
background-color: white; }
|
||||
.book_item.sixth:after {
|
||||
box-sizing: border-box;
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
left: 9px;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 50%;
|
||||
border: 5px solid white; }
|
||||
.book_item:nth-child(2) {
|
||||
animation-delay: 416.66667ms; }
|
||||
.book_item:nth-child(3) {
|
||||
animation-delay: 833.33333ms; }
|
||||
.book_item:nth-child(4) {
|
||||
animation-delay: 1250ms; }
|
||||
.book_item:nth-child(5) {
|
||||
animation-delay: 1666.66667ms; }
|
||||
.book_item:nth-child(6) {
|
||||
animation-delay: 2083.33333ms; }
|
||||
|
||||
.shelf {
|
||||
width: 300px;
|
||||
height: 5px;
|
||||
margin: 0 auto;
|
||||
background-color: white;
|
||||
position: relative; }
|
||||
.shelf:before, .shelf:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #222222;
|
||||
background-image: radial-gradient(rgba(255, 255, 255, 0.5) 30%, transparent 0);
|
||||
background-size: 10px 10px;
|
||||
background-position: 0 -2.5px;
|
||||
top: 200%;
|
||||
left: 5%;
|
||||
animation: move 250ms linear infinite; }
|
||||
.shelf:after {
|
||||
top: 400%;
|
||||
left: 7.5%; }
|
||||
|
||||
@keyframes move {
|
||||
from {
|
||||
background-position-x: 0; }
|
||||
to {
|
||||
background-position-x: 10px; } }
|
||||
@keyframes travel {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateX(300px) rotateZ(0deg) scaleY(1); }
|
||||
6.5% {
|
||||
transform: translateX(279.5px) rotateZ(0deg) scaleY(1.1); }
|
||||
8.8% {
|
||||
transform: translateX(273.6px) rotateZ(0deg) scaleY(1); }
|
||||
10% {
|
||||
opacity: 1;
|
||||
transform: translateX(270px) rotateZ(0deg); }
|
||||
17.6% {
|
||||
transform: translateX(247.2px) rotateZ(-30deg); }
|
||||
45% {
|
||||
transform: translateX(165px) rotateZ(-30deg); }
|
||||
49.5% {
|
||||
transform: translateX(151.5px) rotateZ(-45deg); }
|
||||
61.5% {
|
||||
transform: translateX(115.5px) rotateZ(-45deg); }
|
||||
67% {
|
||||
transform: translateX(99px) rotateZ(-60deg); }
|
||||
76% {
|
||||
transform: translateX(72px) rotateZ(-60deg); }
|
||||
83.5% {
|
||||
opacity: 1;
|
||||
transform: translateX(49.5px) rotateZ(-90deg); }
|
||||
90% {
|
||||
opacity: 0; }
|
||||
100% {
|
||||
opacity: 0;
|
||||
transform: translateX(0px) rotateZ(-90deg); } }
|
||||
|
||||
/*# sourceMappingURL=loader.css.map */
|
7
css/loader.css.map
Normal file
7
css/loader.css.map
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AAYA,OAAQ;EACN,MAAM,EAAE,CAAC;EAET,OAAO,EAAE,KAAK;EACd,QAAQ,EAAE,KAAK;EACf,GAAG,EAAE,CAAC;EACN,MAAM,EAAE,CAAC;EACT,IAAI,EAAE,CAAC;EACP,KAAK,EAAE,CAAC;EAER,OAAO,EAAE,GAAG;EACZ,UAAU,EAAE,MAAM;;AAGpB,aAAc;EACZ,QAAQ,EAAE,KAAK;EACf,UAAU,EAAE,OAAO;EACnB,GAAG,EAAE,CAAC;EACN,MAAM,EAAE,CAAC;EACT,KAAK,EAAE,GAAG;EACV,MAAM,EAAE,IAAI;;AAGd,mBAAoB;EAClB,KAAK,EAAE,CAAC;;AAEV,kBAAmB;EACjB,IAAI,EAAE,CAAC;;AAGT,kBAAmB;EACjB,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,GAAG;EACR,IAAI,EAAE,GAAG;EACT,SAAS,EAAE,qBAAqB;;AAGlC,WAAY;EACV,MAAM,EAAE,MAAM;EACd,KAAK,EAAE,KAAK;EACZ,OAAO,EAAE,CAAC;;AAGZ,UAAW;EACT,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,MAAM;EACX,UAAU,EAAE,UAAU;EACtB,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,CAAC;EACV,gBAAgB,EAAE,OA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C;EAGnD,YAAQ;IACN,GAAG,EAAE,IAAI;IACT,IAAI,EAAE,IAAI;;AAKd,eAUC;EARC,IAAK;IACH,qBAAqB,EAAE,CAAC;EAG1B,EAAG;IACD,qBAAqB,EAAE,IAAI;AAK/B,iBA0DC;EAxDC,EAAG;IACD,OAAO,EAAE,CAAC;IACV,SAAS,EAAE,yCAAyC;EAGtD,IAAK;IACH,SAAS,EAAE,6CAA6C;EAG1D,IAAK;IACH,SAAS,EAAE,2CAA2C;EAGxD,GAAI;IACF,OAAO,EAAE,CAAC;IACV,SAAS,EAAE,+BAA+B;EAG5C,KAAM;IACJ,SAAS,EAAE,mCAAmC;EAGhD,GAAI;IACF,SAAS,EAAE,iCAAiC;EAG9C,KAAM;IACJ,SAAS,EAAE,mCAAmC;EAGhD,KAAM;IACJ,SAAS,EAAE,mCAAmC;EAGhD,GAAI;IACF,SAAS,EAAE,gCAAgC;EAG7C,GAAI;IACF,SAAS,EAAE,gCAAgC;EAG7C,KAAM;IACJ,OAAO,EAAE,CAAC;IACV,SAAS,EAAE,kCAAkC;EAG/C,GAAI;IACF,OAAO,EAAE,CAAC;EAGZ,IAAK;IACH,OAAO,EAAE,CAAC;IACV,SAAS,EAAE,+BAA+B",
|
||||
"sources": ["loader.scss"],
|
||||
"names": [],
|
||||
"file": "loader.css"
|
||||
}
|
185
css/music/info_plate.css
Normal file
185
css/music/info_plate.css
Normal file
|
@ -0,0 +1,185 @@
|
|||
.music-wrapper {
|
||||
display: flex;
|
||||
position: relative;
|
||||
width: 400px;
|
||||
height: 400px;
|
||||
user-select: none; }
|
||||
.music-wrapper .container .right:hover {
|
||||
z-index: 120; }
|
||||
.music-wrapper .container .right:hover .flip-card {
|
||||
transform: rotateY(-60deg); }
|
||||
.music-wrapper .left, .music-wrapper .right {
|
||||
position: absolute;
|
||||
width: 50%;
|
||||
height: 100%;
|
||||
perspective-origin: 50% 50%;
|
||||
perspective: 1200px; }
|
||||
.music-wrapper .left .flip-card,
|
||||
.music-wrapper .left .static-card, .music-wrapper .right .flip-card,
|
||||
.music-wrapper .right .static-card {
|
||||
background: white;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
border: 7px solid #dedede; }
|
||||
.music-wrapper .left .flip-card img,
|
||||
.music-wrapper .left .static-card img, .music-wrapper .right .flip-card img,
|
||||
.music-wrapper .right .static-card img {
|
||||
width: calc(100% * 2);
|
||||
height: 100%; }
|
||||
.music-wrapper .left .static-card, .music-wrapper .right .static-card {
|
||||
border-right: none; }
|
||||
.music-wrapper .left .flip-card, .music-wrapper .right .flip-card {
|
||||
border-left: none;
|
||||
transform-origin: 0% 50%;
|
||||
transition: transform 0.5s cubic-bezier(0.45, 0, 0.55, 1);
|
||||
transform: rotateY(0); }
|
||||
.music-wrapper .left .flip-card:before, .music-wrapper .right .flip-card:before {
|
||||
position: absolute;
|
||||
content: '';
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
right: -20px;
|
||||
box-shadow: 29px 0px 52px 6px #bababa; }
|
||||
.music-wrapper .left .flip-card img, .music-wrapper .right .flip-card img {
|
||||
position: absolute;
|
||||
background-color: #fff;
|
||||
right: 0; }
|
||||
.music-wrapper .left {
|
||||
left: 0; }
|
||||
.music-wrapper .right {
|
||||
right: 0; }
|
||||
.music-wrapper .controls {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
width: 50%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
cursor: pointer; }
|
||||
.music-wrapper .controls:after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-shadow: inset 20px 0px 37px -10px rgba(0, 0, 0, 0.75);
|
||||
pointer-events: none;
|
||||
transition: width 0.5s cubic-bezier(0.45, 0, 0.55, 1); }
|
||||
.music-wrapper .controls input[type="radio"] {
|
||||
position: absolute;
|
||||
left: -1000px; }
|
||||
.music-wrapper .controls label {
|
||||
flex-grow: 1;
|
||||
display: block;
|
||||
width: 100%;
|
||||
border-top: 1px #e6e6e6 solid;
|
||||
border-bottom: 1px #9c9c9c solid;
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
background-color: #dcdcdc; }
|
||||
.music-wrapper .controls label span {
|
||||
background-repeat: no-repeat;
|
||||
background-position: 16px 42px;
|
||||
width: 80px;
|
||||
height: 125px;
|
||||
display: block;
|
||||
pointer-events: none; }
|
||||
.music-wrapper .controls input:checked + label,
|
||||
.music-wrapper .controls label:active {
|
||||
background-color: #BCBCBC;
|
||||
box-shadow: inset 0px 0px 10px 5px rgba(120, 120, 120, 0.2);
|
||||
border: 1px solid #fff; }
|
||||
.music-wrapper .controls .btn-forward span {
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAABP0lEQVRoQ+2YwW3DMAxFX4ZNT7knE7QrNB0iWSKZIZ2g9/aYS4oPxECPpUSKFkCdZEAW+Pit729vmHxsJq+fAshWsBQoBTo7UI9QZwO7by8FgBOwA76629mwgYcCD+AbOABHQNfDhhfAUvAFeAFuowi8AVT3HXgDXp/zUJYIgKVgqbAFrpEEkQCqW+dB52IP/ESARAMsNcuh5FRnb4hRAEvdAnC13NEAAnG13AwAV8vNBHCx3GyAbstdC0Cz5a4JoMlyC8Axfeqt/f5Mtf9+a69FgebclA2g5KrUqvSquXlkAujbQWn101z1nxsyABQllE4/PM7PaIBpw9y0cbrJGi1nIvIRarbGbIBua8wEcLHGDABXaxwNMP2vRUvD3Nd6uJB7UZYNC8DSrYi1pUBEVy17lgKWbkWsLQUiumrZ8xeQiV4xsW8UvQAAAABJRU5ErkJggg=="); }
|
||||
.music-wrapper .controls .btn-rewind span {
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAsElEQVRoQ+2YSw6AIAxEh9vqifS2utAF0YgtpBCS57raz0wHxqTJnzR5/aKB0QiCAAg0TgAKNQ6w+fUaBI5C1lXS/lPVImkrxLhqcgXfSWkABDL+QaHHMrLEku+CCYWg0PtEc7HCFcxBdk2Aq0TOOiiECqFCfk+EH8AP4Ae+9wY/gB8wqCoyiowio8jo2J+7BqHqF1LjyPpVZ8hEA4YhhYaAQOh4DR8HAcOQQkOmR+AEspRaMYlt9skAAAAASUVORK5CYII="); }
|
||||
.music-wrapper .controls .btn-settings span {
|
||||
background-size: 42px 42px;
|
||||
background-position: 22px 42px;
|
||||
background-image: url("../../img/music/settings.svg"); }
|
||||
.music-wrapper .controls-overlay {
|
||||
position: absolute;
|
||||
display: block;
|
||||
top: calc(100% - 40px);
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
z-index: 100; }
|
||||
.music-wrapper .controls-overlay .timer {
|
||||
margin-left: 20px;
|
||||
height: 15px;
|
||||
z-index: 200;
|
||||
width: 360px;
|
||||
display: inline-flex;
|
||||
justify-content: space-between;
|
||||
vertical-align: center; }
|
||||
.music-wrapper .controls-overlay .timer .button {
|
||||
width: 10px;
|
||||
height: 12px;
|
||||
margin-left: 2px;
|
||||
fill: none;
|
||||
stroke: #4c4c4c;
|
||||
stroke-width: 0.5;
|
||||
stroke-miterlimit: 10;
|
||||
cursor: pointer; }
|
||||
.music-wrapper .controls-overlay .timer .button:hover {
|
||||
animation: bounce 500ms alternate;
|
||||
transform: scale(1.1);
|
||||
transition: transform 150ms; }
|
||||
.music-wrapper .controls-overlay .timer .timeline * {
|
||||
border: gray 0;
|
||||
border-radius: 8px; }
|
||||
.music-wrapper .controls-overlay .timer .timeline {
|
||||
width: 90%;
|
||||
height: 4px;
|
||||
float: right;
|
||||
background: #DBE3E3;
|
||||
position: relative;
|
||||
align-self: center;
|
||||
border: gray 0;
|
||||
border-radius: 8px; }
|
||||
.music-wrapper .controls-overlay .timer .timeline .buffered {
|
||||
position: absolute;
|
||||
width: 80%;
|
||||
height: 100%;
|
||||
background: #a0a0a0; }
|
||||
.music-wrapper .controls-overlay .timer .timeline .played {
|
||||
position: absolute;
|
||||
width: 60%;
|
||||
height: 100%;
|
||||
background: #1fe2e3; }
|
||||
.music-wrapper .controls-overlay .timer .timeline .slider {
|
||||
position: absolute;
|
||||
width: 4px;
|
||||
height: 12px;
|
||||
top: -4px;
|
||||
background: #303030;
|
||||
cursor: pointer; }
|
||||
|
||||
.music-wrapper.empty {
|
||||
border: 7px solid #dedede;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: white; }
|
||||
|
||||
.music-wrapper.empty img {
|
||||
margin: 5px;
|
||||
-webkit-animation: rotation 5s infinite linear; }
|
||||
|
||||
@-webkit-keyframes rotation {
|
||||
from {
|
||||
-webkit-transform: rotate(0deg); }
|
||||
to {
|
||||
-webkit-transform: rotate(359deg); } }
|
||||
.music-wrapper.empty a {
|
||||
text-align: center;
|
||||
margin: 5px;
|
||||
margin-top: 20px;
|
||||
font-size: 20px;
|
||||
font-family: Arial; }
|
||||
|
||||
/*# sourceMappingURL=info_plate.css.map */
|
7
css/music/info_plate.css.map
Normal file
7
css/music/info_plate.css.map
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AAGA,cAAe;EACd,OAAO,EAAE,IAAI;EACb,QAAQ,EAAE,QAAQ;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,KAAK;EACb,WAAW,EAAE,IAAI;EAGhB,sCAAa;IAKZ,OAAO,EAAE,GAAG;IAJZ,iDAAW;MACV,SAAS,EAAE,eAAe;EAO7B,2CAAc;IACb,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,IAAI;IACZ,kBAAkB,EAAE,OAAO;IAC3B,WAAW,EAAE,MAAM;IAEnB;;sCACa;MACZ,UAAU,EAAE,KAAK;MACjB,QAAQ,EAAE,QAAQ;MAClB,KAAK,EAAE,IAAI;MACX,MAAM,EAAE,IAAI;MACZ,QAAQ,EAAE,MA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AE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,KAAK,EAAE,KAAK;QACZ,UAAU,EAAE,OAAO;QACnB,QAAQ,EAAE,QAAQ;QAClB,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE,MAAM;QACd,aAAa,EAAE,GAAG;QAElB,2DAAU;UACT,QAAQ,EAAE,QAAQ;UAClB,KAAK,EAAE,GAAG;UACV,MAAM,EAAE,IAAI;UACZ,UAAU,EAAE,OAAO;QAGpB,yDAAQ;UACP,QAAQ,EAAE,QAAQ;UAClB,KAAK,EAAE,GAAG;UACV,MAAM,EAAE,IAAI;UACZ,UAAU,EAAE,OAAO;QAGpB,yDAAQ;UACP,QAAQ,EAAE,QAAQ;UAClB,KAAK,EAAE,GAAG;UACV,MAAM,EAAE,IAAI;UACZ,GAAG,EAAE,IAAI;UACT,UAAU,EAAE,OAAO;UACnB,MAAM,EAAE,OAAO;;AAOpB,oBAAqB;EACpB,MAAM,EAAE,iBAAiB;EACzB,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,MAAM;EACtB,UAAU,EAAE,KAAK;;AAGlB,wBAAyB;EACxB,MAAM,EAAE,GAAG;EACX,iBAAiB,EAAE,2BAA2B;;AAE/C,2BAOC;EANA,IAAK;IACJ,iBAAiB,EAAE,YAAY;EAEhC,EAAG;IACF,iBAAiB,EAAE,cAAc;AAInC,sBAAuB;EACtB,UAAU,EAAE,MAAM;EAClB,MAAM,EAAE,GAAG;EACX,UAAU,EAAE,IAAI;EAChB,SAAS,EAAE,IAAI;EACf,WAAW,EAAE,KAAK",
|
||||
"sources": ["info_plate.scss"],
|
||||
"names": [],
|
||||
"file": "info_plate.css"
|
||||
}
|
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
1
generated/js/client.min.js
vendored
1
generated/js/client.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
img/music/empty_disk.svg
Normal file
1
img/music/empty_disk.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 45 45" style="enable-background:new 0 0 45 45;" xml:space="preserve" version="1.1" id="svg2"><metadata id="metadata8"><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/></cc:Work></rdf:RDF></metadata><defs id="defs6"><clipPath id="clipPath16" clipPathUnits="userSpaceOnUse"><path id="path18" d="M 0,36 36,36 36,0 0,0 0,36 Z"/></clipPath><clipPath id="clipPath28" clipPathUnits="userSpaceOnUse"><path id="path30" d="M 2,18 C 2,9.164 9.164,2 18,2 l 0,0 c 8.836,0 16,7.164 16,16 l 0,0 c 0,8.836 -7.164,16 -16,16 l 0,0 C 9.164,34 2,26.836 2,18 m 11.235,0 c 0,2.632 2.133,4.765 4.765,4.765 l 0,0 c 2.631,0 4.766,-2.133 4.766,-4.765 l 0,0 c 0,-2.631 -2.135,-4.766 -4.766,-4.766 l 0,0 c -2.632,0 -4.765,2.135 -4.765,4.766"/></clipPath></defs><g transform="matrix(1.25,0,0,-1.25,0,45)" id="g10"><g id="g12"><g clip-path="url(#clipPath16)" id="g14"><g transform="translate(18,21)" id="g20"><path id="path22" style="fill:#8899a6;fill-opacity:1;fill-rule:nonzero;stroke:none" d="m 0,0 c -1.657,0 -3,-1.343 -3,-3 0,-1.657 1.343,-3 3,-3 1.657,0 3,1.343 3,3 0,1.657 -1.343,3 -3,3 m 18,-3 c 0,-9.941 -8.059,-18 -18,-18 -9.941,0 -18,8.059 -18,18 0,9.941 8.059,18 18,18 9.941,0 18,-8.059 18,-18"/></g></g></g><g id="g24"><g clip-path="url(#clipPath28)" id="g26"><g transform="translate(18,18)" id="g32"><path id="path34" style="fill:#ccd6dd;fill-opacity:1;fill-rule:nonzero;stroke:none" d="m 0,0 -18,2 0,16 16,0 2,-18 z"/></g><g transform="translate(18,18)" id="g36"><path id="path38" style="fill:#ccd6dd;fill-opacity:1;fill-rule:nonzero;stroke:none" d="M 0,0 18,-2 18,-18 2,-18 0,0 Z"/></g><g transform="translate(18.0005,17.9995)" id="g40"><path id="path42" style="fill:#f5f8fa;fill-opacity:1;fill-rule:nonzero;stroke:none" d="m 0,0 2.124,-18.999 15.875,1 L 0,0 Z"/></g><g transform="translate(18.0005,17.9995)" id="g44"><path id="path46" style="fill:#f5f8fa;fill-opacity:1;fill-rule:nonzero;stroke:none" d="m 0,0 -18.001,18.001 16,1 L 0,0 Z"/></g></g></g></g></svg>
|
After Width: | Height: | Size: 2.3 KiB |
23
img/music/settings.svg
Normal file
23
img/music/settings.svg
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 21.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 231.2 231.2" style="enable-background:new 0 0 231.2 231.2;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#333333;}
|
||||
</style>
|
||||
<path class="st0" d="M230.5,102.8c-0.4-3.2-4.2-5.7-7.4-5.7c-10.6,0-20-6.2-23.9-15.8c-4-9.9-1.4-21.3,6.5-28.6
|
||||
c2.5-2.3,2.8-6.1,0.7-8.7c-5.4-6.9-11.6-13.1-18.3-18.5c-2.6-2.1-6.5-1.8-8.8,0.7c-6.9,7.6-19.3,10.5-28.8,6.5
|
||||
c-10-4.2-16.2-14.3-15.6-25.1c0.2-3.4-2.3-6.4-5.7-6.8c-8.6-1-17.3-1-26-0.1c-3.3,0.4-5.8,3.3-5.7,6.6c0.4,10.7-6,20.6-15.8,24.7
|
||||
c-9.5,3.9-21.7,1-28.6-6.5c-2.3-2.5-6.1-2.8-8.7-0.7c-6.9,5.4-13.2,11.7-18.7,18.5c-2.1,2.7-1.8,6.5,0.7,8.8
|
||||
c8,7.3,10.6,18.9,6.5,28.8c-4,9.5-13.9,15.6-25.2,15.6c-3.7-0.1-6.3,2.3-6.7,5.7c-1,8.7-1,17.5,0,26.3c0.4,3.3,4.3,5.7,7.6,5.7
|
||||
c10.1-0.3,19.7,6,23.8,15.8c4,9.9,1.4,21.3-6.5,28.6c-2.5,2.3-2.8,6.1-0.7,8.7c5.4,6.8,11.5,13.1,18.3,18.5c2.7,2.1,6.5,1.8,8.8-0.7
|
||||
c6.9-7.6,19.3-10.5,28.8-6.5c10,4.2,16.3,14.3,15.6,25.1c-0.2,3.4,2.3,6.4,5.7,6.8c4.4,0.5,8.9,0.8,13.3,0.8c4.2,0,8.5-0.2,12.7-0.7
|
||||
c3.4-0.4,5.8-3.3,5.7-6.6c-0.4-10.7,6-20.6,15.8-24.7c9.5-3.9,21.8-1,28.6,6.5c2.3,2.5,6.1,2.8,8.7,0.7c6.9-5.4,13.2-11.6,18.7-18.5
|
||||
c2.1-2.6,1.8-6.5-0.7-8.8c-8-7.3-10.7-18.9-6.5-28.8c3.9-9.4,13.4-15.7,23.6-15.7l1.4,0c3.3,0.3,6.4-2.3,6.8-5.7
|
||||
C231.5,120.4,231.5,111.5,230.5,102.8z M115.6,182.3c-36.8,0-66.7-29.8-66.7-66.7S78.8,49,115.6,49s66.7,29.8,66.7,66.7
|
||||
c0,12.5-3.4,24.2-9.4,34.2l-29.2-29.2c2.1-5,3.2-10.4,3.2-16c0-10.9-4.3-21.2-12-28.9c-7.7-7.7-18-12-28.9-12
|
||||
c-3.6,0-7.3,0.5-10.8,1.4c-1.5,0.4-2.8,1.7-3.2,3.2c-0.4,1.6,0.1,3.2,1.3,4.4c0,0,14.4,14.5,19.2,19.3c0.5,0.5,0.5,1.7,0.4,2.1
|
||||
l0,0.3c-0.5,5.3-1.4,11.7-2.2,14.1c-0.1,0.1-0.2,0.2-0.3,0.3c-0.1,0.1-0.2,0.2-0.3,0.3c-2.5,0.8-8.9,1.7-14.3,2.2l0,0l-0.2,0.1
|
||||
c0,0-0.1,0-0.2,0c-0.6,0-1.4-0.2-2.2-0.9c-5-5-18.9-18.8-18.9-18.8c-1.2-1.2-2.5-1.5-3.4-1.5c-2,0-3.8,1.4-4.3,3.5
|
||||
c-3.8,14.1,0.2,29.3,10.5,39.6c7.7,7.7,18,12,28.9,12c5.6,0,11-1.1,16-3.2l29.5,29.5C141.1,178.4,128.8,182.3,115.6,182.3z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 2.1 KiB |
|
@ -32,6 +32,7 @@
|
|||
<link rel="stylesheet" href="css/loader.css" type="text/css">
|
||||
<link rel="stylesheet" href="css/music/info_plate.css" type="text/css">
|
||||
|
||||
<!-- https://localhost:9987/?forward_url=http%3A%2F%2Flocalhost%3A63344%2FWeb-Client%2Findex.php%3F_ijt%3D82b1uhmnh0a5l1n35nnjps5eid%26loader_ignore_age%3D1%26connect_default_host%3Dlocalhost%26default_connect_type%3Dforum%26default_connect_url%3Dtrue%26default_connect_type%3Dteamspeak%26default_connect_url%3Dlocalhost%253A9987 -->
|
||||
<!-- PHP generated properies -->
|
||||
<!-- localhost:63342/TeaSpeak-Web/index.php?_ijt=o48hmliefjoa8cer8v7mpl98pj&connect_default_host=192.168.43.141 -->
|
||||
<x-properties id="properties">
|
||||
|
|
25
js/client.ts
25
js/client.ts
|
@ -128,6 +128,27 @@ class TSClient {
|
|||
return !!this.serverConnection && this.serverConnection.connected;
|
||||
}
|
||||
|
||||
private certAcceptUrl() {
|
||||
// document.URL
|
||||
let callback = document.URL;
|
||||
if(document.location.search.length == 0)
|
||||
callback += "?default_connect_url=true";
|
||||
else
|
||||
callback += "&default_connect_url=true";
|
||||
//
|
||||
switch (this.serverConnection._handshakeHandler.identity.type()) {
|
||||
case IdentitifyType.TEAFORO:
|
||||
callback += "&default_connect_type=teaforo";
|
||||
break;
|
||||
case IdentitifyType.TEAMSPEAK:
|
||||
callback += "&default_connect_type=teamspeak";
|
||||
break;
|
||||
}
|
||||
callback += "&default_connect_url=" + encodeURIComponent(this.serverConnection._remoteHost + ":" + this.serverConnection._remotePort);
|
||||
|
||||
return "https://" + this.serverConnection._remoteHost + ":" + this.serverConnection._remotePort + "/?forward_url=" + encodeURIComponent(callback);
|
||||
}
|
||||
|
||||
handleDisconnect(type: DisconnectReason, data: any = {}) {
|
||||
switch (type) {
|
||||
case DisconnectReason.REQUESTED:
|
||||
|
@ -140,8 +161,8 @@ class TSClient {
|
|||
createErrorModal(
|
||||
"Could not connect",
|
||||
"Could not connect to remote host (Connection refused)<br>" +
|
||||
"If you're shure that the remot host is up, than you may not allow unsigned certificates.<br>" +
|
||||
"Click <a href='https://" + this.serverConnection._remoteHost + ":" + this.serverConnection._remotePort + "'>here</a> to accept the remote certificate"
|
||||
"If you're sure that the remote host is up, than you may not allow unsigned certificates.<br>" +
|
||||
"Click <a href='" + this.certAcceptUrl() + "'>here</a> to accept the remote certificate"
|
||||
).open();
|
||||
break;
|
||||
case DisconnectReason.CONNECTION_CLOSED:
|
||||
|
|
23
js/main.ts
23
js/main.ts
|
@ -45,10 +45,25 @@ function main() {
|
|||
//Modals.createChannelModal(undefined);
|
||||
|
||||
if(settings.static("default_connect_url")) {
|
||||
if(settings.static("default_connect_type", "forum") == "forum") {
|
||||
globalClient.startConnection(settings.static("default_connect_url"), forumIdentity);
|
||||
} else
|
||||
Modals.spawnConnectModal(settings.static("default_connect_url"));
|
||||
switch (settings.static("default_connect_type")) {
|
||||
case "teaforo":
|
||||
if(forumIdentity)
|
||||
globalClient.startConnection(settings.static("default_connect_url"), forumIdentity);
|
||||
else
|
||||
Modals.spawnConnectModal(settings.static("default_connect_url"), IdentitifyType.TEAFORO);
|
||||
break;
|
||||
|
||||
case "teamspeak":
|
||||
let connectIdentity = TSIdentityHelper.loadIdentity(settings.global("connect_identity_teamspeak_identity", ""));
|
||||
if(!connectIdentity)
|
||||
Modals.spawnConnectModal(settings.static("default_connect_url"), IdentitifyType.TEAMSPEAK);
|
||||
else
|
||||
globalClient.startConnection(settings.static("default_connect_url"), connectIdentity);
|
||||
break;
|
||||
|
||||
default:
|
||||
Modals.spawnConnectModal(settings.static("default_connect_url"));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -28,11 +28,11 @@ class ControlBar {
|
|||
}
|
||||
|
||||
initialise() {
|
||||
this.htmlTag.find(".btn_connect").click(this.onConnect.bind(this));
|
||||
this.htmlTag.find(".btn_client_away").click(this.onAway.bind(this));
|
||||
this.htmlTag.find(".btn_mute_input").click(this.onInputMute.bind(this));
|
||||
this.htmlTag.find(".btn_mute_output").click(this.onOutputMute.bind(this));
|
||||
this.htmlTag.find(".btn_open_settings").click(this.onOpenSettings.bind(this));
|
||||
this.htmlTag.find(".btn_connect").on('click', this.onConnect.bind(this));
|
||||
this.htmlTag.find(".btn_client_away").on('click', this.onAway.bind(this));
|
||||
this.htmlTag.find(".btn_mute_input").on('click', this.onInputMute.bind(this));
|
||||
this.htmlTag.find(".btn_mute_output").on('click', this.onOutputMute.bind(this));
|
||||
this.htmlTag.find(".btn_open_settings").on('click', this.onOpenSettings.bind(this));
|
||||
|
||||
|
||||
//Need an initialise
|
||||
|
@ -161,7 +161,7 @@ class ControlBar {
|
|||
});
|
||||
|
||||
if(this._codecNotSupported)
|
||||
createErrorModal("Channel codec unsupported", "This channel has an unsupported codec.<br>You cant speak or listen to anybody!").open();
|
||||
createErrorModal("Channel codec unsupported", "This channel has an unsupported codec.<br>You cant speak or listen to anybody within this channel!").open();
|
||||
}
|
||||
|
||||
private onOpenSettings() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference path="../../utils/modal.ts" />
|
||||
namespace Modals {
|
||||
export function spawnConnectModal(defaultHost: string = "ts.TeaSpeak.de") {
|
||||
export function spawnConnectModal(defaultHost: string = "ts.TeaSpeak.de", def_connect_type?: IdentitifyType) {
|
||||
let connectIdentity: Identity;
|
||||
const connectModal = createModal({
|
||||
header: function() {
|
||||
|
@ -12,6 +12,7 @@ namespace Modals {
|
|||
let tag = $("#tmpl_connect").contents().clone();
|
||||
|
||||
let updateFields = function () {
|
||||
console.log("UPDATE!");
|
||||
if(connectIdentity) tag.find(".connect_nickname").attr("placeholder", connectIdentity.name());
|
||||
else tag.find(".connect_nickname").attr("");
|
||||
|
||||
|
@ -42,9 +43,9 @@ namespace Modals {
|
|||
}
|
||||
|
||||
if(!flag_nickname || !flag_address || !connectIdentity) {
|
||||
button.attr("disabled", "true");
|
||||
button.prop("disabled", true);
|
||||
} else {
|
||||
button.removeAttr("disabled");
|
||||
button.prop("disabled", false);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -53,12 +54,12 @@ namespace Modals {
|
|||
tag.find(".connect_nickname").on("keyup", () => updateFields());
|
||||
|
||||
tag.find(".identity_select").on('change', function (this: HTMLSelectElement) {
|
||||
settings.changeGlobal("connect_identity_type", this.value);
|
||||
settings.changeGlobal("connect_identity_type", IdentitifyType[this.value]);
|
||||
tag.find(".error_message").hide();
|
||||
tag.find(".identity_config:not(" + ".identity_config_" + this.value + ")").hide();
|
||||
tag.find(".identity_config_" + this.value).show().trigger('shown');
|
||||
});
|
||||
tag.find(".identity_select").val(settings.global("connect_identity_type", "forum"));
|
||||
tag.find(".identity_select").val(IdentitifyType[def_connect_type ? def_connect_type : settings.global("connect_identity_type", IdentitifyType.TEAFORO)]);
|
||||
setTimeout(() => tag.find(".identity_select").trigger('change'), 0); //For some reason could not be run instantly
|
||||
|
||||
tag.find(".identity_file").change(function (this: HTMLInputElement) {
|
||||
|
@ -86,6 +87,7 @@ namespace Modals {
|
|||
tag.find(".identity_string").on('change', function (this: HTMLInputElement) {
|
||||
if(this.value.length == 0){
|
||||
tag.find(".error_message").text("Please select an identity!");
|
||||
connectIdentity = undefined;
|
||||
} else {
|
||||
connectIdentity = TSIdentityHelper.loadIdentity(this.value);
|
||||
if(!connectIdentity) tag.find(".error_message").text("Could not parse identity! " + TSIdentityHelper.last_error());
|
||||
|
@ -96,11 +98,11 @@ namespace Modals {
|
|||
updateFields();
|
||||
});
|
||||
tag.find(".identity_string").val(settings.global("connect_identity_teamspeak_identity", ""));
|
||||
tag.find(".identity_config_teamspeak").on('shown', ev => { tag.find(".identity_string").trigger('change'); });
|
||||
tag.find(".identity_config_" + IdentitifyType[IdentitifyType.TEAMSPEAK]).on('shown', ev => { tag.find(".identity_string").trigger('change'); });
|
||||
|
||||
if(!forumIdentity)
|
||||
tag.find(".identity_config_forum").html("You cant use your TeaSpeak forum account.<br>You're not connected!");
|
||||
tag.find(".identity_config_forum").on('shown', ev => { connectIdentity = forumIdentity; updateFields(); });
|
||||
tag.find(".identity_config_" + IdentitifyType[IdentitifyType.TEAFORO]).html("You cant use your TeaSpeak forum account.<br>You're not connected!");
|
||||
tag.find(".identity_config_" + IdentitifyType[IdentitifyType.TEAFORO]).on('shown', ev => { connectIdentity = forumIdentity; updateFields(); });
|
||||
|
||||
//connect_address
|
||||
return tag;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/// <reference path="../../utils/modal.ts" />
|
||||
/// <reference path="../../utils/tab.ts" />
|
||||
/// <reference path="../../proto.ts" />
|
||||
/// <reference path="../../voice/AudioController.ts" />
|
||||
|
||||
namespace Modals {
|
||||
export function spawnSettingsModal() {
|
||||
|
@ -115,10 +116,9 @@ namespace Modals {
|
|||
elm.trigger("change");
|
||||
|
||||
//Initialise microphones
|
||||
console.log(tag);
|
||||
let mselect = tag.find(".voice_microphone_select");
|
||||
console.log(mselect);
|
||||
let mselectError = tag.find(".voice_microphone_select_error");
|
||||
let select_microphone = tag.find(".voice_microphone_select");
|
||||
let select_error = tag.find(".voice_microphone_select_error");
|
||||
|
||||
navigator.mediaDevices.enumerateDevices().then(devices => {
|
||||
let currentStream = globalClient.voiceConnection.voiceRecorder.getMediaStream();
|
||||
let currentDeviceId;
|
||||
|
@ -134,23 +134,24 @@ namespace Modals {
|
|||
dtag.attr("device-id", device.deviceId);
|
||||
dtag.attr("device-group", device.groupId);
|
||||
dtag.text(device.label);
|
||||
mselect.append(dtag);
|
||||
select_microphone.append(dtag);
|
||||
|
||||
if(currentDeviceId && device.deviceId == currentDeviceId)
|
||||
mselect.attr("selected", "");
|
||||
dtag.prop("selected", currentDeviceId && device.deviceId == currentDeviceId);
|
||||
}
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error("Could not enumerate over devices!");
|
||||
console.error(error);
|
||||
mselectError.text("Could not get device list!").show();
|
||||
select_error.text("Could not get device list!").show();
|
||||
});
|
||||
|
||||
mselect.change(event => {
|
||||
let deviceSelected = mselect.find("option:selected");
|
||||
select_microphone.change(event => {
|
||||
let deviceSelected = select_microphone.find("option:selected");
|
||||
let deviceId = deviceSelected.attr("device-id");
|
||||
console.log("Selected device: " + deviceId);
|
||||
console.log("Selected microphone device: " + deviceId);
|
||||
globalClient.voiceConnection.voiceRecorder.changeDevice(deviceId);
|
||||
});
|
||||
//Initialise speakers
|
||||
|
||||
}
|
||||
}
|
|
@ -7,17 +7,18 @@ enum PlayerState {
|
|||
}
|
||||
|
||||
class AudioController {
|
||||
public static userMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
|
||||
private static _globalContext: AudioContext;
|
||||
private static _audioInstances: AudioController[] = [];
|
||||
private static _globalReplayScheduler: NodeJS.Timer;
|
||||
private static _timeIndex: number = 0;
|
||||
private static _audioDestinationStream: MediaStream;
|
||||
|
||||
static get globalContext() : AudioContext {
|
||||
if(this._globalContext) return this._globalContext;
|
||||
this._globalContext = new AudioContext();
|
||||
return this._globalContext;
|
||||
}
|
||||
|
||||
static initializeAudioController() {
|
||||
//this._globalReplayScheduler = setInterval(() => { AudioController.invokeNextReplay(); }, 20); //Fix me
|
||||
}
|
||||
|
@ -150,7 +151,7 @@ class AudioController {
|
|||
player.onended = () => this.removeNode(player);
|
||||
this.playingAudioCache.push(player);
|
||||
|
||||
player.connect(this.speakerContext.destination);
|
||||
player.connect(AudioController.globalContext.destination);
|
||||
player.start(this._timeIndex);
|
||||
this._timeIndex += buffer.duration;
|
||||
}
|
||||
|
|
|
@ -271,6 +271,7 @@ class VoiceConnection {
|
|||
|
||||
console.log("Voice ended");
|
||||
this.client.getClient().speaking = false;
|
||||
this.sendVoicePacket(new Uint8Array(0), 4); //TODO Use channel codec!
|
||||
if(this.dataChannel)
|
||||
this.sendVoicePacket(new Uint8Array(0), 4); //TODO Use channel codec!
|
||||
}
|
||||
}
|
|
@ -28,7 +28,6 @@ class VoiceRecorder {
|
|||
|
||||
private _recording: boolean = false;
|
||||
|
||||
private userMedia: any;
|
||||
private microphoneStream: MediaStreamAudioSourceNode = undefined;
|
||||
private mediaStream: MediaStream = undefined;
|
||||
|
||||
|
@ -43,7 +42,6 @@ class VoiceRecorder {
|
|||
|
||||
constructor(handle: VoiceConnection) {
|
||||
this.handle = handle;
|
||||
this.userMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
|
||||
|
||||
this._deviceId = settings.global("microphone_id", "default");
|
||||
|
||||
|
@ -71,7 +69,7 @@ class VoiceRecorder {
|
|||
}
|
||||
|
||||
avariable() : boolean {
|
||||
return !!this.userMedia;
|
||||
return !!AudioController.userMedia;
|
||||
}
|
||||
|
||||
recording() : boolean {
|
||||
|
@ -145,7 +143,7 @@ class VoiceRecorder {
|
|||
this._deviceId = device;
|
||||
console.log("Attempt recording!");
|
||||
this._recording = true;
|
||||
this.userMedia({
|
||||
AudioController.userMedia({
|
||||
audio: true,
|
||||
deviceId: device
|
||||
}, this.on_microphone.bind(this), error => {
|
||||
|
|
|
@ -1,164 +0,0 @@
|
|||
const prefix = "[CodecWorker] ";
|
||||
const workerCallbackToken = "callback_token";
|
||||
var CodecWorkerType;
|
||||
(function (CodecWorkerType) {
|
||||
CodecWorkerType[CodecWorkerType["WORKER_OPUS"] = 0] = "WORKER_OPUS";
|
||||
})(CodecWorkerType || (CodecWorkerType = {}));
|
||||
let codecInstance;
|
||||
onmessage = function (e) {
|
||||
let data = JSON.parse(e.data);
|
||||
let res = {};
|
||||
res.token = data.token;
|
||||
res.success = false;
|
||||
//console.log(prefix + " Got from main: %o", data);
|
||||
switch (data.command) {
|
||||
case "initialise":
|
||||
console.log(prefix + "Got initialize for type " + CodecWorkerType[data.type]);
|
||||
switch (data.type) {
|
||||
case CodecWorkerType.WORKER_OPUS:
|
||||
codecInstance = new OpusWorker(data.channelCount, data.channelCount == 1 ? OpusType.VOIP : OpusType.AUDIO);
|
||||
break;
|
||||
default:
|
||||
res.message = "Could not find worker type!";
|
||||
console.error("Could not resolve opus type!");
|
||||
return;
|
||||
}
|
||||
let error = codecInstance.initialise();
|
||||
if (error)
|
||||
res["message"] = error;
|
||||
else
|
||||
res["success"] = true;
|
||||
break;
|
||||
case "encodeSamples":
|
||||
let encodeArray = new Float32Array(data.dataLength);
|
||||
for (let index = 0; index < encodeArray.length; index++)
|
||||
encodeArray[index] = data.data[index];
|
||||
let encodeResult = codecInstance.encode(encodeArray);
|
||||
if (typeof encodeResult === "string") {
|
||||
res.message = encodeResult;
|
||||
}
|
||||
else {
|
||||
res.success = true;
|
||||
res.data = encodeResult;
|
||||
res.dataLength = encodeResult.length;
|
||||
}
|
||||
break;
|
||||
case "decodeSamples":
|
||||
let decodeArray = new Uint8Array(data.dataLength);
|
||||
for (let index = 0; index < decodeArray.length; index++)
|
||||
decodeArray[index] = data.data[index];
|
||||
let decodeResult = codecInstance.decode(decodeArray);
|
||||
if (typeof decodeResult === "string") {
|
||||
res.message = decodeResult;
|
||||
}
|
||||
else {
|
||||
res.success = true;
|
||||
res.data = decodeResult;
|
||||
res.dataLength = decodeResult.length;
|
||||
}
|
||||
break;
|
||||
case "reset":
|
||||
codecInstance.reset();
|
||||
break;
|
||||
default:
|
||||
console.error(prefix + "Unknown type " + data.command);
|
||||
}
|
||||
if (res.token && res.token.length > 0)
|
||||
sendMessage(res, e.origin);
|
||||
};
|
||||
function sendMessage(message, origin) {
|
||||
//console.log(prefix + " Send to main: %o", message);
|
||||
postMessage(JSON.stringify(message));
|
||||
}
|
||||
/// <reference path="CodecWorker.ts" />
|
||||
this["Module"] = typeof this["Module"] !== "undefined" ? this["Module"] : {};
|
||||
let initialized = false;
|
||||
Module['onRuntimeInitialized'] = function () {
|
||||
initialized = true;
|
||||
console.log(prefix + "Initialized!");
|
||||
sendMessage({
|
||||
token: workerCallbackToken,
|
||||
type: "loaded",
|
||||
success: true
|
||||
});
|
||||
};
|
||||
Module['onAbort'] = message => {
|
||||
Module['onAbort'] = undefined;
|
||||
sendMessage({
|
||||
token: workerCallbackToken,
|
||||
type: "loaded",
|
||||
success: false,
|
||||
message: message
|
||||
});
|
||||
};
|
||||
try {
|
||||
Module['locateFile'] = file => "../../asm/generated/" + file;
|
||||
importScripts("../../asm/generated/TeaWeb-Worker-Codec-Opus.js");
|
||||
}
|
||||
catch (e) {
|
||||
try {
|
||||
Module['locateFile'] = file => "../assembly/" + file;
|
||||
importScripts("../assembly/TeaWeb-Worker-Codec-Opus.js");
|
||||
}
|
||||
catch (e) {
|
||||
console.log(e);
|
||||
Module['onAbort']("Cloud not load native script!");
|
||||
}
|
||||
}
|
||||
//let Module = typeof Module !== 'undefined' ? Module : {};
|
||||
var OpusType;
|
||||
(function (OpusType) {
|
||||
OpusType[OpusType["VOIP"] = 2048] = "VOIP";
|
||||
OpusType[OpusType["AUDIO"] = 2049] = "AUDIO";
|
||||
OpusType[OpusType["RESTRICTED_LOWDELAY"] = 2051] = "RESTRICTED_LOWDELAY";
|
||||
})(OpusType || (OpusType = {}));
|
||||
class OpusWorker {
|
||||
constructor(channelCount, type) {
|
||||
this.bufferSize = 4096 * 2;
|
||||
this.channelCount = channelCount;
|
||||
this.type = type;
|
||||
}
|
||||
name() {
|
||||
return "Opus (Type: " + OpusWorker[this.type] + " Channels: " + this.channelCount + ")";
|
||||
}
|
||||
initialise() {
|
||||
this.fn_newHandle = Module.cwrap("codec_opus_createNativeHandle", "pointer", ["number", "number"]);
|
||||
this.fn_decode = Module.cwrap("codec_opus_decode", "number", ["pointer", "pointer", "number", "number"]);
|
||||
/* codec_opus_decode(handle, buffer, length, maxlength) */
|
||||
this.fn_encode = Module.cwrap("codec_opus_encode", "number", ["pointer", "pointer", "number", "number"]);
|
||||
this.fn_reset = Module.cwrap("codec_opus_reset", "number", ["pointer"]);
|
||||
this.nativeHandle = this.fn_newHandle(this.channelCount, this.type);
|
||||
this.encodeBufferRaw = Module._malloc(this.bufferSize);
|
||||
this.encodeBuffer = new Float32Array(Module.HEAPF32.buffer, this.encodeBufferRaw, this.bufferSize / 4);
|
||||
this.decodeBufferRaw = Module._malloc(this.bufferSize);
|
||||
this.decodeBuffer = new Uint8Array(Module.HEAPU8.buffer, this.decodeBufferRaw, this.bufferSize);
|
||||
return undefined;
|
||||
}
|
||||
deinitialise() { } //TODO
|
||||
decode(data) {
|
||||
if (data.byteLength > this.decodeBuffer.byteLength)
|
||||
return "Data to long!";
|
||||
this.decodeBuffer.set(data);
|
||||
//console.log("decode(" + data.length + ")");
|
||||
//console.log(data);
|
||||
let result = this.fn_decode(this.nativeHandle, this.decodeBuffer.byteOffset, data.byteLength, this.decodeBuffer.byteLength);
|
||||
if (result < 0) {
|
||||
return "invalid result on decode (" + result + ")";
|
||||
}
|
||||
return Module.HEAPF32.slice(this.decodeBuffer.byteOffset / 4, (this.decodeBuffer.byteOffset / 4) + (result * this.channelCount));
|
||||
}
|
||||
encode(data) {
|
||||
this.encodeBuffer.set(data);
|
||||
let result = this.fn_encode(this.nativeHandle, this.encodeBuffer.byteOffset, data.length, this.encodeBuffer.byteLength);
|
||||
if (result < 0) {
|
||||
return "invalid result on encode (" + result + ")";
|
||||
}
|
||||
let buf = Module.HEAP8.slice(this.encodeBuffer.byteOffset, this.encodeBuffer.byteOffset + result);
|
||||
return Uint8Array.from(buf);
|
||||
}
|
||||
reset() {
|
||||
console.log(prefix + " Reseting opus codec!");
|
||||
this.fn_reset(this.nativeHandle);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=WorkerCodec.js.map
|
File diff suppressed because one or more lines are too long
|
@ -1,73 +0,0 @@
|
|||
const prefix = "[CodecWorker] ";
|
||||
const workerCallbackToken = "callback_token";
|
||||
var CodecWorkerType;
|
||||
(function (CodecWorkerType) {
|
||||
CodecWorkerType[CodecWorkerType["WORKER_OPUS"] = 0] = "WORKER_OPUS";
|
||||
})(CodecWorkerType || (CodecWorkerType = {}));
|
||||
let codecInstance;
|
||||
onmessage = function (e) {
|
||||
let data = JSON.parse(e.data);
|
||||
let res = {};
|
||||
res.token = data.token;
|
||||
res.success = false;
|
||||
//console.log(prefix + " Got from main: %o", data);
|
||||
switch (data.command) {
|
||||
case "initialise":
|
||||
console.log(prefix + "Got initialize for type " + CodecWorkerType[data.type]);
|
||||
switch (data.type) {
|
||||
case CodecWorkerType.WORKER_OPUS:
|
||||
codecInstance = new OpusWorker(data.channelCount, data.channelCount == 1 ? OpusType.VOIP : OpusType.AUDIO);
|
||||
break;
|
||||
default:
|
||||
res.message = "Could not find worker type!";
|
||||
console.error("Could not resolve opus type!");
|
||||
return;
|
||||
}
|
||||
let error = codecInstance.initialise();
|
||||
if (error)
|
||||
res["message"] = error;
|
||||
else
|
||||
res["success"] = true;
|
||||
break;
|
||||
case "encodeSamples":
|
||||
let encodeArray = new Float32Array(data.dataLength);
|
||||
for (let index = 0; index < encodeArray.length; index++)
|
||||
encodeArray[index] = data.data[index];
|
||||
let encodeResult = codecInstance.encode(encodeArray);
|
||||
if (typeof encodeResult === "string") {
|
||||
res.message = encodeResult;
|
||||
}
|
||||
else {
|
||||
res.success = true;
|
||||
res.data = encodeResult;
|
||||
res.dataLength = encodeResult.length;
|
||||
}
|
||||
break;
|
||||
case "decodeSamples":
|
||||
let decodeArray = new Uint8Array(data.dataLength);
|
||||
for (let index = 0; index < decodeArray.length; index++)
|
||||
decodeArray[index] = data.data[index];
|
||||
let decodeResult = codecInstance.decode(decodeArray);
|
||||
if (typeof decodeResult === "string") {
|
||||
res.message = decodeResult;
|
||||
}
|
||||
else {
|
||||
res.success = true;
|
||||
res.data = decodeResult;
|
||||
res.dataLength = decodeResult.length;
|
||||
}
|
||||
break;
|
||||
case "reset":
|
||||
codecInstance.reset();
|
||||
break;
|
||||
default:
|
||||
console.error(prefix + "Unknown type " + data.command);
|
||||
}
|
||||
if (res.token && res.token.length > 0)
|
||||
sendMessage(res, e.origin);
|
||||
};
|
||||
function sendMessage(message, origin) {
|
||||
//console.log(prefix + " Send to main: %o", message);
|
||||
postMessage(JSON.stringify(message));
|
||||
}
|
||||
//# sourceMappingURL=CodecWorker.js.map
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"CodecWorker.js","sourceRoot":"","sources":["CodecWorker.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG,gBAAgB,CAAC;AAChC,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AAY7C,IAAK,eAEJ;AAFD,WAAK,eAAe;IAChB,mEAAW,CAAA;AACf,CAAC,EAFI,eAAe,KAAf,eAAe,QAEnB;AAED,IAAI,aAA0B,CAAC;AAE/B,SAAS,GAAG,UAAS,CAAC;IAClB,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAE9B,IAAI,GAAG,GAAQ,EAAE,CAAC;IAClB,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IACvB,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC;IAEpB,mDAAmD;IACnD,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QACnB,KAAK,YAAY;YACb,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,0BAA0B,GAAG,eAAe,CAAC,IAAI,CAAC,IAAuB,CAAC,CAAC,CAAC;YACjG,MAAM,CAAC,CAAC,IAAI,CAAC,IAAuB,CAAC,CAAC,CAAC;gB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: {};
|
||||
let initialized = false;
|
||||
Module['onRuntimeInitialized'] = function () {
|
||||
initialized = true;
|
||||
console.log(prefix + "Initialized!");
|
||||
sendMessage({
|
||||
token: workerCallbackToken,
|
||||
type: "loaded",
|
||||
success: true
|
||||
});
|
||||
};
|
||||
Module['onAbort'] = message => {
|
||||
Module['onAbort'] = undefined;
|
||||
sendMessage({
|
||||
token: workerCallbackToken,
|
||||
type: "loaded",
|
||||
success: false,
|
||||
message: message
|
||||
});
|
||||
};
|
||||
try {
|
||||
Module['locateFile'] = file => "../../asm/generated/" + file;
|
||||
importScripts("../../asm/generated/TeaWeb-Worker-Codec-Opus.js");
|
||||
}
|
||||
catch (e) {
|
||||
try {
|
||||
Module['locateFile'] = file => "../assembly/" + file;
|
||||
importScripts("../assembly/TeaWeb-Worker-Codec-Opus.js");
|
||||
}
|
||||
catch (e) {
|
||||
console.log(e);
|
||||
Module['onAbort']("Cloud not load native script!");
|
||||
}
|
||||
}
|
||||
//let Module = typeof Module !== 'undefined' ? Module : {};
|
||||
var OpusType;
|
||||
(function (OpusType) {
|
||||
OpusType[OpusType["VOIP"] = 2048] = "VOIP";
|
||||
OpusType[OpusType["AUDIO"] = 2049] = "AUDIO";
|
||||
OpusType[OpusType["RESTRICTED_LOWDELAY"] = 2051] = "RESTRICTED_LOWDELAY";
|
||||
})(OpusType || (OpusType = {}));
|
||||
class OpusWorker {
|
||||
constructor(channelCount, type) {
|
||||
this.bufferSize = 4096 * 2;
|
||||
this.channelCount = channelCount;
|
||||
this.type = type;
|
||||
}
|
||||
name() {
|
||||
return "Opus (Type: " + OpusWorker[this.type] + " Channels: " + this.channelCount + ")";
|
||||
}
|
||||
initialise() {
|
||||
this.fn_newHandle = Module.cwrap("codec_opus_createNativeHandle", "pointer", ["number", "number"]);
|
||||
this.fn_decode = Module.cwrap("codec_opus_decode", "number", ["pointer", "pointer", "number", "number"]);
|
||||
/* codec_opus_decode(handle, buffer, length, maxlength) */
|
||||
this.fn_encode = Module.cwrap("codec_opus_encode", "number", ["pointer", "pointer", "number", "number"]);
|
||||
this.fn_reset = Module.cwrap("codec_opus_reset", "number", ["pointer"]);
|
||||
this.nativeHandle = this.fn_newHandle(this.channelCount, this.type);
|
||||
this.encodeBufferRaw = Module._malloc(this.bufferSize);
|
||||
this.encodeBuffer = new Float32Array(Module.HEAPF32.buffer, this.encodeBufferRaw, this.bufferSize / 4);
|
||||
this.decodeBufferRaw = Module._malloc(this.bufferSize);
|
||||
this.decodeBuffer = new Uint8Array(Module.HEAPU8.buffer, this.decodeBufferRaw, this.bufferSize);
|
||||
return undefined;
|
||||
}
|
||||
deinitialise() { } //TODO
|
||||
decode(data) {
|
||||
if (data.byteLength > this.decodeBuffer.byteLength)
|
||||
return "Data to long!";
|
||||
this.decodeBuffer.set(data);
|
||||
//console.log("decode(" + data.length + ")");
|
||||
//console.log(data);
|
||||
let result = this.fn_decode(this.nativeHandle, this.decodeBuffer.byteOffset, data.byteLength, this.decodeBuffer.byteLength);
|
||||
if (result < 0) {
|
||||
return "invalid result on decode (" + result + ")";
|
||||
}
|
||||
return Module.HEAPF32.slice(this.decodeBuffer.byteOffset / 4, (this.decodeBuffer.byteOffset / 4) + (result * this.channelCount));
|
||||
}
|
||||
encode(data) {
|
||||
this.encodeBuffer.set(data);
|
||||
let result = this.fn_encode(this.nativeHandle, this.encodeBuffer.byteOffset, data.length, this.encodeBuffer.byteLength);
|
||||
if (result < 0) {
|
||||
return "invalid result on encode (" + result + ")";
|
||||
}
|
||||
let buf = Module.HEAP8.slice(this.encodeBuffer.byteOffset, this.encodeBuffer.byteOffset + result);
|
||||
return Uint8Array.from(buf);
|
||||
}
|
||||
reset() {
|
||||
console.log(prefix + " Reseting opus codec!");
|
||||
this.fn_reset(this.nativeHandle);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=OpusCodec.js.map
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"OpusCodec.js","sourceRoot":"","sources":["OpusCodec.ts"],"names":[],"mappings":"AAAA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MAAM,CAAC,IAAkB;QACrB,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAE5B,IAAI,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QACxH,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;YACb,MAAM,CAAC,4BAA4B,GAAG,MAAM,GAAG,GAAG,CAAC;QACvD,CAAC;QACD,IAAI,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,UAAU,GAAG,MAAM,CAAC,CAAC;QAClG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IAED,KAAK;QACD,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,uBAAuB,CAAC,CAAC;QAC9C,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACrC,CAAC;CACJ"}
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"module": "none",
|
||||
"target": "es6",
|
||||
"sourceMap": true,
|
||||
"outFile": "WorkerCodec.js"
|
||||
},
|
||||
"files": [
|
||||
"codec/CodecWorker.ts",
|
||||
"codec/OpusCodec.ts"
|
||||
]
|
||||
}
|
|
@ -134,19 +134,19 @@
|
|||
<div style="display: flex; justify-content: space-between;">
|
||||
<div style="text-align: right;">Identity Settings</div>
|
||||
<select class="identity_select">
|
||||
<option name="identity_type" value="forum">Forum Account</option>
|
||||
<option name="identity_type" value="teamspeak">TeamSpeak</option>
|
||||
<option name="identity_type" value="TEAFORO">Forum Account</option>
|
||||
<option name="identity_type" value="TEAMSPEAK">TeamSpeak</option>
|
||||
</select>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="identity_config_teamspeak identity_config">
|
||||
<div class="identity_config_TEAMSPEAK identity_config">
|
||||
Please enter your exported TS3 Identity string bellow or select your exported Identity<br>
|
||||
<div style="width: 100%; display: flex; flex-direction: row">
|
||||
<input placeholder="Identity string" style="width: 70%; margin: 5px;" class="identity_string">
|
||||
<div style="width: 30%; margin: 5px"><input class="identity_file" type="file"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="identity_config_forum identity_config">
|
||||
<div class="identity_config_TEAFORO identity_config">
|
||||
You're using your forum account as verification
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue