mirror of
https://github.com/the-spellman/js-plus-plus-toxicity-demo
synced 2024-12-23 09:32:33 -06:00
26 lines
1 KiB
HTML
26 lines
1 KiB
HTML
<!DOCTYPE html>
|
|
<script src="https://cdn.jsdelivr.net/gh/Sneed-Group/js-plus-plus@81aabdfb07451b663536e01b788634b446052141/jspp.js"></script>
|
|
<script>
|
|
const helpers = new JSPlusPlus.General.Helpers
|
|
const html = new JSPlusPlus.HTMLFrontend
|
|
html.initHead("Toxicity Check")
|
|
html.initBody()
|
|
async function tox() {
|
|
const sentence = document.getElementById("textBox1").value
|
|
let p = document.getElementById("toxicityBool")
|
|
const objSentence = [sentence]
|
|
let toxic = await helpers.isToxic(objSentence)
|
|
p.innerText = toxic
|
|
console.log(toxic)
|
|
}
|
|
|
|
helpers.consoleUseWarner("DO NOT INPUT ANYTHING HERE UNLESS YOU KNOW WHAT YOU ARE DOING.")
|
|
|
|
let p = html.createParagraph("toxicityBool", "Input text to the text box bellow, click the button, and check here if its toxic.")
|
|
let textbox = html.createElement("textarea", "textBox1", {width: "80%", placeholder: "input sentence here."})
|
|
let submit = html.createElement("button", "submit")
|
|
|
|
submit.innerText = "Toxic?" // github pages pls dont bug out now
|
|
|
|
submit.addEventListener("click", tox);
|
|
</script>
|