Skip to content
Merged

Test #51

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
24a7639
chore: add to resources
Jun 13, 2022
5311f2f
add resources
brendondsouza Jun 13, 2022
1285f31
Added font awesome and frontend project readme template
20jasper Jun 13, 2022
2ab7202
Merge branch 'resources' into resources
schneedotdev Jun 13, 2022
d9fb0b4
Merge pull request #35 from brendondsouza/resources
schneedotdev Jun 13, 2022
077917d
Merge branch 'resources' into resources
Ethodeus Jun 13, 2022
63ea545
Merge pull request #34 from AbdulkarimOgaji/resources
Ethodeus Jun 13, 2022
f686621
added js functionality to scroll to a target element
Ethodeus Jun 13, 2022
b658a95
added timelinecss resources
Danamitecoder Jun 13, 2022
1f05a25
added more css and git resources
AlysshaLewin Jun 13, 2022
564d933
added simple icons, javascript visualizer, undraw
Danamitecoder Jun 13, 2022
07e358b
added more css and git resources
AlysshaLewin Jun 13, 2022
5e3ce43
added css and git resources
AlysshaLewin Jun 13, 2022
0c7665d
added devdocs to resources
Danamitecoder Jun 13, 2022
b5bc410
added devdocs to resources
Danamitecoder Jun 13, 2022
16b25e4
fixed devdocs
Ethodeus Jun 13, 2022
449865d
added resource
bytesbybianca Jun 13, 2022
e24d459
Added picular, canva wireframe, python coding tutor
Danamitecoder Jun 14, 2022
fabed06
added picular, canva wireframe, python tutor
Danamitecoder Jun 14, 2022
84d4391
fixed indentations
Ethodeus Jun 14, 2022
708ddab
added resource
bytesbybianca Jun 14, 2022
c02bdfd
added resource
bytesbybianca Jun 14, 2022
8ec7219
added resource
bytesbybianca Jun 14, 2022
2dca365
added resource
bytesbybianca Jun 14, 2022
8be8ee2
added resource
bytesbybianca Jun 14, 2022
2586893
added resource
bytesbybianca Jun 14, 2022
8758dcd
added resource
bytesbybianca Jun 14, 2022
08fa9f5
added resource
bytesbybianca Jun 14, 2022
a40dcc9
added resource
bytesbybianca Jun 14, 2022
fc090ec
added unscreen, quicktools, squoosh, warp, uiverse, loaders, postman,…
Danamitecoder Jun 14, 2022
5edcd7b
added unscreen, quicktools, squoosh, warp, uiverse, loaders, postman,…
Danamitecoder Jun 14, 2022
67ae5fc
added compressor and tinypng to resources
Danamitecoder Jun 14, 2022
f6e66b7
coolors, namecheap logomakere
Danamitecoder Jun 14, 2022
13c340d
added unsplash and page speed to resources
Danamitecoder Jun 14, 2022
fc3cd51
added cloudconvert to resources page
Danamitecoder Jun 14, 2022
81d6318
Update resources.js
Danamitecoder Jun 14, 2022
faf3b38
handled case where keyword doesnt exist
schneedotdev Jun 14, 2022
44c92ca
Merge pull request #43 from the-api-administration/scroll-fix
schneedotdev Jun 14, 2022
a400a35
Merge pull request #47 from the-api-administration/keyword-not-found
Ethodeus Jun 14, 2022
f01707d
formatted object
20jasper Jun 14, 2022
d1d5401
Merge pull request #46 from the-api-administration/resources
20jasper Jun 14, 2022
ef0bbbb
fixed client side search when resource was not found
schneedotdev Jun 14, 2022
2fd3572
Update server.js
schneedotdev Jun 14, 2022
7355888
Merge pull request #49 from the-api-administration/keyword-not-found
Ethodeus Jun 14, 2022
500bf6c
Update resources.js
schneedotdev Jun 14, 2022
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
30 changes: 23 additions & 7 deletions public/js/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
const scrollBtn = document.getElementById('contributors')
const targetScroll = document.getElementById('contributors-title')
const elemRect = targetScroll.getBoundingClientRect()
scrollBtn.addEventListener("click", function () {
window.scrollTo({
top: elemRect.top,
left: 0,
});
});

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

