mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 06:31:20 -08:00
update demo
This commit is contained in:
1 parent
95c0887939
commit
3567a487f0
3 files changed
+25
-10
No files matched your search
@@ -136,6 +136,10 @@ img {
|
|||||||
background-color: rgb(39, 41, 54);
|
background-color: rgb(39, 41, 54);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.header .run:hover {
|
||||||
|
background-color: #2e3350;
|
||||||
|
}
|
||||||
|
|
||||||
.main {
|
.main {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|||||||
@@ -174,15 +174,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener('error', function (err) {
|
$run.addEventListener('click', function () {
|
||||||
console.error(err);
|
|
||||||
});
|
|
||||||
|
|
||||||
window.addEventListener('unhandledrejection', function (err) {
|
|
||||||
console.error(err);
|
|
||||||
});
|
|
||||||
|
|
||||||
$run.addEventListener('click', function (e) {
|
|
||||||
var libs = encodeURIComponent($lib.value);
|
var libs = encodeURIComponent($lib.value);
|
||||||
var code = encodeURIComponent(editor.getValue());
|
var code = encodeURIComponent(editor.getValue());
|
||||||
var url = window.location.origin + window.location.pathname + '?libs=' + libs + '&code=' + code;
|
var url = window.location.origin + window.location.pathname + '?libs=' + libs + '&code=' + code;
|
||||||
@@ -195,4 +187,23 @@
|
|||||||
this.style.display = 'none';
|
this.style.display = 'none';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
window.addEventListener('error', function (err) {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
|
||||||
|
window.addEventListener('unhandledrejection', function (err) {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
|
||||||
|
document.addEventListener('keydown', function (event) {
|
||||||
|
if ((event.ctrlKey || event.metaKey) && event.key === 's') {
|
||||||
|
event.preventDefault();
|
||||||
|
var libs = encodeURIComponent($lib.value);
|
||||||
|
var code = encodeURIComponent(editor.getValue());
|
||||||
|
var url = window.location.origin + window.location.pathname + '?libs=' + libs + '&code=' + code;
|
||||||
|
history.pushState(null, null, url);
|
||||||
|
initApp();
|
||||||
|
}
|
||||||
|
});
|
||||||
})();
|
})();
|
||||||
+1
-1
@@ -45,7 +45,7 @@
|
|||||||
<a class="item" href="./document/">Document</a>
|
<a class="item" href="./document/">Document</a>
|
||||||
<a class="item" href="https://github.com/zhw2590582/ArtPlayer">Github</a>
|
<a class="item" href="https://github.com/zhw2590582/ArtPlayer">Github</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="run">Run Code</div>
|
<div class="run">▶ Run Code</div>
|
||||||
</header>
|
</header>
|
||||||
<div class="libs">
|
<div class="libs">
|
||||||
<textarea class="libsInput"
|
<textarea class="libsInput"
|
||||||
|
|||||||
Reference in new issue
Block a user