drive 0.13.0 → 0.14.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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 24419ab8de44f3e2b5b3441f15a770c76eb011b03f947050d31be42e32d73c6a
|
|
4
|
+
data.tar.gz: 367abd230ea32c9d975e291f1f4055d6b1107516fb15218d6284e61e456c4774
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b301347f49f53d6272d89946e9c176494683660956e15c3887669a64c08bddccf20f3ecd042585e57284813929fc0879e175cfe8aea40d9802fb1d392cd9ce22
|
|
7
|
+
data.tar.gz: 9dbbdbbcb087ecaaae146947862a7de9c72ae6bba533316e881afd3d82da91e86182a3fa412c0b7a79412eb83ae6eb83539b2b7953140c828cb61b3ad5fd5380
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,12 @@ For more information about changelogs, check [Keep a Changelog](http://keepachan
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## 0.14.0 - 2026-11-06
|
|
10
|
+
|
|
11
|
+
* [FEATURE] `easy/konami.js`, the flyer's easter egg, included beside `easy/flyer`: the Konami code (↑ ↑ ↓ ↓ ← → ← → B
|
|
12
|
+
A, or on a phone swipes up, up, down, down, left, right, left, right and two taps) sets the plane free. It wanders the
|
|
13
|
+
window at random until it flies out, and never comes back in that browser (localStorage, per site).
|
|
14
|
+
|
|
9
15
|
## 0.13.0 - 2026-11-06
|
|
10
16
|
|
|
11
17
|
* [FEATURE] `i-twin-plane`, a twin engine, in the sprite beside `i-plane` and `i-small-plane`, for the flyer of
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
lines[i].setAttribute('points', points.join(' '));
|
|
91
91
|
fades[i].setAttribute('x2', Math.max(tailX, 1).toFixed(1));
|
|
92
92
|
}
|
|
93
|
-
window.requestAnimationFrame(frame);
|
|
93
|
+
if (sky.className.indexOf('is-gone') < 0) { window.requestAnimationFrame(frame); } // freed (easy/konami)
|
|
94
94
|
}
|
|
95
95
|
window.requestAnimationFrame(frame);
|
|
96
96
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
})();
|
|
@@ -363,3 +363,8 @@ a.tooltip-trigger:hover,a.tooltip-trigger:focus{box-shadow:0 0 0 2px currentColo
|
|
|
363
363
|
.flyer{position:absolute;top:0;left:0;color:var(--color-sky);opacity:.8;-webkit-transform-origin:17px 17px;transform-origin:17px 17px}
|
|
364
364
|
.flyer .i{display:block;width:34px;height:34px;-webkit-transform:rotate(90deg);transform:rotate(90deg)}
|
|
365
365
|
@media (prefers-reduced-motion: reduce){.has-js .sky{display:none}}
|
|
366
|
+
/* The plane set free by easy/konami: over the window, the header too, its sky left empty and its trail fading. */
|
|
367
|
+
.flyer.is-free{position:fixed;z-index:30}
|
|
368
|
+
.sky .trail{-webkit-transition:opacity 1.2s;transition:opacity 1.2s}
|
|
369
|
+
.sky.is-gone .trail{opacity:0}
|
|
370
|
+
.sky.is-gone .flyer{visibility:hidden}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
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
|
|
2
|
+
<%# A plane crossing the sky behind a hero, its trail behind it, flown by easy/flyer.js, which the page includes once,
|
|
3
|
+
with easy/konami.js, its easter egg.
|
|
3
4
|
plane: its icon in the sprite, "plane" (easyFAA's airliner), "small-plane" (easyAnnual's single engine) or
|
|
4
5
|
"twin-plane" (easyFAA's accidents' twin engine).
|
|
5
6
|
date: "2026-12-25", the day to fly on instead of the visitor's today, to see a holiday's colors. -%>
|
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.14.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- claudiob
|
|
@@ -38,6 +38,7 @@ files:
|
|
|
38
38
|
- app/assets/fonts/easy/outfit-latin.woff2
|
|
39
39
|
- app/assets/images/easy/sprite.svg
|
|
40
40
|
- app/assets/javascripts/easy/flyer.js
|
|
41
|
+
- app/assets/javascripts/easy/konami.js
|
|
41
42
|
- app/assets/javascripts/easy/rotating_placeholder.js
|
|
42
43
|
- app/assets/stylesheets/easy/base.css
|
|
43
44
|
- app/assets/stylesheets/easy/components.css
|