Plugin Directory

Changeset 3793295


Ignore:
Timestamp:
11/09/2026 09:39:20 PM (12 days ago)
Author:
celestinetan
Message:

Update to version 0.45.22 from GitHub

Location:
stubli
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • stubli/tags/0.45.22/assets/app/app.css

    r3792180 r3793295  
    861861
    862862/* Stacked tabs in You (0.45.21), as on the page: rows instead of a sliding row. */
    863 .a-ctabs-row.is-stacked { flex-wrap: wrap; column-gap: 4px; row-gap: 0; }
     863/* Stacked collection tabs as an index-card box (0.45.22): rows behind tuck under the one in front, showing a 26px
     864   strip, a shade darker each, with a full-width card edge. A back tab lifts on touch (JS .is-lift) or hover. */
     865.a-ctabs-row.is-stacked { position: relative; flex-wrap: wrap; column-gap: 4px; row-gap: 0; }
    864866.a-ctabs-row.is-stacked .a-ctabs { display: contents; }
    865867.a-ctabs-row.is-stacked .a-ctabs-gap { display: none; }
    866 .a-ctabs-row.is-stacked .a-ctab { margin-top: 4px; }
    867 .a-ctabs-row.is-stacked .a-ctab.is-back { min-height: 36px; filter: brightness(.965); }
     868.a-ctabs-row.is-stacked .a-ctab { position: relative; box-shadow: 0 -3px 5px -3px rgba(40, 36, 30, .16); transition: transform .16s ease-out, filter .16s ease-out; }
     869.a-ctabs-row.is-stacked .a-ctab.is-back { margin-bottom: -14px; align-items: flex-start; padding-top: 4px; filter: brightness(calc(1 - .035 * var(--depth, 1))); }
     870.a-ctabs-row.is-stacked .a-ctab.is-back.is-lift,
     871.a-ctabs-row.is-stacked .a-ctab.is-back:active { transform: translateY(-7px); filter: none; }
     872@media (hover: hover) {
     873        .a-ctabs-row.is-stacked .a-ctab.is-back:hover { transform: translateY(-5px); filter: none; }
     874}
     875@media (prefers-reduced-motion: reduce) {
     876        .a-ctabs-row.is-stacked .a-ctab { transition: none; }
     877}
    868878.a-ctabs-break { flex-basis: 100%; height: 0; }
     879.a-ctabs-card { position: absolute; left: 0; right: 0; pointer-events: none; background: var(--field); filter: brightness(calc(1 - .035 * var(--depth, 1))); box-shadow: 0 -3px 5px -3px rgba(40, 36, 30, .16); }
  • stubli/tags/0.45.22/assets/app/app.js

    r3792180 r3793295  
    625625                return '<svg class="a-smile" viewBox="0 0 60 80" width="26" height="35" aria-hidden="true" focusable="false"><path d="M10.5 35.5V52a19.5 19.5 0 0 0 39 0V35.5" fill="none" stroke="currentColor" stroke-width="11" stroke-linecap="round"/><circle cx="19" cy="15" r="6.2" fill="currentColor"/><circle cx="41" cy="15" r="6.2" fill="currentColor"/></svg>';
    626626        }
    627         // Stacked tabs in You (0.45.21, Celestine 8 Nov), as on the page since theme 0.2.118: when the collection tabs
    628         // don't fit in one row, they stack in rows instead of sliding behind the icons. The open one's row sits against
    629         // the photos; Journal, arrange, guest book and Favourites stay together.
     627        // Stacked tabs in You as an index-card box (0.45.22, Celestine 9 Nov; first stacked in 0.45.21), as on the page
     628        // since theme 0.2.119: when the collection tabs don't fit in one row they wrap into rows. The open one's row is in
     629        // front with Journal, arrange, guest book and Favourites at its right (others move back to make room); rows
     630        // behind tuck under it, a shade darker each, with a full-width card edge (.a-ctabs-card).
    630631        function stackAppTabs() {
    631632                var row = $( '.a-ctabs-row' ), scroll = row && row.querySelector( '.a-ctabs' );
    … …  
    633634                var tabs = Array.prototype.slice.call( row.querySelectorAll( '.a-ctab' ) );
    634635                row.classList.remove( 'is-stacked' );
    635                 $$( '.a-ctabs-break' ).forEach( function ( b ) { b.remove(); } );
    636                 tabs.forEach( function ( t ) { t.style.order = ''; t.style.marginLeft = ''; t.classList.remove( 'is-back' ); } );
     636                $$( '.a-ctabs-break, .a-ctabs-card' ).forEach( function ( b ) { b.remove(); } );
     637                tabs.forEach( function ( t ) { t.style.order = ''; t.style.marginLeft = ''; t.style.zIndex = ''; t.style.removeProperty( '--depth' ); t.classList.remove( 'is-back' ); } );
    637638                if ( scroll.scrollWidth <= scroll.clientWidth + 1 ) { return; }
    638639                var gap = 4, room = row.clientWidth, width = function ( t ) { return Math.ceil( t.getBoundingClientRect().width ); };
     640                var rowW = function ( r ) { return r.reduce( function ( s, t ) { return s + width( t ) + gap; }, 0 ); };
    639641                var icons = tabs.filter( function ( t ) { return t.classList.contains( 'a-ctab-icon' ); } );
    640642                var plain = tabs.filter( function ( t ) { return icons.indexOf( t ) < 0; } );
    641                 var iconsW = icons.reduce( function ( s, t ) { return s + width( t ) + gap; }, gap );
     643                var iconsW = rowW( icons ) + gap;
    642644                var rows = [ [] ], used = 0;
    643645                plain.forEach( function ( t ) {
    … …  
    650652                var ri = rows.findIndex( function ( r ) { return r.indexOf( active ) >= 0; } );
    651653                if ( ri >= 0 ) { rows.push( rows.splice( ri, 1 )[ 0 ] ); }
    652                 var lastW = rows[ rows.length - 1 ].reduce( function ( s, t ) { return s + width( t ) + gap; }, 0 );
    653                 var iconsOnTop = lastW + iconsW > room;
    654                 if ( iconsOnTop ) { rows.unshift( [] ); }
     654                var front = rows[ rows.length - 1 ], moved = [];
     655                while ( front.length > 1 && rowW( front ) + iconsW > room ) {
     656                        moved.unshift( front.splice( front[ front.length - 1 ] === active ? 0 : front.length - 1, 1 )[ 0 ] );
     657                }
     658                if ( moved.length ) { rows.splice( rows.length - 1, 0, moved ); }
     659                var iconsOwnRow = icons.length && rowW( front ) + iconsW > room;
     660                if ( iconsOwnRow ) { rows.unshift( icons.slice() ); }
    655661                row.classList.add( 'is-stacked' );
    656662                rows.forEach( function ( r, n ) {
    657663                        var last = n === rows.length - 1;
    658                         r.forEach( function ( t ) { t.style.order = n * 2; if ( ! last ) { t.classList.add( 'is-back' ); } } );
     664                        r.forEach( function ( t ) {
     665                                t.style.order = n * 2; t.style.zIndex = n * 2 + 2;
     666                                if ( ! last ) { t.classList.add( 'is-back' ); t.style.setProperty( '--depth', Math.min( 3, rows.length - 1 - n ) ); }
     667                        } );
    659668                        if ( ! last ) { var b = document.createElement( 'span' ); b.className = 'a-ctabs-break'; b.setAttribute( 'aria-hidden', 'true' ); b.style.order = n * 2 + 1; row.appendChild( b ); }
    660669                } );
    661                 icons.forEach( function ( t, i ) { t.style.order = iconsOnTop ? 0 : ( rows.length - 1 ) * 2; t.style.marginLeft = 0 === i ? 'auto' : ''; if ( iconsOnTop ) { t.classList.add( 'is-back' ); } } );
    662         }
     670                if ( ! iconsOwnRow ) {
     671                        icons.forEach( function ( t, i ) { t.style.order = ( rows.length - 1 ) * 2; t.style.zIndex = rows.length * 2; t.style.marginLeft = 0 === i ? 'auto' : ''; } );
     672                } else if ( icons.length ) { icons[ 0 ].style.marginLeft = 'auto'; }
     673                var rowTop = row.getBoundingClientRect().top;
     674                var bottom = function ( r ) { return Math.max.apply( null, r.map( function ( t ) { return t.getBoundingClientRect().bottom; } ) ); };
     675                rows.forEach( function ( r, n ) {
     676                        if ( n === rows.length - 1 ) { return; }
     677                        var top = bottom( r ), below = bottom( rows[ n + 1 ] ), card = document.createElement( 'span' );
     678                        card.className = 'a-ctabs-card'; card.setAttribute( 'aria-hidden', 'true' );
     679                        card.style.top = ( top - rowTop - 1 ) + 'px'; card.style.height = ( below - top + 1 ) + 'px';
     680                        card.style.zIndex = n * 2 + 1; card.style.setProperty( '--depth', Math.min( 3, rows.length - 1 - n ) );
     681                        row.appendChild( card );
     682                } );
     683        }
     684        // Lift on touch (Celestine 9 Nov): a tab in a back row rises as soon as a finger goes down, before it opens.
     685        document.addEventListener( 'pointerdown', function ( e ) {
     686                var t = e.target.closest && e.target.closest( '.a-ctabs-row.is-stacked .a-ctab.is-back' );
     687                if ( t ) { t.classList.add( 'is-lift' ); }
     688        } );
     689        [ 'pointerup', 'pointercancel' ].forEach( function ( ev ) {
     690                document.addEventListener( ev, function () { $$( '.a-ctab.is-lift' ).forEach( function ( t ) { t.classList.remove( 'is-lift' ); } ); }, true );
     691        } );
    663692        var stackAppWait;
    664693        window.addEventListener( 'resize', function () { cancelAnimationFrame( stackAppWait ); stackAppWait = requestAnimationFrame( stackAppTabs ); } );
  • stubli/tags/0.45.22/look/assets/css/stubli.css

    r3791468 r3793295  
    10321032   sliding under Journal, Guest book and Favourites. The row with the open folder sits against the photos; the rows
    10331033   behind it are a little shorter and a shade darker, like folders further back. Nothing changes when they fit. */
    1034 .st-tabs.is-stacked { flex-wrap: wrap; column-gap: 4px; row-gap: 0; }
     1034/* Stacked folders as an index-card box (0.2.119): rows behind tuck under the one in front, showing a 26px strip,
     1035   each a shade darker, with a full-width card edge. A back folder lifts on touch (JS .is-lift) or hover. */
     1036.st-tabs.is-stacked { position: relative; flex-wrap: wrap; column-gap: 4px; row-gap: 0; }
    10351037.st-tabs.is-stacked .st-tabs-left,
    10361038.st-tabs.is-stacked .st-tabs-scroll,
    10371039.st-tabs.is-stacked .st-tabs-right { display: contents; }
    1038 .st-tabs.is-stacked .st-tab { margin-top: 4px; }
    1039 .st-tabs.is-stacked .st-tab.is-back { height: 38px; }
    1040 .st-tabs.is-stacked .st-tab.is-back .st-tab-face { height: 32px; filter: brightness(.965); }
     1040.st-tabs.is-stacked .st-tab { position: relative; pointer-events: none; }
     1041.st-tabs.is-stacked .st-tab-face { pointer-events: auto; box-shadow: 0 -3px 5px -3px rgba(40, 36, 30, .16); transition: transform .16s ease-out, filter .16s ease-out; }
     1042.st-tabs.is-stacked .st-tab.is-back { margin-bottom: -18px; }
     1043.st-tabs.is-stacked .st-tab.is-back .st-tab-face { align-items: flex-start; padding-top: 4px; box-sizing: border-box; filter: brightness(calc(1 - .035 * var(--depth, 1))); }
     1044.st-tabs.is-stacked .st-tab.is-back.is-lift .st-tab-face,
     1045.st-tabs.is-stacked .st-tab.is-back:active .st-tab-face { transform: translateY(-7px); filter: none; }
     1046@media (hover: hover) {
     1047        .st-tabs.is-stacked .st-tab.is-back:hover .st-tab-face { transform: translateY(-5px); filter: none; }
     1048}
     1049@media (prefers-reduced-motion: reduce) {
     1050        .st-tabs.is-stacked .st-tab-face { transition: none; }
     1051}
    10411052.st-tabs-break { flex-basis: 100%; height: 0; }
     1053.st-tabs-card { position: absolute; left: 0; right: 0; pointer-events: none; background: var(--st-tab-off); filter: brightness(calc(1 - .035 * var(--depth, 1))); box-shadow: 0 -3px 5px -3px rgba(40, 36, 30, .16); }
  • stubli/tags/0.45.22/look/assets/js/stubli.js

    r3791468 r3793295  
    1414        window.addEventListener( 'pageshow', function ( e ) { if ( e.persisted && document.body && document.body.classList.contains( 'logged-in' ) ) { location.reload(); } } );
    1515
    16         /* Stacked folders (0.2.118, Celestine 8 Nov): when the folder tabs don't fit in one row, stack them in rows
    17            (CSS .is-stacked) instead of letting them slide under the icon tabs. The open folder's row moves to the
    18            bottom, against the photos; the rows behind it are marked .is-back. */
     16        /* Stacked folders as an index-card box (0.2.119, Celestine 9 Nov; first stacked in 0.2.118): when the folder tabs
     17           don't fit in one row they wrap into rows. The open folder's row is in front, against the photos, with Journal,
     18           Guest book and Favourites at its right (folders that don't fit beside them move back). Rows behind tuck under
     19           the one in front (CSS .is-stacked .is-back) and each gets a card edge (.st-tabs-card), a shade darker per row. */
    1920        function stackTabs() {
    2021                document.querySelectorAll( '.st-tabs' ).forEach( function ( nav ) {
    … …  
    2324                        if ( ! scroll ) { return; }
    2425                        nav.classList.remove( 'is-stacked' );
    25                         nav.querySelectorAll( '.st-tabs-break' ).forEach( function ( b ) { b.remove(); } );
    26                         tabs.forEach( function ( t ) { t.style.order = ''; t.style.marginLeft = ''; t.classList.remove( 'is-back' ); } );
     26                        nav.querySelectorAll( '.st-tabs-break, .st-tabs-card' ).forEach( function ( b ) { b.remove(); } );
     27                        tabs.forEach( function ( t ) { t.style.order = ''; t.style.marginLeft = ''; t.style.zIndex = ''; t.style.removeProperty( '--depth' ); t.classList.remove( 'is-back' ); } );
    2728                        if ( scroll.scrollWidth <= scroll.clientWidth + 1 ) { return; }
    28                         // Pack the folders into rows by their widths, in their own order.
    2929                        var gap = 4, room = nav.clientWidth, width = function ( t ) { return Math.ceil( t.getBoundingClientRect().width ); };
     30                        var rowW = function ( r ) { return r.reduce( function ( s, t ) { return s + width( t ) + gap; }, 0 ); };
    3031                        var icons = tabs.filter( function ( t ) { return t.classList.contains( 'st-tab-icon' ); } );
    3132                        var plain = tabs.filter( function ( t ) { return icons.indexOf( t ) < 0; } );
    32                         var iconsW = icons.reduce( function ( s, t ) { return s + width( t ) + gap; }, gap );
     33                        var iconsW = rowW( icons ) + gap;
     34                        // Pack the folders into rows by their widths, in their own order.
    3335                        var rows = [ [] ], used = 0;
    3436                        plain.forEach( function ( t ) {
    … …  
    3840                                rows[ rows.length - 1 ].push( t );
    3941                        } );
    40                         // The open folder's row goes last, against the photos; the others keep their order behind it.
     42                        // The open folder's row goes in front; the others keep their order behind it.
    4143                        var active = nav.querySelector( '.st-tab.is-active' );
    4244                        var ri = rows.findIndex( function ( r ) { return r.indexOf( active ) >= 0; } );
    4345                        if ( ri >= 0 ) { rows.push( rows.splice( ri, 1 )[ 0 ] ); }
    44                         // Journal, Guest book and Favourites stay together at the right of the bottom row, as on a
    45                         // computer; when that row has no room for them, they sit together at the right of a row of their own on top.
    46                         var lastW = rows[ rows.length - 1 ].reduce( function ( s, t ) { return s + width( t ) + gap; }, 0 );
    47                         var iconsOnTop = lastW + iconsW > room;
    48                         if ( iconsOnTop ) { rows.unshift( [] ); }
     46                        // Make room for the icon tabs in the front row: the other folders there move to a row just behind it.
     47                        var front = rows[ rows.length - 1 ], moved = [];
     48                        while ( front.length > 1 && rowW( front ) + iconsW > room ) {
     49                                moved.unshift( front.splice( front[ front.length - 1 ] === active ? 0 : front.length - 1, 1 )[ 0 ] );
     50                        }
     51                        if ( moved.length ) { rows.splice( rows.length - 1, 0, moved ); }
     52                        // Only when even the open folder alone has no room beside them do they get a back row of their own.
     53                        var iconsOwnRow = icons.length && rowW( front ) + iconsW > room;
     54                        if ( iconsOwnRow ) { rows.unshift( icons.slice() ); }
    4955                        nav.classList.add( 'is-stacked' );
    50                         var brk = function ( order ) {
    51                                 var b = document.createElement( 'span' );
    52                                 b.className = 'st-tabs-break'; b.setAttribute( 'aria-hidden', 'true' ); b.style.order = order;
    53                                 nav.appendChild( b );
    54                         };
    5556                        rows.forEach( function ( r, n ) {
    5657                                var last = n === rows.length - 1;
    57                                 r.forEach( function ( t ) { t.style.order = n * 2; if ( ! last ) { t.classList.add( 'is-back' ); } } );
    58                                 if ( ! last ) { brk( n * 2 + 1 ); }
    59                         } );
    60                         var at = iconsOnTop ? 0 : ( rows.length - 1 ) * 2;
    61                         icons.forEach( function ( t, i ) {
    62                                 t.style.order = at; t.style.marginLeft = 0 === i ? 'auto' : '';
    63                                 if ( iconsOnTop ) { t.classList.add( 'is-back' ); }
     58                                r.forEach( function ( t ) {
     59                                        t.style.order = n * 2; t.style.zIndex = n * 2 + 2;
     60                                        if ( ! last ) { t.classList.add( 'is-back' ); t.style.setProperty( '--depth', Math.min( 3, rows.length - 1 - n ) ); }
     61                                } );
     62                                if ( ! last ) {
     63                                        var b = document.createElement( 'span' );
     64                                        b.className = 'st-tabs-break'; b.setAttribute( 'aria-hidden', 'true' ); b.style.order = n * 2 + 1;
     65                                        nav.appendChild( b );
     66                                }
     67                        } );
     68                        if ( ! iconsOwnRow ) {
     69                                icons.forEach( function ( t, i ) { t.style.order = ( rows.length - 1 ) * 2; t.style.zIndex = rows.length * 2; t.style.marginLeft = 0 === i ? 'auto' : ''; } );
     70                        } else if ( icons.length ) { icons[ 0 ].style.marginLeft = 'auto'; }
     71                        // Each back row's card edge: a full-width band from the bottom of its tabs to the bottom of the row in front.
     72                        var navTop = nav.getBoundingClientRect().top;
     73                        var bottom = function ( r ) { return Math.max.apply( null, r.map( function ( t ) { return t.getBoundingClientRect().bottom; } ) ); };
     74                        rows.forEach( function ( r, n ) {
     75                                if ( n === rows.length - 1 ) { return; }
     76                                var top = bottom( r ), below = bottom( rows[ n + 1 ] );
     77                                var card = document.createElement( 'span' );
     78                                card.className = 'st-tabs-card'; card.setAttribute( 'aria-hidden', 'true' );
     79                                card.style.top = ( top - navTop - 1 ) + 'px'; card.style.height = ( below - top + 1 ) + 'px';
     80                                card.style.zIndex = n * 2 + 1; card.style.setProperty( '--depth', Math.min( 3, rows.length - 1 - n ) );
     81                                nav.appendChild( card );
    6482                        } );
    6583                } );
    … …  
    6987        var stackWait;
    7088        window.addEventListener( 'resize', function () { cancelAnimationFrame( stackWait ); stackWait = requestAnimationFrame( stackTabs ); } );
     89        // Lift on touch (Celestine 9 Nov): a folder in a back row rises as soon as a finger (or the mouse button) goes down, before it opens.
     90        document.addEventListener( 'pointerdown', function ( e ) {
     91                var t = e.target.closest && e.target.closest( '.st-tabs.is-stacked .st-tab.is-back' );
     92                if ( t ) { t.classList.add( 'is-lift' ); }
     93        } );
     94        [ 'pointerup', 'pointercancel' ].forEach( function ( ev ) {
     95                document.addEventListener( ev, function () { document.querySelectorAll( '.st-tab.is-lift' ).forEach( function ( t ) { t.classList.remove( 'is-lift' ); } ); }, true );
     96        } );
    7197
    7298        /* Reading mode: Light ↔ Paper. No dark mode since 0.2.117 (Celestine 8 Nov); a saved Auto or Dark reads as Light. */
  • stubli/tags/0.45.22/readme.txt

    r3792180 r3793295  
    66Tested up to: 7.1
    77Requires PHP: 7.4
    8 Stable tag: 0.45.21
     8Stable tag: 0.45.22
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    100100== Changelog ==
    101101
     102= 0.45.22 =
     103* When your collections don't fit in one row, on your page and in the app, they now stack like cards in a box: the rows behind peek out above the one in front, and a tab lifts as soon as you touch it. On your page, Journal, guest book and Favourites stay beside the open collection instead of floating in a row of their own.
     104
    102105= 0.45.21 =
    103106* In the app, under You: when your collections don't fit in one row, they now stack in rows, so none hide behind Journal, arrange, guest book and Favourites. The one you have open sits nearest your photos.
  • stubli/tags/0.45.22/wordgram.php

    r3792180 r3793295  
    33 * Plugin Name:       Stubli
    44 * Description:       Turns a WordPress site into a cosy, familiar photo-sharing home: a public profile with collections, a journal and a guest book, a private reader for the Stubli sites you follow, and comments between sites via Webmention.
    5  * Version:           0.45.21
     5 * Version:           0.45.22
    66 * Requires at least: 6.5
    77 * Requires PHP:      7.4
    … …  
    2222defined( 'ABSPATH' ) || exit;
    2323
    24 const VERSION        = '0.45.21';
     24const VERSION        = '0.45.22';
    2525const SCHEMA_VERSION = 5;
    2626const REST_NS        = 'stubli/v1';
  • stubli/trunk/assets/app/app.css

    r3792180 r3793295  
    861861
    862862/* Stacked tabs in You (0.45.21), as on the page: rows instead of a sliding row. */
    863 .a-ctabs-row.is-stacked { flex-wrap: wrap; column-gap: 4px; row-gap: 0; }
     863/* Stacked collection tabs as an index-card box (0.45.22): rows behind tuck under the one in front, showing a 26px
     864   strip, a shade darker each, with a full-width card edge. A back tab lifts on touch (JS .is-lift) or hover. */
     865.a-ctabs-row.is-stacked { position: relative; flex-wrap: wrap; column-gap: 4px; row-gap: 0; }
    864866.a-ctabs-row.is-stacked .a-ctabs { display: contents; }
    865867.a-ctabs-row.is-stacked .a-ctabs-gap { display: none; }
    866 .a-ctabs-row.is-stacked .a-ctab { margin-top: 4px; }
    867 .a-ctabs-row.is-stacked .a-ctab.is-back { min-height: 36px; filter: brightness(.965); }
     868.a-ctabs-row.is-stacked .a-ctab { position: relative; box-shadow: 0 -3px 5px -3px rgba(40, 36, 30, .16); transition: transform .16s ease-out, filter .16s ease-out; }
     869.a-ctabs-row.is-stacked .a-ctab.is-back { margin-bottom: -14px; align-items: flex-start; padding-top: 4px; filter: brightness(calc(1 - .035 * var(--depth, 1))); }
     870.a-ctabs-row.is-stacked .a-ctab.is-back.is-lift,
     871.a-ctabs-row.is-stacked .a-ctab.is-back:active { transform: translateY(-7px); filter: none; }
     872@media (hover: hover) {
     873        .a-ctabs-row.is-stacked .a-ctab.is-back:hover { transform: translateY(-5px); filter: none; }
     874}
     875@media (prefers-reduced-motion: reduce) {
     876        .a-ctabs-row.is-stacked .a-ctab { transition: none; }
     877}
    868878.a-ctabs-break { flex-basis: 100%; height: 0; }
     879.a-ctabs-card { position: absolute; left: 0; right: 0; pointer-events: none; background: var(--field); filter: brightness(calc(1 - .035 * var(--depth, 1))); box-shadow: 0 -3px 5px -3px rgba(40, 36, 30, .16); }
  • stubli/trunk/assets/app/app.js

    r3792180 r3793295  
    625625                return '<svg class="a-smile" viewBox="0 0 60 80" width="26" height="35" aria-hidden="true" focusable="false"><path d="M10.5 35.5V52a19.5 19.5 0 0 0 39 0V35.5" fill="none" stroke="currentColor" stroke-width="11" stroke-linecap="round"/><circle cx="19" cy="15" r="6.2" fill="currentColor"/><circle cx="41" cy="15" r="6.2" fill="currentColor"/></svg>';
    626626        }
    627         // Stacked tabs in You (0.45.21, Celestine 8 Nov), as on the page since theme 0.2.118: when the collection tabs
    628         // don't fit in one row, they stack in rows instead of sliding behind the icons. The open one's row sits against
    629         // the photos; Journal, arrange, guest book and Favourites stay together.
     627        // Stacked tabs in You as an index-card box (0.45.22, Celestine 9 Nov; first stacked in 0.45.21), as on the page
     628        // since theme 0.2.119: when the collection tabs don't fit in one row they wrap into rows. The open one's row is in
     629        // front with Journal, arrange, guest book and Favourites at its right (others move back to make room); rows
     630        // behind tuck under it, a shade darker each, with a full-width card edge (.a-ctabs-card).
    630631        function stackAppTabs() {
    631632                var row = $( '.a-ctabs-row' ), scroll = row && row.querySelector( '.a-ctabs' );
    … …  
    633634                var tabs = Array.prototype.slice.call( row.querySelectorAll( '.a-ctab' ) );
    634635                row.classList.remove( 'is-stacked' );
    635                 $$( '.a-ctabs-break' ).forEach( function ( b ) { b.remove(); } );
    636                 tabs.forEach( function ( t ) { t.style.order = ''; t.style.marginLeft = ''; t.classList.remove( 'is-back' ); } );
     636                $$( '.a-ctabs-break, .a-ctabs-card' ).forEach( function ( b ) { b.remove(); } );
     637                tabs.forEach( function ( t ) { t.style.order = ''; t.style.marginLeft = ''; t.style.zIndex = ''; t.style.removeProperty( '--depth' ); t.classList.remove( 'is-back' ); } );
    637638                if ( scroll.scrollWidth <= scroll.clientWidth + 1 ) { return; }
    638639                var gap = 4, room = row.clientWidth, width = function ( t ) { return Math.ceil( t.getBoundingClientRect().width ); };
     640                var rowW = function ( r ) { return r.reduce( function ( s, t ) { return s + width( t ) + gap; }, 0 ); };
    639641                var icons = tabs.filter( function ( t ) { return t.classList.contains( 'a-ctab-icon' ); } );
    640642                var plain = tabs.filter( function ( t ) { return icons.indexOf( t ) < 0; } );
    641                 var iconsW = icons.reduce( function ( s, t ) { return s + width( t ) + gap; }, gap );
     643                var iconsW = rowW( icons ) + gap;
    642644                var rows = [ [] ], used = 0;
    643645                plain.forEach( function ( t ) {
    … …  
    650652                var ri = rows.findIndex( function ( r ) { return r.indexOf( active ) >= 0; } );
    651653                if ( ri >= 0 ) { rows.push( rows.splice( ri, 1 )[ 0 ] ); }
    652                 var lastW = rows[ rows.length - 1 ].reduce( function ( s, t ) { return s + width( t ) + gap; }, 0 );
    653                 var iconsOnTop = lastW + iconsW > room;
    654                 if ( iconsOnTop ) { rows.unshift( [] ); }
     654                var front = rows[ rows.length - 1 ], moved = [];
     655                while ( front.length > 1 && rowW( front ) + iconsW > room ) {
     656                        moved.unshift( front.splice( front[ front.length - 1 ] === active ? 0 : front.length - 1, 1 )[ 0 ] );
     657                }
     658                if ( moved.length ) { rows.splice( rows.length - 1, 0, moved ); }
     659                var iconsOwnRow = icons.length && rowW( front ) + iconsW > room;
     660                if ( iconsOwnRow ) { rows.unshift( icons.slice() ); }
    655661                row.classList.add( 'is-stacked' );
    656662                rows.forEach( function ( r, n ) {
    657663                        var last = n === rows.length - 1;
    658                         r.forEach( function ( t ) { t.style.order = n * 2; if ( ! last ) { t.classList.add( 'is-back' ); } } );
     664                        r.forEach( function ( t ) {
     665                                t.style.order = n * 2; t.style.zIndex = n * 2 + 2;
     666                                if ( ! last ) { t.classList.add( 'is-back' ); t.style.setProperty( '--depth', Math.min( 3, rows.length - 1 - n ) ); }
     667                        } );
    659668                        if ( ! last ) { var b = document.createElement( 'span' ); b.className = 'a-ctabs-break'; b.setAttribute( 'aria-hidden', 'true' ); b.style.order = n * 2 + 1; row.appendChild( b ); }
    660669                } );
    661                 icons.forEach( function ( t, i ) { t.style.order = iconsOnTop ? 0 : ( rows.length - 1 ) * 2; t.style.marginLeft = 0 === i ? 'auto' : ''; if ( iconsOnTop ) { t.classList.add( 'is-back' ); } } );
    662         }
     670                if ( ! iconsOwnRow ) {
     671                        icons.forEach( function ( t, i ) { t.style.order = ( rows.length - 1 ) * 2; t.style.zIndex = rows.length * 2; t.style.marginLeft = 0 === i ? 'auto' : ''; } );
     672                } else if ( icons.length ) { icons[ 0 ].style.marginLeft = 'auto'; }
     673                var rowTop = row.getBoundingClientRect().top;
     674                var bottom = function ( r ) { return Math.max.apply( null, r.map( function ( t ) { return t.getBoundingClientRect().bottom; } ) ); };
     675                rows.forEach( function ( r, n ) {
     676                        if ( n === rows.length - 1 ) { return; }
     677                        var top = bottom( r ), below = bottom( rows[ n + 1 ] ), card = document.createElement( 'span' );
     678                        card.className = 'a-ctabs-card'; card.setAttribute( 'aria-hidden', 'true' );
     679                        card.style.top = ( top - rowTop - 1 ) + 'px'; card.style.height = ( below - top + 1 ) + 'px';
     680                        card.style.zIndex = n * 2 + 1; card.style.setProperty( '--depth', Math.min( 3, rows.length - 1 - n ) );
     681                        row.appendChild( card );
     682                } );
     683        }
     684        // Lift on touch (Celestine 9 Nov): a tab in a back row rises as soon as a finger goes down, before it opens.
     685        document.addEventListener( 'pointerdown', function ( e ) {
     686                var t = e.target.closest && e.target.closest( '.a-ctabs-row.is-stacked .a-ctab.is-back' );
     687                if ( t ) { t.classList.add( 'is-lift' ); }
     688        } );
     689        [ 'pointerup', 'pointercancel' ].forEach( function ( ev ) {
     690                document.addEventListener( ev, function () { $$( '.a-ctab.is-lift' ).forEach( function ( t ) { t.classList.remove( 'is-lift' ); } ); }, true );
     691        } );
    663692        var stackAppWait;
    664693        window.addEventListener( 'resize', function () { cancelAnimationFrame( stackAppWait ); stackAppWait = requestAnimationFrame( stackAppTabs ); } );
  • stubli/trunk/look/assets/css/stubli.css

    r3791468 r3793295  
    10321032   sliding under Journal, Guest book and Favourites. The row with the open folder sits against the photos; the rows
    10331033   behind it are a little shorter and a shade darker, like folders further back. Nothing changes when they fit. */
    1034 .st-tabs.is-stacked { flex-wrap: wrap; column-gap: 4px; row-gap: 0; }
     1034/* Stacked folders as an index-card box (0.2.119): rows behind tuck under the one in front, showing a 26px strip,
     1035   each a shade darker, with a full-width card edge. A back folder lifts on touch (JS .is-lift) or hover. */
     1036.st-tabs.is-stacked { position: relative; flex-wrap: wrap; column-gap: 4px; row-gap: 0; }
    10351037.st-tabs.is-stacked .st-tabs-left,
    10361038.st-tabs.is-stacked .st-tabs-scroll,
    10371039.st-tabs.is-stacked .st-tabs-right { display: contents; }
    1038 .st-tabs.is-stacked .st-tab { margin-top: 4px; }
    1039 .st-tabs.is-stacked .st-tab.is-back { height: 38px; }
    1040 .st-tabs.is-stacked .st-tab.is-back .st-tab-face { height: 32px; filter: brightness(.965); }
     1040.st-tabs.is-stacked .st-tab { position: relative; pointer-events: none; }
     1041.st-tabs.is-stacked .st-tab-face { pointer-events: auto; box-shadow: 0 -3px 5px -3px rgba(40, 36, 30, .16); transition: transform .16s ease-out, filter .16s ease-out; }
     1042.st-tabs.is-stacked .st-tab.is-back { margin-bottom: -18px; }
     1043.st-tabs.is-stacked .st-tab.is-back .st-tab-face { align-items: flex-start; padding-top: 4px; box-sizing: border-box; filter: brightness(calc(1 - .035 * var(--depth, 1))); }
     1044.st-tabs.is-stacked .st-tab.is-back.is-lift .st-tab-face,
     1045.st-tabs.is-stacked .st-tab.is-back:active .st-tab-face { transform: translateY(-7px); filter: none; }
     1046@media (hover: hover) {
     1047        .st-tabs.is-stacked .st-tab.is-back:hover .st-tab-face { transform: translateY(-5px); filter: none; }
     1048}
     1049@media (prefers-reduced-motion: reduce) {
     1050        .st-tabs.is-stacked .st-tab-face { transition: none; }
     1051}
    10411052.st-tabs-break { flex-basis: 100%; height: 0; }
     1053.st-tabs-card { position: absolute; left: 0; right: 0; pointer-events: none; background: var(--st-tab-off); filter: brightness(calc(1 - .035 * var(--depth, 1))); box-shadow: 0 -3px 5px -3px rgba(40, 36, 30, .16); }
  • stubli/trunk/look/assets/js/stubli.js

    r3791468 r3793295  
    1414        window.addEventListener( 'pageshow', function ( e ) { if ( e.persisted && document.body && document.body.classList.contains( 'logged-in' ) ) { location.reload(); } } );
    1515
    16         /* Stacked folders (0.2.118, Celestine 8 Nov): when the folder tabs don't fit in one row, stack them in rows
    17            (CSS .is-stacked) instead of letting them slide under the icon tabs. The open folder's row moves to the
    18            bottom, against the photos; the rows behind it are marked .is-back. */
     16        /* Stacked folders as an index-card box (0.2.119, Celestine 9 Nov; first stacked in 0.2.118): when the folder tabs
     17           don't fit in one row they wrap into rows. The open folder's row is in front, against the photos, with Journal,
     18           Guest book and Favourites at its right (folders that don't fit beside them move back). Rows behind tuck under
     19           the one in front (CSS .is-stacked .is-back) and each gets a card edge (.st-tabs-card), a shade darker per row. */
    1920        function stackTabs() {
    2021                document.querySelectorAll( '.st-tabs' ).forEach( function ( nav ) {
    … …  
    2324                        if ( ! scroll ) { return; }
    2425                        nav.classList.remove( 'is-stacked' );
    25                         nav.querySelectorAll( '.st-tabs-break' ).forEach( function ( b ) { b.remove(); } );
    26                         tabs.forEach( function ( t ) { t.style.order = ''; t.style.marginLeft = ''; t.classList.remove( 'is-back' ); } );
     26                        nav.querySelectorAll( '.st-tabs-break, .st-tabs-card' ).forEach( function ( b ) { b.remove(); } );
     27                        tabs.forEach( function ( t ) { t.style.order = ''; t.style.marginLeft = ''; t.style.zIndex = ''; t.style.removeProperty( '--depth' ); t.classList.remove( 'is-back' ); } );
    2728                        if ( scroll.scrollWidth <= scroll.clientWidth + 1 ) { return; }
    28                         // Pack the folders into rows by their widths, in their own order.
    2929                        var gap = 4, room = nav.clientWidth, width = function ( t ) { return Math.ceil( t.getBoundingClientRect().width ); };
     30                        var rowW = function ( r ) { return r.reduce( function ( s, t ) { return s + width( t ) + gap; }, 0 ); };
    3031                        var icons = tabs.filter( function ( t ) { return t.classList.contains( 'st-tab-icon' ); } );
    3132                        var plain = tabs.filter( function ( t ) { return icons.indexOf( t ) < 0; } );
    32                         var iconsW = icons.reduce( function ( s, t ) { return s + width( t ) + gap; }, gap );
     33                        var iconsW = rowW( icons ) + gap;
     34                        // Pack the folders into rows by their widths, in their own order.
    3335                        var rows = [ [] ], used = 0;
    3436                        plain.forEach( function ( t ) {
    … …  
    3840                                rows[ rows.length - 1 ].push( t );
    3941                        } );
    40                         // The open folder's row goes last, against the photos; the others keep their order behind it.
     42                        // The open folder's row goes in front; the others keep their order behind it.
    4143                        var active = nav.querySelector( '.st-tab.is-active' );
    4244                        var ri = rows.findIndex( function ( r ) { return r.indexOf( active ) >= 0; } );
    4345                        if ( ri >= 0 ) { rows.push( rows.splice( ri, 1 )[ 0 ] ); }
    44                         // Journal, Guest book and Favourites stay together at the right of the bottom row, as on a
    45                         // computer; when that row has no room for them, they sit together at the right of a row of their own on top.
    46                         var lastW = rows[ rows.length - 1 ].reduce( function ( s, t ) { return s + width( t ) + gap; }, 0 );
    47                         var iconsOnTop = lastW + iconsW > room;
    48                         if ( iconsOnTop ) { rows.unshift( [] ); }
     46                        // Make room for the icon tabs in the front row: the other folders there move to a row just behind it.
     47                        var front = rows[ rows.length - 1 ], moved = [];
     48                        while ( front.length > 1 && rowW( front ) + iconsW > room ) {
     49                                moved.unshift( front.splice( front[ front.length - 1 ] === active ? 0 : front.length - 1, 1 )[ 0 ] );
     50                        }
     51                        if ( moved.length ) { rows.splice( rows.length - 1, 0, moved ); }
     52                        // Only when even the open folder alone has no room beside them do they get a back row of their own.
     53                        var iconsOwnRow = icons.length && rowW( front ) + iconsW > room;
     54                        if ( iconsOwnRow ) { rows.unshift( icons.slice() ); }
    4955                        nav.classList.add( 'is-stacked' );
    50                         var brk = function ( order ) {
    51                                 var b = document.createElement( 'span' );
    52                                 b.className = 'st-tabs-break'; b.setAttribute( 'aria-hidden', 'true' ); b.style.order = order;
    53                                 nav.appendChild( b );
    54                         };
    5556                        rows.forEach( function ( r, n ) {
    5657                                var last = n === rows.length - 1;
    57                                 r.forEach( function ( t ) { t.style.order = n * 2; if ( ! last ) { t.classList.add( 'is-back' ); } } );
    58                                 if ( ! last ) { brk( n * 2 + 1 ); }
    59                         } );
    60                         var at = iconsOnTop ? 0 : ( rows.length - 1 ) * 2;
    61                         icons.forEach( function ( t, i ) {
    62                                 t.style.order = at; t.style.marginLeft = 0 === i ? 'auto' : '';
    63                                 if ( iconsOnTop ) { t.classList.add( 'is-back' ); }
     58                                r.forEach( function ( t ) {
     59                                        t.style.order = n * 2; t.style.zIndex = n * 2 + 2;
     60                                        if ( ! last ) { t.classList.add( 'is-back' ); t.style.setProperty( '--depth', Math.min( 3, rows.length - 1 - n ) ); }
     61                                } );
     62                                if ( ! last ) {
     63                                        var b = document.createElement( 'span' );
     64                                        b.className = 'st-tabs-break'; b.setAttribute( 'aria-hidden', 'true' ); b.style.order = n * 2 + 1;
     65                                        nav.appendChild( b );
     66                                }
     67                        } );
     68                        if ( ! iconsOwnRow ) {
     69                                icons.forEach( function ( t, i ) { t.style.order = ( rows.length - 1 ) * 2; t.style.zIndex = rows.length * 2; t.style.marginLeft = 0 === i ? 'auto' : ''; } );
     70                        } else if ( icons.length ) { icons[ 0 ].style.marginLeft = 'auto'; }
     71                        // Each back row's card edge: a full-width band from the bottom of its tabs to the bottom of the row in front.
     72                        var navTop = nav.getBoundingClientRect().top;
     73                        var bottom = function ( r ) { return Math.max.apply( null, r.map( function ( t ) { return t.getBoundingClientRect().bottom; } ) ); };
     74                        rows.forEach( function ( r, n ) {
     75                                if ( n === rows.length - 1 ) { return; }
     76                                var top = bottom( r ), below = bottom( rows[ n + 1 ] );
     77                                var card = document.createElement( 'span' );
     78                                card.className = 'st-tabs-card'; card.setAttribute( 'aria-hidden', 'true' );
     79                                card.style.top = ( top - navTop - 1 ) + 'px'; card.style.height = ( below - top + 1 ) + 'px';
     80                                card.style.zIndex = n * 2 + 1; card.style.setProperty( '--depth', Math.min( 3, rows.length - 1 - n ) );
     81                                nav.appendChild( card );
    6482                        } );
    6583                } );
    … …  
    6987        var stackWait;
    7088        window.addEventListener( 'resize', function () { cancelAnimationFrame( stackWait ); stackWait = requestAnimationFrame( stackTabs ); } );
     89        // Lift on touch (Celestine 9 Nov): a folder in a back row rises as soon as a finger (or the mouse button) goes down, before it opens.
     90        document.addEventListener( 'pointerdown', function ( e ) {
     91                var t = e.target.closest && e.target.closest( '.st-tabs.is-stacked .st-tab.is-back' );
     92                if ( t ) { t.classList.add( 'is-lift' ); }
     93        } );
     94        [ 'pointerup', 'pointercancel' ].forEach( function ( ev ) {
     95                document.addEventListener( ev, function () { document.querySelectorAll( '.st-tab.is-lift' ).forEach( function ( t ) { t.classList.remove( 'is-lift' ); } ); }, true );
     96        } );
    7197
    7298        /* Reading mode: Light ↔ Paper. No dark mode since 0.2.117 (Celestine 8 Nov); a saved Auto or Dark reads as Light. */
  • stubli/trunk/readme.txt

    r3792180 r3793295  
    66Tested up to: 7.1
    77Requires PHP: 7.4
    8 Stable tag: 0.45.21
     8Stable tag: 0.45.22
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    100100== Changelog ==
    101101
     102= 0.45.22 =
     103* When your collections don't fit in one row, on your page and in the app, they now stack like cards in a box: the rows behind peek out above the one in front, and a tab lifts as soon as you touch it. On your page, Journal, guest book and Favourites stay beside the open collection instead of floating in a row of their own.
     104
    102105= 0.45.21 =
    103106* In the app, under You: when your collections don't fit in one row, they now stack in rows, so none hide behind Journal, arrange, guest book and Favourites. The one you have open sits nearest your photos.
  • stubli/trunk/wordgram.php

    r3792180 r3793295  
    33 * Plugin Name:       Stubli
    44 * Description:       Turns a WordPress site into a cosy, familiar photo-sharing home: a public profile with collections, a journal and a guest book, a private reader for the Stubli sites you follow, and comments between sites via Webmention.
    5  * Version:           0.45.21
     5 * Version:           0.45.22
    66 * Requires at least: 6.5
    77 * Requires PHP:      7.4
    … …  
    2222defined( 'ABSPATH' ) || exit;
    2323
    24 const VERSION        = '0.45.21';
     24const VERSION        = '0.45.22';
    2525const SCHEMA_VERSION = 5;
    2626const REST_NS        = 'stubli/v1';
Note: See TracChangeset for help on using the changeset viewer.