Inital commit

This commit is contained in:
Lexi / Zoe 2021-03-17 21:47:41 +01:00
commit a4894d612a
Signed by: binaryDiv
GPG key ID: F8D4956E224DA232
5 changed files with 83 additions and 0 deletions

48
assets/index.html Normal file
View file

@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Stardew Mod Launcher</title>
</head>
<body>
<h1>Hallo :)</h1>
<button onclick="hello()">Click me!</button>
<h2>Mod list</h2>
<ul id="mod_list">
<li>(not loaded yet)</li>
</ul>
<script>
function hello() {
pywebview.api.hello().then((result) => {
alert(result);
});
}
function list_mods() {
pywebview.api.list_mods().then((mod_list) => {
const list_ul = document.getElementById('mod_list');
list_ul.textContent = '';
mod_list.forEach((item) => {
const new_li = document.createElement('li');
new_li.textContent = item;
list_ul.appendChild(new_li);
});
});
}
window.addEventListener('pywebviewready', () => {
list_mods();
});
</script>
</body>
</html>