Add "People with this name" button

This commit is contained in:
Ethan Marshall 2024-01-28 21:09:28 +00:00
parent f7f231244c
commit 652cb26f57
Signed by: ejv2
GPG key ID: EC2FAEF4DB8968D8
3 changed files with 15 additions and 0 deletions

View file

@ -45,6 +45,10 @@ input.highlight {
cursor: wait !important;
}
.hidden {
display: none;
}
footer {
font-size: small !important;
position: fixed;

View file

@ -20,6 +20,8 @@
<input type="text" placeholder="Pajeet" name="name-box" id="name-box" readonly>
<br>
<button onclick="generate()" id="btn">Do the needful</button>
<br>
<a id="search" class="hidden" target="_blank">People with this name</a>
<footer>
<p>Written by <a href="https://github.com/ejv2/">ejv2</a> in 2024 -- <a href="/ijeet.jpg">Inspiration</a></p>

View file

@ -13,6 +13,9 @@ let root;
let btn;
let out;
const search_front = "https://www.linkedin.com/pub/dir?firstName=";
const search_back = "&lastName=&trk=people-guest_people-search-bar_search-submit";
function onready()
{
root = document.querySelector("html")
@ -68,6 +71,10 @@ function cleanup_generate()
btn.classList.remove("loading");
out.classList.remove("loading");
// People with this name
document.querySelector("#search").classList.remove("hidden");
document.querySelector("#search").href = search_front + out.value + search_back;
flashinterval = setInterval(() => {
out.classList.toggle("highlight");
if (flashcount++ >= 6) {
@ -118,6 +125,8 @@ function generate()
root.classList.add("loading");
btn.classList.add("loading");
out.classList.add("loading");
// People with this name
document.querySelector("#search").classList.add("hidden");
get_names(pull_names);
}