Closed HummusB0x closed 5 months ago
Hey,
It kind of sounds like you're trying to use Glance for a kiosk. While I don't intend on adding such automatic page switching functionality, you could easily achieve the same with a bit of HTML and JS:
<body>
<style>
* {
padding: 0;
margin: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
</style>
<iframe id="iframe" src="" frameborder="0"></iframe>
<script>
const baseUrl = "http://localhost:8080";
const pages = [
{
path: "page1",
// 90 seconds
duration: 90 * 1000
},
{
path: "page2",
// 4 minutes
duration: 4 * 60 * 1000
},
{
path: "page3",
// 1 hour
duration: 60 * 60 * 1000
},
];
const iframe = document.getElementById('iframe');
var currentPage = 0;
const update = () => {
const page = pages[currentPage];
currentPage = (currentPage + 1) % pages.length;
iframe.src = `${baseUrl}/${page.path}`;
setTimeout(update, page.duration);
}
update();
</script>
</body>
Hello,
First of all, thank you very much for the share of this tool!
To use your project as dashboard, could we have an option that would automatically switch between pages after a given period defined by the user?
This configuration could be proposed through an option within the page page itself or even globally.
For example, let's configure the case you have 4 pages:
page1
,page2
,page3
andpage4
.page1
), I would like to to stay on this page 2 minutes.page2
for 1:30 minutespage3
for 4 minutespage4
for 1 hourpage1
for 2 minutes, etc.When the auto switch enabled, the default time between page switch could be 1 minute for example.
This would be an awesome feature!