mirror of
https://github.com/Screenly/Anthias.git
synced 2026-03-05 15:30:19 -05:00
24 lines
602 B
Python
24 lines
602 B
Python
# -*- coding: utf8 -*-
|
|
|
|
def black_page(filepath):
|
|
html = """<html>
|
|
<head>
|
|
<script>
|
|
window.setimg = function (uri) {
|
|
var i = new Image();
|
|
i.onload = function() {
|
|
document.body.style.backgroundSize = i.width > window.innerWidth || i.height > window.innerHeight ? 'contain' : 'auto';
|
|
document.body.style.backgroundImage = 'url(' + uri + ')';
|
|
}
|
|
i.src = uri;
|
|
}
|
|
</script>
|
|
</head>
|
|
<body style="background: #000 center no-repeat"></body>
|
|
</html>"""
|
|
|
|
with open(filepath, 'w') as f:
|
|
f.write(html)
|
|
return filepath
|
|
|