drive 0.10.1 → 0.11.1
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 +15 -0
- data/app/assets/images/easy/sprite.svg +1 -0
- data/app/assets/javascripts/easy/flyer.js +100 -0
- data/app/assets/stylesheets/easy/components.css +10 -0
- data/app/views/easy/_flyer.html.erb +8 -0
- data/lib/drive/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 16ca4df866a330aeecbf74b073b816d70fdc0be19747d4467220d80b841f8f1c
|
|
4
|
+
data.tar.gz: a0d24a41daa9e74c413c42acc9e8e2bc0fa3a997b1bbbbc629a0e49cd0475540
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f6badb85246267708fab6d15f99157ea6bd22857e6905652729757922a5c19c116d60ea9fc6d4490546fe0ad9905ef07d45aad6fa6a2b62ded7c8571ea0b838b
|
|
7
|
+
data.tar.gz: 04d953eba6674e7d02e906014fca552ae503ea830c2a37c7a5b8836e54554d9963fab3c935e68dfa48512c709fc3d4e9349a3776fe15f5b9ae6b690b9d7adcc2
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,21 @@ For more information about changelogs, check [Keep a Changelog](http://keepachan
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## 0.11.1 - 2026-11-06
|
|
10
|
+
|
|
11
|
+
* [ENHANCEMENT] The flyer flies Hanukkah's eight days in blue and silver (2025 to 2045, from a table of 25 Kislev),
|
|
12
|
+
yielding to another holiday on the same day.
|
|
13
|
+
|
|
14
|
+
## 0.11.0 - 2026-11-06
|
|
15
|
+
|
|
16
|
+
* [FEATURE] `render "easy/flyer", plane:`: a plane crossing the top of a hero on a gentle wave, its trail behind it,
|
|
17
|
+
flown by `easy/flyer.js` (ES5, included once by the page) and drawn by `sky` and `flyer` in `easy/components`.
|
|
18
|
+
On a holiday, by the visitor's own calendar, the plane flies in the day's colors with one line of smoke per color:
|
|
19
|
+
New Year's Day and Eve, Valentine's Day, St. Patrick's Day, Easter, Memorial Day, Independence Day, National
|
|
20
|
+
Aviation Day, Halloween, Veterans Day, Thanksgiving, Wright Brothers Day and Christmas. `date:` flies it on another day, to see one.
|
|
21
|
+
|
|
22
|
+
* [FEATURE] `i-small-plane`, easyAnnual's single engine, in the sprite beside easyFAA's `i-plane`.
|
|
23
|
+
|
|
9
24
|
## 0.10.1 - 2026-11-06
|
|
10
25
|
|
|
11
26
|
* [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,100 @@
|
|
|
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
|
+
window.requestAnimationFrame(frame);
|
|
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
|
+
})();
|
|
@@ -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
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.11.1
|
|
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
|