-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·174 lines (163 loc) · 9.12 KB
/
index.php
File metadata and controls
executable file
·174 lines (163 loc) · 9.12 KB
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
<?php
/**
* 首页:国旗列表与文档入口
*/
$pageTitle = 'Country Flag Icons – Free SVG Flags CDN | flagcdn.io';
$pageDescription = 'Free SVG country flag icons by ISO 3166-1 alpha-2. One-line CSS, 4:3 & 1:1 aspect ratios. Copy HTML or image URL for any country. Fast CDN delivery.';
$pageKeywords = 'country flags, flag icons, SVG flags, ISO 3166, flag CDN, country code flags, free flag icons, national flags, flag emoji, world flags';
$canonicalUrl = 'https://flagcdn.io/';
$extraHead = '<link rel="stylesheet" href="https://jsd.bluecdn.com/npm/leaflet@1.9.4/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin="" />';
require __DIR__ . '/header.php';
// JSON-LD structured data
$extraHead .= '
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebApplication",
"name": "flagcdn.io",
"url": "https://flagcdn.io",
"description": "Free SVG country flag icons by ISO 3166-1 alpha-2. One-line CSS, 4:3 & 1:1 aspect ratios. Fast CDN delivery.",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "Any",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
},
"author": {
"@type": "Organization",
"name": "flagcdn.io",
"url": "https://flagcdn.io"
},
"license": "https://opensource.org/licenses/MIT"
}
</script>';
// 页脚脚本:Leaflet 地图与主应用
$footerScripts = implode("\n ", [
'<script src="https://jsd.bluecdn.com/npm/leaflet@1.9.4/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script>',
'<script src="/assets/i18n.js"></script>',
'<script src="/assets/app.js"></script>',
]);
?>
<section class="welcome">
<div class="container welcome-inner">
<div class="welcome-content">
<h1 class="welcome-title" data-i18n="hero.title">Flag Icons</h1>
<p class="welcome-desc" data-i18n="hero.sub">
Country flags in SVG. Use the code icon to copy HTML, or the copy button to copy image
URL and country code.
</p>
<div class="welcome-cta-row">
<a href="/docs/" class="welcome-cta">
<i class="fa-solid fa-file-lines welcome-cta-fa" aria-hidden="true"></i>
<span data-i18n="hero.cta">View Docs</span>
</a>
<a href="/download/flags.zip" class="welcome-cta welcome-cta--download" id="download-flags-btn" download>
<span class="download-btn-tooltip" id="download-btn-tooltip" role="tooltip">flags.zip</span>
<span class="download-btn-content">
<i class="fa-solid fa-arrow-down-to-line welcome-cta-fa download-btn-icon" aria-hidden="true"></i>
<span data-i18n="hero.download">Download</span>
</span>
<span class="download-btn-number" id="download-count">0</span>
<span class="download-btn-spinner" aria-hidden="true"></span>
</a>
</div>
</div>
<div class="welcome-visual">
<div class="welcome-flags">
<span class="fi fi-cn" title="4:3"></span>
<span class="fi fi-us" title="4:3"></span>
<span class="fi fi-gb" title="4:3"></span>
<span class="fi fi-jp" title="4:3"></span>
<span class="fi fi-de" title="4:3"></span>
<span class="fi fi-fr fis" title="1:1"></span>
<span class="fi fi-eu fis" title="1:1"></span>
</div>
</div>
</div>
</section>
<section class="bento">
<div class="container bento-grid">
<div class="bento-card bento-feat">
<div class="bento-feat-header"><i class="fa-solid fa-flag bento-feat-icon" aria-hidden="true"></i><h3 class="bento-feat-title" data-i18n="bento.flagsTitle">270+ Flags</h3></div>
<p class="bento-feat-desc" data-i18n="bento.flagsDesc">Every ISO 3166-1 country and territory, plus regions and organizations.</p>
</div>
<div class="bento-card bento-feat">
<div class="bento-feat-header"><i class="fa-solid fa-crop-simple bento-feat-icon" aria-hidden="true"></i><h3 class="bento-feat-title" data-i18n="bento.ratioTitle">4:3 & 1:1</h3></div>
<p class="bento-feat-desc" data-i18n="bento.ratioDesc">Two aspect ratios. Uniform sizing for clean, aligned layouts.</p>
</div>
<div class="bento-card bento-feat">
<div class="bento-feat-header"><i class="fa-solid fa-bolt bento-feat-icon" aria-hidden="true"></i><h3 class="bento-feat-title" data-i18n="bento.cdnTitle">CDN Powered</h3></div>
<p class="bento-feat-desc" data-i18n="bento.cdnDesc">Global edge delivery via Cloudflare. One CSS link to get started.</p>
</div>
<div class="bento-card bento-feat">
<div class="bento-feat-header"><i class="fa-solid fa-clipboard bento-feat-icon" aria-hidden="true"></i><h3 class="bento-feat-title" data-i18n="bento.copyTitle">Click to Copy</h3></div>
<p class="bento-feat-desc" data-i18n="bento.copyDesc">Copy HTML snippet or SVG image URL with a single click.</p>
</div>
<div class="bento-card bento-feat">
<div class="bento-feat-header"><i class="fa-solid fa-earth-americas bento-feat-icon" aria-hidden="true"></i><h3 class="bento-feat-title" data-i18n="bento.mapTitle">Map View</h3></div>
<p class="bento-feat-desc" data-i18n="bento.mapDesc">Locate any country on an interactive Mapbox map.</p>
</div>
</div>
</section>
<main class="container main-content">
<div class="controls">
<div class="search-box">
<input type="text" id="search-flag" data-i18n-placeholder="search.placeholder" placeholder="Search..." />
</div>
<div class="filter-continent">
<label for="continent-select" class="filter-label" data-i18n="filter.continent">Continent</label>
<select id="continent-select" class="continent-select" data-i18n-title="filter.title" title="Filter by continent">
<option value="" data-i18n="filter.all">All</option>
<option value="Africa">Africa</option>
<option value="Asia">Asia</option>
<option value="Europe">Europe</option>
<option value="North America">North America</option>
<option value="Oceania">Oceania</option>
<option value="South America">South America</option>
<option value="Antarctica">Antarctica</option>
<option value="non-iso">Non-ISO</option>
</select>
</div>
</div>
<header class="section-header">
<span class="section-header-icon" aria-hidden="true"><i class="fa-solid fa-flag"></i></span>
<div class="section-header-text">
<h2 class="section-title" data-i18n="section.isoFlags">Country flags</h2>
<p class="section-subtitle" data-i18n="section.isoFlagsSub">ISO 3166-1-alpha-2 country and territory codes.</p>
</div>
</header>
<div id="flags-loading" class="flags-loading" aria-hidden="false">
<div class="flags-loading-spinner"></div>
</div>
<div id="iso-flags" class="flags-grid"></div>
<header class="section-header">
<span class="section-header-icon" aria-hidden="true"><i class="fa-solid fa-globe"></i></span>
<div class="section-header-text">
<h2 class="section-title" data-i18n="section.otherFlags">Other Flags</h2>
<p class="section-subtitle" data-i18n="section.otherFlagsSub">Non-ISO flags (regions, organizations, etc.).</p>
</div>
</header>
<div id="non-iso-flags" class="flags-grid"></div>
</main>
<div class="format-switch">
<button id="format-4x3" class="active" title="4:3">4:3</button>
<button id="format-1x1" title="1:1">1:1</button>
<button type="button" class="theme-toggle-side" id="theme-toggle-side" aria-label="Toggle theme" title="Toggle light/dark theme"><i class="fa-solid fa-moon theme-toggle-icon theme-toggle-icon--dark" aria-hidden="true"></i><i class="fa-solid fa-sun theme-toggle-icon theme-toggle-icon--light" aria-hidden="true"></i></button>
<button type="button" class="format-switch-backtotop" id="format-switch-backtotop" aria-label="Back to top" title="Back to top" data-i18n-title="footer.backtotop"><i class="fa-solid fa-arrow-up" aria-hidden="true"></i></button>
</div>
<div id="copy-toast" class="toast" aria-live="polite">
<i class="fa-solid fa-check"></i><span data-i18n="toast.copied">Copied</span>
</div>
<div id="map-modal" class="map-modal" role="dialog" aria-modal="true" aria-labelledby="map-modal-title" hidden>
<div class="map-modal-backdrop"></div>
<div class="map-modal-box">
<div class="map-modal-header">
<h2 id="map-modal-title" class="map-modal-title"></h2>
<button type="button" class="map-modal-close" aria-label="Close"><i class="fa-solid fa-times"></i></button>
</div>
<div id="map-container" class="map-container"></div>
</div>
</div>
<?php
require __DIR__ . '/footer.php';