Skip to content
Open
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
29 changes: 29 additions & 0 deletions CountriesData.json
Original file line number Diff line number Diff line change
@@ -1,174 +1,203 @@
[
{
"name": "Åland Islands",
"flag": "https://flagcdn.com/w320/ax.png",
"population": 21225,
"region": "Europe",
"capital": "Mariehamn"
},
{
"name": "Afghanistan",
"flag": "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Flag_of_the_Taliban.svg/320px-Flag_of_the_Taliban.svg.png",
"population": 27657145,
"region": "Asia",
"capital": "Kabul"
},
{
"name": "Albania",
"flag": "https://flagcdn.com/w320/al.png",
"population": 2886026,
"region": "Europe",
"capital": "Tirana"
},
{
"name": "Algeria",
"flag": "https://flagcdn.com/w320/dz.png",
"population": 40400000,
"region": "Africa",
"capital": "Algiers"
},
{
"name": "American Samoa",
"flag": "https://flagcdn.com/w320/as.png",
"population": 57100,
"region": "Oceania",
"capital": "Pago Pago"
},
{
"name": "Andorra",
"flag": "https://flagcdn.com/w320/ad.png",
"population": 78014,
"region": "Europe",
"capital": "Andorra la Vella"
},
{
"name": "Angola",
"flag": "https://flagcdn.com/w320/ao.png",
"population": 25868000,
"region": "Africa",
"capital": "Luanda"
},
{
"name": "Anguilla",
"flag": "https://flagcdn.com/w320/ai.png",
"population": 13452,
"region": "Americas",
"capital": "The Valley"
},
{
"name": "Antarctica",
"flag": "https://flagcdn.com/w320/aq.png",
"population": 1000,
"region": "Polar",
"capital": ""
},
{
"name": "Israel",
"flag": "https://flagcdn.com/w320/il.png",
"population": 8527400,
"region": "Asia",
"capital": "Jerusalem"
},
{
"name": "Italy",
"flag": "https://flagcdn.com/w320/it.png",
"population": 60665551,
"region": "Europe",
"capital": "Rome"
},
{
"name": "Jamaica",
"flag": "https://flagcdn.com/w320/jm.png",
"population": 2723246,
"region": "Americas",
"capital": "Kingston"
},
{
"name": "Japan",
"flag": "https://flagcdn.com/w320/jp.png",
"population": 126960000,
"region": "Asia",
"capital": "Tokyo"
},
{
"name": "Jersey",
"flag": "https://flagcdn.com/w320/je.png",
"population": 100800,
"region": "Europe",
"capital": "Saint Helier"
},
{
"name": "Jordan",
"flag": "https://flagcdn.com/w320/jo.png",
"population": 9531712,
"region": "Asia",
"capital": "Amman"
},
{
"name": "Kazakhstan",
"flag": "https://flagcdn.com/w320/kz.png",
"population": 17753200,
"region": "Asia",
"capital": "Astana"
},
{
"name": "Kenya",
"flag": "https://flagcdn.com/w320/ke.png",
"population": 47251000,
"region": "Africa",
"capital": "Nairobi"
},
{
"name": "Kiribati",
"flag": "https://flagcdn.com/w320/ki.png",
"population": 113400,
"region": "Oceania",
"capital": "South Tarawa"
},
{
"name": "Kuwait",
"flag": "https://flagcdn.com/w320/kw.png",
"population": 4183658,
"region": "Asia",
"capital": "Kuwait City"
},
{
"name": "Kyrgyzstan",
"flag": "https://flagcdn.com/w320/kg.png",
"population": 6047800,
"region": "Asia",
"capital": "Bishkek"
},
{
"name": "Laos",
"flag": "https://flagcdn.com/w320/la.png",
"population": 6492400,
"region": "Asia",
"capital": "Vientiane"
},
{
"name": "Latvia",
"flag": "https://flagcdn.com/w320/lv.png",
"population": 1961600,
"region": "Europe",
"capital": "Riga"
},
{
"name": "Lebanon",
"flag": "https://flagcdn.com/w320/lb.png",
"population": 5988000,
"region": "Asia",
"capital": "Beirut"
},
{
"name": "Lesotho",
"flag": "https://flagcdn.com/w320/ls.png",
"population": 1894194,
"region": "Africa",
"capital": "Maseru"
},
{
"name": "Liberia",
"flag": "https://flagcdn.com/w320/lr.png",
"population": 4615000,
"region": "Africa",
"capital": "Monrovia"
},
{
"name": "Libya",
"flag": "https://flagcdn.com/w320/ly.png",
"population": 6385000,
"region": "Africa",
"capital": "Tripoli"
},
{
"name": "Liechtenstein",
"flag": "https://flagcdn.com/w320/li.png",
"population": 37623,
"region": "Europe",
"capital": "Vaduz"
},
{
"name": "Lithuania",
"flag": "https://flagcdn.com/w320/lt.png",
"population": 2872294,
"region": "Europe",
"capital": "Vilnius"
},
{
"name": "Luxembourg",
"flag": "https://flagcdn.com/w320/lu.png",
"population": 576200,
"region": "Europe",
"capital": "Luxembourg"
Expand Down
21 changes: 21 additions & 0 deletions css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -307,3 +307,24 @@ body.dark-theme .country-info li {
body.dark-theme .country-info strong {
color: white;
}

.toast {
position: fixed;
bottom: 10px;
left: 50%;
transform: translateX(-50%);
background-color: #444;
color: #fff;
padding: 8px 15px;
border-radius: 4px;
font-size: 14px;
display: none; /* Initially hidden */
z-index: 1000; /* Ensure it's above other elements */
opacity: 0; /* Start invisible */
transition: opacity 0.3s ease-in-out; /* Smooth fade in/out */
}

.toast.visible {
display: block; /* Show the toast */
opacity: 1; /* Make it fully visible */
}
27 changes: 11 additions & 16 deletions details.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,9 @@
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;600;800&display=swap"
rel="stylesheet"
/>
<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;600;800&display=swap" rel="stylesheet"/>
<!-- Fontawesome Library -->
<link
rel="stylesheet"
href="https://site-assets.fontawesome.com/releases/v6.0.0/css/all.css"
/>
<link rel="stylesheet" href="https://site-assets.fontawesome.com/releases/v6.0.0/css/all.css"/>
<!-- Shared CSS Styles File -->
<link rel="stylesheet" href="./css/common.css" />
<!-- Page Custom CSS File -->
Expand All @@ -43,17 +37,17 @@
<i class="fa-regular fa-chevron-up icon"></i>
</button>
<!-- Header -->
<header class="header">
<header id="header-id" class="header">
<div class="container flex flex-jc-sb flex-ai-c">
<div class="logo">
<a href="index.html">
<h1>Where in the world?</h1>
</a>
</div>
<button
type="button"
aria-label="Theme Switcher Button"
class="theme-toggle flex flex-jc-sb flex-ai-c"
type="button"
aria-label="Theme Switcher Button"
class="theme-toggle flex flex-jc-sb flex-ai-c"
>
<i class="fa-regular fa-moon theme-icon"></i>
<span class="theme-text">Dark Mode</span>
Expand All @@ -70,11 +64,12 @@ <h1>Where in the world?</h1>
</div>
</div>
<main class="main">
<div class="container">
<section class="country-details"></section>
<div id="container-id"class="container">
<section id="country-details-id" class="country-details"></section>
</div>
</main>
<script src="./js/common.js"></script>
<script src="./js/details.js"></script>
<script src="js/common.js" defer></script>
<script src="js/details.js"></script>

</body>
</html>
65 changes: 2 additions & 63 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,71 +88,10 @@ <h1>Where in the world?</h1>
<main class="main">
<div class="container">
<section class="countries-grid">
<a
href="#"
class="country scale-effect"
data-country-name="Afghanistan"
>
<div class="country-flag">
<img
src="https://upload.wikimedia.org/wikipedia/commons/5/5c/Flag_of_the_Taliban.svg"
alt="Afghanistan FLag"
/>
</div>
<div class="country-info">
<h2 class="country-title">Afghanistan</h2>
<ul class="country-brief">
<li><strong>population: </strong>40218234</li>
<li><strong>Region: </strong>Asia</li>
<li><strong>capital: </strong>Kabul</li>
</ul>
</div>
</a>
<a
href="#"
class="country scale-effect"
data-country-name="Åland Islands"
>
<div class="country-flag">
<img src="https://flagcdn.com/ax.svg" alt="Åland Islands FLag" />
</div>
<div class="country-info">
<h2 class="country-title">Åland Islands</h2>
<ul class="country-brief">
<li><strong>population: </strong>28875</li>
<li><strong>Region: </strong>Europe</li>
<li><strong>capital: </strong>Mariehamn</li>
</ul>
</div>
</a>
<a href="#" class="country scale-effect" data-country-name="Aruba">
<div class="country-flag">
<img src="https://flagcdn.com/aw.svg" alt="Aruba FLag" />
</div>
<div class="country-info">
<h2 class="country-title">Aruba</h2>
<ul class="country-brief">
<li><strong>population: </strong>106766</li>
<li><strong>Region: </strong>Americas</li>
<li><strong>capital: </strong>Oranjestad</li>
</ul>
</div>
</a>
<a href="#" class="country scale-effect" data-country-name="Belize">
<div class="country-flag">
<img src="https://flagcdn.com/bz.svg" alt="Belize FLag" />
</div>
<div class="country-info">
<h2 class="country-title">Belize</h2>
<ul class="country-brief">
<li><strong>population: </strong>397621</li>
<li><strong>Region: </strong>Americas</li>
<li><strong>capital: </strong>Belmopan</li>
</ul>
</div>
</a>
</section>
</div>
</main>
<script src="js/common.js" defer></script>
<script src="js/index.js" defer></script>
</body>
</html>
Loading