-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gensokyo flight helper
- Loading branch information
KirisameSoup
committed
Nov 8, 2023
1 parent
8c1bd93
commit cc0222a
Showing
27 changed files
with
963 additions
and
686 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
- name: 主页 | ||
link: /home | ||
- name: About | ||
link: /about | ||
- name: Markdown 实验室 | ||
- name: 主页 | ||
link: /home | ||
- name: About | ||
link: /about | ||
- name: Markdown 实验室 | ||
link: /md-lab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
current: | ||
- categ: _weather | ||
addr: current.weather_code | ||
intervs: -1, 1, 2, 3, 48, 51, 55, 57, 61, 63, 65, 67, 71, 73, 75, 77, 82, 86, 95, 99, 100 | ||
name: 天气 | ||
unit: | ||
msgs: " | ||
'快晴', | ||
'半晴', | ||
'阴晴', | ||
'云天', | ||
'浓雾', | ||
'细雨', | ||
'雾雨', | ||
'寒雨', | ||
'疏雨', | ||
'雨', | ||
'強雨', | ||
'冰雨', | ||
'綿雪', | ||
'雪', | ||
'大雪', | ||
'霰', | ||
'豪雨', | ||
'豪雪', | ||
'风雨', | ||
'雪嵐'" | ||
|
||
- categ: temp | ||
addr: current.temperature_2m | ||
intervs: -100, 7, 13, 18, 23, 28, 33, 35, 100 | ||
name: 温度 | ||
unit: °C | ||
msgs: " | ||
'严寒', | ||
'寒冷', | ||
'清凉', | ||
'和暖', | ||
'温暖', | ||
'炎热', | ||
'酷热', | ||
'极热'" | ||
|
||
- categ: humi | ||
addr: current.relative_humidity_2m | ||
intervs: 0, 40, 70, 85, 95, 100 | ||
name: 湿度 | ||
unit: \% | ||
msgs: " | ||
'干燥难耐', | ||
'干燥', | ||
'适宜', | ||
'潮湿', | ||
'太潮了'" | ||
|
||
- categ: winddir | ||
addr: current.wind_direction_10m | ||
intervs: 0, 22.5, 67.5, 112.5, 157.5, 202.5, 247.5, 292.5, 337.5, 360 | ||
name: 风向 | ||
unit: ° | ||
msgs: " | ||
'北风', | ||
'东北风', | ||
'东风', | ||
'东南风', | ||
'南风', | ||
'西南风', | ||
'西风', | ||
'西北风', | ||
'北风'" | ||
|
||
- categ: windscal | ||
addr: current.wind_speed_10m | ||
intervs: 0, 2, 7, 13, 20, 31, 41, 52, 63, 76, 88, 104, 118 | ||
name: 风速 | ||
unit: km/h | ||
msgs: " | ||
'无风', | ||
'弱风', | ||
'轻风', | ||
'微风', | ||
'和风', | ||
'清风', | ||
'强风', | ||
'疾风', | ||
'大风', | ||
'烈风', | ||
'狂风', | ||
'暴风', | ||
'飓风'" | ||
|
||
forcast: | ||
- categ: weather | ||
addr: daily.weather_code | ||
intervs: _weather_intervs | ||
msgs: _weather_msgs | ||
|
||
- categ: tempM | ||
addr: daily.temperature_2m_max | ||
intervs: temp_intervs | ||
msgs: temp_msgs | ||
|
||
- categ: tempm | ||
addr: daily.temperature_2m_min | ||
intervs: temp_intervs | ||
msgs: temp_msgs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{%- capture ip -%} | ||
<script> | ||
function getIP(json) { | ||
ip = document.querySelectorAll('.ip'); | ||
|
||
for (i = 0; i < ip.length; i++) { | ||
ip[i].innerHTML=`你的IP地址是: <a href="https://ipleak.net/?q=${json.ip}" target="_blank" rel="noopener noreferrer">${json.ip}</a>`; | ||
}; | ||
} | ||
</script> | ||
<script src="http://api.ipify.org?format=jsonp&callback=getIP" async></script> | ||
{% endcapture %} | ||
{{ ip | strip_newlines | normalize_whitespace }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<nav> | ||
{% for item in site.data.navigation %} | ||
<p> | ||
{% if page.url == item.link %}<strong class="urHere-i"> >> </strong>{% endif %} | ||
<a href="{{ item.link }}" {% if page.url == item.link %}class="urHere"{% endif %}> | ||
{{ item.name }} | ||
</a> | ||
<!-- {% if page.url == item.link %}<strong class="urHere-i"> <<< </strong>{% endif %} --> | ||
</p> | ||
{% endfor %} | ||
</nav> | ||
<nav> | ||
{% for item in site.data.nav %} | ||
<p> | ||
{% if page.url == item.link %}<strong class="urHere-i"> >> </strong>{% endif %} | ||
<a href="{{ item.link }}" {% if page.url == item.link %}class="urHere"{% endif %}> | ||
{{ item.name }} | ||
</a> | ||
<!-- {% if page.url == item.link %}<strong class="urHere-i"> <<< </strong>{% endif %} --> | ||
</p> | ||
{% endfor %} | ||
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{%- capture weather -%} | ||
<script> | ||
doneWeather = false; | ||
|
||
fetch('https://api.open-meteo.com/v1/forecast?latitude=36.7&longitude=137.85¤t=temperature_2m,relative_humidity_2m,weather_code,wind_speed_10m,wind_direction_10m&daily=weather_code,temperature_2m_max,temperature_2m_min&timezone=Asia%2FTokyo&past_days=1&forecast_days=8') | ||
.then(response => response.json()) | ||
.then(jsonWeather => { if (!doneWeather) { doneWeather = true; | ||
|
||
console.log(jsonWeather); | ||
|
||
// current weather | ||
|
||
{% for i in site.data.weather.current %} | ||
{{ i.categ }} = jsonWeather.{{ i.addr }}; | ||
{{ i.categ }}_intervs = [{{ i.intervs }}]; | ||
{{ i.categ }}_msgs = [{{ i.msgs }}]; | ||
{% endfor %} | ||
|
||
{%- capture categs %} | ||
{% for i in site.data.weather.current -%} | ||
'{{ i.categ }}' | ||
{% if forloop.last %}{% else %}, {% endif %} | ||
{% endfor %} | ||
{% endcapture %} | ||
categs = [{{ categs | strip_newlines | normalize_whitespace}}]; | ||
|
||
for (i = 0; i < categs.length; i++) { | ||
categ = `${categs[i]}`; | ||
value = eval(`${categ}`); | ||
interv = eval(`${categ}_intervs`); | ||
msg = eval(`${categ}_msgs`); | ||
|
||
for (j = 0; j < interv.length; j++) { | ||
if (value > interv[j] && value <= interv[j+1] ) { | ||
window[`${categ}_value`] = value; | ||
window[`${categ}_msg`] = msg[j]; | ||
break; | ||
} | ||
} | ||
} | ||
|
||
{% for i in site.data.weather.current -%} | ||
console.log(`{{ i.name }}: ${ {{ i.categ }}_value }{{ i.unit }} ${ {{ i.categ }}_msg }`); | ||
{% endfor %} | ||
|
||
// weather forcast | ||
|
||
{% for i in site.data.weather.forcast %} | ||
f{{ i.categ }} = jsonWeather.{{ i.addr }}; | ||
f{{ i.categ }}_intervs = {{ i.intervs }}; | ||
f{{ i.categ }}_msgs = {{ i.msgs }}; | ||
{% endfor %} | ||
|
||
console.log('未来七日幻想乡天气:') | ||
|
||
fcategs = ['fweather', 'ftempM', 'ftempm']; | ||
|
||
for (i = 2; i < fweather.length; i++) { | ||
|
||
for (j = 0; j < fcategs.length; j++) { | ||
fcateg = `${fcategs[j]}`; | ||
value = eval(`${fcateg}`)[i]; | ||
interv = eval(`${fcateg}_intervs`); | ||
msg = eval(`${fcateg}_msgs`); | ||
|
||
for (k = 0; k < interv.length; k++) { | ||
if (value >= interv[k] && value < interv[k+1]) { | ||
window[`${fcateg}_value_${i}`] = value; | ||
window[`${fcateg}_msg_${i}`] = msg[k]; | ||
break; | ||
} | ||
} | ||
} | ||
console.log(`${eval(`fweather_value_${i}`)} ${eval(`fweather_msg_${i}`)}\n ${eval(`ftempM_msg_${i}`)}/${eval(`ftempm_msg_${i}`)}\n ${eval(`ftempM_value_${i}`)}°C ~ ${eval(`ftempm_value_${i}`)}°C`); | ||
} | ||
}}) | ||
</script> | ||
{% endcapture %} | ||
{{ weather | remove: "<script>" | remove: "</script>"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.