{"id":22009996,"url":"https://github.com/jack970/search-country-api","last_synced_at":"2025-03-23T07:30:27.051Z","repository":{"id":117349694,"uuid":"406258706","full_name":"jack970/search-country-api","owner":"jack970","description":"Live Site:","archived":false,"fork":false,"pushed_at":"2021-10-02T11:33:56.000Z","size":812,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-28T14:21:47.366Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://search-country-api.netlify.app/index.html","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jack970.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-14T06:56:11.000Z","updated_at":"2021-10-02T11:33:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"252cf1ea-99b6-415b-af69-034b01bc4f2d","html_url":"https://github.com/jack970/search-country-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jack970%2Fsearch-country-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jack970%2Fsearch-country-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jack970%2Fsearch-country-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jack970%2Fsearch-country-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jack970","download_url":"https://codeload.github.com/jack970/search-country-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245071200,"owners_count":20556267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-30T02:11:42.725Z","updated_at":"2025-03-23T07:30:27.009Z","avatar_url":"https://github.com/jack970.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Frontend Mentor - REST Countries API solution\n\nThis is a solution to the [REST Countries API with color theme switcher challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/rest-countries-api-with-color-theme-switcher-5cacc469fec04111f7b848ca). Frontend Mentor challenges help you improve your coding skills by building realistic projects. \n\n## Table of contents\n\n- [Frontend Mentor - REST Countries API solution](#frontend-mentor---rest-countries-api-solution)\n  - [Table of contents](#table-of-contents)\n  - [Overview](#overview)\n    - [The challenge](#the-challenge)\n    - [Screenshot](#screenshot)\n    - [Links](#links)\n    - [Built with](#built-with)\n    - [What I learned](#what-i-learned)\n  - [Author](#author)\n\n## Overview\n\n### The challenge\n\nUsers should be able to:\n\n- See all countries from the API on the homepage\n- Search for a country using an `input` field\n- Filter countries by region\n- Click on a country to see more detailed information on a separate page\n- Click through to the border countries on the detail page\n- Toggle the color scheme between light and dark mode *(optional)*\n\n### Screenshot\n\n![Image Site](./thumbnail.png)\n\n### Links\n\n- Live Site Here: [search-country-api](https://search-country-api.netlify.app/index.html)\n- Solution Here: [Image Site](https://prnt.sc/1s5525n)\n\n### Built with\n\n- Semantic HTML5 markup\n- CSS custom properties\n- Flexbox\n- CSS Grid\n- Mobile-first workflow\n- API Fetch\n### What I learned\n\nThese functions check the value by Theme in Local Storage. If the value by Theme be equal dark-mode, the tag ```html``` will have an class dark-mode.\n```html\n\u003chtml lang=\"en\" class=\"dark-mode\"\u003e\n```\nIf Theme value in local storage is empty, the class in the tag will be empty.\n\n```html\n\u003chtml lang=\"en\" class=\"\"\u003e\n```\n\nSee below the code:\n\n```js\nfunction setTheme(themeName) {\n    localStorage.setItem('theme', themeName);\n    document.documentElement.className = themeName;\n}\n\n// function to toggle between light and dark theme\nfunction toggleTheme() {\n   if (localStorage.getItem('theme') === 'dark-mode'){\n       setTheme('');\n   } else {\n       setTheme('dark-mode');\n   }\n}\n\n// Immediately invoked function to set the theme on initial load\n(function () {\n   if (localStorage.getItem('theme') === 'dark-mode') {\n       setTheme('dark-mode');\n   } else {\n       setTheme(\"\");\n   }\n})();\n```\n## Author\n\n- Website - [search-country-api](https://search-country-api.netlify.app/index.html)\n- Frontend Mentor - [@jack970](https://www.frontendmentor.io/profile/yourusername)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjack970%2Fsearch-country-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjack970%2Fsearch-country-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjack970%2Fsearch-country-api/lists"}