-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
180 lines (160 loc) · 9.37 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>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">
<link rel="stylesheet" href="styles/functional.css">
<link rel="stylesheet" href="styles/style.css">
<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=Space+Grotesk&display=swap" rel="stylesheet">
</head>
<body>
<div id="header">
<div class="fs-1">Interactive Country Names</div>
<div class="header-select">
<span class="fs-5 fst-italic">Grammatical genders for countries in </span>
<select name="lang" id="lang-select">
<option value="de">German (de)</option>
</select> <br>
</div>
<div class="mt-3 mb-1" id="color-key">
<canvas width="15px" height="15px" id="feminine-color"></canvas> Feminine
<canvas width="15px" height="15px" id="masculine-color"></canvas> Masculine
<canvas width="15px" height="15px" id="neuter-color"></canvas> Neuter
<canvas width="15px" height="15px" id="plural-color"></canvas> Plural
<canvas width="15px" height="15px" id="no-gender-color"></canvas> No gender data
<canvas width="15px" height="15px" id="no-country-color"></canvas> Country is not found.
</div>
<button class="header-select" onclick="toggle()">Click here for <b><span id="toggle"></span></b> form genders</button>
</div>
<div id="extra-section">
<div id="extra-section-buttons">
<button onclick="document.getElementById('help-dialog').showModal()">Help</button>
<button onclick="document.getElementById('about-dialog').showModal()">About</button> <br>
<a href="https://github.com/brainuser5705/interaktiv-landernamen" target="_blank"><img src="github-mark/github-mark.svg" height="30px"></a>
</div>
<dialog id="help-dialog">
<h1>Welcome to Interactive Country Names!</h1>
<h4 style="color:crimson">It is still in active development, so more features will be added!</h4>
<p>
<b>Here's how to use it:</b>
<ul>
<li><b>Zoom and pan</b> the map.</li>
<li>Click on a country to <b>lock the <i>Infobox</i></b>. You can <b>still click on other country</b> in lock mode.</li>
<li><b>Exit out of lock mode</b> by clicking on the selected country.</li>
</ul>
</p>
<p>
<b>Note:</b>
This was developed on a 1920 X 1080 screen resolution. Styling and UI is not guarantee to work for other resolutions.
</p>
<form method="dialog">
<button>Alrighty!</button>
</form>
</dialog>
<dialog id="about-dialog">
<h1>About Interactive Country Names</h1>
<h4>Why?</h4>
<p>
<i>Interactive Country Names</i> is an interactive tool to view official country names in different languages.
The idea came up while I was learning German and encountered <i>grammatical genders</i> for the first time.
</p>
<h4>Grammatical Gender</h4>
<p>
Essentially in German (and other languages like Spanishand French), countries have a grammatical gender
and as a result, their names are prefixed with a "gendered" article. For example, Switzerland is feminine and would be
prefixed with the feminine definite article <i>"die"</i>. Check out the map and see if you can find out what
the definite articles are for the masculine gender, neutral gender and plural.
</p>
<p>
Source code, raw data, and research notes can be found in the <a href="https://github.com/brainuser5705/interaktiv-landernamen">Github repository</a>.
</p>
<form method="dialog">
<button>Alrighty!</button>
</form>
</dialog>
</div>
<div id="info-box">
<div id="info-box-header">
<img id="info-box-flag" width="200px"/>
<div id="info-box-isos">
<div>ISO 3166-1: <span id="info-box-iso"></span></div>
<div>ISO 3166-1 a2: <span id="info-box-iso-a2"></span></div>
<div>ISO 3166-1 a3: <span id="info-box-iso-a3"></span></div>
</div>
</div>
<div id="info-box-body" class="container text-left">
<!-- <div class="row text-center">
<div class="col col-3"></div>
<div class="col">Deutsch</div>
<div class="col">English</div>
</div> -->
<div class="row mt-1">
<div class="info-box-label col-3 px-0 py-1"><b>Official long form: </b></div>
<div class="col px-1 py-1"><span id="info-box-long"></span> <span id="info-box-long-gen"></span></div>
<div class="col px-1 py-1"><span id="info-box-long-en" lang="en"></span></div>
</div>
<div class="row mt-1">
<div class="info-box-label col-3 px-0 py-1"><b>Official short form: </b></div>
<div class="col px-1 py-1"><span id="info-box-short"></span> <span id="info-box-short-gen"></span></div>
<div class="col px-1 py-1"><span id="info-box-short-en" lang="en"></span></div>
</div>
<div class="row mt-1">
<div class="info-box-label col-3 px-0 py-1"><b>Capital: </b></div>
<div class="col px-1 py-1"><span id="info-box-capital"></span></div>
<div class="col px-1 py-1"><span id="info-box-capital-en" lang="en"></span></div>
</div>
<div class="row mt-1">
<div class="info-box-label col-3 px-0 py-1"><b>Nationals: </b></div>
<div class="col px-1 py-1">
<div><span id="info-box-nat-m"> </span> <span class="gender">m.</span></div>
<div><span id="info-box-nat-f"> </span> <span class="gender">f.</span></div>
</div>
</div>
<div class="row mt-1">
<div class="info-box-label col-3 px-0 py-1"><b>Nationality: </b></div>
<div class="col px-1 py-1" id="info-box-nationality"></div>
</div>
</div>
</div>
<div id="map-div">
<svg id="map">
<defs>
<filter id="softGlow" height="300%" width="300%" x="-75%" y="-75%">
<!-- Thicken out the original shape -->
<feMorphology operator="dilate" radius="4" in="SourceAlpha" result="thicken" />
<!-- Use a gaussian blur to create the soft blurriness of the glow -->
<feGaussianBlur in="thicken" stdDeviation="10" result="blurred" />
<!-- Change the colour -->
<feFlood flood-color="rgb(0,186,255)" result="glowColor" />
<!-- Color in the glows -->
<feComposite in="glowColor" in2="blurred" operator="in" result="softGlow_colored" />
<!-- Layer the effects together -->
<feMerge>
<feMergeNode in="softGlow_colored"/>
<feMergeNode in="SourceGraphic"/>
</feMerge>
</filter>
</defs>
<g id="map-group">
<g id="long-map"></g>
<g id="short-map"></g>
<!-- for glowing effect, moves on top of the country vector-->
<path id="selected-country"></path>
</g>
</svg>
</div>
<div id="credit-section">
Developed by <a href="https://ashleyliew.com" target="_blank">Ashley Liew <i>(brainuser5705)</i></a> - 2023
</div>
<div id="tooltip">
<div><i>Long: </i><span id="tooltip-long"></span></div>
<div><i>Short: </i><span id="tooltip-short"></span></div>
</div>
<script src="https://d3js.org/d3.v5.min.js"></script>
<script src="https://unpkg.com/topojson@3"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous"></script>
<script src="scripts/script.js"></script>
</body>
</html>