-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcountry.html
81 lines (65 loc) · 3.66 KB
/
country.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta http-equiv="X-UA-Compatible" content="ie=edge"/>
<title>Country | REST Countries API</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.2/css/all.min.css"/>
<link rel="stylesheet" href="/styles/style.css"/>
<link rel="stylesheet" href="/styles/responsive.css">
</head>
<body>
<div id="app">
<div :class="[ darkMode ? 'dark-mode' : 'light-mode' ]">
<header>
<div class="container">
<h1>Where in the world?</h1>
<button class="btn-toggle-mode" id="toggle" @click="darkMode=!darkMode">
<i :class="[darkMode ? 'fas fa-moon' : 'far fa-moon']"></i>
Dark Mode
</button>
</div>
</header>
<section id="country-page">
<div class="back container">
<button class="btn-back" @click="goIndex">
<i class="fas fa-chevron-left"></i>
Back
</button>
</div>
<div class="country">
<div class="country__photo">
<img :src="country.flag" :alt="country.name"/>
</div>
<div class="country__card-body">
<h2 class="country__name-title">{{ country.name }}</h2>
<div class="country__description">
<div class="country__description-block">
<p><strong>Native Name:</strong> {{ country.nativeName }}</p>
<p><strong>Population:</strong> {{ new Intl.NumberFormat("en-US").format(country.population) }}</p>
<p class="country-region"><strong>Region:</strong> {{ country.region }}</p>
<p><strong>Sub Region:</strong> {{ country.subregion }}</p>
<p><strong>Capital:</strong> {{ country.capital }}</p>
</div>
<div class="country__description-block">
<p><strong>Top Level Domain:</strong> {{ country.topLevelDomain.map(domain => domain).join(', ') }}</p>
<p><strong>Currencies:</strong> {{ country.currencies.map(currency => currency.name).join(', ') }}</p>
<p><strong>Languages:</strong> {{ country.languages.map(language => language.name).join(', ') }}</p>
</div>
</div>
<div class="country__borders">
<p class="country__border-title">Border Countries:</p>
<div class="country__border-buttons">
<button class="btn-border" v-for="border in country.borders" @click="newTab(border)">{{ (this.countries.find(c => c.alpha3Code == border)).name }}</button>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
<script src="https://unpkg.com/vue@next"></script>
<script type="module" src="/scripts/getCountry.js"></script>
</body>
</html>