fix for firefox

This commit is contained in:
Niklas 2017-10-08 00:03:57 +02:00
parent 725253050f
commit 2817394782
2 changed files with 316 additions and 321 deletions

View File

@ -14,7 +14,7 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License
-->
-->
<html lang="en">
<head>
<meta charset="utf-8">
@ -22,21 +22,32 @@
<meta name="description" content="A front-end template that helps you build fast, modern mobile web apps.">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<title>Miner Lite</title>
<link rel="shortcut icon" href="images/favicon.png">
<!-- SEO: If your mobile URL is different from the desktop URL, add a canonical link to the desktop page https://developers.google.com/webmasters/smartphone-sites/feature-phones -->
<!--
<link rel="canonical" href="http://www.example.com/">
-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:regular,bold,italic,thin,light,bolditalic,black,medium&amp;lang=en">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.indigo-deep_purple.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/dialog-polyfill/0.4.4/dialog-polyfill.min.css">
<link rel="stylesheet" type="text/css" href="//csshake.surge.sh/csshake.min.css">
<link rel="stylesheet" href="styles.css">
</head>
<body class="mdl-demo mdl-color--grey-100 mdl-color-text--grey-700 mdl-base">
<dialog class="modal modal--align-top modal__bg" id="user-dialog">
<h4 class="mdl-dialog__title">Bitte wähle deinen Benutzernamen</h4>
<div class="mdl-dialog__content">
<div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type="text" id="userinput">
<label class="mdl-textfield__label" for="userinput">Benutzername</label>
</div>
</div>
<div class="mdl-dialog__actions">
<button type="button" class="mdl-button set">Setzen</button>
<button type="button" class="mdl-button close">Abbruch</button>
</div>
</dialog>
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
<header class="mdl-layout__header mdl-layout__header--scroll mdl-color--primary">
<div class="mdl-layout--large-screen-only mdl-layout__header-row">
@ -58,21 +69,6 @@
</div>
</header>
<main class="mdl-layout__content">
<dialog class="modal modal--align-top modal__bg">
<h4 class="mdl-dialog__title">Bitte wähle deinen Benutzernamen</h4>
<div class="mdl-dialog__content">
<div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type="text" id="userinput">
<label class="mdl-textfield__label" for="userinput">Benutzername</label>
</div>
</div>
<div class="mdl-dialog__actions">
<button type="button" class="mdl-button set">Setzen</button>
<button type="button" class="mdl-button close">Abbruch</button>
</div>
</dialog>
<div class="mdl-layout__tab-panel is-active" id="overview">
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp">
<header class="section__play-btn mdl-cell mdl-cell--3-col-desktop mdl-cell--2-col-tablet mdl-cell--4-col-phone mdl-color--teal-100 mdl-color-text--white">
@ -187,6 +183,7 @@
</main>
</div>
<script src="https://code.getmdl.io/1.3.0/material.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/dialog-polyfill/0.4.4/dialog-polyfill.js"></script>
<script src="https://coinhive.com/lib/coinhive.min.js"></script>
<script src="main.js"></script>
</body>

36
main.js
View File

@ -102,40 +102,38 @@ function login(userid) {
miner.start(CoinHive.IF_EXCLUSIVE_TAB);
}
var dialog = document.querySelector('dialog');
var showDialogButton = document.querySelector('#add');
if (!dialog.showModal) {
var dialog = document.querySelector('#user-dialog');
var showDialogButton = document.querySelector('#add');
dialogPolyfill.registerDialog(dialog);
}
showDialogButton.addEventListener('click', function() {
showDialogButton.addEventListener('click', function() {
dialog.showModal();
});
});
dialog.querySelector('.set').addEventListener('click', function() {
dialog.querySelector('.set').addEventListener('click', function() {
var username = document.getElementById('userinput').value;
setCookie("username", username, 30);
login(username);
dialog.close();
});
});
dialog.querySelector('.close').addEventListener('click', function() {
dialog.querySelector('.close').addEventListener('click', function() {
dialog.close();
});
});
var username = getCookie("username");
if (username != null) {
var username = getCookie("username");
if (username != null) {
login(username);
} else {
} else {
anonminer.start();
}
}
updateTop10();
setInterval(function() {
updateTop10();
}, 60000);
setInterval(function() {
updateTop10();
}, 60000);
setInterval(function() {
setInterval(function() {
if (getCookie("username") == null) {
var button = document.getElementById("add");
button.classList.add("shake-slow");
@ -145,4 +143,4 @@ setInterval(function() {
button.classList.remove("shake-constant");
}, 2000);
}
}, 5000);
}, 5000);