Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions public/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ scrollBtn.addEventListener("click", function () {
});
});

const input = document.querySelector('input')
const scrollContainer = document.querySelector('.scroll-container')
//add event listener for when input is focused
input.addEventListener('keydown', (e) => {
if (e.key === 'Enter') {
//stop browser from refreshing
e.preventDefault()
getMatches()
}
});


const btn = document.getElementById('keyword-btn');
btn.addEventListener('click', getMatches);

Expand All @@ -28,6 +40,10 @@ async function getMatches() {
} catch (err) {
console.error(err);
}
//reset search bar to empty
document.querySelector('input').value = ''
//scroll back to the top
scrollContainer.scrollTop = 0
}

/**
Expand Down
26 changes: 26 additions & 0 deletions resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,32 @@ const resources = [
url: 'https://cloudconvert.com/jpg-to-webp',
keywords: ['jpg', 'webp', 'converter', 'heic', 'formats', 'high-quality', 'api']
},

{
name: 'Thumbnails for Social Media "Metatags',
url: 'https://nickcarmont8.medium.com/how-to-add-a-website-thumbnail-for-sharing-your-html-site-on-social-media-facebook-linkedin-12813f8d2618',
keywords: ['metadata', 'metatags', 'thumbnails', 'social media']
},
{
name: 'HTML Cheat Sheet',
url: 'https://htmlcheatsheet.com/',
keywords: ['HTML', 'cheat sheet', 'tags']
},
{
name: 'CSS Cheat Sheet',
url: 'https://htmlcheatsheet.com/css/',
keywords: ['CSS', 'cheat sheet', 'box model', 'selectors', 'color picker']
},
{
name: 'JS "JavaScript" Cheat Sheet',
url: 'https://htmlcheatsheet.com/js/',
keywords: ['JS', 'Javascript', 'cheat sheet', 'conditionals', 'loops', 'variables', 'dates', 'events', 'functions', 'regex', 'json', 'promises', 'arrays']
},
{
name: 'SEO Cheat Sheet',
url: 'https://htmlcheatsheet.com/seo/',
keywords: ['SEO', 'cheat sheet']
},
// Resource Format - please follow the styling below.
// {
// name: '',
Expand Down