mirror of
https://github.com/neosubhamoy/neosubhamoy-portfolio.git
synced 2025-12-19 23:59:35 +05:30
(feat): added pages and quick actions as search results
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
<i class="fa-solid fa-chevron-right text-accent_three mx-2 hidden group-hover:block"></i>
|
||||
</span>
|
||||
</div>
|
||||
<p class="text-xs text-accent_three mt-3 mb-2 mx-1">QUICK SHOTCUTS</p>
|
||||
<p class="text-xs text-accent_three mt-3 mb-2 mx-1">QUICK ACTIONS</p>
|
||||
<div class="group resultitem w-full flex justify-between items-center my-1 p-1 cursor-pointer hover:bg-bg_third transition transform duration-200 rounded-lg" onclick="location.href='mailto:hey@neosubhamoy.dev'">
|
||||
<span class="flex items-center">
|
||||
<lord-icon class="mx-1" src="https://cdn.lordicon.com/xtnsvhie.json" target=".resultitem" trigger="hover" colors="primary:#38BDF8" style="width:25px"></lord-icon>
|
||||
|
||||
@@ -138,7 +138,7 @@ function inject_search_results (results) {
|
||||
results.project.forEach(function(result) {
|
||||
let projectDiv = document.createElement("div");
|
||||
projectDiv.className = "group resultitem w-full flex justify-between items-center my-1 p-1 cursor-pointer hover:bg-bg_third transition transform duration-200 rounded-lg";
|
||||
projectDiv.setAttribute("onclick", "location.href='" + result.link + "'");
|
||||
projectDiv.setAttribute("onclick", "window.open('" + result.link + "', '_blank')");
|
||||
|
||||
projectDiv.innerHTML = `
|
||||
<span class="flex items-center">
|
||||
@@ -178,6 +178,48 @@ function inject_search_results (results) {
|
||||
searchRes.appendChild(socialDiv);
|
||||
});
|
||||
}
|
||||
|
||||
if(typeof(results.page) !== 'undefined') {
|
||||
results.page.forEach(function(result) {
|
||||
let pageDiv = document.createElement("div");
|
||||
pageDiv.className = "group resultitem w-full flex justify-between items-center my-1 p-1 cursor-pointer hover:bg-bg_third transition transform duration-200 rounded-lg";
|
||||
pageDiv.setAttribute("onclick", "location.href='" + result.link + "'");
|
||||
|
||||
pageDiv.innerHTML = `
|
||||
<span class="flex items-center">
|
||||
<lord-icon class="mx-1" src="https://cdn.lordicon.com/${result.icon}" target=".resultitem" trigger="hover" colors="primary:#38BDF8" style="width:25px"></lord-icon>
|
||||
<p class="mx-1">${result.name}</p>
|
||||
</span>
|
||||
<span class="flex items-center mr-1">
|
||||
<span class="px-[1rem] py-[0.05rem] mx-1 text-xs bg-accent_four text-bg_secondary rounded-full group-hover:hidden">${'#' + result.tag}</span>
|
||||
<i class="fa-solid fa-chevron-right text-accent_three mx-2 hidden group-hover:block"></i>
|
||||
</span>
|
||||
`;
|
||||
|
||||
searchRes.appendChild(pageDiv);
|
||||
});
|
||||
}
|
||||
|
||||
if(typeof(results.action) !== 'undefined') {
|
||||
results.action.forEach(function(result) {
|
||||
let actionDiv = document.createElement("div");
|
||||
actionDiv.className = "group resultitem w-full flex justify-between items-center my-1 p-1 cursor-pointer hover:bg-bg_third transition transform duration-200 rounded-lg";
|
||||
actionDiv.setAttribute("onclick", "window.open('" + result.link + "', '_blank')");
|
||||
|
||||
actionDiv.innerHTML = `
|
||||
<span class="flex items-center">
|
||||
<lord-icon class="mx-1" src="https://cdn.lordicon.com/${result.icon}" target=".resultitem" trigger="hover" colors="primary:#38BDF8" style="width:25px"></lord-icon>
|
||||
<p class="mx-1">${result.name}</p>
|
||||
</span>
|
||||
<span class="flex items-center mr-1">
|
||||
<span class="px-[1rem] py-[0.05rem] mx-1 text-xs bg-accent_four text-bg_secondary rounded-full group-hover:hidden">${'#' + result.tag}</span>
|
||||
<i class="fa-solid fa-chevron-right text-accent_three mx-2 hidden group-hover:block"></i>
|
||||
</span>
|
||||
`;
|
||||
|
||||
searchRes.appendChild(actionDiv);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function inject_no_results(results) {
|
||||
|
||||
Reference in New Issue
Block a user