Inital commit
This commit is contained in:
commit
a4894d612a
5 changed files with 83 additions and 0 deletions
48
assets/index.html
Normal file
48
assets/index.html
Normal 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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue