-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
21 lines (18 loc) · 956 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { h } from 'https://esm.sh/gh/evbogue/bogbookv4@02f96a104e/lib/h.js'
import {embed} from 'https://esm.sh/gh/evbogue/bog-embed@20b2c9b5cb/mod.js'
const el = h('div')
document.body.insertBefore(el, document.body.firstChild)
embed('EvEscFEThxeGbGnbMeDL0kHVhTZ/sJz1hN1e8qjZo8c=', el)
const input = h('input', {placeholder: 'Your phone or email please'})
const textarea = h('textarea', {placeholder: 'Send a message to my phone'})
const button = h('button', { onclick: () => {
if (textarea.value && input.value) {
fetch('https://ntfy.sh/evbogue', {
method: 'POST',
body: input.value + ' | ' + textarea.value
})
const got = document.getElementById('phonebuzz')
got.replaceWith(h('div', ['Sent! I received a message: "' + input.value + ' | ' + textarea.value + '"']))
} else {alert('Fill out all fields plz')}
}}, ['Send urgent message'])
document.body.appendChild(h('div', {id: 'phonebuzz'}, [input, textarea, button]))