-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
180 lines (156 loc) · 8.64 KB
/
index.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!DOCTYPE html>
<html lang="en" class="transition-colors ease-in-out duration-500">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Where in the world?</title>
<link rel="icon" type="image/x-icon" href="./media/favico.svg" />
<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 rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@48,400,0,0" />
<script src="https://cdn.tailwindcss.com"></script>
<script src="tailwind.config.js"></script>
<script src="https://unpkg.com/@popperjs/core@2"></script>
<link rel="stylesheet" href="./css/style.css" />
</head>
<body class="bg-gray-100 text-black dark:bg-gray-700 dark:text-white flex flex-col h-screen">
<header class="bg-white relative text-black dark:bg-gray-800 dark:text-white shadow-md">
<nav class="container flex justify-between items-center mx-auto py-4">
<a class="text-xl md:text-2xl font-extrabold p-2" href="./index.html">Where in the world?</a>
<div class="group relative cursor-pointertext-black bg-white dark:bg-gray-800
dark:text-white rounded-lg flex align-center">
<button type="button" class="hover:bg-gray-100 focus:bg-gray-100 active:bg-gray-200 dark:hover:bg-gray-700
dark:focus:bg-gray-700 dark:active:bg-gray-600 rounded-lg font-semibold p-2 flex items-center"
data-dropdown-toggle="dark-menu-dropdown" id="dark-menu-button">
<span class="material-symbols-rounded mr-1" aria-hidden="true">
dark_mode
</span>
Dark Mode
</button>
<ul class="group-items w-full absolute inset-x-0 mt-1 before:content['']
before:absolute hidden before:inline-block before:-top-2 before:bottom-0
before:w-full before:h-2 top-full rounded-lg text-black bg-white dark:bg-gray-800
border-solid border-2 border-gray-300 dark:border-gray-500 dark:text-white shadow-lg py-4 z-10" role="menu"
aria-labelledby="dark-menu-button" tabindex="-1" aria-orientation="vertical" id="dark-menu-dropdown">
<li class="w-full">
<button class="flex justify-start px-4 py-1 w-full text-black bg-white dark:bg-gray-800 dark:text-white
hover:bg-gray-100 focus:bg-gray-100 active:bg-gray-200 dark:hover:bg-gray-700
dark:focus:bg-gray-700 dark:active:bg-gray-600 select-none" onclick="setThemeLight()">
Light
</button>
</li>
<li class="w-full">
<button class="flex justify-start px-4 py-1 w-full text-black bg-white dark:bg-gray-800 dark:text-white
hover:bg-gray-100 focus:bg-gray-100 active:bg-gray-200 dark:hover:bg-gray-700
dark:focus:bg-gray-700 dark:active:bg-gray-600 select-none" onclick="setThemeDark()">
Dark
</button>
</li>
<li class="w-full">
<button class="flex justify-start px-4 py-1 w-full text-black bg-white dark:bg-gray-800 dark:text-white
hover:bg-gray-100 focus:bg-gray-100 active:bg-gray-200 dark:hover:bg-gray-700
dark:focus:bg-gray-700 dark:active:bg-gray-600 select-none" onclick="setThemePrefered()">
System
</button>
</li>
</ul>
</div>
</nav>
</header>
<div class="flex flex-col bg-gray-100 text-black dark:bg-gray-700 dark:text-white pt-8 grow">
<div class="container flex justify-between flex-col md:flex-row flex-wrap mb-10">
<div class="input-group py-4 px-6 text-black bg-white dark:bg-gray-800
dark:text-white rounded-lg my-4 shadow-lg flex w-full lg:w-3/6 xl:w-2/6">
<span class="material-symbols-rounded mr-3"> search </span>
<input type="text" class="w-full focus-visible:outline-none bg-white dark:bg-gray-800"
placeholder="Search for a country..." id="search" />
</div>
<div class="group relative cursor-pointer text-black bg-white
dark:bg-gray-800 dark:text-white my-4 rounded-lg shadow-lg w-64 flex align-center">
<button type="button" class="flex justify-between py-4 px-6 w-full" data-dropdown-toggle="filter-menu-dropdown"
id="filter-menu-button">
<span id="current-filter">Filter by</span>
<div class="material-symbols-rounded -mr-1" aria-hidden="true">
expand_more
</div>
</button>
<ul class="group-items w-100 absolute inset-x-0 mt-1 before:content['']
before:absolute before:inline-block before:-top-1 before:bottom-0 before:w-full
before:h-1 top-full hidden rounded-lg text-black bg-white dark:bg-gray-800 dark:text-white
shadow-lg py-4 z-10" role="menu" aria-labelledby="filter-menu-button" tabindex="-1"
aria-orientation="vertical" id="filter-menu-dropdown">
<li class="px-4 py-1 text-black bg-white dark:bg-gray-800 dark:text-white
hover:bg-gray-100 dark:hover:bg-gray-700" data-filter-key="Africa">
Africa
</li>
<li class="px-4 py-1 text-black bg-white dark:bg-gray-800 dark:text-white
hover:bg-gray-100 dark:hover:bg-gray-700" data-filter-key="Americas">
Americas
</li>
<li class="px-4 py-1 text-black bg-white dark:bg-gray-800 dark:text-white
hover:bg-gray-100 dark:hover:bg-gray-700" data-filter-key="Asia">
Asia
</li>
<li class="px-4 py-1 text-black bg-white dark:bg-gray-800 dark:text-white
hover:bg-gray-100 dark:hover:bg-gray-700" data-filter-key="Europe">
Europe
</li>
<li class="px-4 py-1 text-black bg-white dark:bg-gray-800 dark:text-white
hover:bg-gray-100 dark:hover:bg-gray-700" data-filter-key="Oceania">
Oceania
</li>
<li class="px-4 py-1 text-black bg-white dark:bg-gray-800 dark:text-white
hover:bg-gray-100 dark:hover:bg-gray-700" data-filter-key="Favourites">
Favourites
</li>
</ul>
</div>
</div>
<div class="container grid grid-cols-12 max-h-100 lg:overflow-auto">
<aside class="col-span-3 sticky top-5 mr-5 mb-5 hidden lg:block bg-white dark:bg-gray-800 mt-5 rounded-lg
shadow-md overflow-scroll" id="fav-box">
<h2 class="text-2xl sticky top-0 bg-white dark:bg-gray-800 p-5 font-bold">Favourites</h2>
<ol class="px-5 pb-5" id="fav-list">
</ol>
</aside>
<main class="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-2 2xl:grid-cols-3 gap-x-16 col-span-12 lg:col-span-9
py-5 h-full" id="grid">
</main>
</div>
</div>
<div class="relative z-50 hidden" aria-labelledby="modal-title" id="modal" role="dialog" aria-modal="true">
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"></div>
<div class="fixed z-50 inset-0 overflow-y-auto">
<div class="flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0">
<div
class="relative bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:max-w-lg sm:w-full">
<div class="bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
<div class="sm:flex sm:items-start">
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left">
<h3 class="text-lg leading-6 font-semibold text-gray-900 dark:text-gray-100" id="modal-title"></h3>
<div class="mt-2">
<p class="text-sm text-gray-600 dark:text-gray-200" id="modal-body"></p>
</div>
</div>
</div>
</div>
<div class="bg-gray-50 dark:bg-gray-700 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
<button type="button" class="mt-3 w-full inline-flex justify-center rounded-md shadow-sm px-4 py-2 bg-red-700
text-base font-semibold text-white hover:bg-red-500 focus:outline-none focus:ring-2 focus:ring-offset-1 focus:ring-red-300 sm:mt-0 sm:ml-3
sm:w-auto sm:text-sm dark:bg-red-700 dark:text-white dark:focus:ring-offset-0"
onclick="closeModal()">Close</button>
</div>
</div>
</div>
</div>
</div>
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script src="https://unpkg.com/tippy.js@6"></script>
<script src="./js/dropdown.js"></script>
<script src="./js/modal.js"></script>
<script src="./js/dark.js"></script>
<script type="module" src="./js/list.js"></script>
</body>
</html>