Expand Down Expand Up @@ -30,14 +40,20 @@ function renderMatches(matches) {
list.innerHTML = '';

// For every match found, render the objects to the DOM in JSON format
matches.forEach(match => {
const li = document.createElement('li');
if(matches.length > 0) {
matches.forEach(match => {
const li = document.createElement('li');

// Create an element that looks like a JSON object for every match
li.innerHTML = `
<pre class="json"><code>{<div class="indent"><br>name: '${match.name}',<br>url: <a href="${match.url}" target="_blank">'${match.url}',</a><br class="middle-br">keywords: [${match.keywords.map(keyword => `'${keyword}'`).join(", ")}]<br></div>},</code></pre>
`;
// Create an element that looks like a JSON object for every match
li.innerHTML = `
<pre class="json"><code>{<div class="indent"><br>name: '${match.name}',<br>url: <a href="${match.url}" target="_blank">'${match.url}',</a><br class="middle-br">keywords: [${match.keywords.map(keyword => `'${keyword}'`).join(", ")}]<br></div>},</code></pre>
`;

list.appendChild(li);
});
} else {
const li = document.createElement('li');
li.innerText = 'No matches were found.';
list.appendChild(li);
});
}
}
188 changes: 187 additions & 1 deletion resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,192 @@ const resources = [
url: 'https://javascript.info/object',
keywords: ['javascript', 'objects']
},
{
name: 'Crypto Zombies',
url: "https://cryptozombies.io",
keywords: ["crypto", "web3", "blockchain"]
},
{
name: 'How to make your first pull request on GitHub',
url: "https://www.freecodecamp.org/news/how-to-make-your-first-pull-request-on-github-3/",
keywords: ["open source", "git"]
},
{
name: 'CORS Proxy',
url: 'https://codetabs.com/cors-proxy/cors-proxy.html',
keywords: ['cors', 'proxy', 'api', 'errors']
},
{
name: 'How to write good commit messages',
url: 'https://www.freecodecamp.org/news/writing-good-commit-messages-a-practical-guide/',
keywords: ['git', 'commit', 'version control', 'command line']
},
{
name: 'Grind 75 questions',
url: 'https://www.techinterviewhandbook.org/grind75',
keywords: ['interview', 'job search', 'coding challenges', 'leet code']
},
{
name: 'Font Awesome',
url: 'https://faicons.com/',
keywords: ['icons', 'frontend']
},
{
name: 'Frontend Project README template',
url: 'https://github.com/alecortega/portfolio-template',
keywords: ['markdown', 'frontend', 'documentation']
},
{
name: 'CSS Diner',
url: 'https://flukeout.github.io/',
keywords: ['css']
},
{
name: 'Flexbox Froggy',
url: 'https://flexboxfroggy.com/',
keywords: ['css', 'flexbox']
},
{
name: 'Learn Git Branching',
url: 'https://learngitbranching.js.org/',
keywords: ['git', 'version control']
},
{
name: 'What the Flexbox',
url: 'https://flexbox.io/',
keywords: ['css', 'flexbox']
},
{
name: 'Code Driven Animation Editor',
url: 'https://www.timelinecss.io/',
keywords: ['css animations', 'css', 'animations', 'editor', 'visuals']
},
{
name: 'Simple Icons',
url: 'https://simpleicons.org',
keywords: ['free', 'svg icons', 'svg', 'icons', 'popular brands']
},
{
name: 'JavaScript Visualizer 9000',
url: 'https://www.jsv9000.app',
keywords: ['javascript', 'call stack', 'event loop', 'microtask queue', 'task queue']
},
{
name: 'unDraw',
url: 'https://undraw.co',
keywords: ['open-source illustrations', 'svg', 'images', 'design', 'graphics', 'art', 'vectors', 'minimal', 'free', 'modern', 'png', 'interface', 'open-source']
},
{
name: 'DevDocs',
url: 'https://devdocs.io',
keywords: ['api documentation', 'free', 'open-source', 'developer tools', 'interface', 'offline', 'css', 'html', 'http', 'javascript', 'web apis', 'angular', 'angularjs', 'ansible', 'apache http server', 'apache pig', 'async', 'babel', 'backbone.js', 'bash', 'bluebird', 'bootstrap', 'bottle', 'bower', 'c', 'c++', 'cakephp', 'chai', 'chef', 'clojure', 'cmake', 'codeception', 'codeceptjs', 'codeigniter', 'coffeescript', 'composer', 'cordova', 'crystal', 'cypress', 'd', 'd3.js', 'dart', 'deno', 'django', 'django rest framework', 'docker', 'dojo', 'drupal', 'eigen3', 'electron', 'elisp', 'elixir', 'ember.js', 'enzyme', 'erlang', 'esbuild', 'eslint', 'express', 'falcon', 'fish', 'flask', 'flow', 'gcc', 'git', 'gnu fortran', 'gnu make', 'gnucobol', 'gnuplot', 'go', 'godot', 'graphite', 'groovy', 'grunt', 'gtk', 'handlebars', 'haproxy', 'haskell', 'haxe', 'homebrew', 'i3', 'immutable.js', 'influxdata', 'jasmine', 'jekyll', 'jest', 'jinja', 'jq', 'jquery', 'jquery mobile', 'jquery ui', 'jsdoc', 'julia', 'knockout.js', 'koa', 'kotlin', 'kubectl', 'kubernetes', 'laravel', 'latex', 'leaflet', 'less', 'liquid', 'lodash', 'lua', 'love', 'mariadb', 'marionette.js', 'markdown', 'matplotlib', 'meteor', 'mocha', 'modernizr', 'moment.js', 'mongoose', 'nginx', 'nginx lua module', 'nim', 'nix', 'node.js', 'nokogiri', 'npm', 'numpy', 'ocaml', 'octave', 'openjdk', 'opentsdb', 'padrino', 'pandas', 'perl', 'phalcon', 'phaser', 'phoenix', 'php', 'phpunit', 'pointcloudlibrary', 'pony', 'postgresql', 'prettier', 'pug', 'puppeteer', 'pygame', 'python', 'pytorch', 'q', 'qt', 'r', 'ramda', 'react', 'reactbootstrap', 'react native', 'react router', 'reactivex', 'redis', 'redux', 'relay', 'requirejs', 'rethinkdb', 'ruby', 'ruby minitest', 'ruby on rails', 'rust', 'rxjs', 'saltstack', 'sass', 'scala', 'scikit-image', 'scikit-learn', 'sequelize', 'sinon.js', 'socket.io', 'spring boot', 'sqlite', 'statsmodels', 'support tables', 'svg', 'symfony', 'tailwind css', 'tcl tk', 'tensorflow', 'tensorflow c++', 'terraform', 'trio', 'twig', 'typescript', 'underscore.js', 'vagrant', 'vite', 'vue router', 'vue.js', 'vuex', 'vulkan', 'web extensions', 'webpack', 'werkzeug', 'wordpress', 'xslt & xpath', 'yarn', 'yii']
},
{
name: 'Picular',
url: 'https://picular.co',
keywords: ['color', 'palette', 'color palette', 'primary color generator', 'fast', 'google image search', 'generator', 'hex codes']
},
{
name: 'Canva Wireframe Templates',
url: 'https://www.canva.com/templates/?query=wireframe',
keywords: ['canva', 'wireframe', 'template', 'prototype', 'project', 'design']
},
{
name: 'Python Tutor: Visualize Code in Python, JavaScript, C, C++, and Java',
url: 'https://pythontutor.com/visualize.html#mode=edit',
keywords: ['code', 'visualize', 'python', 'javascript', 'c', 'c++', 'javascript', 'java', 'visualize execution', 'coding tutor', 'debug', 'supplement', 'recursion', 'execution', 'frames', 'objects', 'steps']
},
{
name: 'Unscreen',
url: 'https://www.unscreen.com',
keywords: ['remove video background', 'video', 'background', 'free', 'hd', 'no watermark', 'api plugins', 'plugins', 'clips', 'video file', 'audio', 'gif', 'presentation', 'remove', '.mp4', '.mov', '.gif', 'url', 'footage', 'record', 'video editing']
},
{
name: 'Quicktools by Picsart',
url: 'https://tools.picsart.com/image/background-remover/',
keywords: ['remove', 'background remover', 'image', 'picture', 'transparent', 'ai', 'free', 'refine', 'backgrounds', 'shadows', 'borders']
},
{
name: 'Squoosh',
url: 'https://squoosh.app',
keywords: ['compress image', 'reduce file size', 'reduce', 'high quality', 'image', 'smaller file', 'file size', 'privacy', 'image optimizer', 'compress', 'codecs', 'resize', 'convert image', 'convert', 'free', 'open-source', 'pixels', 'real-time', 'jpg', 'png', 'webp', 'avif']
},
{
name: 'Warp',
url: 'https://www.warp.dev',
keywords: ['terminal', 'gpu', 'crdt', 'rust', 'zsh', 'fish', 'bash', 'modern', 'development', 'code editor', 'writing code', 'code', 'commands', 'selections', 'cursor positioning', 'ai', 'shell commands', 'terminal sharing', 'customize', 'cli', 'command line']
},
{
name: 'Uiverse',
url: 'https://uiverse.io',
keywords: ['ui', 'ui elements', 'open-source', 'free', 'button', 'checkbox', 'toggle', 'switches', 'cards', 'loaders', 'inputs', 'css', 'html', 'hover', 'copy paste', 'cssbuttons']
},
{
name: 'Loaders',
url: 'https://cssloaders.github.io',
keywords: ['css', 'html', 'loader', 'loaders', 'animations', 'speed', 'simplicity', 'spinners', 'styling', 'pseudo elements', 'website', 'frontend']
},
{
name: 'Postman',
url: 'https://www.postman.com',
keywords: ['api', 'api platform', 'data', 'api lifecycle', 'collaboration', 'design', 'build', 'test', 'iterate', 'documentation', 'workspace', 'rest api', 'accessibility', 'http requests', 'tracking']
},
{
name: 'Screeps',
url: 'https://screeps.com',
keywords: ['sandbox', 'game', 'open-source', 'ai', 'programming', 'javascript', 'mmo', 'rts', 'player', 'scripting', 'steam', 'multiplayer', 'strategy game', 'colony', 'resources', 'mine', 'units', 'territory']
},
{
name: 'Oh My Posh',
url: 'https://ohmyposh.dev',
keywords: ['theme engine', 'shell', 'color', 'terminal', 'prompt', 'render', 'customizable', 'theme', 'powershell', 'windows', 'macos', 'linux', 'fonts', 'console', 'full color set', 'prompt string', 'function', 'variable']
},
{
name: 'Compressor',
url: 'https://compressor.io',
keywords: ['image compressor', 'image', 'fast', 'efficient', 'jpeg', 'png', 'svg', 'gif', 'webp', 'smaller images', 'faster website', 'optimized', 'seo', 'seo ranking', 'lighthouse', 'compression algorithm', 'shrink']
},
{
name: 'tiny png',
url: 'https://tinypng.com',
keywords: ['image compressor', 'image', 'fast', 'efficient', 'jpeg', 'png', 'webp', 'smaller images', 'transparent image', 'faster website', 'optimized', 'seo', 'seo ranking', 'lighthouse', 'compression algorithm', 'shrink']
},
{
name: 'Nerdy Data',
url: 'https://www.nerdydata.com',
keywords: ['search engine', 'source-code', 'tech stack', 'code', 'companies', 'leads', 'integrations', 'api access', 'domain', 'domain lookup', 'seo', 'google analytics', 'images', 'badges', 'websites', 'competitors']
},
{
name: 'Coolors',
url: 'https://coolors.co/palettes/trending',
keywords: ['color', 'color palettes', 'topics', 'styles', 'hex', 'hex values', 'color schemes', 'color combinations', 'design', 'free', 'css', 'generator']
},
{
name: 'Name Cheap Logo Maker',
url: 'https://www.namecheap.com/logo-maker/',
keywords: ['logo', 'logo maker', 'free', 'creator', 'business', 'branding']
},
{
name: 'Unsplash',
url: 'https://unsplash.com',
keywords: ['images', 'free', 'high-resolution', 'wallpapers', '3d renders', 'textures', 'patterns', 'experimental', 'architecture', 'nature', 'business and work', 'fashion', 'film', 'food', 'drink', 'street photography', 'arts and culture', 'royalty-free', 'stock photo', 'commercial', 'personal projects']
},
{
name: 'Page Speed',
url: 'https://pagespeed.web.dev',
keywords: ['page speed', 'web page', 'speed', 'load time', 'browser request', 'seo', 'optimization']
},
{
name: 'Cloud Convert',
url: 'https://cloudconvert.com/jpg-to-webp',
keywords: ['jpg', 'webp', 'converter', 'heic', 'formats', 'high-quality', 'api']
},
// Resource Format - please follow the styling below.
// {
// name: '',
// url: '',
// keywords: ['']
// },
];

exports.resources = resources;
exports.resources = resources;
17 changes: 8 additions & 9 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@ app.get('/api/:keyword', (req, res) => {
// filter resources array, return items that match query; tag.
const matches = resources.filter((obj) => obj.keywords.some(str => str.includes(keyword)));

try {
// if matches were found respond with json
if (matches.length) {
res.json(matches);
} else {
throw new Error('No resources found.');
}
} catch(err) {
console.error(err);
// if matches were found, respond with matches array in JSON format
if (matches.length) {
res.json(matches);
} else {
// respond with status 404, no matches were found
res.status(404).json({
error: `No resources were found with the ${keyword} keyword.`
});
}
});

Expand Down
2 changes: 1 addition & 1 deletion views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<div class="frame">
<nav>
<img src="public/assets/logo.svg" alt="logo" />
<a href='#contributors-title'><button id="contributors">Contributors</button></a>
<button id="contributors">Contributors</button>
</nav>
<main>
<section class="description">
Expand Down