Split HTML head, PHP, added searching tags

This commit is contained in:
Pablo Ferreiro 2022-01-03 16:11:24 +01:00
parent 477efe8486
commit 340f500206
No known key found for this signature in database
GPG key ID: 41FBCE65B779FA24
17 changed files with 262 additions and 216 deletions

16
scripts/home.js Normal file
View file

@ -0,0 +1,16 @@
const goToUser = (e) => {
e.preventDefault()
const formData = new FormData(e.target)
const username = formData.get('username')
window.location.href = `./@${username}`
}
const goToTag = (e) => {
e.preventDefault()
const formData = new FormData(e.target)
const tag = formData.get('tag')
window.location.href = `./tag/${tag}`
}
document.getElementById('username_form').addEventListener('submit', goToUser, false)
document.getElementById('tag_form').addEventListener('submit', goToTag, false)