drive 0.25.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -1
- data/README.md +4 -4
- data/app/controllers/concerns/rate_limited.rb +29 -5
- data/lib/drive/cloudflare.rb +2 -3
- data/lib/drive/engine.rb +1 -19
- data/lib/drive/version.rb +1 -1
- data/lib/drive.rb +1 -6
- metadata +1 -27
- data/app/assets/fonts/easy/outfit-latin-ext.woff2 +0 -0
- data/app/assets/fonts/easy/outfit-latin.woff2 +0 -0
- data/app/assets/images/easy/sprite.svg +0 -52
- data/app/assets/javascripts/easy/flyer.js +0 -100
- data/app/assets/javascripts/easy/konami.js +0 -68
- data/app/assets/javascripts/easy/modal.js +0 -48
- data/app/assets/javascripts/easy/pin_code.js +0 -43
- data/app/assets/javascripts/easy/report_sort.js +0 -44
- data/app/assets/javascripts/easy/rotating_placeholder.js +0 -35
- data/app/assets/stylesheets/easy/base.css +0 -35
- data/app/assets/stylesheets/easy/components.css +0 -388
- data/app/assets/stylesheets/easy/layout.css +0 -44
- data/app/assets/stylesheets/easy/tokens.css +0 -9
- data/app/controllers/drive/errors_controller.rb +0 -41
- data/app/helpers/drive/easy_helper.rb +0 -28
- data/app/models/aircraft_avatar.rb +0 -59
- data/app/views/drive/errors/show.html.erb +0 -15
- data/app/views/easy/_flyer.html.erb +0 -10
- data/app/views/easy/_modal.html.erb +0 -14
- data/app/views/easy/_pin_code.html.erb +0 -9
- data/app/views/easy/_report_head.html.erb +0 -19
- data/app/views/easy/mailer/_code.html.erb +0 -67
- data/app/views/easy/mailer/_code.text.erb +0 -16
- data/app/views/layouts/drive/errors.html.erb +0 -26
- data/app/views/layouts/easy/site.html.erb +0 -50
- data/config/aircraft_avatars.yml +0 -26
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7828b1081161322331a35102e95e1cb6f9285a69dd0ffffdd2694dd52eaf8e70
|
|
4
|
+
data.tar.gz: ef2efd33b75c5cded08f19eb6bf2f010659645af095199f10ebdd9cf68bee4e8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9d25f9859ee31c5bf425de1b15f9ed438e7d22bb54c3cc130328ba8226c8d3431352343687f5634f1e1b572117e369a6125c30e5ae6d4df650a807eb5e2be01e
|
|
7
|
+
data.tar.gz: fabfa2d25ae5aadccd3285fdba0d5a34d607b6a80171d2f796c0fc6e0ebc5cbc97e3d2420e92c0adcdf7c1228ae8a8fa5e0d460699699fef0ed78c55810d75ab
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,22 @@ For more information about changelogs, check [Keep a Changelog](http://keepachan
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## 0.27.0 - 2026-11-17
|
|
10
|
+
|
|
11
|
+
* [FEATURE] `rate_limited agent: 60`: pages one user agent may ask for a minute, from every address
|
|
12
|
+
together, for a scraper spread over thousands of addresses. A crawler is not counted, nor a
|
|
13
|
+
controller that says `def agent_limited? = false`; one refused is told nothing of what was counted.
|
|
14
|
+
|
|
15
|
+
## 0.26.0 - 2026-11-10
|
|
16
|
+
|
|
17
|
+
* [BREAKING] The easy design system and the error pages are `wordmark`'s
|
|
18
|
+
|
|
19
|
+
`layouts/easy/site`, `easy/*.css`, the Outfit font, the sprite, the scripts and partials in
|
|
20
|
+
`easy/`, `easy_icon`, `easy_icon_href`, `easy_aircraft_avatar`, `AircraftAvatar`, the error
|
|
21
|
+
pages, `/down.html` and the style guide moved to `wordmark` 0.23.0 under the same names. An
|
|
22
|
+
app that draws pages adds `gem 'wordmark', '~> 0.23'`, and names its site with
|
|
23
|
+
`Wordmark.site` rather than `Drive.site`.
|
|
24
|
+
|
|
9
25
|
## 0.25.0 - 2026-11-10
|
|
10
26
|
|
|
11
27
|
* [ENHANCEMENT] One width for every page, its header and its footer: `--page-max` (85.5rem, 1368px), what an
|
|
@@ -110,7 +126,8 @@ For more information about changelogs, check [Keep a Changelog](http://keepachan
|
|
|
110
126
|
flown by `easy/flyer.js` (ES5, included once by the page) and drawn by `sky` and `flyer` in `easy/components`.
|
|
111
127
|
On a holiday, by the visitor's own calendar, the plane flies in the day's colors with one line of smoke per color:
|
|
112
128
|
New Year's Day and Eve, Valentine's Day, St. Patrick's Day, Easter, Memorial Day, Independence Day, National
|
|
113
|
-
Aviation Day, Halloween, Veterans Day, Thanksgiving, Wright Brothers Day and Christmas. `date:` flies it on another
|
|
129
|
+
Aviation Day, Halloween, Veterans Day, Thanksgiving, Wright Brothers Day and Christmas. `date:` flies it on another
|
|
130
|
+
day, to see one.
|
|
114
131
|
|
|
115
132
|
* [FEATURE] `i-small-plane`, easyAnnual's single engine, in the sprite beside easyFAA's `i-plane`.
|
|
116
133
|
|
data/README.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
# Drive
|
|
2
2
|
|
|
3
|
-
A Rails engine for the easyFAA apps
|
|
3
|
+
A Rails engine for the easyFAA apps, each behind Cloudflare. What their pages look like, the error
|
|
4
|
+
pages included, is [`easyfaa`](https://github.com/easyfaa/easyfaa/tree/main/design)'s.
|
|
4
5
|
A copy of the tables a source publishes is the [`mirroring`](https://github.com/easyfaa/mirroring)
|
|
5
6
|
gem's.
|
|
6
7
|
|
|
7
8
|
- **`RateLimited`**: `rate_limited` holds an address to 20 pages a minute and 200 a day, or the
|
|
8
|
-
app's own limits, and tells it so in words
|
|
9
|
+
app's own limits, and tells it so in words; with `agent:`, a user agent too, from every address
|
|
10
|
+
together. A search engine's own crawler has no limit.
|
|
9
11
|
- **`Crawler`**: whether a request comes from a search engine's crawler: Cloudflare vouches for
|
|
10
12
|
it (where `EDGE_KEY` is set), or its address is in the ranges Google, Bing, Apple, Claude,
|
|
11
13
|
ChatGPT or Perplexity publish, fetched once a day.
|
|
12
14
|
- **`Drive::Cloudflare`**: purges pages by tag or everything, and warms pages. Its addresses are
|
|
13
15
|
the app's trusted proxies.
|
|
14
|
-
- **Error pages**: the same page for 400, 404, 422 and 500 on every app, and `/down.html`, naming
|
|
15
|
-
easyFAA or the site `Drive.site` names for the request.
|
|
16
16
|
- **`NNumber`**, **`Designation`**, **`Serial`**: an N-number, a designation's key and a serial
|
|
17
17
|
number, as every app reads them.
|
|
18
18
|
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
# crawler (Crawler) is never held to, so it can list every page. Refused, a client is told why in
|
|
3
3
|
# words, with status 429, rather than with an error the app would report.
|
|
4
4
|
#
|
|
5
|
+
# A limit by user agent, from every address together, refuses a scraper spread over thousands of
|
|
6
|
+
# addresses, which still sends a few browsers' names. It is told nothing of what was counted. A
|
|
7
|
+
# controller whose callers all share one user agent turns it off with `def agent_limited? = false`.
|
|
8
|
+
#
|
|
5
9
|
# rate_limited # 20 a minute and 200 a day
|
|
6
|
-
# rate_limited minute: 120, day: nil, scope: 'public'
|
|
10
|
+
# rate_limited minute: 120, day: nil, agent: 60, scope: 'public'
|
|
7
11
|
module RateLimited
|
|
8
12
|
extend ActiveSupport::Concern
|
|
9
13
|
|
|
@@ -14,27 +18,47 @@ module RateLimited
|
|
|
14
18
|
class_methods do
|
|
15
19
|
# @param minute [Integer, nil] pages an address may ask for a minute.
|
|
16
20
|
# @param day [Integer, nil] pages an address may ask for a day.
|
|
21
|
+
# @param agent [Integer, nil] pages one user agent may ask for a minute, from every address.
|
|
17
22
|
# @param scope [String, nil] the controllers counted together; each its own if nil.
|
|
18
|
-
def rate_limited(minute: 20, day: 200, scope: nil)
|
|
23
|
+
def rate_limited(minute: 20, day: 200, agent: nil, scope: nil)
|
|
19
24
|
{ minute: [minute, 1.minute], day: [day, 1.day] }.each do |name, (to, within)|
|
|
20
25
|
next unless to
|
|
21
26
|
|
|
22
27
|
rate_limit(to:, within:, name: name.to_s, scope:, unless: -> { crawler? },
|
|
23
28
|
with: -> { refuse_flood minute:, day: })
|
|
24
29
|
end
|
|
30
|
+
limit_agents(agent, scope:) if agent
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
private
|
|
34
|
+
|
|
35
|
+
def limit_agents(to, scope:)
|
|
36
|
+
rate_limit(to:, within: 1.minute, by: -> { request.user_agent.to_s }, name: 'agent', scope:,
|
|
37
|
+
if: -> { agent_limited? }, with: -> { refuse_agent_flood })
|
|
25
38
|
end
|
|
26
39
|
end
|
|
27
40
|
|
|
28
41
|
private
|
|
29
42
|
|
|
30
|
-
|
|
31
|
-
|
|
43
|
+
def crawler?
|
|
44
|
+
# A search engine is asked once a request whether it vouches for this client.
|
|
45
|
+
defined?(@crawler) ? @crawler : @crawler = Crawler.verified?(request)
|
|
46
|
+
end
|
|
32
47
|
|
|
33
|
-
# What a client asking too often is told. A host may say it its own way.
|
|
34
48
|
def refuse_flood(minute:, day:)
|
|
49
|
+
# A host may say it its own way.
|
|
35
50
|
limits = { minute:, day: }.compact.map { |per, count| "#{count} a #{per}" }
|
|
36
51
|
render plain: 'Too many requests. Each address may ask for so many pages: ' \
|
|
37
52
|
"#{limits.join ' and '}.\n",
|
|
38
53
|
status: :too_many_requests
|
|
39
54
|
end
|
|
55
|
+
|
|
56
|
+
def agent_limited? = !crawler?
|
|
57
|
+
|
|
58
|
+
def refuse_agent_flood
|
|
59
|
+
logger.warn "Agent limit: #{request.user_agent} on #{request.path}"
|
|
60
|
+
response.cache_control.merge! private: true, no_store: true
|
|
61
|
+
render plain: "Too many requests right now. Wait a minute, then reload this page.\n",
|
|
62
|
+
status: :too_many_requests
|
|
63
|
+
end
|
|
40
64
|
end
|
data/lib/drive/cloudflare.rb
CHANGED
|
@@ -47,9 +47,8 @@ module Drive
|
|
|
47
47
|
uri = URI "https://api.cloudflare.com/client/v4/zones/#{zone}/purge_cache"
|
|
48
48
|
response = Net::HTTP.post uri, body.to_json, 'Authorization' => "Bearer #{token}",
|
|
49
49
|
'Content-Type' => 'application/json'
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
raise "Cloudflare purge failed: #{response.code} #{response.body}"
|
|
50
|
+
failure = "Cloudflare purge failed: #{response.code} #{response.body}"
|
|
51
|
+
raise failure unless response.is_a? Net::HTTPSuccess
|
|
53
52
|
end
|
|
54
53
|
|
|
55
54
|
# The zone, from the environment or the credentials.
|
data/lib/drive/engine.rb
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
module Drive
|
|
2
|
-
# Lends the host its models (Crawler, NNumber, Designation, Serial)
|
|
3
|
-
# pages and the easy design system (layouts/easy/site, easy/*.css, its fonts and icons).
|
|
2
|
+
# Lends the host its models (Crawler, NNumber, Designation, Serial) and RateLimited.
|
|
4
3
|
class Engine < ::Rails::Engine
|
|
5
4
|
engine_name 'drive'
|
|
6
5
|
|
|
@@ -11,22 +10,5 @@ module Drive
|
|
|
11
10
|
app.config.action_dispatch.trusted_proxies ||=
|
|
12
11
|
ActionDispatch::RemoteIp::TRUSTED_PROXIES + Drive::Cloudflare::RANGES
|
|
13
12
|
end
|
|
14
|
-
|
|
15
|
-
# The same pages for 400, 404, 422 and 500 on every app (Drive::ErrorsController), at the
|
|
16
|
-
# paths Rails keeps for them, and the page shown while an app is down for maintenance.
|
|
17
|
-
initializer 'drive.errors' do |app|
|
|
18
|
-
app.config.exceptions_app ||= app.routes
|
|
19
|
-
app.routes.prepend do
|
|
20
|
-
%w[400 404 422 500].each do |status|
|
|
21
|
-
get status, to: 'drive/errors#show', defaults: { status: status.to_i }
|
|
22
|
-
end
|
|
23
|
-
get 'down.html', to: 'drive/errors#down', format: false
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
# The design system's icons in every view, beside its layout (layouts/easy/site).
|
|
28
|
-
initializer 'drive.easy_helper' do
|
|
29
|
-
ActiveSupport.on_load(:action_view) { include Drive::EasyHelper }
|
|
30
|
-
end
|
|
31
13
|
end
|
|
32
14
|
end
|
data/lib/drive/version.rb
CHANGED
data/lib/drive.rb
CHANGED
|
@@ -4,11 +4,6 @@ require 'drive/cloudflare'
|
|
|
4
4
|
require 'drive/engine'
|
|
5
5
|
|
|
6
6
|
# What every easyFAA app in front of Cloudflare needs alike: Drive::Cloudflare, Crawler,
|
|
7
|
-
# RateLimited,
|
|
7
|
+
# RateLimited, NNumber, Designation and Serial. What its pages look like is easyfaa's.
|
|
8
8
|
module Drive
|
|
9
|
-
# The site an error page names, in its title and its one link: easyFAA, unless the app says
|
|
10
|
-
# otherwise for the request:
|
|
11
|
-
#
|
|
12
|
-
# Drive.site = ->(request) { ['easyAnnual', 'https://easyannual.com/'] }
|
|
13
|
-
mattr_accessor :site, default: ->(_request) { ['easyFAA', 'https://easyfaa.com/'] }
|
|
14
9
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: drive
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.27.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- claudiob
|
|
@@ -34,37 +34,11 @@ files:
|
|
|
34
34
|
- CHANGELOG.md
|
|
35
35
|
- MIT-LICENSE
|
|
36
36
|
- README.md
|
|
37
|
-
- app/assets/fonts/easy/outfit-latin-ext.woff2
|
|
38
|
-
- app/assets/fonts/easy/outfit-latin.woff2
|
|
39
|
-
- app/assets/images/easy/sprite.svg
|
|
40
|
-
- app/assets/javascripts/easy/flyer.js
|
|
41
|
-
- app/assets/javascripts/easy/konami.js
|
|
42
|
-
- app/assets/javascripts/easy/modal.js
|
|
43
|
-
- app/assets/javascripts/easy/pin_code.js
|
|
44
|
-
- app/assets/javascripts/easy/report_sort.js
|
|
45
|
-
- app/assets/javascripts/easy/rotating_placeholder.js
|
|
46
|
-
- app/assets/stylesheets/easy/base.css
|
|
47
|
-
- app/assets/stylesheets/easy/components.css
|
|
48
|
-
- app/assets/stylesheets/easy/layout.css
|
|
49
|
-
- app/assets/stylesheets/easy/tokens.css
|
|
50
37
|
- app/controllers/concerns/rate_limited.rb
|
|
51
|
-
- app/controllers/drive/errors_controller.rb
|
|
52
|
-
- app/helpers/drive/easy_helper.rb
|
|
53
|
-
- app/models/aircraft_avatar.rb
|
|
54
38
|
- app/models/crawler.rb
|
|
55
39
|
- app/models/designation.rb
|
|
56
40
|
- app/models/n_number.rb
|
|
57
41
|
- app/models/serial.rb
|
|
58
|
-
- app/views/drive/errors/show.html.erb
|
|
59
|
-
- app/views/easy/_flyer.html.erb
|
|
60
|
-
- app/views/easy/_modal.html.erb
|
|
61
|
-
- app/views/easy/_pin_code.html.erb
|
|
62
|
-
- app/views/easy/_report_head.html.erb
|
|
63
|
-
- app/views/easy/mailer/_code.html.erb
|
|
64
|
-
- app/views/easy/mailer/_code.text.erb
|
|
65
|
-
- app/views/layouts/drive/errors.html.erb
|
|
66
|
-
- app/views/layouts/easy/site.html.erb
|
|
67
|
-
- config/aircraft_avatars.yml
|
|
68
42
|
- lib/drive.rb
|
|
69
43
|
- lib/drive/cloudflare.rb
|
|
70
44
|
- lib/drive/engine.rb
|
|
Binary file
|
|
Binary file
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
2
|
-
<symbol id="i-check" viewBox="0 0 16 16"><circle cx="8" cy="8" r="8" fill="currentColor"/><path d="M4.5 8.2l2.3 2.3 4.7-4.9" fill="none" stroke="#fff" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></symbol>
|
|
3
|
-
<symbol id="i-applies" viewBox="0 0 16 16"><circle cx="8" cy="8" r="8" fill="currentColor"/><path d="M8 4.2v4.6" stroke="#fff" stroke-width="2" stroke-linecap="round"/><circle cx="8" cy="11.6" r="1.2" fill="#fff"/></symbol>
|
|
4
|
-
<symbol id="i-maybe" viewBox="0 0 16 16"><circle cx="8" cy="8" r="7" fill="none" stroke="currentColor" stroke-width="2"/><path d="M8 4.2v4.6" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><circle cx="8" cy="11.6" r="1.2" fill="currentColor"/></symbol>
|
|
5
|
-
<symbol id="i-none" viewBox="0 0 16 16"><circle cx="8" cy="8" r="7" fill="none" stroke="currentColor" stroke-width="2"/><path d="M4.8 8h6.4" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></symbol>
|
|
6
|
-
<symbol id="i-alert" viewBox="0 0 16 16"><path d="M8 1.6L14.8 13.8H1.2Z" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><path d="M8 6v3.6" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/><circle cx="8" cy="11.6" r="1" fill="currentColor"/></symbol>
|
|
7
|
-
<symbol id="i-superseded" viewBox="0 0 16 16"><path d="M3.5 1.75h5.75l3.25 3.25v9.25h-9z" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/><path d="M9.25 1.75v3.25h3.25" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/><path d="M1.5 14.5L14.5 1.5" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></symbol>
|
|
8
|
-
<symbol id="i-engine" viewBox="0 0 24 24"><path fill="currentColor" d="M7 4v2h3v2H7l-2 2v3H3v-3H1v8h2v-3h2v3h3l2 2h8v-4h2v3h3V9h-3v3h-2V8h-6V6h3V4z"/></symbol>
|
|
9
|
-
<symbol id="i-propeller" viewBox="0 0 16 16"><g fill="currentColor"><path d="M8 7.4C5.4 6 5.3 2.1 8 .5c2.7 1.6 2.6 5.5 0 6.9z"/><path d="M8 7.4C5.4 6 5.3 2.1 8 .5c2.7 1.6 2.6 5.5 0 6.9z" transform="rotate(120 8 8)"/><path d="M8 7.4C5.4 6 5.3 2.1 8 .5c2.7 1.6 2.6 5.5 0 6.9z" transform="rotate(240 8 8)"/><circle cx="8" cy="8" r="2.1"/></g></symbol>
|
|
10
|
-
<symbol id="i-appliance" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M13.07 6.45L15.31 6.84L15.31 9.16L13.07 9.55L12.68 10.49L13.99 12.35L12.35 13.99L10.49 12.68L9.55 13.07L9.16 15.31L6.84 15.31L6.45 13.07L5.51 12.68L3.65 13.99L2.01 12.35L3.32 10.49L2.93 9.55L0.69 9.16L0.69 6.84L2.93 6.45L3.32 5.51L2.01 3.65L3.65 2.01L5.51 3.32L6.45 2.93L6.84 0.69L9.16 0.69L9.55 2.93L10.49 3.32L12.35 2.01L13.99 3.65L12.68 5.51Z M8 5.6a2.4 2.4 0 1 0 0 4.8a2.4 2.4 0 1 0 0-4.8Z"/></symbol>
|
|
11
|
-
<symbol id="i-calendar" viewBox="0 0 16 16"><rect x="2" y="3" width="12" height="11" rx="2" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M2 6.5h12M5 1.5v3M11 1.5v3" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></symbol>
|
|
12
|
-
<symbol id="i-newest" viewBox="0 0 16 16"><path d="M4 2.5v10M1.5 10l2.5 2.5L6.5 10M9 4h5.5M9 7.5h4M9 11h2.5" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></symbol>
|
|
13
|
-
<symbol id="i-oldest" viewBox="0 0 16 16"><path d="M4 13.5v-10M1.5 6L4 3.5 6.5 6M9 4h2.5M9 7.5h4M9 11h5.5" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></symbol>
|
|
14
|
-
<symbol id="i-search" viewBox="0 0 24 24"><circle cx="10.5" cy="10.5" r="6.5" fill="none" stroke="currentColor" stroke-width="2.4"/><path d="M15.5 15.5l5 5" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"/></symbol>
|
|
15
|
-
<symbol id="i-bookmark" viewBox="0 0 16 16"><path d="M4 1.5h8a.5.5 0 0 1 .5.5v12.3L8 11.2l-4.5 3.1V2a.5.5 0 0 1 .5-.5z" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/></symbol>
|
|
16
|
-
<symbol id="i-share" viewBox="0 0 16 16"><circle cx="12" cy="3.5" r="2" fill="none" stroke="currentColor" stroke-width="1.5"/><circle cx="4" cy="8" r="2" fill="none" stroke="currentColor" stroke-width="1.5"/><circle cx="12" cy="12.5" r="2" fill="none" stroke="currentColor" stroke-width="1.5"/><path d="M5.8 7l4.4-2.5M5.8 9l4.4 2.5" stroke="currentColor" stroke-width="1.5"/></symbol>
|
|
17
|
-
<symbol id="i-link" viewBox="0 0 16 16"><path d="M6.6 9.4l2.8-2.8M7 4.6l1.2-1.2a2.8 2.8 0 0 1 4 4L11 8.6M9 11.4l-1.2 1.2a2.8 2.8 0 0 1-4-4L5 7.4" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></symbol>
|
|
18
|
-
<symbol id="i-out" viewBox="0 0 16 16"><path d="M9 2.5h4.5V7M13.5 2.5L7.5 8.5M11.5 9.5v3a1 1 0 0 1-1 1h-7a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1h3" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></symbol>
|
|
19
|
-
<symbol id="i-sun" viewBox="0 0 16 16"><circle cx="8" cy="8" r="3.2" fill="currentColor"/><path d="M8 .8v2M8 13.2v2M.8 8h2M13.2 8h2M2.9 2.9l1.4 1.4M11.7 11.7l1.4 1.4M2.9 13.1l1.4-1.4M11.7 4.3l1.4-1.4" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/></symbol>
|
|
20
|
-
<symbol id="i-moon" viewBox="0 0 16 16"><path d="M13.5 10.2A6 6 0 0 1 5.8 2.5a6 6 0 1 0 7.7 7.7z" fill="currentColor"/></symbol>
|
|
21
|
-
<symbol id="i-monitor" viewBox="0 0 16 16"><rect x="1.2" y="2" width="13.6" height="9" rx="1.4" fill="none" stroke="currentColor" stroke-width="1.4"/><path d="M5.5 14.2h5M8 11v3.2" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/></symbol>
|
|
22
|
-
<symbol id="i-plane" viewBox="0 0 24 24"><path d="M21 15.5v-2l-8-5V3.2a1.5 1.5 0 0 0-3 0V8.5l-8 5v2l8-2.5v5.2l-2 1.5V21l3.5-1 3.5 1v-1.3l-2-1.5V13z" fill="currentColor"/></symbol>
|
|
23
|
-
<symbol id="i-small-plane" viewBox="0 0 24 24"><path fill="currentColor" d="M8.2 1.1h7.6v1.1H8.2zM12 2.2c1.1 0 1.7 1.1 1.7 2.7v3.2h8.1c.5 0 .9.4.9.9v1.7c0 .5-.4.9-.9.9h-8.1l-.8 7.1h2.9c.5 0 .8.3.8.8v1c0 .5-.3.8-.8.8H8.2c-.5 0-.8-.3-.8-.8v-1c0-.5.3-.8.8-.8h2.9l-.8-7.1H2.2c-.5 0-.9-.4-.9-.9V9c0-.5.4-.9.9-.9h8.1V4.9c0-1.6.6-2.7 1.7-2.7z"/></symbol>
|
|
24
|
-
<symbol id="i-twin-plane" viewBox="0 0 24 24"><path fill="currentColor" d="M12 1.8c.9 0 1.5 1 1.5 2.6v13.4l-.5 2.8h-2l-.5-2.8V4.4c0-1.6.6-2.6 1.5-2.6zM1.3 10.2h21.4c.5 0 .8.3.8.8v1.4c0 .5-.3.8-.8.8H1.3c-.5 0-.8-.3-.8-.8V11c0-.5.3-.8.8-.8zM7 6.2c.7 0 1.2.5 1.2 1.2v7H5.8v-7c0-.7.5-1.2 1.2-1.2zM17 6.2c.7 0 1.2.5 1.2 1.2v7h-2.4v-7c0-.7.5-1.2 1.2-1.2zM4.8 5h4.4v1H4.8zM14.8 5h4.4v1h-4.4zM8.2 19.2h7.6c.3 0 .5.2.5.5v1c0 .3-.2.5-.5.5H8.2c-.3 0-.5-.2-.5-.5v-1c0-.3.2-.5.5-.5z"/></symbol>
|
|
25
|
-
<symbol id="s-x" viewBox="0 0 24 24"><path fill="currentColor" d="M17.8 3h3.1l-6.8 7.8L22 21h-6.2l-4.9-6.4L5.3 21H2.2l7.3-8.3L1.9 3h6.3l4.4 5.9zm-1.1 16.2h1.7L7.4 4.7H5.6z"/></symbol>
|
|
26
|
-
<symbol id="s-fb" viewBox="0 0 24 24"><path fill="currentColor" d="M13.6 22v-8.2h2.8l.4-3.3h-3.2V8.4c0-.9.3-1.6 1.6-1.6h1.7V3.9c-.3 0-1.3-.1-2.5-.1-2.5 0-4.2 1.5-4.2 4.3v2.4H7.4v3.3h2.8V22z"/></symbol>
|
|
27
|
-
<symbol id="s-li" viewBox="0 0 24 24"><path fill="currentColor" d="M3.6 8.6h3.7V20.5H3.6zM5.45 2.8a2.15 2.15 0 110 4.3 2.15 2.15 0 010-4.3zM9.6 8.6h3.5v1.6h.1c.5-.9 1.7-1.9 3.5-1.9 3.8 0 4.5 2.5 4.5 5.7v6.5h-3.7v-5.8c0-1.4 0-3.2-1.9-3.2s-2.3 1.5-2.3 3.1v5.9H9.6z"/></symbol>
|
|
28
|
-
<symbol id="s-rd" viewBox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" d="M19.7 5.3a1.6 1.6 0 11-1.5 2l-3.3-.7-1 4.4c2.2.1 4.2.8 5.6 1.9a2.2 2.2 0 113 3 4.3 4.3 0 010 .6c0 3.4-4 6.1-8.5 6.1S5.5 19.9 5.5 16.5v-.6a2.2 2.2 0 113-3c1.4-1 3.3-1.7 5.4-1.8l1.2-5.3 4 .9a1.6 1.6 0 01.6-1.4zM9.3 14.2a1.4 1.4 0 100 2.8 1.4 1.4 0 000-2.8zm5.4 0a1.4 1.4 0 100 2.8 1.4 1.4 0 000-2.8zm-5.2 4.3a.5.5 0 00-.3.9c.9.7 2 1 2.8 1s1.9-.3 2.8-1a.5.5 0 10-.6-.8c-.6.5-1.4.8-2.2.8s-1.6-.3-2.2-.8a.5.5 0 00-.3-.1z"/></symbol>
|
|
29
|
-
<symbol id="s-wa" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2a10 10 0 00-8.6 15.1L2 22l5-1.3A10 10 0 1012 2zm0 1.8a8.2 8.2 0 11-4.2 15.3l-.3-.2-3 .8.8-2.9-.2-.3A8.2 8.2 0 0112 3.8zM8.6 7.2c-.2 0-.5 0-.8.3-.3.3-1 1-1 2.5s1.1 2.9 1.2 3.1c.2.2 2.1 3.3 5.2 4.5 2.6 1 3.1.8 3.7.8.6-.1 1.8-.7 2-1.5.3-.7.3-1.3.2-1.5l-.6-.4-2-1c-.3-.1-.5-.1-.7.1l-.9 1.2c-.2.2-.3.2-.6.1-.3-.2-1.3-.5-2.4-1.5-.9-.8-1.5-1.8-1.7-2.1-.2-.3 0-.5.1-.6l.5-.6.3-.5v-.5l-.9-2.3c-.2-.6-.5-.5-.7-.5z"/></symbol>
|
|
30
|
-
<symbol id="s-em" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" d="M3 5.5h18v13H3zM3.5 6l8.5 7 8.5-7"/></symbol>
|
|
31
|
-
<!-- Aircraft avatars (a-): side views, nose right, drones from above; holes take the avatar background. -->
|
|
32
|
-
<symbol id="a-high-wing" viewBox="1 1 46 46" fill="currentColor"><path d="M43.5 24.2C43.5 22 41.5 20.8 39 20.6L35 18.6H24.5L9 21.4H5V24.2L24 27.2H38.5C41.5 27.2 43.5 26.4 43.5 24.2Z"/><path d="M34.2 19.3L37.6 21H33.8V19.3ZM25.2 19.3H32.8V21H25.2Z" style="fill:var(--avatar-bg,#fff)"/><path d="M5 21.6L4 12.6H7.6L14 21Z"/><rect x="2.5" y="21.2" width="10.0" height="1.4" rx="0.7"/><rect x="21.5" y="16.6" width="13.0" height="2.0" rx="0.8"/><line x1="31" y1="18.4" x2="27" y2="26.4" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><rect x="44.4" y="15.5" width="1.2" height="17.4" rx="0.6"/><circle cx="44.2" cy="24.2" r="1.4"/><line x1="38.5" y1="27" x2="38.5" y2="32.2" stroke="currentColor" stroke-width="1.1" stroke-linecap="round"/><circle cx="38.5" cy="33.6" r="2"/><line x1="28" y1="27" x2="29" y2="32" stroke="currentColor" stroke-width="1.1" stroke-linecap="round"/><circle cx="29" cy="33.6" r="2.3"/></symbol>
|
|
33
|
-
<symbol id="a-high-wing-tailwheel" viewBox="1 1 46 46" fill="currentColor"><g transform="rotate(-8 24 28)"><path d="M43.5 24.2C43.5 22 41.5 20.8 39 20.6L35 18.6H24.5L9 21.4H5V24.2L24 27.2H38.5C41.5 27.2 43.5 26.4 43.5 24.2Z"/><path d="M34.2 19.3L37.6 21H33.8V19.3ZM25.2 19.3H32.8V21H25.2Z" style="fill:var(--avatar-bg,#fff)"/><path d="M5 21.6L4 12.6H7.6L14 21Z"/><rect x="2.5" y="21.2" width="10.0" height="1.4" rx="0.7"/><rect x="21.5" y="16.6" width="13.0" height="2.0" rx="0.8"/><line x1="31" y1="18.4" x2="27" y2="26.4" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><rect x="44.4" y="15.5" width="1.2" height="17.4" rx="0.6"/><circle cx="44.2" cy="24.2" r="1.4"/><line x1="32.5" y1="27" x2="34" y2="32" stroke="currentColor" stroke-width="1.1" stroke-linecap="round"/><circle cx="34" cy="33.6" r="2.3"/><line x1="7.5" y1="23.8" x2="7" y2="25.6" stroke="currentColor" stroke-width="0.9" stroke-linecap="round"/><circle cx="7" cy="26.2" r="1.1"/></g></symbol>
|
|
34
|
-
<symbol id="a-low-wing" viewBox="1 1 46 46" fill="currentColor"><path d="M43.5 24.2C43.5 22 41.5 20.8 39 20.6L35 18.6H24.5L9 21.4H5V24.2L24 27.2H38.5C41.5 27.2 43.5 26.4 43.5 24.2Z"/><path d="M34.2 19.3L37.6 21H33.8V19.3ZM25.2 19.3H32.8V21H25.2Z" style="fill:var(--avatar-bg,#fff)"/><path d="M5 21.6L4 12.6H7.6L14 21Z"/><rect x="2.5" y="21.2" width="10.0" height="1.4" rx="0.7"/><rect x="20" y="26.4" width="14.5" height="2.0" rx="0.8"/><rect x="44.4" y="15.5" width="1.2" height="17.4" rx="0.6"/><circle cx="44.2" cy="24.2" r="1.4"/><line x1="38.5" y1="27" x2="38.5" y2="32.2" stroke="currentColor" stroke-width="1.1" stroke-linecap="round"/><circle cx="38.5" cy="33.6" r="2"/><line x1="28" y1="27" x2="29" y2="32" stroke="currentColor" stroke-width="1.1" stroke-linecap="round"/><circle cx="29" cy="33.6" r="2.3"/></symbol>
|
|
35
|
-
<symbol id="a-low-wing-retractable" viewBox="1 1 46 46" fill="currentColor"><path d="M43.5 24.2C43.5 22 41.5 20.8 39 20.6L35 18.6H24.5L9 21.4H5V24.2L24 27.2H38.5C41.5 27.2 43.5 26.4 43.5 24.2Z"/><path d="M34.2 19.3L37.6 21H33.8V19.3ZM25.2 19.3H32.8V21H25.2Z" style="fill:var(--avatar-bg,#fff)"/><path d="M5 21.6L4 12.6H7.6L14 21Z"/><rect x="2.5" y="21.2" width="10.0" height="1.4" rx="0.7"/><rect x="20" y="26.4" width="14.5" height="2.0" rx="0.8"/><rect x="44.4" y="15.5" width="1.2" height="17.4" rx="0.6"/><circle cx="44.2" cy="24.2" r="1.4"/></symbol>
|
|
36
|
-
<symbol id="a-low-wing-tailwheel" viewBox="1 1 46 46" fill="currentColor"><g transform="rotate(-8 24 28)"><path d="M43.5 24.2C43.5 22 41.5 21 39 21H31L28 18.4C26.5 17.6 23.5 17.6 22 18.6L19.5 21H9L5 21.4V24L24 27H38.5C41.5 27 43.5 26.4 43.5 24.2Z"/><path d="M5 21.6L4 12.6H7.6L14 21Z"/><rect x="2.5" y="21.2" width="10.0" height="1.4" rx="0.7"/><rect x="20" y="26.4" width="14.5" height="2.0" rx="0.8"/><rect x="44.4" y="15.5" width="1.2" height="17.4" rx="0.6"/><circle cx="44.2" cy="24.2" r="1.4"/><line x1="32.5" y1="27" x2="34" y2="32" stroke="currentColor" stroke-width="1.1" stroke-linecap="round"/><circle cx="34" cy="33.6" r="2.3"/><line x1="7.5" y1="23.8" x2="7" y2="25.6" stroke="currentColor" stroke-width="0.9" stroke-linecap="round"/><circle cx="7" cy="26.2" r="1.1"/></g></symbol>
|
|
37
|
-
<symbol id="a-biplane" viewBox="1 1 46 46" fill="currentColor"><g transform="rotate(-8 24 28)"><path d="M43.5 24.2C43.5 22 41.5 20.8 39 20.6L31 20.4C30 18.4 26.5 18.4 25.5 20.4L9 21.4H5V24.2L24 27.2H38.5C41.5 27.2 43.5 26.4 43.5 24.2Z"/><path d="M5 21.6L4 12.6H7.6L14 21Z"/><rect x="2.5" y="21.2" width="10.0" height="1.4" rx="0.7"/><rect x="20" y="13.6" width="14" height="2.0" rx="0.8"/><line x1="25" y1="15.4" x2="26.5" y2="19.5" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><line x1="29.5" y1="15.4" x2="30" y2="19" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><rect x="21" y="26.4" width="13" height="1.8" rx="0.8"/><line x1="22" y1="15.4" x2="22" y2="26.6" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><line x1="32.5" y1="15.4" x2="32.5" y2="26.6" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><rect x="44.4" y="15.5" width="1.2" height="17.4" rx="0.6"/><circle cx="44.2" cy="24.2" r="1.4"/><line x1="32.5" y1="27" x2="34" y2="32" stroke="currentColor" stroke-width="1.1" stroke-linecap="round"/><circle cx="34" cy="33.6" r="2.3"/><line x1="7.5" y1="23.8" x2="7" y2="25.6" stroke="currentColor" stroke-width="0.9" stroke-linecap="round"/><circle cx="7" cy="26.2" r="1.1"/></g></symbol>
|
|
38
|
-
<symbol id="a-ag-plane" viewBox="1 1 46 46" fill="currentColor"><g transform="rotate(-8 24 28)"><path d="M43.5 24.4C43.5 22.2 42 21.4 40 21.2L37 18.8H31.5L28.5 15.6C27.5 14.8 24.5 14.8 23.5 15.8L21.5 19.6L9 21.4H5V24.2L24 27.6H38.5C41.5 27.6 43.5 26.6 43.5 24.4Z"/><path d="M5 21.6L4 12.6H7.6L14 21Z"/><rect x="2.5" y="21.2" width="10.0" height="1.4" rx="0.7"/><rect x="20" y="26.4" width="14.5" height="2.0" rx="0.8"/><rect x="19.5" y="29.4" width="15.5" height="0.8" rx="0.4"/><rect x="44.4" y="15.5" width="1.2" height="17.4" rx="0.6"/><circle cx="44.2" cy="24.2" r="1.4"/><line x1="32.5" y1="27" x2="34" y2="32" stroke="currentColor" stroke-width="1.1" stroke-linecap="round"/><circle cx="34" cy="33.6" r="2.3"/><line x1="7.5" y1="23.8" x2="7" y2="25.6" stroke="currentColor" stroke-width="0.9" stroke-linecap="round"/><circle cx="7" cy="26.2" r="1.1"/></g></symbol>
|
|
39
|
-
<symbol id="a-floatplane" viewBox="1 1 46 46" fill="currentColor"><path d="M43.5 24.2C43.5 22 41.5 20.8 39 20.6L35 18.6H24.5L9 21.4H5V24.2L24 27.2H38.5C41.5 27.2 43.5 26.4 43.5 24.2Z"/><path d="M34.2 19.3L37.6 21H33.8V19.3ZM25.2 19.3H32.8V21H25.2Z" style="fill:var(--avatar-bg,#fff)"/><path d="M5 21.6L4 12.6H7.6L14 21Z"/><rect x="2.5" y="21.2" width="10.0" height="1.4" rx="0.7"/><rect x="21.5" y="16.6" width="13.0" height="2.0" rx="0.8"/><line x1="31" y1="18.4" x2="27" y2="26.4" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><rect x="44.4" y="15.5" width="1.2" height="17.4" rx="0.6"/><circle cx="44.2" cy="24.2" r="1.4"/><path d="M13 32.4H38C41 32.4 42.6 31.4 43.4 29.8L44 30.6C43.4 33 41.4 34.8 38 34.8H15L13 33.8Z"/><line x1="22" y1="27" x2="21" y2="32.6" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><line x1="33.5" y1="27" x2="34.5" y2="32.6" stroke="currentColor" stroke-width="1" stroke-linecap="round"/></symbol>
|
|
40
|
-
<symbol id="a-single-turboprop" viewBox="1 1 46 46" fill="currentColor"><path d="M45 24.4C45 22.6 43.6 21.6 41.6 21.4L33 20.8L30 18.4H21L7 21.2H3.6V24L22 27.4H41.6C43.8 27.4 45 26.4 45 24.4Z"/><g style="fill:var(--avatar-bg,#fff)"><path d="M29.2 19.1L31 20.6H28.4V19.1Z"/><rect x="21.6" y="19.1" width="5.8" height="1.5" rx="0.3"/></g><rect x="35.5" y="19.6" width="2.5" height="2.0" rx="0.5"/><path d="M3.6 21.4L2.6 11.6H6.6L13 21Z"/><rect x="1.2" y="21" width="10.4" height="1.4" rx="0.7"/><rect x="18" y="16.4" width="14" height="2.0" rx="0.8"/><line x1="28" y1="18.2" x2="24.6" y2="26.6" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><path d="M17 27.4H34C35.4 27.4 36 28 36 28.8C36 29.6 35.4 30.2 34 30.2H19Z"/><rect x="45.6" y="15.4" width="1.2" height="18.0" rx="0.6"/><line x1="40" y1="27.4" x2="40" y2="31.6" stroke="currentColor" stroke-width="1.1" stroke-linecap="round"/><circle cx="40" cy="33.2" r="1.8"/><line x1="26" y1="30" x2="27" y2="32" stroke="currentColor" stroke-width="1.1" stroke-linecap="round"/><circle cx="27" cy="33.4" r="2.1"/></symbol>
|
|
41
|
-
<symbol id="a-twin" viewBox="1 1 46 46" fill="currentColor"><path d="M45 24.6C45 22.8 43 21.6 40 21.2L35.4 18.6H24.5L9 21.4H5V24.2L24 27.2H40C43 27.2 45 26.4 45 24.6Z"/><g style="fill:var(--avatar-bg,#fff)"><path d="M34.6 19.3L37.8 21H34.2V19.3Z"/><rect x="25.2" y="19.3" width="7.8" height="1.7" rx="0.3"/></g><path d="M5 21.6L4 12.6H7.6L14 21Z"/><rect x="2.5" y="21.2" width="10.0" height="1.4" rx="0.7"/><rect x="19" y="26.4" width="14" height="2.0" rx="0.8"/><path d="M20 24.2H34.6C37.2 24.2 38.4 25.8 38.4 27.6C38.4 29.4 37.2 31 34.6 31H20Z"/><ellipse cx="38.4" cy="27.6" rx="0.8" ry="7"/></symbol>
|
|
42
|
-
<symbol id="a-business-jet" viewBox="1 1 46 46" fill="currentColor"><path d="M46.6 24.8C45 22.6 42.6 21.2 39 20.8L36 19.2H20L7 21.2H4V24.4L20 27H38C42.6 27 45.6 26.2 46.6 24.8Z"/><g style="fill:var(--avatar-bg,#fff)"><path d="M37.8 20.2L39.8 21.2H37.2Z"/><circle cx="32" cy="21.2" r="0.8"/><circle cx="29" cy="21.2" r="0.8"/><circle cx="26" cy="21.2" r="0.8"/><circle cx="23" cy="21.4" r="0.8"/></g><path d="M4.4 21.4L5.4 10.6H8.4L13.6 21Z"/><rect x="2.6" y="9.8" width="8.8" height="1.4" rx="0.7"/><path d="M9 17.4H17C19 17.4 20 18.4 20 19.4C20 20.4 19 21.4 17 21.4H9Z"/><path d="M18 26.4L30 26.2L34 27.8L22 28.4Z"/></symbol>
|
|
43
|
-
<symbol id="a-airliner" viewBox="1 1 46 46" fill="currentColor"><path d="M47 24.6C46 22.4 44 21.2 41 21.2H8L3.4 18.6H1V24.4L6 27.4H41C44 27.4 46.4 26.2 47 24.6Z"/><g style="fill:var(--avatar-bg,#fff)"><path d="M42 22.2L44.4 23.2H41.6Z"/><circle cx="10" cy="23" r="0.55"/><circle cx="13" cy="23" r="0.55"/><circle cx="16" cy="23" r="0.55"/><circle cx="19" cy="23" r="0.55"/><circle cx="22" cy="23" r="0.55"/><circle cx="25" cy="23" r="0.55"/><circle cx="28" cy="23" r="0.55"/><circle cx="31" cy="23" r="0.55"/><circle cx="34" cy="23" r="0.55"/><circle cx="37" cy="23" r="0.55"/></g><path d="M1.4 19L1 8.8H4.4L11.2 21.2Z"/><rect x="0" y="20.4" width="8.6" height="1.4" rx="0.7"/><path d="M18 26.6L30 26.4L34 28.4L22 29Z"/><path d="M24 28.2H31C32.6 28.2 33.4 29 33.4 30C33.4 31 32.6 31.8 31 31.8H24Z"/></symbol>
|
|
44
|
-
<symbol id="a-helicopter" viewBox="1 1 46 46" fill="currentColor"><path d="M39 26.4C39 21.4 36 18.4 31 18.4H27L24.6 16.4H18.6L16 19L4.6 21.6V23.4L19 25.4C19.6 28.4 21.6 30 24.6 30H35.4C37.6 30 39 28.6 39 26.4Z"/><g style="fill:var(--avatar-bg,#fff)"><path d="M31.4 19.8C35 19.8 37.4 22.4 37.6 25.8H32Z"/><rect x="25.4" y="20.6" width="4.0" height="4.4" rx="0.6"/></g><rect x="22.6" y="12.6" width="1.8" height="4" rx="0.5"/><rect x="4" y="11.4" width="40" height="1.4" rx="0.7"/><path d="M4.8 22L3 13.6H5.6L8.8 21.6Z"/><rect x="9" y="21.4" width="6" height="1.2" rx="0.5"/><circle cx="4.4" cy="17.4" r="2.6" fill="none" stroke="currentColor" stroke-width="0.8"/><line x1="25" y1="30" x2="24.4" y2="33" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><line x1="35" y1="30" x2="35.6" y2="33" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><rect x="20" y="32.8" width="20" height="1.2" rx="0.6"/></symbol>
|
|
45
|
-
<symbol id="a-heavy-helicopter" viewBox="1 1 46 46" fill="currentColor"><path d="M43 26C43 22 40.4 19.6 36.4 19.4L33 17.4H17.4L15 19.6L3.6 20.4V22.8L15 24.4V28.4C15 29.4 15.8 30 17 30H39.4C41.6 30 43 28.6 43 26Z"/><g style="fill:var(--avatar-bg,#fff)"><path d="M37 20.8C39.6 21 41.2 22.6 41.6 25H37.4Z"/><rect x="30" y="21.4" width="4.4" height="3.0" rx="0.5"/><rect x="23.4" y="21.4" width="4.4" height="3.0" rx="0.5"/><rect x="17.6" y="21.4" width="4.0" height="3.0" rx="0.5"/></g><path d="M14.6 17.4H34.6L33 15.6H17Z"/><rect x="24.4" y="11.4" width="2.0" height="4.4" rx="0.5"/><rect x="2.4" y="10.4" width="44.6" height="1.4" rx="0.7"/><path d="M4 21L2.4 12.6H5.4L9 20.6Z"/><rect x="5" y="19.4" width="7" height="1.2" rx="0.5"/><line x1="37" y1="30" x2="37" y2="32.6" stroke="currentColor" stroke-width="1.1" stroke-linecap="round"/><circle cx="37" cy="34" r="1.8"/><line x1="21" y1="30" x2="21" y2="32.6" stroke="currentColor" stroke-width="1.1" stroke-linecap="round"/><circle cx="21" cy="34" r="1.9"/><circle cx="4.6" cy="23.6" r="1"/></symbol>
|
|
46
|
-
<symbol id="a-multirotor-drone" viewBox="1 1 46 46" fill="currentColor"><g transform="translate(24 24) scale(.84) translate(-24 -24)"><line x1="11" y1="11" x2="37" y2="37" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"/><line x1="37" y1="11" x2="11" y2="37" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"/><circle cx="11" cy="11" r="7.4" fill="none" stroke="currentColor" stroke-width="1.3"/><circle cx="37" cy="11" r="7.4" fill="none" stroke="currentColor" stroke-width="1.3"/><circle cx="11" cy="37" r="7.4" fill="none" stroke="currentColor" stroke-width="1.3"/><circle cx="37" cy="37" r="7.4" fill="none" stroke="currentColor" stroke-width="1.3"/><circle cx="11" cy="11" r="1.6"/><circle cx="37" cy="11" r="1.6"/><circle cx="11" cy="37" r="1.6"/><circle cx="37" cy="37" r="1.6"/><rect x="18.4" y="17" width="11.2" height="14" rx="3"/><g style="fill:var(--avatar-bg,#fff)"><rect x="20.6" y="19.6" width="6.8" height="4.4" rx="1.4"/></g><rect x="9" y="40.6" width="30" height="1.4" rx="0.7"/></g></symbol>
|
|
47
|
-
<symbol id="a-fixed-wing-drone" viewBox="1 1 46 46" fill="currentColor"><g transform="translate(24 24) scale(.84) translate(-24 -24)"><path d="M24 6C25.6 6 26.6 7.6 26.6 10V36H21.4V10C21.4 7.6 22.4 6 24 6Z"/><rect x="2" y="17" width="44" height="4.4" rx="1.4"/><rect x="11" y="9" width="2" height="26" rx="1"/><rect x="35" y="9" width="2" height="26" rx="1"/><circle cx="12" cy="9" r="4.4" fill="none" stroke="currentColor" stroke-width="1.1"/><circle cx="12" cy="35" r="4.4" fill="none" stroke="currentColor" stroke-width="1.1"/><circle cx="36" cy="9" r="4.4" fill="none" stroke="currentColor" stroke-width="1.1"/><circle cx="36" cy="35" r="4.4" fill="none" stroke="currentColor" stroke-width="1.1"/><rect x="17" y="36" width="14" height="2" rx="0.8"/><ellipse cx="24" cy="40" rx="5.4" ry="1"/></g></symbol>
|
|
48
|
-
<symbol id="a-glider" viewBox="1 1 46 46" fill="currentColor"><path d="M46 24.4C46 23 44 22.2 41 21.8L36 20.2C34.4 19.4 31 19.4 29.6 20.4L28 21.4L8 22.6H4.4V24.6L8 25.2L28 27H40C44 27 46 25.8 46 24.4Z"/><g style="fill:var(--avatar-bg,#fff)"><path d="M35.8 21.4C34.6 20.4 31.6 20.4 30.4 21.4Z"/></g><path d="M4.6 22.8L5.6 12H8.4L12 22.6Z"/><rect x="3.4" y="11.2" width="8.2" height="1.2" rx="0.6"/><rect x="22" y="22.2" width="11" height="1.4" rx="0.6"/><circle cx="30.4" cy="28" r="1.6"/></symbol>
|
|
49
|
-
<symbol id="a-balloon" viewBox="1 1 46 46" fill="currentColor"><path d="M24 2.6C32.6 2.6 38.6 8.4 38.6 16.4C38.6 23.6 31.6 29 27.2 32.6H20.8C16.4 29 9.4 23.6 9.4 16.4C9.4 8.4 15.4 2.6 24 2.6Z"/><g style="fill:var(--avatar-bg,#fff)"><path d="M19.6 4.4C17.4 9 17 20 21.4 31.6H22.6C19.4 20 19.8 9 21.6 3.8Z"/><path d="M28.4 4.4C30.6 9 31 20 26.6 31.6H25.4C28.6 20 28.2 9 26.4 3.8Z"/></g><line x1="21" y1="32.6" x2="21.6" y2="38.6" stroke="currentColor" stroke-width="0.7" stroke-linecap="round"/><line x1="27" y1="32.6" x2="26.4" y2="38.6" stroke="currentColor" stroke-width="0.7" stroke-linecap="round"/><rect x="20.4" y="38.2" width="7.2" height="6.0" rx="0.8"/></symbol>
|
|
50
|
-
<symbol id="a-trike" viewBox="1 1 46 46" fill="currentColor"><path d="M2 17.6L42 8.4C43.6 8.2 44.6 9 44.2 10.2L43.6 11.4L4 19.8Z"/><line x1="26" y1="13.6" x2="24" y2="25" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/><line x1="26" y1="13.6" x2="34.6" y2="22.6" stroke="currentColor" stroke-width="0.9" stroke-linecap="round"/><line x1="26" y1="13.6" x2="30.6" y2="23.4" stroke="currentColor" stroke-width="0.9" stroke-linecap="round"/><line x1="30.6" y1="23.4" x2="34.6" y2="22.6" stroke="currentColor" stroke-width="1.1" stroke-linecap="round"/><path d="M38 27.4C38 25.4 36 24 33 24H24L20 25V29.4H34C36.6 29.4 38 28.8 38 27.4Z"/><ellipse cx="18.4" cy="27.2" rx="1" ry="6.2"/><line x1="34" y1="29.4" x2="35" y2="32.6" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><circle cx="35" cy="34.2" r="1.8"/><line x1="23" y1="29.4" x2="22" y2="32.6" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><circle cx="22" cy="34.2" r="1.9"/></symbol>
|
|
51
|
-
<symbol id="a-powered-parachute" viewBox="1 1 46 46" fill="currentColor"><path d="M4 13C10 4 38 4 44 13L41.6 14.6C35.6 8 12.4 8 6.4 14.6Z"/><line x1="7" y1="14" x2="22" y2="30" stroke="currentColor" stroke-width="0.6" stroke-linecap="round"/><line x1="17" y1="8.4" x2="23" y2="30" stroke="currentColor" stroke-width="0.6" stroke-linecap="round"/><line x1="31" y1="8.4" x2="25" y2="30" stroke="currentColor" stroke-width="0.6" stroke-linecap="round"/><line x1="41" y1="14" x2="26" y2="30" stroke="currentColor" stroke-width="0.6" stroke-linecap="round"/><path d="M34 32C34 30.2 32 29 29 29H20L16 30V34H30C32.6 34 34 33.4 34 32Z"/><circle cx="14.4" cy="31" r="5.2" fill="none" stroke="currentColor" stroke-width="1"/><circle cx="29" cy="36.4" r="1.7"/><circle cx="20" cy="36.4" r="1.8"/></symbol>
|
|
52
|
-
</svg>
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
// The plane of render "easy/flyer": across the sky in 14 seconds on a gentle wave, nose along it, its trail behind it.
|
|
2
|
-
// On a holiday, by the visitor's own calendar, it flies in the day's colors with a line of smoke per color: every day
|
|
3
|
-
// is in this file, so whatever cached it, it's right at midnight. No plane where motion is off. ES5, for old phones.
|
|
4
|
-
(function () {
|
|
5
|
-
if (!document.querySelectorAll || !document.createElementNS || !window.requestAnimationFrame) { return; }
|
|
6
|
-
if (window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches) { return; }
|
|
7
|
-
|
|
8
|
-
var SKY = { trail: ['#5aa9e6'], opacity: 0.45 }, HANUKKAH = { plane: '#2f6fd0', trail: ['#2f6fd0', '#cfd8e3'] };
|
|
9
|
-
var GOLD = { plane: '#d4a514', trail: ['#d4a514', '#a8b0b8'] };
|
|
10
|
-
var USA = { plane: '#2f5fc4', trail: ['#d63a3a', '#ffffff', '#2f5fc4'] };
|
|
11
|
-
// Hanukkah's first day (25 Kislev) as a day of December, 2025 to 2045 (Nov 28 is -2); its days yield to the others.
|
|
12
|
-
var KISLEV_25 = [15, 5, 25, 13, 2, 21, 10, -2, 17, 7, 26, 14, 3, 22, 12, 0, 18, 8, 27, 15, 5];
|
|
13
|
-
|
|
14
|
-
// The holidays of a year, by "month-day": the plane's color, then its trail's, top to bottom. National Aviation Day
|
|
15
|
-
// is in pilot's-wings gold and blue, Wright Brothers Day in the Wright Flyer's muslin and spruce.
|
|
16
|
-
function holidays(year) {
|
|
17
|
-
var easter = easterOf(year), days = {};
|
|
18
|
-
for (var k = 0; k < 16; k++) { // last year's eight days of Hanukkah, reaching into January, then this year's
|
|
19
|
-
var y = year - 1 + (k >> 3), day = new Date(y, 11, KISLEV_25[y - 2025] + k % 8);
|
|
20
|
-
if (day.getFullYear() === year) { days[(day.getMonth() + 1) + '-' + day.getDate()] = HANUKKAH; }
|
|
21
|
-
}
|
|
22
|
-
days['1-1'] = days['12-31'] = GOLD;
|
|
23
|
-
days['2-14'] = { plane: '#e0457b', trail: ['#d62f4b', '#f07aa0'] };
|
|
24
|
-
days['3-17'] = { plane: '#1f9d55', trail: ['#1f9d55', '#7cc576'] };
|
|
25
|
-
days[easter] = { plane: '#a77bd6', trail: ['#f2c94c', '#a77bd6', '#6fcf97'] };
|
|
26
|
-
days['5-' + weekday(year, 5, 1, -1)] = days['7-4'] = days['11-11'] = USA;
|
|
27
|
-
days['8-19'] = { plane: '#1a70d0', trail: ['#e0b43a', '#5aa9e6'] };
|
|
28
|
-
days['10-31'] = { plane: '#f28c28', trail: ['#f28c28', '#7b3fa0'] };
|
|
29
|
-
days['11-' + weekday(year, 11, 4, 4)] = { plane: '#c0662b', trail: ['#e0a526', '#c0662b', '#8a4b2a'] };
|
|
30
|
-
days['12-17'] = { plane: '#8a6a43', trail: ['#d9c9a3', '#8a6a43'] };
|
|
31
|
-
days['12-25'] = { plane: '#d42f2f', trail: ['#1f8a4c', '#d42f2f'] };
|
|
32
|
-
return days;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// The day of the month of its nth weekday (0 Sunday), the last for n -1: Memorial Day, Thanksgiving.
|
|
36
|
-
function weekday(year, month, day, n) {
|
|
37
|
-
if (n < 0) { var last = new Date(year, month, 0); return last.getDate() - (last.getDay() - day + 7) % 7; }
|
|
38
|
-
return 1 + (day - new Date(year, month - 1, 1).getDay() + 7) % 7 + (n - 1) * 7;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Easter Sunday's "month-day": the anonymous Gregorian algorithm.
|
|
42
|
-
function easterOf(y) {
|
|
43
|
-
var a = y % 19, b = Math.floor(y / 100), c = y % 100, f = Math.floor((b + 8) / 25);
|
|
44
|
-
var h = (19 * a + b - Math.floor(b / 4) - Math.floor((b - f + 1) / 3) + 15) % 30;
|
|
45
|
-
var l = (32 + 2 * (b % 4) + 2 * Math.floor(c / 4) - h - c % 4) % 7, m = Math.floor((a + 11 * h + 22 * l) / 451);
|
|
46
|
-
return Math.floor((h + l - 7 * m + 114) / 31) + '-' + ((h + l - 7 * m + 114) % 31 + 1);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// The sky's colors: its data-date's ("2026-12-25"), to see a holiday on any day, or today's.
|
|
50
|
-
function colorsOf(sky) {
|
|
51
|
-
var date = /^(\d{4})-(\d\d)-(\d\d)$/.exec(sky.getAttribute('data-date') || '');
|
|
52
|
-
var day = date ? new Date(+date[1], date[2] - 1, +date[3]) : new Date();
|
|
53
|
-
return holidays(day.getFullYear())[(day.getMonth() + 1) + '-' + day.getDate()] || SKY;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function svg(name, attributes, parent) {
|
|
57
|
-
var node = document.createElementNS('http://www.w3.org/2000/svg', name);
|
|
58
|
-
for (var key in attributes) { node.setAttribute(key, attributes[key]); }
|
|
59
|
-
return parent.appendChild(node);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function fly(sky, n) {
|
|
63
|
-
var flyer = sky.querySelector('.js-flyer'), trail = sky.querySelector('.js-trail'), colors = colorsOf(sky);
|
|
64
|
-
var defs = svg('defs', {}, trail), lines = [], fades = [];
|
|
65
|
-
if (colors.plane) { flyer.style.color = colors.plane; }
|
|
66
|
-
// One line per color, 3px apart, each fading in from the sky's left edge to the tail.
|
|
67
|
-
for (var i = 0; i < colors.trail.length; i++) {
|
|
68
|
-
var id = 'flyer-' + n + '-' + i, color = colors.trail[i];
|
|
69
|
-
var fade = svg('linearGradient', { id: id, gradientUnits: 'userSpaceOnUse', x1: 0, y1: 0, x2: 100, y2: 0 }, defs);
|
|
70
|
-
svg('stop', { offset: 0, 'stop-color': color, 'stop-opacity': 0 }, fade);
|
|
71
|
-
svg('stop', { offset: 1, 'stop-color': color, 'stop-opacity': colors.opacity || 0.7 }, fade);
|
|
72
|
-
fades.push(fade);
|
|
73
|
-
lines.push(svg('polyline', { fill: 'none', stroke: 'url(#' + id + ')', 'stroke-width': 2, 'stroke-linecap': 'round' }, trail));
|
|
74
|
-
}
|
|
75
|
-
var span = 14000, size = 34, began = null;
|
|
76
|
-
function wave(x, width) { return 14 + 9 * Math.sin((x / width) * Math.PI * 3); }
|
|
77
|
-
function frame(now) {
|
|
78
|
-
if (began === null) { began = now; }
|
|
79
|
-
var width = sky.offsetWidth, t = ((now - began) % span) / span;
|
|
80
|
-
var x = -size - 40 + (width + size + 80) * t, y = wave(x + size / 2, width);
|
|
81
|
-
var angle = Math.atan(wave(x + size / 2 + 1, width) - y) * 180 / Math.PI;
|
|
82
|
-
var move = 'translate(' + x.toFixed(1) + 'px,' + (y - size / 2).toFixed(1) + 'px) rotate(' + angle.toFixed(1) + 'deg)';
|
|
83
|
-
flyer.style.webkitTransform = move; flyer.style.transform = move;
|
|
84
|
-
// The tail is the plane's left edge, at its middle, turned with it.
|
|
85
|
-
var tailX = x + size / 2 - (size / 2 - 3) * Math.cos(angle * Math.PI / 180);
|
|
86
|
-
for (var i = 0; i < lines.length; i++) {
|
|
87
|
-
var shift = (i - (lines.length - 1) / 2) * 3, points = [];
|
|
88
|
-
for (var px = 0; px < tailX; px += 6) { points.push(px + ',' + (wave(px, width) + shift).toFixed(1)); }
|
|
89
|
-
if (tailX > 0) { points.push(tailX.toFixed(1) + ',' + (wave(tailX, width) + shift).toFixed(1)); }
|
|
90
|
-
lines[i].setAttribute('points', points.join(' '));
|
|
91
|
-
fades[i].setAttribute('x2', Math.max(tailX, 1).toFixed(1));
|
|
92
|
-
}
|
|
93
|
-
if (sky.className.indexOf('is-gone') < 0) { window.requestAnimationFrame(frame); } // freed (easy/konami)
|
|
94
|
-
}
|
|
95
|
-
window.requestAnimationFrame(frame);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
var skies = document.querySelectorAll('.js-sky');
|
|
99
|
-
for (var i = 0; i < skies.length; i++) { fly(skies[i], i); }
|
|
100
|
-
})();
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
// The easter egg of render "easy/flyer": the Konami code sets the plane free, ↑ ↑ ↓ ↓ ← → ← → B A on a keyboard,
|
|
2
|
-
// or on a phone swipes up, up, down, down, left, right, left, right and two taps. It leaves its wave, wanders the
|
|
3
|
-
// window at random until it flies out of it, and never comes back in this browser (localStorage, per site).
|
|
4
|
-
// Included with easy/flyer; where motion is turned off there is no plane, and nothing to free.
|
|
5
|
-
// ES5 alone: every easy app has to work on old iPhones, Androids and Windows browsers.
|
|
6
|
-
(function () {
|
|
7
|
-
if (!document.querySelectorAll || !document.addEventListener || !window.requestAnimationFrame) { return; }
|
|
8
|
-
if (window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches) { return; }
|
|
9
|
-
var GONE = 'easy-plane-gone', CODES = ['UUDDLRLRBA', 'UUDDLRLRTT'];
|
|
10
|
-
var KEYS = { 38: 'U', 40: 'D', 37: 'L', 39: 'R', 66: 'B', 65: 'A' };
|
|
11
|
-
var skies = document.querySelectorAll('.js-sky'), typed = '', start = null, freed = false;
|
|
12
|
-
|
|
13
|
-
// A sky gone keeps no plane, and its trail fades; easy/flyer stops drawing it.
|
|
14
|
-
function gone() { for (var i = 0; i < skies.length; i++) { skies[i].className += ' is-gone'; } }
|
|
15
|
-
try { if (window.localStorage.getItem(GONE)) { gone(); return; } } catch (err) { /* no storage: it comes back */ }
|
|
16
|
-
|
|
17
|
-
// The plane, out of its sky and over the window, where it was and heading as it was: at 160px a second, it turns
|
|
18
|
-
// one way then the other, never sharper than a loop in three seconds, until it is past an edge.
|
|
19
|
-
function fly(flyer) {
|
|
20
|
-
var box = flyer.getBoundingClientRect(), plane = flyer.cloneNode(true), size = 34;
|
|
21
|
-
var rotation = /rotate\((-?[\d.]+)deg\)/.exec(flyer.style.transform || '');
|
|
22
|
-
var x = box.left + box.width / 2 - size / 2, y = box.top + box.height / 2 - size / 2;
|
|
23
|
-
var heading = rotation ? rotation[1] * Math.PI / 180 : 0, turn = 0, last = null;
|
|
24
|
-
if (!box.width) { return; }
|
|
25
|
-
function place() {
|
|
26
|
-
var move = 'translate(' + x.toFixed(1) + 'px,' + y.toFixed(1) + 'px) rotate(' + (heading * 180 / Math.PI).toFixed(1) + 'deg)';
|
|
27
|
-
plane.style.webkitTransform = move; plane.style.transform = move;
|
|
28
|
-
}
|
|
29
|
-
plane.className = 'flyer is-free';
|
|
30
|
-
place();
|
|
31
|
-
document.body.appendChild(plane);
|
|
32
|
-
function frame(now) {
|
|
33
|
-
var dt = last === null ? 16 : Math.min(now - last, 50);
|
|
34
|
-
last = now;
|
|
35
|
-
turn = Math.max(-0.002, Math.min(0.002, turn + (Math.random() - 0.5) * 0.00002 * dt));
|
|
36
|
-
heading += turn * dt;
|
|
37
|
-
x += Math.cos(heading) * 0.16 * dt; y += Math.sin(heading) * 0.16 * dt;
|
|
38
|
-
place();
|
|
39
|
-
if (x < -size || y < -size || x > window.innerWidth || y > window.innerHeight) { return document.body.removeChild(plane); }
|
|
40
|
-
window.requestAnimationFrame(frame);
|
|
41
|
-
}
|
|
42
|
-
window.requestAnimationFrame(frame);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function free() {
|
|
46
|
-
try { window.localStorage.setItem(GONE, '1'); } catch (err) { /* no storage: it comes back */ }
|
|
47
|
-
for (var i = 0; i < skies.length; i++) { fly(skies[i].querySelector('.js-flyer')); }
|
|
48
|
-
gone();
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function push(symbol) {
|
|
52
|
-
typed = (typed + symbol).slice(-10);
|
|
53
|
-
if (!freed && (typed === CODES[0] || typed === CODES[1])) { freed = true; free(); }
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
document.addEventListener('keydown', function (event) { push(KEYS[event.keyCode] || '-'); });
|
|
57
|
-
// A swipe is its longer way, 30px at least; a touch that hardly moved is a tap.
|
|
58
|
-
document.addEventListener('touchstart', function (event) {
|
|
59
|
-
start = event.touches.length === 1 ? { x: event.touches[0].clientX, y: event.touches[0].clientY } : null;
|
|
60
|
-
}, { passive: true });
|
|
61
|
-
document.addEventListener('touchend', function (event) {
|
|
62
|
-
if (!start) { return; }
|
|
63
|
-
var dx = event.changedTouches[0].clientX - start.x, dy = event.changedTouches[0].clientY - start.y;
|
|
64
|
-
var far = Math.max(Math.abs(dx), Math.abs(dy));
|
|
65
|
-
if (far < 10) { push('T'); } else if (far < 30) { push('-'); } else if (Math.abs(dx) > Math.abs(dy)) { push(dx > 0 ? 'R' : 'L'); } else { push(dy > 0 ? 'D' : 'U'); }
|
|
66
|
-
start = null;
|
|
67
|
-
}, { passive: true });
|
|
68
|
-
})();
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// Every dialog of render "easy/modal" lets its reader out: its ×, Esc or a click around it closes it where it is, without loading a page,
|
|
2
|
-
// and the address becomes the × link's (the page without what opened it), or loses the #id that opened it. A link to
|
|
3
|
-
// that #id opens it again. Without the script, the × is a plain link.
|
|
4
|
-
// ES5 alone: every easy app has to work on old iPhones, Androids and Windows browsers.
|
|
5
|
-
(function () {
|
|
6
|
-
if (!document.querySelector || !document.addEventListener) { return; }
|
|
7
|
-
|
|
8
|
-
function close(modal) {
|
|
9
|
-
var link = modal.querySelector('.modal-x'), href = link && link.getAttribute('href');
|
|
10
|
-
modal.className = modal.className.replace(/\s*\bis-(open|closed)\b/g, '') + ' is-closed';
|
|
11
|
-
if (!window.history || !history.replaceState) { return; }
|
|
12
|
-
if (href && href.charAt(0) !== '#') { history.replaceState(null, '', href + location.hash); }
|
|
13
|
-
else if (location.hash === '#' + modal.id) { history.replaceState(null, '', location.pathname + location.search); }
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// The dialog showing: drawn open, or the one the address's #id names.
|
|
17
|
-
function shown() {
|
|
18
|
-
var target = location.hash.length > 1 && document.getElementById(location.hash.slice(1));
|
|
19
|
-
var open = document.querySelector('.modal.is-open');
|
|
20
|
-
if (open) { return open; }
|
|
21
|
-
return target && /(^|\s)modal(\s|$)/.test(target.className) && !/\bis-closed\b/.test(target.className) ? target : null;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// The node or its nearest ancestor with the class: old browsers have no closest().
|
|
25
|
-
function up(node, name) {
|
|
26
|
-
var pattern = new RegExp('(^|\\s)' + name + '(\\s|$)');
|
|
27
|
-
while (node && node.nodeType === 1 && !pattern.test(node.className)) { node = node.parentNode; }
|
|
28
|
-
return node && node.nodeType === 1 ? node : null;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// The ×, or the dimmed page around the box (the dialog itself, not what it holds).
|
|
32
|
-
document.addEventListener('click', function (event) {
|
|
33
|
-
var x = up(event.target, 'modal-x');
|
|
34
|
-
var modal = x ? up(x, 'modal') : /(^|\s)modal(\s|$)/.test(event.target.className) && event.target;
|
|
35
|
-
if (!modal) { return; }
|
|
36
|
-
event.preventDefault();
|
|
37
|
-
close(modal);
|
|
38
|
-
});
|
|
39
|
-
document.addEventListener('keydown', function (event) {
|
|
40
|
-
if (event.key !== 'Escape' && event.key !== 'Esc' && event.keyCode !== 27) { return; }
|
|
41
|
-
var modal = shown();
|
|
42
|
-
if (modal) { event.preventDefault(); close(modal); }
|
|
43
|
-
});
|
|
44
|
-
window.addEventListener('hashchange', function () {
|
|
45
|
-
var target = location.hash.length > 1 && document.getElementById(location.hash.slice(1));
|
|
46
|
-
if (target) { target.className = target.className.replace(/\s*\bis-closed\b/g, ''); }
|
|
47
|
-
});
|
|
48
|
-
})();
|