From 21d62ea4dac7209888e5f3fb67807bdcaeae969e Mon Sep 17 00:00:00 2001 From: rav4s Date: Wed, 31 Mar 2021 17:00:38 -0500 Subject: [PATCH] Allow strand to be inputted --- www/app.html | 12 ++++++++++++ www/app.js | 8 ++++++++ www/bootstrap.js | 2 ++ www/index.html | 5 +++++ www/index.js | 3 --- 5 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 www/app.html create mode 100644 www/app.js diff --git a/www/app.html b/www/app.html new file mode 100644 index 0000000..c3de0d4 --- /dev/null +++ b/www/app.html @@ -0,0 +1,12 @@ + + + + + DNA Transcription & Translation + + + + +

Hello

+ + diff --git a/www/app.js b/www/app.js new file mode 100644 index 0000000..1e76d02 --- /dev/null +++ b/www/app.js @@ -0,0 +1,8 @@ +import * as wasm from "wasm-dna-transcription-translation"; + +const urlParams = new URLSearchParams(window.location.search); +const strand = urlParams.get('strand'); + +console.log(strand) + +wasm.main(); diff --git a/www/bootstrap.js b/www/bootstrap.js index 7934d62..1cb721f 100644 --- a/www/bootstrap.js +++ b/www/bootstrap.js @@ -3,3 +3,5 @@ // that no one else needs to worry about it again. import("./index.js") .catch(e => console.error("Error importing `index.js`:", e)); +import("./app.js") + .catch(e => console.error("Error importing `app.js`:", e)); diff --git a/www/index.html b/www/index.html index 231d19b..49097f7 100644 --- a/www/index.html +++ b/www/index.html @@ -7,5 +7,10 @@ +

Please enter the DNA strand in the space below:

+
+ + +
diff --git a/www/index.js b/www/index.js index 7d8cac7..e69de29 100644 --- a/www/index.js +++ b/www/index.js @@ -1,3 +0,0 @@ -import * as wasm from "wasm-dna-transcription-translation"; - -wasm.main();