deno run -A --unstable https://gist.github.com/psqq/5c9b1d4bf6b5cc3469fde370d73fafb8/raw/29bbb3f19e9ba2f8b8e630ef1224d360281b8c9a/main.ts
Last active
November 3, 2020 06:19
-
-
Save psqq/5c9b1d4bf6b5cc3469fde370d73fafb8 to your computer and use it in GitHub Desktop.
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
// Importing the webview library | |
import { WebView } from "https://deno.land/x/webview/mod.ts"; | |
// Creating an HTML page | |
let html = ` | |
<html> | |
<body> | |
<input type="text"/> | |
Result: "<span></span>". | |
<script> | |
document.querySelector('input').addEventListener('keyup', function(e) { | |
var s = e.target.value; | |
var res = s.toLowerCase().split(' ').join('-'); | |
document.querySelector('span').innerText = res; | |
}); | |
</script> | |
</body> | |
</html> | |
`; | |
// Creating and configuring the webview | |
const webview = new WebView({ | |
title: "Deno Webview Example", | |
url: "data:text/html," + html, | |
width: 800, | |
height: 600, | |
resizable: true, | |
debug: true, | |
frameless: false | |
}); | |
// Running the webview | |
webview.run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment