-
-
Save renbaoshuo/bf90d4cfad5b8ae7ad43bc8a8a6a6b89 to your computer and use it in GitHub Desktop.
OBS Studio: A HTML page for showing current date and time in the video
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>A simple clock</title> | |
</head> | |
<body translate="no"> | |
<div id="output"></div> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script> | |
<script> | |
var urlParams = new URLSearchParams(location); | |
var output = document.getElementById('output'); | |
if (urlParams.get('style')) { | |
output.setAttribute('style', urlParams['style']); | |
} | |
if (urlParams.get('bodyStyle')) { | |
document.body.setAttribute('style', urlParams['bodyStyle']); | |
} | |
var c = function () { | |
output.innerText = moment().format(urlParams.get('format') || ''); | |
}; | |
setInterval(c, 250); | |
c(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment