-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.php
278 lines (251 loc) · 15.4 KB
/
index.php
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
<?PHP
header("Cache-Control: no-cache");
require_once ("env.php");
$lastEditTime = date ("jhi", filemtime(__FILE__));
$acceptLanguage = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
$languages = explode(',', $acceptLanguage);
$zhLanguages = [];
$lang = "en";
foreach($languages as $lang){
if(strpos(trim($lang), 'zh-') === 0){
$zhLanguages[] = $lang;
}
}
if(!empty($zhLanguages)) $lang = "cn";
if(isset($_GET['lang']) && $_GET['lang'] == "cn") $lang = "cn";
if(isset($_GET['lang']) && $_GET['lang'] == "en") $lang = "en";
if($lang == "cn"){
$extraHead = "";
// $pageDesc="可交互的纽博格林北环赛道地图,展示了众多弯道的介绍和图片";
// $pageLang="zh-Hans";
$jsLang = "cn";
}
else{
$extraHead = "";
// $pageDesc="An interactive map of Nürburgring race track";
// $pageLang="en-US";
$jsLang = "en";
}
echo
<<<HTML
<html lang="zh-Hans">
<head>
<meta charset="UTF-8">
<title>纽北赛道地图 Nürburgring Map</title>
<meta name="robots" content="noodp"/>
<meta name="author" content="JJ Ying" />
<meta name="description" content="可交互的纽博格林北环赛道地图,展示了众多弯道的介绍和图片 An interactive map of Nürburgring race track"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0" />
<meta name="format-detection" content="telephone=no">
<meta property="og:url" content="https://jjying.com/nurburgring">
<meta property="og:type" content="website">
<meta property="og:title" content="纽北赛道地图">
<meta property="og:description" content="可交互的纽博格林北环赛道地图,展示了众多弯道的介绍和图片">
<meta property="og:image" content="https://s.anyway.red/nurburgring/og.png">
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="纽北赛道地图" />
<meta name="twitter:description" content="可交互的纽博格林北环赛道地图,展示了众多弯道的介绍和图片" />
<meta name="twitter:site" content="@JJYing" />
<meta name="twitter:image" content="https://s.anyway.red/nurburgring/og.png" />
<link rel="preconnect" href="https://s.anyway.red">
<link rel="preconnect" href="https://anyway.fm">
<link rel="stylesheet" href="{$assetsDir}/main.css?v={$lastEditTime}"/>
{$extraHead}
<link rel="stylesheet" href="{$assetsDir}/sm/result.css"/>
<link rel="icon" href="{$assetsDir}/fav.png">
<style>[v-cloak],.hidden-area{display: none;}</style>
<script>
var lang = '{$jsLang}'
var _paq = window._paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//anyway.fm/matomo/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '3']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
</head>
<body>
<div id="app" :class="[showAllCornerNames ? 'show-all-corners' : '', lang ]">
<!-- <div class="debug">P: {{p.toFixed(3)}}<br/>X: {{mX.toFixed(3)}}<br/>Y: {{mY.toFixed(3)}}</div> -->
<div class="track-map">
<div class="inner">
<svg viewBox="0 0 660 530" class="main-svg" width="6600px" height="5300px">
<def>
<path d="M246.6 482.9c-.8-.8-1.6-1.7-2.4-2.8l-1.7-2.3c-3.7-5.6-2.8-7-6.9-7.3-2-.1-4.3 0-6.9 4.7a23.2 23.2 0 0 1-5 6.4c-4.2 3.8-8.7 7-14.2 7-5.8 0-7.6-3-14.4-5.2a30.4 30.4 0 0 0-15.4-.6c-2 1-1.8 1.2-3.4 1.4-2.1.2-4-1-5.6-2.6-2.4-2.6-3.4-4.4-5.7-7.4-1.7-2.3-4.5-3.6-6-6.2-1-1.8-.6-2.7-3-4.5-1.6-1.2-8.7-1.1-13.4-2.8-3.7-1.2-3.3-6.1-5.8-9.9-2.4-3.7-14.7-11-21.7-16.9-8.4-8.8-8.7-9.6-12-13.4-3.4-3.8-6.4-6.7-9-10.4a15.6 15.6 0 0 1-3.1-10.9c1-9.8 6.7-17.6 6.8-28.7 0-7.7.6-11.2-1.2-23.8-.7-5-2.4-8.5-4.3-13.3a305 305 0 0 0-15-32.4c-2.2-4-5.3-7-9-9.2-4-2.3-8.8-4.3-13.3-6.6a5.6 5.6 0 0 1-3-6c1-4.4 7.3-4.7 14.7-8.2 9-4.2 13-6.7 18.2-11.2 6.3-5.5 12-9.3 18.1-15.3 4.3-4.2 8-6.8 11.5-13.7 1.9-3.8 3.2-7 4.3-11.4 1.5-6.5.1-12.2 1.1-15.7 1.2-4.2 6-5 6.6-8 .6-3-2.8-6.3-1.2-10.6 1-2.6 7.6-6 12.3-10.2 3.9-3.3 3.3-4.2 7-8.1 7.2-7.7 7.7-6.6 15.3-15.2a24 24 0 0 0 6.4-11.5c1.2-5.9-1.5-11.2-3.6-16-.7-1.5-1.9-2.4-3.8-3.2-1.7-.6-4.3.2-6.1-.5-3-1.2-5-2.1-7.8-4.4-3.6-2.8-5.1-5.3-5.3-7.4-.2-2.7 1.4-3.7 3.4-4.6a53 53 0 0 0 15.4-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6.4 6-10.1 10-3.6 4-4.3 6.4-6.5 11.3-2 4.2-3.6 6-5.9 8.7-2 2.4-5.1 3.5-7.7 5.3-2.5 1.6-4.7 4.3-8.9 5.4-11.3 3-21.9 7.8-32.7 8.6-7 .5-9.5-8.4-16.5-8.3-2.9 0-5.7 1.7-8.2 3.4-4.3 3-8.6 5.1-8.3 8.7 1 11.5 22.4 10.7 28 19.6 2 3 4.7 7 4.2 14-.2 3.9-3.3 7-6.2 9.3-6.6 5.4-29.9 18.6-45.1 27.8L351.8 402c-13.8 8.7-35.7 21.7-41.6 26.1-14.2 10.8-26.5 31-29.7 35.7-2 2.9-8.9 7.7-9.6 9.9-1 2.5-.7 7.4-3.2 9.2-3 2.1-4.7 1.3-7.8 1.3-2.7 0-2 .7-4.9 1.3-1.8.4-5 .3-8.3-2.6" id="track"/>
</def>
<g class="section" :class=" showSection ? 'show' : 'hidden' " :style=" '--st:' + sectionStart + ';--ed:' + sectionEnd" >
<use href="#track" class="path"></use>
</g>
<use href="#track" class="base base2"/>
<g class="extras">
<path v-for="c in bridges" class="bridge" :d=" 'M' + w * c.stx + ' ' + h * c.sty + 'L' + w * c.edx + ' ' + h * c.edy"/>
<path class="bridge" :d=" 'M' + w * .367 + ' ' + h * .919 + 'L' + w * .379 + ' ' + h * .903"/>
</g>
<use href="#track" class="base"/>
<g class="corner" :class=" showCorner ? 'show' : 'hidden' " :style=" '--st:' + cornerStart + ';--ed:' + cornerEnd" >
<use href="#track" class="path"></use>
</g>
<use href="#track" class="progress"/>
</svg>
<div v-for="c in bridges" class="corner-name bridge-name" :class="[ (c.pt < p) || showAllCornerNames ? 'show' : 'hidden', c.h, c.v, c.pt - 0.001 < p && p < c.pt + 0.001 ? 'highlighted' : '']" :style=" '--x:' + c.x + ';--y:' + c.y " @click="setP(c.pt)">
<div>
<div>
<template v-if="lang == 'cn'">{{c.ch}}</template>
<template v-if="lang == 'en'">{{c.en}}</template>
</div>
</div>
</div>
<div v-for="c in sections" class="corner-name section-name" :class="[ (c.st < p) || showAllCornerNames ? 'show' : 'hidden', c.h, c.v, c.st < p && p < c.ed ? 'highlighted' : '']" :style=" '--x:' + c.x + ';--y:' + c.y " @click="setP((c.st + c.ed) / 2)">
<div>
<div>
<template v-if="lang == 'cn'">{{c.ch}}</template>
<template v-if="lang == 'en'">{{c.en}}</template>
</div>
</div>
</div>
<div v-for="c in corners" class="corner-name" :class="[ (c.st < p) || showAllCornerNames ? 'show' : 'hidden', c.h, c.v, c.st < p && p < c.ed ? 'highlighted' : '' ]" :style=" '--x:' + c.x + ';--y:' + c.y " @click="setP( (c.st + c.ed) / 2)">
<div>
<div>
<template v-if="lang == 'cn'">{{c.ch}}</template>
<template v-if="lang == 'en'">{{c.en}}</template>
</div>
</div>
</div>
<div class="mid " v-cloak>
<div class="msg" v-if="p == 0">
<div class="inner" v-if="p == 0" v-cloak>
<p class="title-font msg-title" v-if="lang == 'cn'">纽北赛道地图</p>
<p class="title-font msg-title" v-if="lang == 'en'">Nürburgring Map</p>
<p v-if="lang == 'cn'"><a href="https://zh.wikipedia.org/zh-hans/%E7%BA%BD%E5%8D%9A%E6%A0%BC%E6%9E%97%E8%B5%9B%E9%81%93" target="_blank">纽博格林赛道</a>(德语:Nürburgring)修筑于 1920 年代,由于跑道非常长、地形复杂充满挑战性,被认为是世界上最严苛的竞速赛道,其中的北环俗称为“纽北”,又叫“绿色地狱”。这里很多弯道都有独特的名字和故事,通过本地图可以方便爱好者学习。</p>
<p v-if="lang == 'en'"><a href="https://en.wikipedia.org/wiki/N%C3%BCrburgring" target="_blank">Nürburgring</a> is a German race track built in 1920s, and the North Loop(Nordschleife) of it is very famous and challenging for racers around the world, through this interactive map you can learn the names of the corners in Nürburgring</p>
<div class="indicator">
<div v-if="lang == 'cn'">向下滚动或点击弯道名查看地图</div>
<div v-if="lang == 'en'">Scroll or click the corner to start</div>
<svg viewBox="0 0 100 100" class="scroll-arrow">
<path d="M10 20l40 30l40 -30"/>
<path d="M10 60l40 30l40 -30"/>
</svg>
</div>
</div>
</div>
<div class="title-font miles" v-if="p != 0">
<span v-if="p > 0">{{ (p * 20.832).toFixed(2)}}</span><span v-else>0.00</span> <em>KM</em>
</div>
</div>
</div>
</div>
<div class="desc skew-p">
<div class="logo">
<div class="inner skew-n">
<span class="title-font" v-if="lang == 'cn'">纽<span>博格林</span>北<span>环</span>赛道地图</span>
<span class="title-font" v-if="lang == 'en'">Nürburgring Map</span>
<img src="{$assetsDir}/logo.svg" alt="纽北赛道地图"/>
</div>
</div>
<div class="corner-info">
<div class="inner" v-if="currentCorner && p > 0" v-cloak>
<div class="primary skew-n title-font" v-if="lang == 'cn' && currentCorner.ch" :class="currentCorner.ch == currentCorner.nk ? 'qt' : '' " v-cloak>{{currentCorner.ch}}</div>
<div class="primary skew-n" v-if="lang == 'en' && currentCorner.en" v-cloak>{{currentCorner.en}}</div>
<div class="nickname qt skew-n title-font" v-if="lang == 'cn' && currentCorner.nk && currentCorner.ch != currentCorner.nk" v-cloak>{{currentCorner.nk}}</div>
<div class="secondary skew-n" v-if="currentCorner.en" v-cloak>
<span class="extra" v-if="currentCorner.de">
<svg viewBox="0 0 5 3" class="skew-p">
<rect id="black_stripe" width="5" height="3" y="0" x="0" fill="#000"/>
<rect id="red_stripe" width="5" height="2" y="1" x="0" fill="#6C6C6C"/>
<rect id="gold_stripe" width="5" height="1" y="2" x="0" fill="#DADADA"/>
</svg> {{currentCorner.de}}
</span>
<span class="extra" v-if="lang == 'cn' && currentCorner.en">
<svg viewBox="0 0 60 30" class="skew-p">
<clipPath id="s">
<path d="M0,0 v30 h60 v-30 z"/>
</clipPath>
<clipPath id="t">
<path d="M30,15 h30 v15 z v15 h-30 z h-30 v-15 z v-15 h30 z"/>
</clipPath>
<g clip-path="url(#s)">
<path d="M0,0 v30 h60 v-30 z" fill="#292929"/>
<path d="M0,0 L60,30 M60,0 L0,30" stroke="#fff" stroke-width="6"/>
<path d="M0,0 L60,30 M60,0 L0,30" clip-path="url(#t)" stroke="#646464" stroke-width="4"/>
<path d="M30,0 v30 M0,15 h60" stroke="#fff" stroke-width="10"/>
<path d="M30,0 v30 M0,15 h60" stroke="#646464" stroke-width="6"/>
</g>
</svg> {{currentCorner.en}}
</span>
</div>
<div class="more skew-n" v-if="lang == 'cn' && currentCorner.more" v-html="currentCorner.more"></div>
</div>
<div class="inner desc-msg" v-if="p == 1" v-cloak>
<div class="ending skew-n" v-if="p > 0.999">
The End
<div class='btn skew-p' @click="setP(0.001)">
<div class='skew-n title-font' v-if="lang == 'cn'">回到起点</div>
<div class='skew-n' v-if="lang == 'en'">Start Over</div>
</div>
</div>
</div>
<div class="thumbs" v-if="currentCorner && currentCorner.imgs" v-cloak>
<div class="thumb" v-for="img in currentCorner.imgs" :class="img.url ? 'has-author' : '' ">
<img class="skew-n" :src=" 'https://s.anyway.red/nurburgring/' + img.src + '!/fh/300/quality/68/progressive/true/ignore-error/true' " loading="lazy" @click="openModal('image', img)"/>
<a class="thumb-source" v-if="img.url" :href="img.url" target="_blank" title="查看照片来源"><span class="skew-n">{{img.author}}</span></a>
</div>
</div>
</div>
<div class="controls">
<div class="inner skew-n">
<div @click="openModal('text')" role="button" class="link">
<template v-if="lang == 'cn'">关于本站</template>
<template v-if="lang == 'en'">About</template>
</div>
<div class="toggle-group" :class=" showAllCornerNames ? 'on' : 'off' " @click="showAllCornerNames = !showAllCornerNames">
<span v-if="lang == 'cn'">所有弯道</span>
<span v-if="lang == 'en'">All Corners</span>
<div class="toggle"></div>
</div>
<div class="toggle-group" :class=" darkMode ? 'on' : 'off' " @click="toggleDarkMode()">
<span v-if="lang == 'cn'">深色模式</span>
<span v-if="lang == 'en'">Dark Mode</span>
<div class="toggle"></div>
</div>
<div class="toggle-group" :class=" lang == 'cn' ? 'on' : 'off' " @click="toggleLang()">
<span v-if="lang == 'cn'">中文</span>
<span v-if="lang == 'en'">Chinese</span>
<div class="toggle"></div>
</div>
</div>
</div>
</div>
<div class="modal text" :class="[showModal && modalType == 'text' ? 'show' : '']" @click="showModal = false">
<div class="inner" @click="innerModal(event)">
<div class="modal-content skew-n" v-html="modalContent" @click="showModal = false"></div>
<div class="modal-close skew-n" @click="showModal = false">
<svg viewBox="0 0 30 30">
<circle cx="15" cy="15" r="12"/>
<path d="M10 10L20 20M20 10L10 20"/>
</svg>
</div>
</div>
</div>
<div class="modal image" :class="[showModal && modalType == 'image' ? 'show' : '']" @click="showModal = false">
<div class="inner" @click="innerModal(event)">
<div class="modal-content skew-n" v-html="modalContent"></div>
<div class="modal-close skew-n" @click="showModal = false">
<svg viewBox="0 0 30 30">
<circle cx="15" cy="15" r="12"/>
<path d="M10 10L20 20M20 10L10 20"/>
</svg>
</div>
</div>
</div>
<div class="all-names title-font"><template v-for="c in corners" >{{c.ch}} <template v-if="c.nk && c.ch != c.nk">{{c.nk}} </template></template> </div>
</div>
<script src='{$assetsDir}/vue-2.6.11.min.js'></script>
<script src="{$assetsDir}/main.js?v={$lastEditTime}"></script>
</body>
</html>
HTML;
?>