Implemented Minimal DARKMode
This commit is contained in:
parent
eca7f06e21
commit
247fa1103c
|
@ -35,11 +35,82 @@
|
||||||
display: block;
|
display: block;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.theme-switch-wrapper {
|
||||||
|
margin: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-switch {
|
||||||
|
display: inline-block;
|
||||||
|
height: 40px;
|
||||||
|
position: relative;
|
||||||
|
width: 65px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-switch input {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider {
|
||||||
|
background: #000;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
font-size: 13px;
|
||||||
|
transition: 0.4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider p:after {
|
||||||
|
color: #fff;
|
||||||
|
float: right;
|
||||||
|
margin: 0 5px 0 0;
|
||||||
|
content: "OFF";
|
||||||
|
transition: 0.4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider p:after {
|
||||||
|
float: left;
|
||||||
|
color: #000;
|
||||||
|
content: "ON";
|
||||||
|
margin: 0 0 0 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider:before {
|
||||||
|
background: #fff;
|
||||||
|
top: 8px;
|
||||||
|
content: "";
|
||||||
|
height: 26px;
|
||||||
|
left: 4px;
|
||||||
|
position: absolute;
|
||||||
|
transition: 0.4s;
|
||||||
|
width: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider:before {
|
||||||
|
transform: translateX(28px);
|
||||||
|
background: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider.round {
|
||||||
|
border-radius: 34px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider.round:before {
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.bundle.min.js"></script> <!--THIS LIBRARY SUCKS!-->
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.bundle.min.js"></script> <!--THIS LIBRARY SUCKS!-->
|
||||||
<script src="speedtest.js"></script>
|
<script src="speedtest.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var s = null
|
var s = null;
|
||||||
|
var xAxesColor='#000';
|
||||||
|
var yAxesColor='#000';
|
||||||
function runTest() {
|
function runTest() {
|
||||||
var chart1ctx = document.getElementById('chart1Area').getContext('2d')
|
var chart1ctx = document.getElementById('chart1Area').getContext('2d')
|
||||||
var chart2ctx = document.getElementById('chart2Area').getContext('2d')
|
var chart2ctx = document.getElementById('chart2Area').getContext('2d')
|
||||||
|
@ -150,6 +221,11 @@
|
||||||
},
|
},
|
||||||
ticks: {
|
ticks: {
|
||||||
beginAtZero: true
|
beginAtZero: true
|
||||||
|
},
|
||||||
|
gridLines: {
|
||||||
|
display: true ,
|
||||||
|
color:xAxesColor,
|
||||||
|
lineWidth:0.1
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
yAxes: [{
|
yAxes: [{
|
||||||
|
@ -157,6 +233,11 @@
|
||||||
scaleLabel: 'Speed',
|
scaleLabel: 'Speed',
|
||||||
ticks: {
|
ticks: {
|
||||||
beginAtZero: true
|
beginAtZero: true
|
||||||
|
},
|
||||||
|
gridLines: {
|
||||||
|
display:true,
|
||||||
|
color:yAxesColor,
|
||||||
|
lineWidth:0.1
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
@ -180,6 +261,11 @@
|
||||||
},
|
},
|
||||||
ticks: {
|
ticks: {
|
||||||
beginAtZero: true
|
beginAtZero: true
|
||||||
|
},
|
||||||
|
gridLines: {
|
||||||
|
display: true ,
|
||||||
|
color:xAxesColor,
|
||||||
|
lineWidth:0.1
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
yAxes: [{
|
yAxes: [{
|
||||||
|
@ -187,6 +273,11 @@
|
||||||
scaleLabel: 'Latency',
|
scaleLabel: 'Latency',
|
||||||
ticks: {
|
ticks: {
|
||||||
beginAtZero: true
|
beginAtZero: true
|
||||||
|
},
|
||||||
|
gridLines: {
|
||||||
|
display:true,
|
||||||
|
color:yAxesColor,
|
||||||
|
lineWidth:0.1
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
@ -251,6 +342,58 @@
|
||||||
<a href="javascript:abortTest()" id="abortBtn">Abort</a>
|
<a href="javascript:abortTest()" id="abortBtn">Abort</a>
|
||||||
</div>
|
</div>
|
||||||
<a href="javascript:runTest()" id="startBtn">Run speedtest</a>
|
<a href="javascript:runTest()" id="startBtn">Run speedtest</a>
|
||||||
|
<div id='darkMode'>
|
||||||
|
<h3>DARKMODE</h3>
|
||||||
|
<div class="theme-switch-wrapper">
|
||||||
|
<label class="theme-switch" for="checkbox">
|
||||||
|
<input type="checkbox" id="checkbox" />
|
||||||
|
<div class="slider round">
|
||||||
|
<p></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<br/><br/> Charts by <a href="http://www.chartjs.org/">Chart.js</a><br/><br/><a href="https://github.com/librespeed/speedtest">Source code</a>
|
<br/><br/> Charts by <a href="http://www.chartjs.org/">Chart.js</a><br/><br/><a href="https://github.com/librespeed/speedtest">Source code</a>
|
||||||
|
<script>
|
||||||
|
//DARMODE
|
||||||
|
const toggleSwitch = document.querySelector(
|
||||||
|
'.theme-switch input[type="checkbox"]'
|
||||||
|
);
|
||||||
|
|
||||||
|
function switchTheme(e) {
|
||||||
|
if (e.target.checked) {
|
||||||
|
toggleDarkMode();
|
||||||
|
} else {
|
||||||
|
toggleDarkMode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
toggleSwitch.addEventListener("change", switchTheme, true);
|
||||||
|
|
||||||
|
var countToggleDark = 0;
|
||||||
|
|
||||||
|
function toggleDarkMode() {
|
||||||
|
if (countToggleDark == 0) {
|
||||||
|
document.querySelector("html").style.background = "#000";
|
||||||
|
document.querySelector("body").style.background = "#000";
|
||||||
|
document.querySelector("html").style.color = "#fdfdfd";
|
||||||
|
document.querySelector("body").style.color = "#fdfdfd";
|
||||||
|
document.querySelector("#startBtn").style.border =
|
||||||
|
"0.15em solid #fff";
|
||||||
|
document.querySelector("#startBtn").style.color = "#fff";
|
||||||
|
xAxesColor="#fff";
|
||||||
|
yAxesColor="#fff";
|
||||||
|
countToggleDark++;
|
||||||
|
} else {
|
||||||
|
document.querySelector("html ").style.background = "#fdfdfd";
|
||||||
|
document.querySelector("body").style.background = "#fdfdfd";
|
||||||
|
document.querySelector("html").style.color = "#202020";
|
||||||
|
document.querySelector("body").style.color = "#202020";
|
||||||
|
document.querySelector("#startBtn").style.border =
|
||||||
|
"0.15em solid #000";
|
||||||
|
document.querySelector("#startBtn").style.color = "#6060AA";
|
||||||
|
xAxesColor="#000";
|
||||||
|
yAxesColor="#000";
|
||||||
|
countToggleDark = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -78,9 +78,9 @@ function I(id){return document.getElementById(id);}
|
||||||
box-shadow: 0 0 2em rgba(0,0,0,0.1), inset 0 0 1em rgba(0,0,0,0.1);
|
box-shadow: 0 0 2em rgba(0,0,0,0.1), inset 0 0 1em rgba(0,0,0,0.1);
|
||||||
}
|
}
|
||||||
#startStopBtn.running{
|
#startStopBtn.running{
|
||||||
background-color:#FF3030;
|
background-color:#FF3030!important;
|
||||||
border-color:#FF6060;
|
border-color:#FF6060!important;
|
||||||
color:#FFFFFF;
|
color:#FFFFFF!important;
|
||||||
}
|
}
|
||||||
#startStopBtn:before{
|
#startStopBtn:before{
|
||||||
content:"Start";
|
content:"Start";
|
||||||
|
@ -147,6 +147,74 @@ function I(id){return document.getElementById(id);}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.theme-switch-wrapper {
|
||||||
|
margin: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-switch {
|
||||||
|
display: inline-block;
|
||||||
|
height: 40px;
|
||||||
|
position: relative;
|
||||||
|
width: 65px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-switch input {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider {
|
||||||
|
background: #000;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
font-size: 13px;
|
||||||
|
transition: 0.4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider p:after {
|
||||||
|
color: #fff;
|
||||||
|
float: right;
|
||||||
|
margin: 0 5px 0 0;
|
||||||
|
content: "OFF";
|
||||||
|
transition: 0.4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider p:after {
|
||||||
|
float: left;
|
||||||
|
color: #000;
|
||||||
|
content: "ON";
|
||||||
|
margin: 0 0 0 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider:before {
|
||||||
|
background: #fff;
|
||||||
|
top: 8px;
|
||||||
|
content: "";
|
||||||
|
height: 26px;
|
||||||
|
left: 4px;
|
||||||
|
position: absolute;
|
||||||
|
transition: 0.4s;
|
||||||
|
width: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider:before {
|
||||||
|
transform: translateX(28px);
|
||||||
|
background: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider.round {
|
||||||
|
border-radius: 34px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider.round:before {
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -166,9 +234,60 @@ function I(id){return document.getElementById(id);}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id='darkMode'>
|
||||||
|
<h3>DARKMODE</h3>
|
||||||
|
<div class="theme-switch-wrapper">
|
||||||
|
<label class="theme-switch" for="checkbox">
|
||||||
|
<input type="checkbox" id="checkbox" />
|
||||||
|
<div class="slider round">
|
||||||
|
<p></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<a href="https://github.com/librespeed/speedtest">Source code</a>
|
<a href="https://github.com/librespeed/speedtest">Source code</a>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
initUI();
|
initUI();
|
||||||
|
|
||||||
|
//DARMODE
|
||||||
|
const toggleSwitch = document.querySelector(
|
||||||
|
'.theme-switch input[type="checkbox"]'
|
||||||
|
);
|
||||||
|
|
||||||
|
function switchTheme(e) {
|
||||||
|
if (e.target.checked) {
|
||||||
|
toggleDarkMode();
|
||||||
|
} else {
|
||||||
|
toggleDarkMode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
toggleSwitch.addEventListener("change", switchTheme, true);
|
||||||
|
|
||||||
|
var countToggleDark = 0;
|
||||||
|
|
||||||
|
function toggleDarkMode() {
|
||||||
|
if (countToggleDark == 0) {
|
||||||
|
document.querySelector("html").style.background = "#000";
|
||||||
|
document.querySelector("body").style.background = "#000";
|
||||||
|
document.querySelector("html").style.color = "#fdfdfd";
|
||||||
|
document.querySelector("body").style.color = "#fdfdfd";
|
||||||
|
document.querySelector("#startStopBtn").style.border =
|
||||||
|
"0.15em solid #996cb4";
|
||||||
|
document.querySelector("#startStopBtn").style.color = "#996cb4";
|
||||||
|
document.querySelector("h1").style.color = "#d3cfcf";
|
||||||
|
document.querySelector("#dlText").style.color = "#996cb4";
|
||||||
|
countToggleDark++;
|
||||||
|
} else {
|
||||||
|
document.querySelector("html ").style.background = "#fdfdfd";
|
||||||
|
document.querySelector("body").style.background = "#fdfdfd";
|
||||||
|
document.querySelector("html").style.color = "#202020";
|
||||||
|
document.querySelector("body").style.color = "#202020";
|
||||||
|
document.querySelector("#startStopBtn").style.border =
|
||||||
|
"0.15em solid #6060FF";
|
||||||
|
document.querySelector("#startStopBtn").style.color = "#6060AA";
|
||||||
|
document.querySelector("h1").style.color = "#404040";
|
||||||
|
document.querySelector("#dlText").style.color = "#000";
|
||||||
|
countToggleDark = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -154,9 +154,9 @@ function initUI(){
|
||||||
box-shadow: 0 0 2em rgba(0,0,0,0.1), inset 0 0 1em rgba(0,0,0,0.1);
|
box-shadow: 0 0 2em rgba(0,0,0,0.1), inset 0 0 1em rgba(0,0,0,0.1);
|
||||||
}
|
}
|
||||||
#startStopBtn.running{
|
#startStopBtn.running{
|
||||||
background-color:#FF3030;
|
background-color:#FF3030!important;
|
||||||
border-color:#FF6060;
|
border-color:#FF6060!important;
|
||||||
color:#FFFFFF;
|
color:#FFFFFF!important;
|
||||||
}
|
}
|
||||||
#startStopBtn:before{
|
#startStopBtn:before{
|
||||||
content:"Start";
|
content:"Start";
|
||||||
|
@ -272,6 +272,78 @@ function initUI(){
|
||||||
font-size:0.8em;
|
font-size:0.8em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#darkMode{
|
||||||
|
margin-top:-100px;
|
||||||
|
}
|
||||||
|
.theme-switch-wrapper {
|
||||||
|
margin:5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-switch {
|
||||||
|
display: inline-block;
|
||||||
|
height: 40px;
|
||||||
|
position: relative;
|
||||||
|
width: 65px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-switch input {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider {
|
||||||
|
background: #000;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
font-size: 13px;
|
||||||
|
transition: 0.4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider p:after {
|
||||||
|
color: #fff;
|
||||||
|
float: right;
|
||||||
|
margin: 0 5px 0 0;
|
||||||
|
content: "OFF";
|
||||||
|
transition: 0.4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider p:after {
|
||||||
|
float: left;
|
||||||
|
color: #000;
|
||||||
|
content: "ON";
|
||||||
|
margin: 0 0 0 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider:before {
|
||||||
|
background: #fff;
|
||||||
|
top: 8px;
|
||||||
|
content: "";
|
||||||
|
height: 26px;
|
||||||
|
left: 4px;
|
||||||
|
position: absolute;
|
||||||
|
transition: 0.4s;
|
||||||
|
width: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider:before {
|
||||||
|
transform: translateX(28px);
|
||||||
|
background: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider.round {
|
||||||
|
border-radius: 34px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider.round:before {
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<title>LibreSpeed Example</title>
|
<title>LibreSpeed Example</title>
|
||||||
</head>
|
</head>
|
||||||
|
@ -317,6 +389,15 @@ function initUI(){
|
||||||
<img src="" id="resultsImg" />
|
<img src="" id="resultsImg" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id='darkMode'>
|
||||||
|
<h3>DARKMODE</h3>
|
||||||
|
<div class="theme-switch-wrapper">
|
||||||
|
<label class="theme-switch" for="checkbox">
|
||||||
|
<input type="checkbox" id="checkbox" />
|
||||||
|
<div class="slider round">
|
||||||
|
<p></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<a href="https://github.com/librespeed/speedtest">Source code</a>
|
<a href="https://github.com/librespeed/speedtest">Source code</a>
|
||||||
</div>
|
</div>
|
||||||
<div id="privacyPolicy" style="display:none">
|
<div id="privacyPolicy" style="display:none">
|
||||||
|
@ -360,6 +441,60 @@ function initUI(){
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">setTimeout(function(){initUI()},100);</script>
|
<script type="text/javascript">
|
||||||
|
setTimeout(function(){initUI()},100);
|
||||||
|
|
||||||
|
//DARMODE
|
||||||
|
const toggleSwitch = document.querySelector(
|
||||||
|
'.theme-switch input[type="checkbox"]'
|
||||||
|
);
|
||||||
|
|
||||||
|
function switchTheme(e) {
|
||||||
|
if (e.target.checked) {
|
||||||
|
toggleDarkMode();
|
||||||
|
} else {
|
||||||
|
toggleDarkMode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
toggleSwitch.addEventListener("change", switchTheme, true);
|
||||||
|
|
||||||
|
var countToggleDark = 0;
|
||||||
|
|
||||||
|
function toggleDarkMode() {
|
||||||
|
if (countToggleDark == 0) {
|
||||||
|
document.querySelector("html").style.background = "#000";
|
||||||
|
document.querySelector("body").style.background = "#000";
|
||||||
|
document.querySelector("html").style.color = "#fdfdfd";
|
||||||
|
document.querySelector("body").style.color = "#fdfdfd";
|
||||||
|
document.querySelector("#startStopBtn").style.border =
|
||||||
|
"0.15em solid #996cb4";
|
||||||
|
document.querySelector("#startStopBtn").style.color = "#996cb4";
|
||||||
|
document.querySelector("h1").style.color = "#d3cfcf";
|
||||||
|
document.querySelector("#dlText").style.color = "#996cb4";
|
||||||
|
document.querySelector("#pingText").style.color = "#b92323";
|
||||||
|
document.querySelector("#jitText").style.color = "#b92323";
|
||||||
|
ulColor='#fff';
|
||||||
|
meterBk=/Trident.*rv:(\d+\.\d+)/i.test(navigator.userAgent)?"#EAEAEA":"#c7c7c7";
|
||||||
|
progColor="#fff";
|
||||||
|
countToggleDark++;
|
||||||
|
} else {
|
||||||
|
document.querySelector("html ").style.background = "#fdfdfd";
|
||||||
|
document.querySelector("body").style.background = "#fdfdfd";
|
||||||
|
document.querySelector("html").style.color = "#202020";
|
||||||
|
document.querySelector("body").style.color = "#202020";
|
||||||
|
document.querySelector("#startStopBtn").style.border =
|
||||||
|
"0.15em solid #6060FF";
|
||||||
|
document.querySelector("#startStopBtn").style.color = "#6060AA";
|
||||||
|
document.querySelector("h1").style.color = "#404040";
|
||||||
|
document.querySelector("#dlText").style.color = "#000";
|
||||||
|
document.querySelector("#pingText").style.color = "#AA6060";
|
||||||
|
document.querySelector("#jitText").style.color = "#AA6060";
|
||||||
|
ulColor='#616161';
|
||||||
|
meterBk=/Trident.*rv:(\d+\.\d+)/i.test(navigator.userAgent)?"#EAEAEA":"#80808040";
|
||||||
|
progColor=meterBk;
|
||||||
|
countToggleDark = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -139,9 +139,9 @@ function initUI(){
|
||||||
box-shadow: 0 0 2em rgba(0,0,0,0.1), inset 0 0 1em rgba(0,0,0,0.1);
|
box-shadow: 0 0 2em rgba(0,0,0,0.1), inset 0 0 1em rgba(0,0,0,0.1);
|
||||||
}
|
}
|
||||||
#startStopBtn.running{
|
#startStopBtn.running{
|
||||||
background-color:#FF3030;
|
background-color: #ff3030 !important;
|
||||||
border-color:#FF6060;
|
border-color: #ff6060 !important;
|
||||||
color:#FFFFFF;
|
color: #ffffff !important;
|
||||||
}
|
}
|
||||||
#startStopBtn:before{
|
#startStopBtn:before{
|
||||||
content:"Start";
|
content:"Start";
|
||||||
|
@ -217,6 +217,78 @@ function initUI(){
|
||||||
font-size:0.8em;
|
font-size:0.8em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#darkMode{
|
||||||
|
margin-top:-100px;
|
||||||
|
}
|
||||||
|
.theme-switch-wrapper {
|
||||||
|
margin:5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-switch {
|
||||||
|
display: inline-block;
|
||||||
|
height: 40px;
|
||||||
|
position: relative;
|
||||||
|
width: 65px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-switch input {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider {
|
||||||
|
background: #000;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
font-size: 13px;
|
||||||
|
transition: 0.4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider p:after {
|
||||||
|
color: #fff;
|
||||||
|
float: right;
|
||||||
|
margin: 0 5px 0 0;
|
||||||
|
content: "OFF";
|
||||||
|
transition: 0.4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider p:after {
|
||||||
|
float: left;
|
||||||
|
color: #000;
|
||||||
|
content: "ON";
|
||||||
|
margin: 0 0 0 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider:before {
|
||||||
|
background: #fff;
|
||||||
|
top: 8px;
|
||||||
|
content: "";
|
||||||
|
height: 26px;
|
||||||
|
left: 4px;
|
||||||
|
position: absolute;
|
||||||
|
transition: 0.4s;
|
||||||
|
width: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider:before {
|
||||||
|
transform: translateX(28px);
|
||||||
|
background: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider.round {
|
||||||
|
border-radius: 34px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider.round:before {
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<title>LibreSpeed Example</title>
|
<title>LibreSpeed Example</title>
|
||||||
</head>
|
</head>
|
||||||
|
@ -255,8 +327,72 @@ function initUI(){
|
||||||
<span id="ip"></span>
|
<span id="ip"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id='darkMode'>
|
||||||
|
<h3>DARKMODE</h3>
|
||||||
|
<div class="theme-switch-wrapper">
|
||||||
|
<label class="theme-switch" for="checkbox">
|
||||||
|
<input type="checkbox" id="checkbox" />
|
||||||
|
<div class="slider round">
|
||||||
|
<p></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
<a href="https://github.com/librespeed/speedtest">Source code</a>
|
<a href="https://github.com/librespeed/speedtest">Source code</a>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">setTimeout(function(){initUI()},100);</script>
|
<script type="text/javascript">
|
||||||
|
setTimeout(function(){initUI()},100);
|
||||||
|
//DARMODE
|
||||||
|
const toggleSwitch = document.querySelector(
|
||||||
|
'.theme-switch input[type="checkbox"]'
|
||||||
|
);
|
||||||
|
|
||||||
|
function switchTheme(e) {
|
||||||
|
if (e.target.checked) {
|
||||||
|
toggleDarkMode();
|
||||||
|
} else {
|
||||||
|
toggleDarkMode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
toggleSwitch.addEventListener("change", switchTheme, true);
|
||||||
|
|
||||||
|
var countToggleDark = 0;
|
||||||
|
|
||||||
|
function toggleDarkMode() {
|
||||||
|
if (countToggleDark == 0) {
|
||||||
|
document.querySelector("html").style.background = "#000";
|
||||||
|
document.querySelector("body").style.background = "#000";
|
||||||
|
document.querySelector("html").style.color = "#fdfdfd";
|
||||||
|
document.querySelector("body").style.color = "#fdfdfd";
|
||||||
|
document.querySelector("#startStopBtn").style.border =
|
||||||
|
"0.15em solid #996cb4";
|
||||||
|
document.querySelector("#startStopBtn").style.color = "#996cb4";
|
||||||
|
document.querySelector("h1").style.color = "#d3cfcf";
|
||||||
|
document.querySelector("#dlText").style.color = "#996cb4";
|
||||||
|
document.querySelector("#pingText").style.color = "#b92323";
|
||||||
|
document.querySelector("#jitText").style.color = "#b92323";
|
||||||
|
ulColor='#fff';
|
||||||
|
meterBk=/Trident.*rv:(\d+\.\d+)/i.test(navigator.userAgent)?"#EAEAEA":"#c7c7c7";
|
||||||
|
progColor="#fff";
|
||||||
|
countToggleDark++;
|
||||||
|
} else {
|
||||||
|
document.querySelector("html ").style.background = "#fdfdfd";
|
||||||
|
document.querySelector("body").style.background = "#fdfdfd";
|
||||||
|
document.querySelector("html").style.color = "#202020";
|
||||||
|
document.querySelector("body").style.color = "#202020";
|
||||||
|
document.querySelector("#startStopBtn").style.border =
|
||||||
|
"0.15em solid #6060FF";
|
||||||
|
document.querySelector("#startStopBtn").style.color = "#6060AA";
|
||||||
|
document.querySelector("h1").style.color = "#404040";
|
||||||
|
document.querySelector("#dlText").style.color = "#000";
|
||||||
|
document.querySelector("#pingText").style.color = "#AA6060";
|
||||||
|
document.querySelector("#jitText").style.color = "#AA6060";
|
||||||
|
ulColor='#616161';
|
||||||
|
meterBk=/Trident.*rv:(\d+\.\d+)/i.test(navigator.userAgent)?"#EAEAEA":"#80808040";
|
||||||
|
progColor=meterBk;
|
||||||
|
countToggleDark = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,192 +1,352 @@
|
||||||
<!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, shrink-to-fit=no, user-scalable=no" />
|
<meta
|
||||||
<title>LibreSpeed Example</title>
|
name="viewport"
|
||||||
<link rel="shortcut icon" href="favicon.ico">
|
content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no"
|
||||||
<script type="text/javascript" src="speedtest.js"></script>
|
/>
|
||||||
<script type="text/javascript">
|
<title>LibreSpeed Example</title>
|
||||||
|
<link rel="shortcut icon" href="favicon.ico" />
|
||||||
|
<script type="text/javascript" src="speedtest.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
//INITIALIZE SPEEDTEST
|
||||||
|
var s = new Speedtest(); //create speedtest object
|
||||||
|
s.onupdate = function (data) {
|
||||||
|
//callback to update data in UI
|
||||||
|
I("ip").textContent = data.clientIp;
|
||||||
|
I("dlText").textContent =
|
||||||
|
data.testState == 1 && data.dlStatus == 0 ? "..." : data.dlStatus;
|
||||||
|
I("ulText").textContent =
|
||||||
|
data.testState == 3 && data.ulStatus == 0 ? "..." : data.ulStatus;
|
||||||
|
I("pingText").textContent = data.pingStatus;
|
||||||
|
I("jitText").textContent = data.jitterStatus;
|
||||||
|
};
|
||||||
|
s.onend = function (aborted) {
|
||||||
|
//callback for test ended/aborted
|
||||||
|
I("startStopBtn").className = ""; //show start button again
|
||||||
|
if (aborted) {
|
||||||
|
//if the test was aborted, clear the UI and prepare for new test
|
||||||
|
initUI();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
//INITIALIZE SPEEDTEST
|
function startStop() {
|
||||||
var s=new Speedtest(); //create speedtest object
|
//start/stop button pressed
|
||||||
s.onupdate=function(data){ //callback to update data in UI
|
if (s.getState() == 3) {
|
||||||
I("ip").textContent=data.clientIp;
|
//speedtest is running, abort
|
||||||
I("dlText").textContent=(data.testState==1&&data.dlStatus==0)?"...":data.dlStatus;
|
s.abort();
|
||||||
I("ulText").textContent=(data.testState==3&&data.ulStatus==0)?"...":data.ulStatus;
|
} else {
|
||||||
I("pingText").textContent=data.pingStatus;
|
//test is not running, begin
|
||||||
I("jitText").textContent=data.jitterStatus;
|
s.start();
|
||||||
}
|
I("startStopBtn").className = "running";
|
||||||
s.onend=function(aborted){ //callback for test ended/aborted
|
}
|
||||||
I("startStopBtn").className=""; //show start button again
|
}
|
||||||
if(aborted){ //if the test was aborted, clear the UI and prepare for new test
|
|
||||||
initUI();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function startStop(){ //start/stop button pressed
|
//function to (re)initialize UI
|
||||||
if(s.getState()==3){
|
function initUI() {
|
||||||
//speedtest is running, abort
|
I("dlText").textContent = "";
|
||||||
s.abort();
|
I("ulText").textContent = "";
|
||||||
}else{
|
I("pingText").textContent = "";
|
||||||
//test is not running, begin
|
I("jitText").textContent = "";
|
||||||
s.start();
|
I("ip").textContent = "";
|
||||||
I("startStopBtn").className="running";
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//function to (re)initialize UI
|
function I(id) {
|
||||||
function initUI(){
|
return document.getElementById(id);
|
||||||
I("dlText").textContent="";
|
}
|
||||||
I("ulText").textContent="";
|
</script>
|
||||||
I("pingText").textContent="";
|
|
||||||
I("jitText").textContent="";
|
|
||||||
I("ip").textContent="";
|
|
||||||
}
|
|
||||||
|
|
||||||
function I(id){return document.getElementById(id);}
|
<style type="text/css">
|
||||||
</script>
|
html,
|
||||||
|
body {
|
||||||
|
border: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
background: #ffffff;
|
||||||
|
color: #202020;
|
||||||
|
}
|
||||||
|
|
||||||
<style type="text/css">
|
body {
|
||||||
html,body{
|
text-align: center;
|
||||||
border:none; padding:0; margin:0;
|
font-family: "Roboto", sans-serif;
|
||||||
background:#FFFFFF;
|
}
|
||||||
color:#202020;
|
|
||||||
}
|
|
||||||
body{
|
|
||||||
text-align:center;
|
|
||||||
font-family:"Roboto",sans-serif;
|
|
||||||
}
|
|
||||||
h1{
|
|
||||||
color:#404040;
|
|
||||||
}
|
|
||||||
#startStopBtn{
|
|
||||||
display:inline-block;
|
|
||||||
margin:0 auto;
|
|
||||||
color:#6060AA;
|
|
||||||
background-color:rgba(0,0,0,0);
|
|
||||||
border:0.15em solid #6060FF;
|
|
||||||
border-radius:0.3em;
|
|
||||||
transition:all 0.3s;
|
|
||||||
box-sizing:border-box;
|
|
||||||
width:8em; height:3em;
|
|
||||||
line-height:2.7em;
|
|
||||||
cursor:pointer;
|
|
||||||
box-shadow: 0 0 0 rgba(0,0,0,0.1), inset 0 0 0 rgba(0,0,0,0.1);
|
|
||||||
}
|
|
||||||
#startStopBtn:hover{
|
|
||||||
box-shadow: 0 0 2em rgba(0,0,0,0.1), inset 0 0 1em rgba(0,0,0,0.1);
|
|
||||||
}
|
|
||||||
#startStopBtn.running{
|
|
||||||
background-color:#FF3030;
|
|
||||||
border-color:#FF6060;
|
|
||||||
color:#FFFFFF;
|
|
||||||
}
|
|
||||||
#startStopBtn:before{
|
|
||||||
content:"Start";
|
|
||||||
}
|
|
||||||
#startStopBtn.running:before{
|
|
||||||
content:"Abort";
|
|
||||||
}
|
|
||||||
#test{
|
|
||||||
margin-top:2em;
|
|
||||||
margin-bottom:12em;
|
|
||||||
}
|
|
||||||
div.testArea{
|
|
||||||
display:inline-block;
|
|
||||||
width:14em;
|
|
||||||
height:9em;
|
|
||||||
position:relative;
|
|
||||||
box-sizing:border-box;
|
|
||||||
}
|
|
||||||
div.testName{
|
|
||||||
position:absolute;
|
|
||||||
top:0.1em; left:0;
|
|
||||||
width:100%;
|
|
||||||
font-size:1.4em;
|
|
||||||
z-index:9;
|
|
||||||
}
|
|
||||||
div.meterText{
|
|
||||||
position:absolute;
|
|
||||||
bottom:1.5em; left:0;
|
|
||||||
width:100%;
|
|
||||||
font-size:2.5em;
|
|
||||||
z-index:9;
|
|
||||||
}
|
|
||||||
#dlText{
|
|
||||||
color:#6060AA;
|
|
||||||
}
|
|
||||||
#ulText{
|
|
||||||
color:#309030;
|
|
||||||
}
|
|
||||||
#pingText,#jitText{
|
|
||||||
color:#AA6060;
|
|
||||||
}
|
|
||||||
div.meterText:empty:before{
|
|
||||||
color:#505050 !important;
|
|
||||||
content:"0.00";
|
|
||||||
}
|
|
||||||
div.unit{
|
|
||||||
position:absolute;
|
|
||||||
bottom:2em; left:0;
|
|
||||||
width:100%;
|
|
||||||
z-index:9;
|
|
||||||
}
|
|
||||||
div.testGroup{
|
|
||||||
display:inline-block;
|
|
||||||
}
|
|
||||||
@media all and (max-width:65em){
|
|
||||||
body{
|
|
||||||
font-size:1.5vw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@media all and (max-width:40em){
|
|
||||||
body{
|
|
||||||
font-size:0.8em;
|
|
||||||
}
|
|
||||||
div.testGroup{
|
|
||||||
display:block;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
h1 {
|
||||||
</head>
|
color: #404040;
|
||||||
<body>
|
}
|
||||||
<h1>LibreSpeed Example</h1>
|
|
||||||
<div id="startStopBtn" onclick="startStop()"></div>
|
#startStopBtn {
|
||||||
<div id="test">
|
display: inline-block;
|
||||||
<div class="testGroup">
|
margin: 0 auto;
|
||||||
<div class="testArea">
|
color: #6060aa;
|
||||||
<div class="testName">Download</div>
|
background-color: rgba(0, 0, 0, 0);
|
||||||
<div id="dlText" class="meterText"></div>
|
border: 0.15em solid #6060ff;
|
||||||
<div class="unit">Mbps</div>
|
border-radius: 0.3em;
|
||||||
</div>
|
transition: all 0.3s;
|
||||||
<div class="testArea">
|
box-sizing: border-box;
|
||||||
<div class="testName">Upload</div>
|
width: 8em;
|
||||||
<div id="ulText" class="meterText"></div>
|
height: 3em;
|
||||||
<div class="unit">Mbps</div>
|
line-height: 2.7em;
|
||||||
</div>
|
cursor: pointer;
|
||||||
</div>
|
box-shadow: 0 0 0 rgba(0, 0, 0, 0.1), inset 0 0 0 rgba(0, 0, 0, 0.1);
|
||||||
<div class="testGroup">
|
}
|
||||||
<div class="testArea">
|
|
||||||
<div class="testName">Ping</div>
|
#startStopBtn:hover {
|
||||||
<div id="pingText" class="meterText"></div>
|
box-shadow: 0 0 2em rgba(0, 0, 0, 0.1), inset 0 0 1em rgba(0, 0, 0, 0.1);
|
||||||
<div class="unit">ms</div>
|
}
|
||||||
</div>
|
|
||||||
<div class="testArea">
|
#startStopBtn.running {
|
||||||
<div class="testName">Jitter</div>
|
background-color: #ff3030 !important;
|
||||||
<div id="jitText" class="meterText"></div>
|
border-color: #ff6060 !important;
|
||||||
<div class="unit">ms</div>
|
color: #ffffff !important;
|
||||||
</div>
|
}
|
||||||
</div>
|
|
||||||
<div id="ipArea">
|
#startStopBtn:before {
|
||||||
IP Address: <span id="ip"></span>
|
content: "Start";
|
||||||
</div>
|
}
|
||||||
</div>
|
|
||||||
<a href="https://github.com/librespeed/speedtest">Source code</a>
|
#startStopBtn.running:before {
|
||||||
<script type="text/javascript">
|
content: "Abort";
|
||||||
initUI();
|
}
|
||||||
</script>
|
|
||||||
</body>
|
#test {
|
||||||
|
margin-top: 2em;
|
||||||
|
margin-bottom: 12em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.testArea {
|
||||||
|
display: inline-block;
|
||||||
|
width: 14em;
|
||||||
|
height: 9em;
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.testName {
|
||||||
|
position: absolute;
|
||||||
|
top: 0.1em;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
font-size: 1.4em;
|
||||||
|
z-index: 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.meterText {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 1.5em;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
font-size: 2.5em;
|
||||||
|
z-index: 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
#dlText {
|
||||||
|
color: #6060aa;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ulText {
|
||||||
|
color: #309030;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pingText,
|
||||||
|
#jitText {
|
||||||
|
color: #aa6060;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.meterText:empty:before {
|
||||||
|
color: #505050 !important;
|
||||||
|
content: "0.00";
|
||||||
|
}
|
||||||
|
|
||||||
|
div.unit {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 2em;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.testGroup {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media all and (max-width: 65em) {
|
||||||
|
body {
|
||||||
|
font-size: 1.5vw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media all and (max-width: 40em) {
|
||||||
|
body {
|
||||||
|
font-size: 0.8em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.testGroup {
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-switch-wrapper {
|
||||||
|
margin: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-switch {
|
||||||
|
display: inline-block;
|
||||||
|
height: 40px;
|
||||||
|
position: relative;
|
||||||
|
width: 65px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-switch input {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider {
|
||||||
|
background: #000;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
font-size: 13px;
|
||||||
|
transition: 0.4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider p:after {
|
||||||
|
color: #fff;
|
||||||
|
float: right;
|
||||||
|
margin: 0 5px 0 0;
|
||||||
|
content: "OFF";
|
||||||
|
transition: 0.4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider p:after {
|
||||||
|
float: left;
|
||||||
|
color: #000;
|
||||||
|
content: "ON";
|
||||||
|
margin: 0 0 0 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider:before {
|
||||||
|
background: #fff;
|
||||||
|
top: 8px;
|
||||||
|
content: "";
|
||||||
|
height: 26px;
|
||||||
|
left: 4px;
|
||||||
|
position: absolute;
|
||||||
|
transition: 0.4s;
|
||||||
|
width: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider:before {
|
||||||
|
transform: translateX(28px);
|
||||||
|
background: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider.round {
|
||||||
|
border-radius: 34px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider.round:before {
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h1>LibreSpeed Example</h1>
|
||||||
|
<div id="startStopBtn" onclick="startStop()"></div>
|
||||||
|
<div id="test">
|
||||||
|
<div class="testGroup">
|
||||||
|
<div class="testArea">
|
||||||
|
<div class="testName">Download</div>
|
||||||
|
<div id="dlText" class="meterText"></div>
|
||||||
|
<div class="unit">Mbps</div>
|
||||||
|
</div>
|
||||||
|
<div class="testArea">
|
||||||
|
<div class="testName">Upload</div>
|
||||||
|
<div id="ulText" class="meterText"></div>
|
||||||
|
<div class="unit">Mbps</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="testGroup">
|
||||||
|
<div class="testArea">
|
||||||
|
<div class="testName">Ping</div>
|
||||||
|
<div id="pingText" class="meterText"></div>
|
||||||
|
<div class="unit">ms</div>
|
||||||
|
</div>
|
||||||
|
<div class="testArea">
|
||||||
|
<div class="testName">Jitter</div>
|
||||||
|
<div id="jitText" class="meterText"></div>
|
||||||
|
<div class="unit">ms</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="ipArea">IP Address: <span id="ip"></span></div>
|
||||||
|
</div>
|
||||||
|
<h3>DARKMODE</h3>
|
||||||
|
<div class="theme-switch-wrapper">
|
||||||
|
<label class="theme-switch" for="checkbox">
|
||||||
|
<input type="checkbox" id="checkbox" />
|
||||||
|
<div class="slider round">
|
||||||
|
<p></p>
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<a href="https://github.com/librespeed/speedtest">Source code</a>
|
||||||
|
<script type="text/javascript">
|
||||||
|
initUI();
|
||||||
|
|
||||||
|
//DARMODE
|
||||||
|
const toggleSwitch = document.querySelector(
|
||||||
|
'.theme-switch input[type="checkbox"]'
|
||||||
|
);
|
||||||
|
|
||||||
|
function switchTheme(e) {
|
||||||
|
if (e.target.checked) {
|
||||||
|
toggleDarkMode();
|
||||||
|
} else {
|
||||||
|
toggleDarkMode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
toggleSwitch.addEventListener("change", switchTheme, true);
|
||||||
|
|
||||||
|
var countToggleDark = 0;
|
||||||
|
|
||||||
|
function toggleDarkMode() {
|
||||||
|
if (countToggleDark == 0) {
|
||||||
|
document.querySelector("html").style.background = "#000";
|
||||||
|
document.querySelector("body").style.background = "#000";
|
||||||
|
document.querySelector("html").style.color = "#fdfdfd";
|
||||||
|
document.querySelector("body").style.color = "#fdfdfd";
|
||||||
|
document.querySelector("#startStopBtn").style.border =
|
||||||
|
"0.15em solid #996cb4";
|
||||||
|
document.querySelector("#startStopBtn").style.color = "#996cb4";
|
||||||
|
document.querySelector("h1").style.color = "#d3cfcf";
|
||||||
|
document.querySelector("#dlText").style.color = "#996cb4";
|
||||||
|
document.querySelector("#pingText").style.color = "#b92323";
|
||||||
|
document.querySelector("#jitText").style.color = "#b92323";
|
||||||
|
countToggleDark++;
|
||||||
|
} else {
|
||||||
|
document.querySelector("html ").style.background = "#fdfdfd";
|
||||||
|
document.querySelector("body").style.background = "#fdfdfd";
|
||||||
|
document.querySelector("html").style.color = "#202020";
|
||||||
|
document.querySelector("body").style.color = "#202020";
|
||||||
|
document.querySelector("#startStopBtn").style.border =
|
||||||
|
"0.15em solid #6060FF";
|
||||||
|
document.querySelector("#startStopBtn").style.color = "#6060AA";
|
||||||
|
document.querySelector("h1").style.color = "#404040";
|
||||||
|
document.querySelector("#dlText").style.color = "#6060AA";
|
||||||
|
document.querySelector("#pingText").style.color = "#AA6060";
|
||||||
|
document.querySelector("#jitText").style.color = "#AA6060";
|
||||||
|
countToggleDark = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,212 +1,383 @@
|
||||||
<!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, shrink-to-fit=no, user-scalable=no" />
|
<meta
|
||||||
<title>LibreSpeed Example</title>
|
name="viewport"
|
||||||
<link rel="shortcut icon" href="favicon.ico">
|
content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no"
|
||||||
<script type="text/javascript" src="speedtest.js"></script>
|
/>
|
||||||
<script type="text/javascript">
|
<title>LibreSpeed Example</title>
|
||||||
|
<link rel="shortcut icon" href="favicon.ico" />
|
||||||
|
<script type="text/javascript" src="speedtest.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
//INITIALIZE SPEEDTEST
|
||||||
|
var s = new Speedtest(); //create speedtest object
|
||||||
|
s.onupdate = function (data) {
|
||||||
|
//callback to update data in UI
|
||||||
|
I("ip").textContent = data.clientIp;
|
||||||
|
I("dlText").textContent =
|
||||||
|
data.testState == 1 && data.dlStatus == 0 ? "..." : data.dlStatus;
|
||||||
|
I("ulText").textContent =
|
||||||
|
data.testState == 3 && data.ulStatus == 0 ? "..." : data.ulStatus;
|
||||||
|
I("pingText").textContent = data.pingStatus;
|
||||||
|
I("jitText").textContent = data.jitterStatus;
|
||||||
|
var prog =
|
||||||
|
(Number(data.dlProgress) * 2 +
|
||||||
|
Number(data.ulProgress) * 2 +
|
||||||
|
Number(data.pingProgress)) /
|
||||||
|
5;
|
||||||
|
I("progress").style.width = 100 * prog + "%";
|
||||||
|
};
|
||||||
|
s.onend = function (aborted) {
|
||||||
|
//callback for test ended/aborted
|
||||||
|
I("startStopBtn").className = ""; //show start button again
|
||||||
|
if (aborted) {
|
||||||
|
//if the test was aborted, clear the UI and prepare for new test
|
||||||
|
initUI();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
//INITIALIZE SPEEDTEST
|
function startStop() {
|
||||||
var s=new Speedtest(); //create speedtest object
|
//start/stop button pressed
|
||||||
s.onupdate=function(data){ //callback to update data in UI
|
if (s.getState() == 3) {
|
||||||
I("ip").textContent=data.clientIp;
|
//speedtest is running, abort
|
||||||
I("dlText").textContent=(data.testState==1&&data.dlStatus==0)?"...":data.dlStatus;
|
s.abort();
|
||||||
I("ulText").textContent=(data.testState==3&&data.ulStatus==0)?"...":data.ulStatus;
|
} else {
|
||||||
I("pingText").textContent=data.pingStatus;
|
//test is not running, begin
|
||||||
I("jitText").textContent=data.jitterStatus;
|
s.start();
|
||||||
var prog=(Number(data.dlProgress)*2+Number(data.ulProgress)*2+Number(data.pingProgress))/5;
|
I("startStopBtn").className = "running";
|
||||||
I("progress").style.width=(100*prog)+"%";
|
}
|
||||||
}
|
}
|
||||||
s.onend=function(aborted){ //callback for test ended/aborted
|
|
||||||
I("startStopBtn").className=""; //show start button again
|
//function to (re)initialize UI
|
||||||
if(aborted){ //if the test was aborted, clear the UI and prepare for new test
|
function initUI() {
|
||||||
initUI();
|
I("dlText").textContent = "";
|
||||||
|
I("ulText").textContent = "";
|
||||||
|
I("pingText").textContent = "";
|
||||||
|
I("jitText").textContent = "";
|
||||||
|
I("ip").textContent = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
function I(id) {
|
||||||
|
return document.getElementById(id);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
html,
|
||||||
|
body {
|
||||||
|
border: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
background: #fdfdfd;
|
||||||
|
color: #202020;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
text-align: center;
|
||||||
|
font-family: "Roboto", sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
color: #404040;
|
||||||
|
}
|
||||||
|
|
||||||
|
#startStopBtn {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 0 auto;
|
||||||
|
color: #6060aa;
|
||||||
|
background-color: rgba(0, 0, 0, 0);
|
||||||
|
border: 0.15em solid #6060ff;
|
||||||
|
border-radius: 0.3em;
|
||||||
|
transition: all 0.3s;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 8em;
|
||||||
|
height: 3em;
|
||||||
|
line-height: 2.7em;
|
||||||
|
cursor: pointer;
|
||||||
|
box-shadow: 0 0 0 rgba(0, 0, 0, 0.1), inset 0 0 0 rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
#startStopBtn:hover {
|
||||||
|
box-shadow: 0 0 2em rgba(0, 0, 0, 0.1), inset 0 0 1em rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
#startStopBtn.running {
|
||||||
|
background-color: #ff3030 !important;
|
||||||
|
border-color: #ff6060 !important;
|
||||||
|
color: #ffffff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#startStopBtn:before {
|
||||||
|
content: "Start";
|
||||||
|
}
|
||||||
|
|
||||||
|
#startStopBtn.running:before {
|
||||||
|
content: "Abort";
|
||||||
|
}
|
||||||
|
|
||||||
|
#test {
|
||||||
|
margin-top: 2em;
|
||||||
|
margin-bottom: 12em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.testArea {
|
||||||
|
display: inline-block;
|
||||||
|
width: 14em;
|
||||||
|
height: 9em;
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.testName {
|
||||||
|
position: absolute;
|
||||||
|
top: 0.1em;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
font-size: 1.4em;
|
||||||
|
z-index: 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.meterText {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 1.5em;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
font-size: 2.5em;
|
||||||
|
z-index: 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
#dlText {
|
||||||
|
color: #6060aa;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ulText {
|
||||||
|
color: #309030;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pingText,
|
||||||
|
#jitText {
|
||||||
|
color: #aa6060;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.meterText:empty:before {
|
||||||
|
color: #505050 !important;
|
||||||
|
content: "0.00";
|
||||||
|
}
|
||||||
|
|
||||||
|
div.unit {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 2em;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.testGroup {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media all and (max-width: 65em) {
|
||||||
|
body {
|
||||||
|
font-size: 1.5vw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media all and (max-width: 40em) {
|
||||||
|
body {
|
||||||
|
font-size: 0.8em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.testGroup {
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#progressBar {
|
||||||
|
width: 90%;
|
||||||
|
height: 0.3em;
|
||||||
|
background-color: #eeeeee;
|
||||||
|
position: relative;
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-bottom: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#progress {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
height: 100%;
|
||||||
|
width: 0%;
|
||||||
|
transition: width 2s;
|
||||||
|
background-color: #90bbff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-switch-wrapper {
|
||||||
|
margin: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-switch {
|
||||||
|
display: inline-block;
|
||||||
|
height: 40px;
|
||||||
|
position: relative;
|
||||||
|
width: 65px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-switch input {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider {
|
||||||
|
background: #000;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
font-size: 13px;
|
||||||
|
transition: 0.4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider p:after {
|
||||||
|
color: #fff;
|
||||||
|
float: right;
|
||||||
|
margin: 0 5px 0 0;
|
||||||
|
content: "OFF";
|
||||||
|
transition: 0.4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider p:after {
|
||||||
|
float: left;
|
||||||
|
color: #000;
|
||||||
|
content: "ON";
|
||||||
|
margin: 0 0 0 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider:before {
|
||||||
|
background: #fff;
|
||||||
|
top: 8px;
|
||||||
|
content: "";
|
||||||
|
height: 26px;
|
||||||
|
left: 4px;
|
||||||
|
position: absolute;
|
||||||
|
transition: 0.4s;
|
||||||
|
width: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider:before {
|
||||||
|
transform: translateX(28px);
|
||||||
|
background: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider.round {
|
||||||
|
border-radius: 34px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider.round:before {
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h1>LibreSpeed Example</h1>
|
||||||
|
<div id="startStopBtn" onclick="startStop()"></div>
|
||||||
|
<div id="test">
|
||||||
|
<div id="progressBar">
|
||||||
|
<div id="progress"></div>
|
||||||
|
</div>
|
||||||
|
<div class="testGroup">
|
||||||
|
<div class="testArea">
|
||||||
|
<div class="testName">Download</div>
|
||||||
|
<div id="dlText" class="meterText"></div>
|
||||||
|
<div class="unit">Mbps</div>
|
||||||
|
</div>
|
||||||
|
<div class="testArea">
|
||||||
|
<div class="testName">Upload</div>
|
||||||
|
<div id="ulText" class="meterText"></div>
|
||||||
|
<div class="unit">Mbps</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="testGroup">
|
||||||
|
<div class="testArea">
|
||||||
|
<div class="testName">Ping</div>
|
||||||
|
<div id="pingText" class="meterText"></div>
|
||||||
|
<div class="unit">ms</div>
|
||||||
|
</div>
|
||||||
|
<div class="testArea">
|
||||||
|
<div class="testName">Jitter</div>
|
||||||
|
<div id="jitText" class="meterText"></div>
|
||||||
|
<div class="unit">ms</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="ipArea">IP Address: <span id="ip"></span></div>
|
||||||
|
</div>
|
||||||
|
<h3>DARKMODE</h3>
|
||||||
|
<div class="theme-switch-wrapper">
|
||||||
|
<label class="theme-switch" for="checkbox">
|
||||||
|
<input type="checkbox" id="checkbox" />
|
||||||
|
<div class="slider round">
|
||||||
|
<p></p>
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<a href="https://github.com/librespeed/speedtest">Source code</a>
|
||||||
|
<script type="text/javascript">
|
||||||
|
initUI();
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
<script>
|
||||||
|
//DARMODE
|
||||||
|
const toggleSwitch = document.querySelector(
|
||||||
|
'.theme-switch input[type="checkbox"]'
|
||||||
|
);
|
||||||
|
|
||||||
|
function switchTheme(e) {
|
||||||
|
if (e.target.checked) {
|
||||||
|
toggleDarkMode();
|
||||||
|
} else {
|
||||||
|
toggleDarkMode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
toggleSwitch.addEventListener("change", switchTheme, true);
|
||||||
|
|
||||||
function startStop(){ //start/stop button pressed
|
var countToggleDark = 0;
|
||||||
if(s.getState()==3){
|
|
||||||
//speedtest is running, abort
|
|
||||||
s.abort();
|
|
||||||
}else{
|
|
||||||
//test is not running, begin
|
|
||||||
s.start();
|
|
||||||
I("startStopBtn").className="running";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//function to (re)initialize UI
|
function toggleDarkMode() {
|
||||||
function initUI(){
|
if (countToggleDark == 0) {
|
||||||
I("dlText").textContent="";
|
document.querySelector("html").style.background = "#000";
|
||||||
I("ulText").textContent="";
|
document.querySelector("body").style.background = "#000";
|
||||||
I("pingText").textContent="";
|
document.querySelector("html").style.color = "#fdfdfd";
|
||||||
I("jitText").textContent="";
|
document.querySelector("body").style.color = "#fdfdfd";
|
||||||
I("ip").textContent="";
|
document.querySelector("#startStopBtn").style.border ="0.15em solid #996cb4";
|
||||||
}
|
document.querySelector("#startStopBtn").style.color = "#996cb4";
|
||||||
|
document.querySelector("h1").style.color = "#d3cfcf";
|
||||||
|
document.querySelector("#dlText").style.color = "#996cb4";
|
||||||
|
document.querySelector("#pingText").style.color = "#b92323";
|
||||||
|
document.querySelector("#jitText").style.color = "#b92323";
|
||||||
|
document.querySelector("#progress").style.background = "#996cb4";
|
||||||
|
|
||||||
function I(id){return document.getElementById(id);}
|
countToggleDark++;
|
||||||
</script>
|
} else {
|
||||||
|
document.querySelector("html ").style.background = "#fdfdfd";
|
||||||
<style type="text/css">
|
document.querySelector("body").style.background = "#fdfdfd";
|
||||||
html,body{
|
document.querySelector("html").style.color = "#202020";
|
||||||
border:none; padding:0; margin:0;
|
document.querySelector("body").style.color = "#202020";
|
||||||
background:#FFFFFF;
|
document.querySelector("#startStopBtn").style.border ="0.15em solid #6060FF";
|
||||||
color:#202020;
|
document.querySelector("#startStopBtn").style.color = "#6060AA";
|
||||||
}
|
document.querySelector("h1").style.color = "#404040";
|
||||||
body{
|
document.querySelector("#dlText").style.color = "#6060AA";
|
||||||
text-align:center;
|
document.querySelector("#pingText").style.color = "#AA6060";
|
||||||
font-family:"Roboto",sans-serif;
|
document.querySelector("#jitText").style.color = "#AA6060";
|
||||||
}
|
document.querySelector("#progress").style.background = "#90BBFF";
|
||||||
h1{
|
countToggleDark = 0;
|
||||||
color:#404040;
|
}
|
||||||
}
|
}
|
||||||
#startStopBtn{
|
</script>
|
||||||
display:inline-block;
|
|
||||||
margin:0 auto;
|
|
||||||
color:#6060AA;
|
|
||||||
background-color:rgba(0,0,0,0);
|
|
||||||
border:0.15em solid #6060FF;
|
|
||||||
border-radius:0.3em;
|
|
||||||
transition:all 0.3s;
|
|
||||||
box-sizing:border-box;
|
|
||||||
width:8em; height:3em;
|
|
||||||
line-height:2.7em;
|
|
||||||
cursor:pointer;
|
|
||||||
box-shadow: 0 0 0 rgba(0,0,0,0.1), inset 0 0 0 rgba(0,0,0,0.1);
|
|
||||||
}
|
|
||||||
#startStopBtn:hover{
|
|
||||||
box-shadow: 0 0 2em rgba(0,0,0,0.1), inset 0 0 1em rgba(0,0,0,0.1);
|
|
||||||
}
|
|
||||||
#startStopBtn.running{
|
|
||||||
background-color:#FF3030;
|
|
||||||
border-color:#FF6060;
|
|
||||||
color:#FFFFFF;
|
|
||||||
}
|
|
||||||
#startStopBtn:before{
|
|
||||||
content:"Start";
|
|
||||||
}
|
|
||||||
#startStopBtn.running:before{
|
|
||||||
content:"Abort";
|
|
||||||
}
|
|
||||||
#test{
|
|
||||||
margin-top:2em;
|
|
||||||
margin-bottom:12em;
|
|
||||||
}
|
|
||||||
div.testArea{
|
|
||||||
display:inline-block;
|
|
||||||
width:14em;
|
|
||||||
height:9em;
|
|
||||||
position:relative;
|
|
||||||
box-sizing:border-box;
|
|
||||||
}
|
|
||||||
div.testName{
|
|
||||||
position:absolute;
|
|
||||||
top:0.1em; left:0;
|
|
||||||
width:100%;
|
|
||||||
font-size:1.4em;
|
|
||||||
z-index:9;
|
|
||||||
}
|
|
||||||
div.meterText{
|
|
||||||
position:absolute;
|
|
||||||
bottom:1.5em; left:0;
|
|
||||||
width:100%;
|
|
||||||
font-size:2.5em;
|
|
||||||
z-index:9;
|
|
||||||
}
|
|
||||||
#dlText{
|
|
||||||
color:#6060AA;
|
|
||||||
}
|
|
||||||
#ulText{
|
|
||||||
color:#309030;
|
|
||||||
}
|
|
||||||
#pingText,#jitText{
|
|
||||||
color:#AA6060;
|
|
||||||
}
|
|
||||||
div.meterText:empty:before{
|
|
||||||
color:#505050 !important;
|
|
||||||
content:"0.00";
|
|
||||||
}
|
|
||||||
div.unit{
|
|
||||||
position:absolute;
|
|
||||||
bottom:2em; left:0;
|
|
||||||
width:100%;
|
|
||||||
z-index:9;
|
|
||||||
}
|
|
||||||
div.testGroup{
|
|
||||||
display:inline-block;
|
|
||||||
}
|
|
||||||
@media all and (max-width:65em){
|
|
||||||
body{
|
|
||||||
font-size:1.5vw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@media all and (max-width:40em){
|
|
||||||
body{
|
|
||||||
font-size:0.8em;
|
|
||||||
}
|
|
||||||
div.testGroup{
|
|
||||||
display:block;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#progressBar{
|
|
||||||
width:90%;
|
|
||||||
height:0.3em;
|
|
||||||
background-color:#EEEEEE;
|
|
||||||
position:relative;
|
|
||||||
display:block;
|
|
||||||
margin:0 auto;
|
|
||||||
margin-bottom:2em;
|
|
||||||
}
|
|
||||||
#progress{
|
|
||||||
position:absolute;
|
|
||||||
top:0; left:0;
|
|
||||||
height:100%;
|
|
||||||
width:0%;
|
|
||||||
transition: width 2s;
|
|
||||||
background-color:#90BBFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>LibreSpeed Example</h1>
|
|
||||||
<div id="startStopBtn" onclick="startStop()"></div>
|
|
||||||
<div id="test">
|
|
||||||
<div id="progressBar"><div id="progress"></div></div>
|
|
||||||
<div class="testGroup">
|
|
||||||
<div class="testArea">
|
|
||||||
<div class="testName">Download</div>
|
|
||||||
<div id="dlText" class="meterText"></div>
|
|
||||||
<div class="unit">Mbps</div>
|
|
||||||
</div>
|
|
||||||
<div class="testArea">
|
|
||||||
<div class="testName">Upload</div>
|
|
||||||
<div id="ulText" class="meterText"></div>
|
|
||||||
<div class="unit">Mbps</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="testGroup">
|
|
||||||
<div class="testArea">
|
|
||||||
<div class="testName">Ping</div>
|
|
||||||
<div id="pingText" class="meterText"></div>
|
|
||||||
<div class="unit">ms</div>
|
|
||||||
</div>
|
|
||||||
<div class="testArea">
|
|
||||||
<div class="testName">Jitter</div>
|
|
||||||
<div id="jitText" class="meterText"></div>
|
|
||||||
<div class="unit">ms</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="ipArea">
|
|
||||||
IP Address: <span id="ip"></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<a href="https://github.com/librespeed/speedtest">Source code</a>
|
|
||||||
<script type="text/javascript">
|
|
||||||
initUI();
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue