Publish Vulpes Preview 15 sources for desktop, Android and Tundra

Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
OverSu 2026-09-30 23:13:03 +02:00
commit b38dea0597
25901 changed files with 9982925 additions and 369 deletions

View file

@ -0,0 +1,29 @@
{
"name": "smart-banner",
"homepage": "https://github.com/gaia-components/smart-banner",
"main": "script.js",
"license": "MPL",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests",
"examples",
"LICENSE",
"README.md"
],
"devDependencies": {
"evt": "gaia-components/evt#~0.4.0",
"smart-button": "gaia-components/smart-button"
},
"_release": "01f885eced",
"_resolution": {
"type": "branch",
"branch": "master",
"commit": "01f885eced4ebe6e601bd252b2b5730309960b90"
},
"_source": "git://github.com/gaia-components/smart-banner.git",
"_target": "*",
"_originalSource": "gaia-components/smart-banner"
}

View file

@ -0,0 +1,21 @@
{
"name": "smart-banner",
"version": "0.0.0",
"homepage": "https://github.com/gaia-components/smart-banner",
"main": "script.js",
"license": "MPL",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests",
"examples",
"LICENSE",
"README.md"
],
"devDependencies": {
"evt": "gaia-components/evt#~0.4.0",
"smart-button": "gaia-components/smart-button"
}
}

View file

@ -0,0 +1,130 @@
'use strict';
/* global evt */
window.SmartBanner = (function(win) {
// Extend from the HTMLElement prototype
var proto = evt(Object.create(HTMLElement.prototype));
proto.createdCallback = function() {
this.init();
this.addEventListener('transitionend', this);
this.addEventListener('animationend', this);
};
proto.init = function() {
this.style.width = '0';
this.classList.add('closed');
};
proto.calculateChildWidth = function() {
var child = this.firstElementChild;
var childWidth = 0;
var style;
while(child) {
style = window.getComputedStyle(child);
childWidth += child.offsetWidth + parseInt(style.marginLeft, 10) +
parseInt(style.marginRight, 10);
child = child.nextElementSibling;
}
return childWidth;
};
proto.fireEvent = function(event, detail) {
var evtObject = new CustomEvent(event, {
bubbles: false,
detail: detail || this
});
this.dispatchEvent(evtObject);
this.fire(event, detail);
};
proto.handleEvent = function(evt) {
switch(evt.type) {
// Like System app, the transition is our state machine.
case 'transitionend':
// We only process 'background-color' because all states have this
// change.
if ((evt.propertyName !== 'background-color' &&
evt.propertyName !== 'opacity' &&
evt.propertyName !== 'width') ||
evt.target !== this) {
break;
}
if (this.classList.contains('opening')) {
this.classList.add('opened');
this.classList.remove('opening');
// final state: opened
this.fireEvent('opened');
} else if (this.classList.contains('closing')) {
this.classList.add('closed');
this.classList.remove('closing');
// final state: closed
this.fireEvent('closed');
}
// go back to initial state after hiding
if (this.classList.contains('hiding')) {
this.classList.remove('opened');
this.classList.remove('opening');
this.classList.remove('closing');
this.classList.remove('flying');
this.classList.remove('hiding');
this.init();
this.fireEvent('hidden');
}
break;
case 'animationend':
this.classList.remove('flying');
this.open();
break;
}
};
proto.open = function() {
// no operation during flying and hiding
if (this.classList.contains('flying') ||
this.classList.contains('hiding')) {
return;
}
this.fireEvent('will-open');
// If we get focus when we closing the group, we need to cancel the closing
// state.
this.classList.remove('closed');
this.classList.remove('closing');
this.classList.add('opening');
// change to opening
this.style.width = this.calculateChildWidth() + 'px';
};
proto.close = function() {
// no operation during flying and hiding
if (this.classList.contains('flying') ||
this.classList.contains('hiding')) {
return;
}
this.fireEvent('will-close');
// We may call close at mid state, we need to reset all of them and go to
// closing state
this.classList.remove('opened');
this.classList.remove('opening');
this.classList.add('closing');
this.style.width = '0';
};
proto.hide = function(callback) {
this.classList.add('hiding');
};
proto.flyOpen = function() {
if (this.classList.contains('closed')) {
this.classList.add('flying');
}
};
// Register and return the constructor
return document.registerElement('smart-banner', { prototype: proto });
})(window);

View file

@ -0,0 +1,135 @@
/**
* Button state:
* 1. normal (class name: [none])
* 2. opening (class name: opening)
* 3. opened (class name: opened)
* 4. closing (class name: closing)
* 5. closed (class name: closed)
* 6. hiding (class name: hiding)
* 8. flying (class name: flying)
**/
/**
* Normal:
* open: closed -> opening -> opened
* close: opened -> closing -> closed
* hide: current state -> hiding -> closed
* flyOpen: flying -> closed -> opening -> opened
**/
smart-banner {
outline: 0;
display: inline-block;
height: 7rem;
/* Same as closed state */
padding-left: 11rem;
padding-right: 0;
padding-top: 2rem;
padding-bottom: 2rem;
opacity: 1;
/* we need to set border to none to remove the button border */
border: none;
/* the radius is still make button as round even if we don't have border */
border-radius: 5.5rem;
background-color: rgba(0, 0, 0, 0.5);
background-repeat: no-repeat;
background-size: 5.4rem auto;
background-position: 2.8rem 50%;
word-break: keep-all;
white-space: nowrap;
overflow: hidden;
position: relative;
font-size: 2.8rem;
line-height: 7rem;
transition-property: none;
transition-timing-function: cubic-bezier(0.25, 0, 0, 1.0);
transition-duration: 0s;
}
smart-banner:before {
content: " ";
background-repeat: no-repeat;
background-size: 5.4rem auto;
background-position: center;
width: 5.4rem;
height: 7rem;
display: inline-block;
position: absolute;
left: 2.8rem;
transition-property: all;
transition-timing-function: cubic-bezier(0.25, 0, 0, 1.0);
transition-duration: 0.42s;
}
smart-banner.closed:before {
width: 11rem;
left: 0;
}
smart-banner[data-icon]:before {
width: 5.4rem;
left: 4.4rem;
font-size: 5.4rem;
line-height: 11rem;
text-align: center;
color: #5f6368;
white-space: normal;
top: 0;
}
smart-banner[data-icon].closed:before {
left: 2.8rem;
}
smart-banner.closed {
padding-left: 11rem;
padding-right: 0;
transition-duration: 0.5s;
background-color: rgba(0, 0, 0, 0.5);
}
smart-banner.closed > * {
display: none;
}
smart-banner.opened {
padding-right: 4.4rem;
}
smart-banner.opening {
transition-property: all;
transition-duration: 0.72s;
/* add the same padding-right of normal to make it run transition */
padding-right: 4.4rem;
}
smart-banner.opening:before {
transition-duration: 0.72s;
}
smart-banner.closing {
transition-property: all;
transition-duration: 0.5s;
padding-left: 11rem;
padding-right: 0;
background-color: rgba(0, 0, 0, 0.5);
}
smart-banner.hiding {
opacity: 0;
transition-property: opacity;
transition-duration: 1s;
}
smart-banner.flying {
animation: flyAnimation 1s;
}
@keyframes flyAnimation {
from {transform: translateY(20rem);}
to {transform: translateY(0);}
}