Last active
June 9, 2021 12:56
-
-
Save icantrank/35ebec8fbe9834ed3a7aeae0be033d78 to your computer and use it in GitHub Desktop.
oodler.js - node oodler and visit localhost in browser and lol
This file contains hidden or 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
//node oodler and visit localhost in browser and lol | |
var http = require('http') | |
http.createServer( (req,res) => { | |
res.writeHead(200, {'contentType' : 'text/html'}) | |
res.write( | |
` | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Oodler</title> | |
<script src='https://code.responsivevoice.org/responsivevoice.js'></script> | |
</head> | |
<body style="background:black;color:white;text-align:center"> | |
<br> | |
<img style="width:200px;height:200px" src="https://cdn-webimages.wimages.net/053f1adf314cf13555ae04e35dd5101fde6dc4-wide-thumbnail.jpg" /> | |
<br><br> | |
<button style="font-size:200%;padding:20px;" onclick="oodle()">Go</button> | |
<script> | |
function oodle() { | |
var name = window.prompt("Enter your name"); | |
name = name.replace(/a|e|i|o|u/gi,"oodle"); | |
document.body.innerHTML += '<h1><span>' + name + '<span onclick="name = this.parentElement.firstChild.textContent;speak(name)"> 🔊</span></h1>'; | |
speak("Hello "+ name); | |
} | |
function speak(name) { | |
responsiveVoice.speak(name); | |
} | |
</script> | |
</body> | |
</html> | |
` | |
) | |
res.end() | |
}).listen(80) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment