drive 0.10.1 → 0.11.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c049b386464385f31003f7584b4d1528c1b1c5a3f798225d83c22bb6a103d9b
4
- data.tar.gz: aab19ebc3ee156cf09ed060444fed2e33a833459c0016aa98417ec8f479cb09d
3
+ metadata.gz: 50f607d239ebaf95756e8b6fcfc7cc274d47fe0d62ab1e97bfecfe72120213ef
4
+ data.tar.gz: 3303e9de0f19b1f9ca98383f1a5c747d4108802c5a4125da274ed7fcb1631a9f
5
5
  SHA512:
6
- metadata.gz: 6948a9b614049f26e09f90e35f386898621fe8a081bec30dfe91c8b5810cafbb50d2565be9476044b19cb2e48d4daa2c1a53ea9f39921eeefaa1fd8f26f7ca6a
7
- data.tar.gz: cdc71a09885301e66a618d49dad7f8a5065e1d57c612295b61d22b97e87eb95cb444f255e0ac25286540248e48a87d8fba69053347f785d678fe4b9f4d58751f
6
+ metadata.gz: 8f2e2ee0af3af57e30c33a6a8fdf1e0225c18849217e77c5c1422afd6135c783a366c55a04501a46f8ac1813064572a9a8b26b710106c81c395335ae2adcdd85
7
+ data.tar.gz: 07f896adb850af12b1043c163c50588155770a8907fb05c139f53e7fcf43be7bd5f47a9629b2db13664be05cf4365fcd1badc9680c1f9fd6d8fb316b04db5e51
data/CHANGELOG.md CHANGED
@@ -6,6 +6,16 @@ For more information about changelogs, check [Keep a Changelog](http://keepachan
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## 0.11.0 - 2026-11-06
10
+
11
+ * [FEATURE] `render "easy/flyer", plane:`: a plane crossing the top of a hero on a gentle wave, its trail behind it,
12
+ flown by `easy/flyer.js` (ES5, included once by the page) and drawn by `sky` and `flyer` in `easy/components`.
13
+ On a holiday, by the visitor's own calendar, the plane flies in the day's colors with one line of smoke per color:
14
+ New Year's Day and Eve, Valentine's Day, St. Patrick's Day, Easter, Memorial Day, Independence Day, National
15
+ Aviation Day, Halloween, Veterans Day, Thanksgiving, Wright Brothers Day and Christmas. `date:` flies it on another day, to see one.
16
+
17
+ * [FEATURE] `i-small-plane`, easyAnnual's single engine, in the sprite beside easyFAA's `i-plane`.
18
+
9
19
  ## 0.10.1 - 2026-11-06
10
20
 
11
21
  * [ENHANCEMENT] A badge (`level-chip`) has the filters' border too, so the two share one shape.
@@ -18,6 +18,7 @@
18
18
  <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>
19
19
  <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>
20
20
  <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>
21
+ <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>
21
22
  <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>
22
23
  <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>
23
24
  <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>
@@ -0,0 +1,98 @@
1
+ // The plane of render "easy/flyer": across the sky in 14 seconds, rising and falling on a gentle wave, nose along it,
2
+ // its trail drawn on the same wave from the sky's left edge to its tail. On a holiday, by the visitor's own calendar,
3
+ // it flies in the day's colors and trails one line of smoke per color: every day is in this file, so whatever
4
+ // cached it, the page is right at midnight. Where motion is turned off, there is no plane.
5
+ // ES5 alone: every easy app has to work on old iPhones, Androids and Windows browsers.
6
+ (function () {
7
+ if (!document.querySelectorAll || !document.createElementNS || !window.requestAnimationFrame) { return; }
8
+ if (window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches) { return; }
9
+
10
+ var SKY = { trail: ['#5aa9e6'], opacity: 0.45 };
11
+ var GOLD = { plane: '#d4a514', trail: ['#d4a514', '#a8b0b8'] };
12
+ var USA = { plane: '#2f5fc4', trail: ['#d63a3a', '#ffffff', '#2f5fc4'] };
13
+
14
+ // The holidays of a year, by "month-day": the plane's color, then its trail's, top to bottom. Two are aviation's:
15
+ // National Aviation Day (Orville Wright's birthday) in pilot's-wings gold and blue, and Wright Brothers Day
16
+ // (the first flight) in the Wright Flyer's muslin and spruce.
17
+ function holidays(year) {
18
+ var easter = easterOf(year), days = {};
19
+ days['1-1'] = days['12-31'] = GOLD;
20
+ days['2-14'] = { plane: '#e0457b', trail: ['#d62f4b', '#f07aa0'] };
21
+ days['3-17'] = { plane: '#1f9d55', trail: ['#1f9d55', '#7cc576'] };
22
+ days[easter] = { plane: '#a77bd6', trail: ['#f2c94c', '#a77bd6', '#6fcf97'] };
23
+ days['5-' + weekday(year, 5, 1, -1)] = days['7-4'] = days['11-11'] = USA;
24
+ days['8-19'] = { plane: '#1a70d0', trail: ['#e0b43a', '#5aa9e6'] };
25
+ days['10-31'] = { plane: '#f28c28', trail: ['#f28c28', '#7b3fa0'] };
26
+ days['11-' + weekday(year, 11, 4, 4)] = { plane: '#c0662b', trail: ['#e0a526', '#c0662b', '#8a4b2a'] };
27
+ days['12-17'] = { plane: '#8a6a43', trail: ['#d9c9a3', '#8a6a43'] };
28
+ days['12-25'] = { plane: '#d42f2f', trail: ['#1f8a4c', '#d42f2f'] };
29
+ return days;
30
+ }
31
+
32
+ // The day of the month of its nth weekday (0 Sunday), the last for n -1: Memorial Day, Thanksgiving.
33
+ function weekday(year, month, day, n) {
34
+ if (n < 0) { var last = new Date(year, month, 0); return last.getDate() - (last.getDay() - day + 7) % 7; }
35
+ return 1 + (day - new Date(year, month - 1, 1).getDay() + 7) % 7 + (n - 1) * 7;
36
+ }
37
+
38
+ // Easter Sunday's "month-day": the anonymous Gregorian algorithm.
39
+ function easterOf(y) {
40
+ var a = y % 19, b = Math.floor(y / 100), c = y % 100, f = Math.floor((b + 8) / 25);
41
+ var h = (19 * a + b - Math.floor(b / 4) - Math.floor((b - f + 1) / 3) + 15) % 30;
42
+ var l = (32 + 2 * (b % 4) + 2 * Math.floor(c / 4) - h - c % 4) % 7, m = Math.floor((a + 11 * h + 22 * l) / 451);
43
+ var n = h + l - 7 * m + 114;
44
+ return Math.floor(n / 31) + '-' + (n % 31 + 1);
45
+ }
46
+
47
+ // The sky's colors: its data-date's ("2026-12-25"), to see a holiday on any day, or today's.
48
+ function colorsOf(sky) {
49
+ var date = /^(\d{4})-(\d\d)-(\d\d)$/.exec(sky.getAttribute('data-date') || '');
50
+ var day = date ? new Date(+date[1], date[2] - 1, +date[3]) : new Date();
51
+ return holidays(day.getFullYear())[(day.getMonth() + 1) + '-' + day.getDate()] || SKY;
52
+ }
53
+
54
+ function svg(name, attributes, parent) {
55
+ var node = document.createElementNS('http://www.w3.org/2000/svg', name);
56
+ for (var key in attributes) { node.setAttribute(key, attributes[key]); }
57
+ return parent.appendChild(node);
58
+ }
59
+
60
+ function fly(sky, n) {
61
+ var flyer = sky.querySelector('.js-flyer'), trail = sky.querySelector('.js-trail'), colors = colorsOf(sky);
62
+ var defs = svg('defs', {}, trail), lines = [], fades = [];
63
+ if (colors.plane) { flyer.style.color = colors.plane; }
64
+ // One line per color, 3px apart, each fading in from the sky's left edge to the tail.
65
+ for (var i = 0; i < colors.trail.length; i++) {
66
+ var id = 'flyer-' + n + '-' + i, color = colors.trail[i];
67
+ var fade = svg('linearGradient', { id: id, gradientUnits: 'userSpaceOnUse', x1: 0, y1: 0, x2: 100, y2: 0 }, defs);
68
+ svg('stop', { offset: 0, 'stop-color': color, 'stop-opacity': 0 }, fade);
69
+ svg('stop', { offset: 1, 'stop-color': color, 'stop-opacity': colors.opacity || 0.7 }, fade);
70
+ fades.push(fade);
71
+ lines.push(svg('polyline', { fill: 'none', stroke: 'url(#' + id + ')', 'stroke-width': 2, 'stroke-linecap': 'round' }, trail));
72
+ }
73
+ var span = 14000, size = 34, began = null;
74
+ function wave(x, width) { return 14 + 9 * Math.sin((x / width) * Math.PI * 3); }
75
+ function frame(now) {
76
+ if (began === null) { began = now; }
77
+ var width = sky.offsetWidth, t = ((now - began) % span) / span;
78
+ var x = -size - 40 + (width + size + 80) * t, y = wave(x + size / 2, width);
79
+ var angle = Math.atan(wave(x + size / 2 + 1, width) - y) * 180 / Math.PI;
80
+ var move = 'translate(' + x.toFixed(1) + 'px,' + (y - size / 2).toFixed(1) + 'px) rotate(' + angle.toFixed(1) + 'deg)';
81
+ flyer.style.webkitTransform = move; flyer.style.transform = move;
82
+ // The tail is the plane's left edge, at its middle, turned with it.
83
+ var tailX = x + size / 2 - (size / 2 - 3) * Math.cos(angle * Math.PI / 180);
84
+ for (var i = 0; i < lines.length; i++) {
85
+ var shift = (i - (lines.length - 1) / 2) * 3, points = [];
86
+ for (var px = 0; px < tailX; px += 6) { points.push(px + ',' + (wave(px, width) + shift).toFixed(1)); }
87
+ if (tailX > 0) { points.push(tailX.toFixed(1) + ',' + (wave(tailX, width) + shift).toFixed(1)); }
88
+ lines[i].setAttribute('points', points.join(' '));
89
+ fades[i].setAttribute('x2', Math.max(tailX, 1).toFixed(1));
90
+ }
91
+ window.requestAnimationFrame(frame);
92
+ }
93
+ window.requestAnimationFrame(frame);
94
+ }
95
+
96
+ var skies = document.querySelectorAll('.js-sky');
97
+ for (var i = 0; i < skies.length; i++) { fly(skies[i], i); }
98
+ })();
@@ -353,3 +353,13 @@ a.tooltip-trigger:hover,a.tooltip-trigger:focus{box-shadow:0 0 0 2px currentColo
353
353
  /* record-table and logbook-entry, printed: each row and entry whole on its page, the entry cut out along its dashed line, a row not complied with striped red on paper too */
354
354
  @media print{.logbook-entry{break-inside:avoid;background:none;width:6.5in;max-width:100%;border:1px dashed #000;border-radius:0;color:#000}.record-table tr{break-inside:avoid}.record-table-part{border:0;padding:0}}
355
355
  @media print{.record-table tr.is-not-complied td{background:#fbe1e1 repeating-linear-gradient(135deg,transparent 0 7px,rgba(170,20,20,.22) 7px 9px)!important;-webkit-print-color-adjust:exact;print-color-adjust:exact;color:#000;font-weight:700;border-top:2px solid #a11}.record-table tr.is-not-complied td:first-child{border-left:5px solid #a11}}
356
+
357
+ /* sky (render "easy/flyer"): a plane crossing the top of a hero, inside anything positioned (relative, overflow hidden),
358
+ flown by easy/flyer.js, which draws its trail along the same rise and fall. Without the script, or with motion turned
359
+ off, there is no plane. */
360
+ .sky{display:none;position:absolute;top:10px;left:0;right:0;height:56px;pointer-events:none}
361
+ .has-js .sky{display:block}
362
+ .sky svg.trail{position:absolute;top:0;left:0;width:100%;height:100%;overflow:visible}
363
+ .flyer{position:absolute;top:0;left:0;color:var(--color-sky);opacity:.8;-webkit-transform-origin:17px 17px;transform-origin:17px 17px}
364
+ .flyer .i{display:block;width:34px;height:34px;-webkit-transform:rotate(90deg);transform:rotate(90deg)}
365
+ @media (prefers-reduced-motion: reduce){.has-js .sky{display:none}}
@@ -0,0 +1,8 @@
1
+ <%# locals: (plane:, date: nil) -%>
2
+ <%# A plane crossing the sky behind a hero, its trail behind it, flown by easy/flyer.js, which the page includes once.
3
+ plane: its icon in the sprite, "plane" (easyFAA's airliner) or "small-plane" (easyAnnual's single engine).
4
+ date: "2026-12-25", the day to fly on instead of the visitor's today, to see a holiday's colors. -%>
5
+ <%= tag.div class: "sky js-sky", aria: { hidden: true }, data: { date: } do %>
6
+ <svg class="trail js-trail" focusable="false"></svg>
7
+ <span class="flyer js-flyer"><%= easy_icon plane %></span>
8
+ <% end %>
data/lib/drive/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Drive
2
2
  # Version of the gem, read by the gemspec.
3
- VERSION = '0.10.1'.freeze
3
+ VERSION = '0.11.0'.freeze
4
4
  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.10.1
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - claudiob
@@ -37,6 +37,7 @@ files:
37
37
  - app/assets/fonts/easy/outfit-latin-ext.woff2
38
38
  - app/assets/fonts/easy/outfit-latin.woff2
39
39
  - app/assets/images/easy/sprite.svg
40
+ - app/assets/javascripts/easy/flyer.js
40
41
  - app/assets/javascripts/easy/rotating_placeholder.js
41
42
  - app/assets/stylesheets/easy/base.css
42
43
  - app/assets/stylesheets/easy/components.css
@@ -50,6 +51,7 @@ files:
50
51
  - app/models/n_number.rb
51
52
  - app/models/serial.rb
52
53
  - app/views/drive/errors/show.html.erb
54
+ - app/views/easy/_flyer.html.erb
53
55
  - app/views/layouts/drive/errors.html.erb
54
56
  - app/views/layouts/easy/site.html.erb
55
57
  - lib/drive.rb