Dawnline 0.15.1

- Dropdowns (the ⋯ menu, the language picker, the page's QR card) open
  on a softer spring: they grow in without the wobble at the end
- Renaming a device on its card: the hint under the name and a refusal
  take the status's place as whole words, and after a save the status
  comes back the same way
- Cancelling a rename started while the status was still changing puts
  back what it said, not a mix of its old and new letters
This commit is contained in:
Aemeath committed 2026-10-22 18:01:01 +03:00
1 parent 3fadee87d3
commit 11673a2e2e
10 files changed
+53 -44

No files matched your search

+15 -15
View File
@@ -752,7 +752,7 @@ The ⋯ menu, the pick pills' popups and the page code card are one kind of thin
- **Glass** (`.drop`): Apple's iOS 26 Liquid Glass, Regular (Figma kit), in `tokens.css` `--glass-*`: on dark black 40% with a white 4% film (the kit's black 60% + white 6% at 67%), on light `rgba(245,245,245,.6)`; backdrop `blur 28, saturate 1.8`; a soft, even 1 px inner edge, no gradient (white 5% / black 4%); a shadow on light only, soft (`0 8 32` black 12%): on dark the edge sets it apart. Its own colours: text `#F5F5F5` / `#1A1A1A`, subtitles `#8A8A8A` / `#727272`, destructive `#FF383C` (`--bad`), separators a touch softer than the edge (white 4% / black 3%); a solid highlight (`raised` + `text` 8% / 11%). Nothing dims around one. Over the page and a sheet alike (z 60). - **Glass** (`.drop`): Apple's iOS 26 Liquid Glass, Regular (Figma kit), in `tokens.css` `--glass-*`: on dark black 40% with a white 4% film (the kit's black 60% + white 6% at 67%), on light `rgba(245,245,245,.6)`; backdrop `blur 28, saturate 1.8`; a soft, even 1 px inner edge, no gradient (white 5% / black 4%); a shadow on light only, soft (`0 8 32` black 12%): on dark the edge sets it apart. Its own colours: text `#F5F5F5` / `#1A1A1A`, subtitles `#8A8A8A` / `#727272`, destructive `#FF383C` (`--bad`), separators a touch softer than the edge (white 4% / black 3%); a solid highlight (`raised` + `text` 8% / 11%). Nothing dims around one. Over the page and a sheet alike (z 60).
- **Placement:** its nearest point 8 px from its button, under it where it fits, else over it; centred on it, 12 px inside the screen's edge. - **Placement:** its nearest point 8 px from its button, under it where it fits, else over it; centred on it, 12 px inside the screen's edge.
- **Motion:** in, a spring out of where it grows from (`scale .5, blur 6` on POP, a little overshoot); out, back towards it from where it stands (`scale .7, blur 4`, 110 ms EASE_IN): quicker than it came. - **Motion:** in, a spring out of where it grows from (`scale .5, blur 6` on SOFT, about 4% over: POP's 14% read as a wobble); out, back towards it from where it stands (`scale .7, blur 4`, 110 ms EASE_IN): quicker than it came.
- **Highlight** (`ui/glide.ts`): one for all of a dropdown's items (rows, segments), under their icons and words, solid and the same for every item (no tint for Reconnect or Remove), with the corners of what it is on. It fades in (160 ms) where the pointer or the keyboard is, glides from item to item on GLIDE (`spring(640, 40)`, about 2% over: place, size, corners), presses in to 0.97 with what it is on, and fades where the pointer leaves, or goes back to the item it rests on (a pick pill's picked segment, where it starts). - **Highlight** (`ui/glide.ts`): one for all of a dropdown's items (rows, segments), under their icons and words, solid and the same for every item (no tint for Reconnect or Remove), with the corners of what it is on. It fades in (160 ms) where the pointer or the keyboard is, glides from item to item on GLIDE (`spring(640, 40)`, about 2% over: place, size, corners), presses in to 0.97 with what it is on, and fades where the pointer leaves, or goes back to the item it rests on (a pick pill's picked segment, where it starts).
- **Shut by:** a press outside it and its button, its button again, Escape (only it: a sheet under it stays; focus goes back to its button), a choice, another dropdown opening (at once), a resize (at once). One at a time; the page holds its repaints while one is open. - **Shut by:** a press outside it and its button, its button again, Escape (only it: a sheet under it stays; focus goes back to its button), a choice, another dropdown opening (at once), a resize (at once). One at a time; the page holds its repaints while one is open.
@@ -840,10 +840,10 @@ A longer reason sits in `title` and, for a screen reader, in hidden text right a
**Rename on the card** (`flows/rename.ts`): the name is where it is changed. **Rename on the card** (`flows/rename.ts`): the name is where it is changed.
- **At rest:** an editable name is a button. Under the pointer a faint wash (`raised` + text 6%, radius 8) hugs its words. - **At rest:** an editable name is a button. Under the pointer a faint wash (`raised` + text 6%, radius 8) hugs its words.
- **Editing:** the name gives way to its own input in the same font and place, with no frame or fill: only the field's caret and selection (the name selected). The status line morphs to a hint in `text-2`. - **Editing:** the name gives way to its own input in the same font and place, with no frame or fill: only the field's caret and selection (the name selected). The status line blurs across to a hint in `text-2`: whole words, not letters (*Whole mode*), as the hint only stands in for the status.
- **Saving:** the words shimmer (see *Motion → Shimmer*), settle to solid, and the status morphs back from the hint, words and colour. - **Saving:** the words shimmer (see *Motion → Shimmer*), settle to solid, and the status blurs back from the hint, words and colour.
- **Cancelling:** the name it had comes back; the status turns back. - **Cancelling:** the name it had comes back; the status blurs back.
- **Refusal:** the words shake (no red ring here, the field has none) and the status line says why in `bad`, in its one line, in full on hover. - **Refusal:** the words shake (no red ring here, the field has none) and the status line blurs across to why in `bad`, in its one line, in full on hover.
**Add card:** a `button.dev.add`, min-height 144, centred, grey glass plus 36 and "Add device" in `text-2` 500. Hover raised + knob 45%, press `.98`. **Add card:** a `button.dev.add`, min-height 144, centred, grey glass plus 36 and "Add device" in `text-2` 500. Hover raised + knob 45%, press `.98`.
@@ -1093,8 +1093,8 @@ Computed from `spring()` and confirmed live: the published CSS variables read 57
| Token | k / c | ζ | Settles | Overshoot | 50% at | 90% at | Peak at | Used for | | Token | k / c | ζ | Settles | Overshoot | 50% at | 90% at | Peak at | Used for |
|---|---|---|---|---|---|---|---|---| |---|---|---|---|---|---|---|---|---|
| **BOUNCY** | 300 / 20 | 0.58 | 572 ms | **10.8%** | 78 ms | 133 ms | 222 ms | Toast in, a newly created device card popping in and the way's server icon pop | | **BOUNCY** | 300 / 20 | 0.58 | 572 ms | **10.8%** | 78 ms | 133 ms | 222 ms | Toast in, a newly created device card popping in and the way's server icon pop |
| **POP** | 520 / 24 | 0.53 | 544 ms | **14.3%** | 58 ms | 96 ms | 162 ms | ⋯ menu open, check icon after copy, the OS mark turning in | | **POP** | 520 / 24 | 0.53 | 544 ms | **14.3%** | 58 ms | 96 ms | 162 ms | Check icon after copy, the OS mark turning in |
| **SOFT** | 380 / 28 | 0.72 | 476 ms | 3.9% | 74 ms | 138 ms | 232 ms | Accordion rows and chevron, dialog open (computer) and its scrim | | **SOFT** | 380 / 28 | 0.72 | 476 ms | 3.9% | 74 ms | 138 ms | 232 ms | Dropdowns open (⋯ menu, pick pills, page code card), accordion rows and chevron, dialog open (computer) and its scrim |
| **SMOOTH** | 300 / 35 | 1.01 | 524 ms | 0 | 98 ms | 228 ms | — | Widths and heights (morph width, sheet height glide, sheet width, a card's and the notice's height on a repaint, the QR box's size), FLIP of cards and letters, picker pill trailing edge, flex-grow and the picked name's width, folds, tooltip glide, snap-back after a pull and its dim; the switch, the field's focus ring and the go button's colours (via CSS var) | | **SMOOTH** | 300 / 35 | 1.01 | 524 ms | 0 | 98 ms | 228 ms | — | Widths and heights (morph width, sheet height glide, sheet width, a card's and the notice's height on a repaint, the QR box's size), FLIP of cards and letters, picker pill trailing edge, flex-grow and the picked name's width, folds, tooltip glide, snap-back after a pull and its dim; the switch, the field's focus ring and the go button's colours (via CSS var) |
| **LEAD** | 520 / 46 | 1.01 | 396 ms | 0 | 74 ms | 173 ms | — | Leading edge of the stretching picker pill | | **LEAD** | 520 / 46 | 1.01 | 396 ms | 0 | 74 ms | 173 ms | — | Leading edge of the stretching picker pill |
| **QUICK** | 900 / 60 | 1.00 | 296 ms | 0 | 56 ms | 130 ms | — | ⋯ menu highlight following the pointer | | **QUICK** | 900 / 60 | 1.00 | 296 ms | 0 | 56 ms | 130 ms | — | ⋯ menu highlight following the pointer |
@@ -1187,7 +1187,7 @@ Every text that changes in place while visible morphs. Hover readouts over chart
- **Kerning correction:** each letter is nudged onto the plain text's kerned position, so the last frame lands exactly on the final text. - **Kerning correction:** each letter is nudged onto the plain text's kerned position, so the last frame lands exactly on the final text.
- **Done:** at the end the element holds plain text again, and an ellipsis box keeps its ellipsis. - **Done:** at the end the element holds plain text again, and an ellipsis box keeps its ellipsis.
**Whole mode** (`whole: true`, for words in a flowing sentence, app names, menu paths): old words `out, b4` 180 ms EASE_IN, new words `in, b4 → 0` 280 / 60 EASE_OUT. **Whole mode** (`whole: true`, for words in a flowing sentence, app names, menu paths, and the rename hint and refusals standing in for a card's status: `data-whole` on the line, so the repaint after a save blurs the status back too): old words `out, b4` 180 ms EASE_IN, new words `in, b4 → 0` 280 / 60 EASE_OUT.
**Colour** (`morphChanged` after a repaint): a text that takes another colour with its words (a status turning green) keeps the old colour on the words that leave, and the new words turn from it (280 ms EASE_OUT). **Colour** (`morphChanged` after a repaint): a text that takes another colour with its words (a status turning green) keeps the old colour on the words that leave, and the new words turn from it (280 ms EASE_OUT).
@@ -1272,13 +1272,13 @@ A click mid-way (a double click) turns every row and body back from where it sta
| What | Motion | Timing | | What | Motion | Timing |
|---|---|---| |---|---|---|
| Open | `in, s.9 → 1, b4 → 0`, origin at the button's corner (top right, or bottom right when above) | POP 544 | | Open | `in, s.5 → 1, b6 → 0`, origin at the button's side (see *Dropdowns*) | SOFT 476 |
| Close | from where it stands (one still popping in included) → `out, s.96, b3` | 120, EASE_IN | | Close | from where it stands (one still opening included) → `out, s.7, b4` | 110, EASE_IN |
| Highlight appears | opacity at the hovered item | 150, EASE_OUT | | Highlight appears | opacity at the hovered item | 160, EASE_OUT |
| Highlight moves | `translateY` to the next item; colour to its tone | QUICK 296; bg 150 | | Highlight moves | place, size and corners to the next item | GLIDE |
| Highlight leaves | opacity 0 when the pointer leaves the menu; back on an item while it still shows, it turns back and glides from where it stands | 150 | | Highlight leaves | opacity 0 when the pointer leaves the menu; back on an item while it still shows, it turns back and glides from where it stands | 160 |
QUICK replaced SMOOTH for the highlight because SMOOTH felt late: it reaches 90% at 130 ms against SMOOTH's 228 ms. POP (14% over) used to open every dropdown: from `scale .5` it overshot to about 1.07 and read as a wobble; SOFT tops out near 1.02.
#### 7. Toast #### 7. Toast
@@ -1405,7 +1405,7 @@ Words being saved (a name on its card) shimmer as an assistant's "thinking" line
- 0: Return; the words' copy laid over them dims to the muted base (240, standard curve), the caret steps aside; - 0: Return; the words' copy laid over them dims to the muted base (240, standard curve), the caret steps aside;
- +120: the first sweep sets off (1.8 s across, linear), then again after a 0.58 s rest, until the answer; - +120: the first sweep sets off (1.8 s across, linear), then again after a 0.58 s rest, until the answer;
- answer: the band holds where it is and the words fade back to their colour (480, standard curve); - answer: the band holds where it is and the words fade back to their colour (480, standard curve);
- then: the input gives way to the name (identical, nothing moves), the card is drawn again and its status morphs from the hint, words and colour. - then: the input gives way to the name (identical, nothing moves), the card is drawn again and its status blurs back from the hint (whole words), words and colour.
**Reconnect:** **Reconnect:**
+1 -1
View File
@@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-dawnline PKG_NAME:=luci-app-dawnline
PKG_VERSION:=0.15.0 PKG_VERSION:=0.15.1
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_LICENSE:=MIT PKG_LICENSE:=MIT
# po/<lang>/dawnline.po becomes luci-i18n-dawnline-<lang> (luci.mk), released # po/<lang>/dawnline.po becomes luci-i18n-dawnline-<lang> (luci.mk), released
@@ -1,6 +1,6 @@
"use strict";(()=>{var Xi=Object.create;var Xo=Object.defineProperty;var Ji=Object.getOwnPropertyDescriptor;var Zi=Object.getOwnPropertyNames;var ea=Object.getPrototypeOf,ta=Object.prototype.hasOwnProperty;var na=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var oa=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Zi(t))!ta.call(e,r)&&r!==n&&Xo(e,r,{get:()=>t[r],enumerable:!(o=Ji(t,r))||o.enumerable});return e};var ra=(e,t,n)=>(n=e!=null?Xi(ea(e)):{},oa(t||!e||!e.__esModule?Xo(n,"default",{value:e,enumerable:!0}):n,e));var qr=na((Fr,Wr)=>{"use strict";var Gr=(function(){var e=function(g,v){var d=236,u=17,l=g,b=n[v],y=null,p=0,C=null,k=[],A={},F=function(S,H){p=l*4+17,y=(function(L){for(var P=new Array(L),$=0;$<L;$+=1){P[$]=new Array(L);for(var I=0;I<L;I+=1)P[$][I]=null}return P})(p),N(0,0),N(p-7,0),N(0,p-7),Y(),q(),te(S,H),l>=7&&Z(S),C==null&&(C=Ie(l,b,k)),le(C,H)},N=function(S,H){for(var L=-1;L<=7;L+=1)if(!(S+L<=-1||p<=S+L))for(var P=-1;P<=7;P+=1)H+P<=-1||p<=H+P||(0<=L&&L<=6&&(P==0||P==6)||0<=P&&P<=6&&(L==0||L==6)||2<=L&&L<=4&&2<=P&&P<=4?y[S+L][H+P]=!0:y[S+L][H+P]=!1)},R=function(){for(var S=0,H=0,L=0;L<8;L+=1){F(!0,L);var P=r.getLostPoint(A);(L==0||S>P)&&(S=P,H=L)}return H},q=function(){for(var S=8;S<p-8;S+=1)y[S][6]==null&&(y[S][6]=S%2==0);for(var H=8;H<p-8;H+=1)y[6][H]==null&&(y[6][H]=H%2==0)},Y=function(){for(var S=r.getPatternPosition(l),H=0;H<S.length;H+=1)for(var L=0;L<S.length;L+=1){var P=S[H],$=S[L];if(y[P][$]==null)for(var I=-2;I<=2;I+=1)for(var G=-2;G<=2;G+=1)I==-2||I==2||G==-2||G==2||I==0&&G==0?y[P+I][$+G]=!0:y[P+I][$+G]=!1}},Z=function(S){for(var H=r.getBCHTypeNumber(l),L=0;L<18;L+=1){var P=!S&&(H>>L&1)==1;y[Math.floor(L/3)][L%3+p-8-3]=P}for(var L=0;L<18;L+=1){var P=!S&&(H>>L&1)==1;y[L%3+p-8-3][Math.floor(L/3)]=P}},te=function(S,H){for(var L=b<<3|H,P=r.getBCHTypeInfo(L),$=0;$<15;$+=1){var I=!S&&(P>>$&1)==1;$<6?y[$][8]=I:$<8?y[$+1][8]=I:y[p-15+$][8]=I}for(var $=0;$<15;$+=1){var I=!S&&(P>>$&1)==1;$<8?y[8][p-$-1]=I:$<9?y[8][15-$-1+1]=I:y[8][15-$-1]=I}y[p-8][8]=!S},le=function(S,H){for(var L=-1,P=p-1,$=7,I=0,G=r.getMaskFunction(H),W=p-1;W>0;W-=2)for(W==6&&(W-=1);;){for(var X=0;X<2;X+=1)if(y[P][W-X]==null){var oe=!1;I<S.length&&(oe=(S[I]>>>$&1)==1);var U=G(P,W-X);U&&(oe=!oe),y[P][W-X]=oe,$-=1,$==-1&&(I+=1,$=7)}if(P+=L,P<0||p<=P){P-=L,L=-L;break}}},me=function(S,H){for(var L=0,P=0,$=0,I=new Array(H.length),G=new Array(H.length),W=0;W<H.length;W+=1){var X=H[W].dataCount,oe=H[W].totalCount-X;P=Math.max(P,X),$=Math.max($,oe),I[W]=new Array(X);for(var U=0;U<I[W].length;U+=1)I[W][U]=255&S.getBuffer()[U+L];L+=X;var be=r.getErrorCorrectPolynomial(oe),ue=i(I[W],be.getLength()-1),Yo=ue.mod(be);G[W]=new Array(be.getLength()-1);for(var U=0;U<G[W].length;U+=1){var jo=U+Yo.getLength()-G[W].length;G[W][U]=jo>=0?Yo.getAt(jo):0}}for(var Qo=0,U=0;U<H.length;U+=1)Qo+=H[U].totalCount;for(var ao=new Array(Qo),fn=0,U=0;U<P;U+=1)for(var W=0;W<H.length;W+=1)U<I[W].length&&(ao[fn]=I[W][U],fn+=1);for(var U=0;U<$;U+=1)for(var W=0;W<H.length;W+=1)U<G[W].length&&(ao[fn]=G[W][U],fn+=1);return ao},Ie=function(S,H,L){for(var P=c.getRSBlocks(S,H),$=f(),I=0;I<L.length;I+=1){var G=L[I];$.put(G.getMode(),4),$.put(G.getLength(),r.getLengthInBits(G.getMode(),S)),G.write($)}for(var W=0,I=0;I<P.length;I+=1)W+=P[I].dataCount;if($.getLengthInBits()>W*8)throw"code length overflow. ("+$.getLengthInBits()+">"+W*8+")";for($.getLengthInBits()+4<=W*8&&$.put(0,4);$.getLengthInBits()%8!=0;)$.putBit(!1);for(;!($.getLengthInBits()>=W*8||($.put(d,8),$.getLengthInBits()>=W*8));)$.put(u,8);return me($,P)};A.addData=function(S,H){H=H||"Byte";var L=null;switch(H){case"Numeric":L=m(S);break;case"Alphanumeric":L=M(S);break;case"Byte":L=h(S);break;case"Kanji":L=x(S);break;default:throw"mode:"+H}k.push(L),C=null},A.isDark=function(S,H){if(S<0||p<=S||H<0||p<=H)throw S+","+H;return y[S][H]},A.getModuleCount=function(){return p},A.make=function(){if(l<1){for(var S=1;S<40;S++){for(var H=c.getRSBlocks(S,b),L=f(),P=0;P<k.length;P++){var $=k[P];L.put($.getMode(),4),L.put($.getLength(),r.getLengthInBits($.getMode(),S)),$.write(L)}for(var I=0,P=0;P<H.length;P++)I+=H[P].dataCount;if(L.getLengthInBits()<=I*8)break}l=S}F(!1,R())},A.createTableTag=function(S,H){S=S||2,H=typeof H=="undefined"?S*4:H;var L="";L+='<table style="',L+=" border-width: 0px; border-style: none;",L+=" border-collapse: collapse;",L+=" padding: 0px; margin: "+H+"px;",L+='">',L+="<tbody>";for(var P=0;P<A.getModuleCount();P+=1){L+="<tr>";for(var $=0;$<A.getModuleCount();$+=1)L+='<td style="',L+=" border-width: 0px; border-style: none;",L+=" border-collapse: collapse;",L+=" padding: 0px; margin: 0px;",L+=" width: "+S+"px;",L+=" height: "+S+"px;",L+=" background-color: ",L+=A.isDark(P,$)?"#000000":"#ffffff",L+=";",L+='"/>';L+="</tr>"}return L+="</tbody>",L+="</table>",L},A.createSvgTag=function(S,H,L,P){var $={};typeof arguments[0]=="object"&&($=arguments[0],S=$.cellSize,H=$.margin,L=$.alt,P=$.title),S=S||2,H=typeof H=="undefined"?S*4:H,L=typeof L=="string"?{text:L}:L||{Line truncated "use strict";(()=>{var Xi=Object.create;var Xo=Object.defineProperty;var Ji=Object.getOwnPropertyDescriptor;var Zi=Object.getOwnPropertyNames;var ea=Object.getPrototypeOf,ta=Object.prototype.hasOwnProperty;var na=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var oa=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Zi(t))!ta.call(e,r)&&r!==n&&Xo(e,r,{get:()=>t[r],enumerable:!(o=Ji(t,r))||o.enumerable});return e};var ra=(e,t,n)=>(n=e!=null?Xi(ea(e)):{},oa(t||!e||!e.__esModule?Xo(n,"default",{value:e,enumerable:!0}):n,e));var qr=na((Fr,Wr)=>{"use strict";var Gr=(function(){var e=function(g,v){var u=236,d=17,l=g,b=n[v],y=null,p=0,L=null,E=[],A={},F=function(S,H){p=l*4+17,y=(function(k){for(var D=new Array(k),$=0;$<k;$+=1){D[$]=new Array(k);for(var I=0;I<k;I+=1)D[$][I]=null}return D})(p),B(0,0),B(p-7,0),B(0,p-7),Y(),q(),te(S,H),l>=7&&Z(S),L==null&&(L=Be(l,b,E)),le(L,H)},B=function(S,H){for(var k=-1;k<=7;k+=1)if(!(S+k<=-1||p<=S+k))for(var D=-1;D<=7;D+=1)H+D<=-1||p<=H+D||(0<=k&&k<=6&&(D==0||D==6)||0<=D&&D<=6&&(k==0||k==6)||2<=k&&k<=4&&2<=D&&D<=4?y[S+k][H+D]=!0:y[S+k][H+D]=!1)},N=function(){for(var S=0,H=0,k=0;k<8;k+=1){F(!0,k);var D=r.getLostPoint(A);(k==0||S>D)&&(S=D,H=k)}return H},q=function(){for(var S=8;S<p-8;S+=1)y[S][6]==null&&(y[S][6]=S%2==0);for(var H=8;H<p-8;H+=1)y[6][H]==null&&(y[6][H]=H%2==0)},Y=function(){for(var S=r.getPatternPosition(l),H=0;H<S.length;H+=1)for(var k=0;k<S.length;k+=1){var D=S[H],$=S[k];if(y[D][$]==null)for(var I=-2;I<=2;I+=1)for(var G=-2;G<=2;G+=1)I==-2||I==2||G==-2||G==2||I==0&&G==0?y[D+I][$+G]=!0:y[D+I][$+G]=!1}},Z=function(S){for(var H=r.getBCHTypeNumber(l),k=0;k<18;k+=1){var D=!S&&(H>>k&1)==1;y[Math.floor(k/3)][k%3+p-8-3]=D}for(var k=0;k<18;k+=1){var D=!S&&(H>>k&1)==1;y[k%3+p-8-3][Math.floor(k/3)]=D}},te=function(S,H){for(var k=b<<3|H,D=r.getBCHTypeInfo(k),$=0;$<15;$+=1){var I=!S&&(D>>$&1)==1;$<6?y[$][8]=I:$<8?y[$+1][8]=I:y[p-15+$][8]=I}for(var $=0;$<15;$+=1){var I=!S&&(D>>$&1)==1;$<8?y[8][p-$-1]=I:$<9?y[8][15-$-1+1]=I:y[8][15-$-1]=I}y[p-8][8]=!S},le=function(S,H){for(var k=-1,D=p-1,$=7,I=0,G=r.getMaskFunction(H),W=p-1;W>0;W-=2)for(W==6&&(W-=1);;){for(var X=0;X<2;X+=1)if(y[D][W-X]==null){var oe=!1;I<S.length&&(oe=(S[I]>>>$&1)==1);var U=G(D,W-X);U&&(oe=!oe),y[D][W-X]=oe,$-=1,$==-1&&(I+=1,$=7)}if(D+=k,D<0||p<=D){D-=k,k=-k;break}}},me=function(S,H){for(var k=0,D=0,$=0,I=new Array(H.length),G=new Array(H.length),W=0;W<H.length;W+=1){var X=H[W].dataCount,oe=H[W].totalCount-X;D=Math.max(D,X),$=Math.max($,oe),I[W]=new Array(X);for(var U=0;U<I[W].length;U+=1)I[W][U]=255&S.getBuffer()[U+k];k+=X;var we=r.getErrorCorrectPolynomial(oe),ue=i(I[W],we.getLength()-1),Yo=ue.mod(we);G[W]=new Array(we.getLength()-1);for(var U=0;U<G[W].length;U+=1){var jo=U+Yo.getLength()-G[W].length;G[W][U]=jo>=0?Yo.getAt(jo):0}}for(var Qo=0,U=0;U<H.length;U+=1)Qo+=H[U].totalCount;for(var ao=new Array(Qo),fn=0,U=0;U<D;U+=1)for(var W=0;W<H.length;W+=1)U<I[W].length&&(ao[fn]=I[W][U],fn+=1);for(var U=0;U<$;U+=1)for(var W=0;W<H.length;W+=1)U<G[W].length&&(ao[fn]=G[W][U],fn+=1);return ao},Be=function(S,H,k){for(var D=c.getRSBlocks(S,H),$=f(),I=0;I<k.length;I+=1){var G=k[I];$.put(G.getMode(),4),$.put(G.getLength(),r.getLengthInBits(G.getMode(),S)),G.write($)}for(var W=0,I=0;I<D.length;I+=1)W+=D[I].dataCount;if($.getLengthInBits()>W*8)throw"code length overflow. ("+$.getLengthInBits()+">"+W*8+")";for($.getLengthInBits()+4<=W*8&&$.put(0,4);$.getLengthInBits()%8!=0;)$.putBit(!1);for(;!($.getLengthInBits()>=W*8||($.put(u,8),$.getLengthInBits()>=W*8));)$.put(d,8);return me($,D)};A.addData=function(S,H){H=H||"Byte";var k=null;switch(H){case"Numeric":k=m(S);break;case"Alphanumeric":k=M(S);break;case"Byte":k=h(S);break;case"Kanji":k=x(S);break;default:throw"mode:"+H}E.push(k),L=null},A.isDark=function(S,H){if(S<0||p<=S||H<0||p<=H)throw S+","+H;return y[S][H]},A.getModuleCount=function(){return p},A.make=function(){if(l<1){for(var S=1;S<40;S++){for(var H=c.getRSBlocks(S,b),k=f(),D=0;D<E.length;D++){var $=E[D];k.put($.getMode(),4),k.put($.getLength(),r.getLengthInBits($.getMode(),S)),$.write(k)}for(var I=0,D=0;D<H.length;D++)I+=H[D].dataCount;if(k.getLengthInBits()<=I*8)break}l=S}F(!1,N())},A.createTableTag=function(S,H){S=S||2,H=typeof H=="undefined"?S*4:H;var k="";k+='<table style="',k+=" border-width: 0px; border-style: none;",k+=" border-collapse: collapse;",k+=" padding: 0px; margin: "+H+"px;",k+='">',k+="<tbody>";for(var D=0;D<A.getModuleCount();D+=1){k+="<tr>";for(var $=0;$<A.getModuleCount();$+=1)k+='<td style="',k+=" border-width: 0px; border-style: none;",k+=" border-collapse: collapse;",k+=" padding: 0px; margin: 0px;",k+=" width: "+S+"px;",k+=" height: "+S+"px;",k+=" background-color: ",k+=A.isDark(D,$)?"#000000":"#ffffff",k+=";",k+='"/>';k+="</tr>"}return k+="</tbody>",k+="</table>",k},A.createSvgTag=function(S,H,k,D){var $={};typeof arguments[0]=="object"&&($=arguments[0],S=$.cellSize,H=$.margin,k=$.alt,D=$.title),S=S||2,H=typeof H=="undefined"?S*4:H,k=typeof k=="string"?{text:k}:k||{Line truncated
`}return L%2&&S>0?ue.substring(0,ue.length-L-1)+Array(L+1).join("▀"):ue.substring(0,ue.length-1)};return A.createASCII=function(S,H){if(S=S||1,S<2)return Ge(H);S-=1,H=typeof H=="undefined"?S*2:H;var L=A.getModuleCount()*S+H*2,P=H,$=L-H,I,G,W,X,oe=Array(S+1).join("██"),U=Array(S+1).join(" "),be="",ue="";for(I=0;I<L;I+=1){for(W=Math.floor((I-P)/S),ue="",G=0;G<L;G+=1)X=1,P<=G&&G<$&&P<=I&&I<$&&A.isDark(W,Math.floor((G-P)/S))&&(X=0),ue+=X?oe:U;for(W=0;W<S;W+=1)be+=ue+` `}return k%2&&S>0?ue.substring(0,ue.length-k-1)+Array(k+1).join("▀"):ue.substring(0,ue.length-1)};return A.createASCII=function(S,H){if(S=S||1,S<2)return Ie(H);S-=1,H=typeof H=="undefined"?S*2:H;var k=A.getModuleCount()*S+H*2,D=H,$=k-H,I,G,W,X,oe=Array(S+1).join("██"),U=Array(S+1).join(" "),we="",ue="";for(I=0;I<k;I+=1){for(W=Math.floor((I-D)/S),ue="",G=0;G<k;G+=1)X=1,D<=G&&G<$&&D<=I&&I<$&&A.isDark(W,Math.floor((G-D)/S))&&(X=0),ue+=X?oe:U;for(W=0;W<S;W+=1)we+=ue+`
`}return be.substring(0,be.length-1)},A.renderTo2dContext=function(S,H){H=H||2;for(var L=A.getModuleCount(),P=0;P<L;P++)for(var $=0;$<L;$++)S.fillStyle=A.isDark(P,$)?"black":"white",S.fillRect(P*H,$*H,H,H)},A};e.stringToBytesFuncs={default:function(g){for(var v=[],d=0;d<g.length;d+=1){var u=g.charCodeAt(d);v.push(u&255)}return v}},e.stringToBytes=e.stringToBytesFuncs.default,e.createStringToBytes=function(g,v){var d=(function(){for(var l=O(g),b=function(){var q=l.read();if(q==-1)throw"eof";return q},y=0,p={};;){var C=l.read();if(C==-1)break;var k=b(),A=b(),F=b(),N=String.fromCharCode(C<<8|k),R=A<<8|F;p[N]=R,y+=1}if(y!=v)throw y+" != "+v;return p})(),u=63;return function(l){for(var b=[],y=0;y<l.length;y+=1){var p=l.charCodeAt(y);if(p<128)b.push(p);else{var C=d[l.charAt(y)];typeof C=="number"?(C&255)==C?b.push(C):(b.push(C>>>8),b.push(C&255)):b.push(u)}}return b}};var t={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},n={L:1,M:0,Q:3,H:2},o={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},r=(function(){var g=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],v=1335,d=7973,u=21522,l={},b=function(y){for(var p=0;y!=0;)p+=1,y>>>=1;return p};return l.getBCHTypeInfo=function(y){for(var p=y<<10;b(p)-b(v)>=0;)p^=v<<b(p)-b(v);return(y<<10|p)^u},l.getBCHTypeNumber=function(y){for(var p=y<<12;b(p)-b(d)>=0;)p^=d<<b(p)-b(d);return y<<12|p},l.getPatternPosition=function(y){return g[y-1]},l.getMaskFunction=function(y){switch(y){case o.PATTERN000:return function(p,C){return(p+C)%2==0};case o.PATTERN001:return function(p,C){return p%2==0};case o.PATTERN010:return function(p,C){return C%3==0};case o.PATTERN011:return function(p,C){return(p+C)%3==0};case o.PATTERN100:return function(p,C){return(Math.floor(p/2)+Math.floor(C/3))%2==0};case o.PATTERN101:return function(p,C){return p*C%2+p*C%3==0};case o.PATTERN110:return function(p,C){return(p*C%2+p*C%3)%2==0};case o.PATTERN111:return function(p,C){return(p*C%3+(p+C)%2)%2==0};default:throw"bad maskPattern:"+y}},l.getErrorCorrectPolynomial=function(y){for(var p=i([1],0),C=0;C<y;C+=1)p=p.multiply(i([1,s.gexp(C)],0));return p},l.getLengthInBits=function(y,p){if(1<=p&&p<10)switch(y){case t.MODE_NUMBER:return 10;case t.MODE_ALPHA_NUM:return 9;case t.MODE_8BIT_BYTE:return 8;case t.MODE_KANJI:return 8;default:throw"mode:"+y}else if(p<27)switch(y){case t.MODE_NUMBER:return 12;case t.MODE_ALPHA_NUM:return 11;case t.MODE_8BIT_BYTE:return 16;case t.MODE_KANJI:return 10;default:throw"mode:"+y}else if(p<41)switch(y){case t.MODE_NUMBER:return 14;case t.MODE_ALPHA_NUM:return 13;case t.MODE_8BIT_BYTE:return 16;case t.MODE_KANJI:return 12;default:throw"mode:"+y}else throw"type:"+p},l.getLostPoint=function(y){for(var p=y.getModuleCount(),C=0,k=0;k<p;k+=1)for(var A=0;A<p;A+=1){for(var F=0,N=y.isDark(k,A),R=-1;R<=1;R+=1)if(!(k+R<0||p<=k+R))for(var q=-1;q<=1;q+=1)A+q<0||p<=A+q||R==0&&q==0||N==y.isDark(k+R,A+q)&&(F+=1);F>5&&(C+=3+F-5)}for(var k=0;k<p-1;k+=1)for(var A=0;A<p-1;A+=1){var Y=0;y.isDark(k,A)&&(Y+=1),y.isDark(k+1,A)&&(Y+=1),y.isDark(k,A+1)&&(Y+=1),y.isDark(k+1,A+1)&&(Y+=1),(Y==0||Y==4)&&(C+=3)}for(var k=0;k<p;k+=1)for(var A=0;A<p-6;A+=1)y.isDark(k,A)&&!y.isDark(k,A+1)&&y.isDark(k,A+2)&&y.isDark(k,A+3)&&y.isDark(k,A+4)&&!y.isDark(k,A+5)&&y.isDark(k,A+6)&&(C+=40);for(var A=0;A<p;A+=1)for(var k=0;k<p-6;k+=1)y.isDark(k,A)&&!y.isDark(k+1,A)&&y.isDark(k+2,A)&&y.isDark(k+3,A)&&y.isDark(k+4,A)&&!y.isDark(k+5,A)&&y.isDark(k+6,A)&&(C+=40);for(var Z=0,A=0;A<p;A+=1)for(var k=0;k<p;k+=1)y.isDark(k,A)&&(Z+=1);var te=Math.abs(100*Z/p/p-50)/5;return C+=te*10,C},l})(),s=(function(){for(var g=new Array(256),v=new Array(256),d=0;d<8;d+=1)g[d]=1<<d;for(var d=8;d<256;d+=1)g[d]=g[d-4]^g[d-5]^g[d-6]^g[d-8];for(var d=0;d<255;d+=1)v[g[d]]=d;var u={};return u.glog=function(l){if(l<1)throw"glog("+l+")";return v[l]},u.gexp=function(l){for(;l<0;)l+=255;for(;l>=256;)l-=255;return g[l]},u})();function i(g,v){if(typeof g.length=="undefined")throw g.length+"/"+v;var d=(function(){for(var l=0;l<g.length&&g[l]==0;)l+=1;for(var b=new Array(g.length-l+v),y=0;y<g.length-l;y+=1)b[y]=g[y+l];return b})(),u={};return u.getAt=function(l){return d[l]},u.getLength=function(){return d.length},u.multiply=function(l){for(var b=new Array(u.getLength()+l.getLength()-1),y=0;y<u.getLength();y+=1)for(var p=0;p<l.getLength();p+=1)b[y+p]^=s.gexp(s.glog(u.getAt(y))+s.glog(l.getAt(p)));return i(b,0)},u.mod=function(l){if(u.ge Line truncated `}return we.substring(0,we.length-1)},A.renderTo2dContext=function(S,H){H=H||2;for(var k=A.getModuleCount(),D=0;D<k;D++)for(var $=0;$<k;$++)S.fillStyle=A.isDark(D,$)?"black":"white",S.fillRect(D*H,$*H,H,H)},A};e.stringToBytesFuncs={default:function(g){for(var v=[],u=0;u<g.length;u+=1){var d=g.charCodeAt(u);v.push(d&255)}return v}},e.stringToBytes=e.stringToBytesFuncs.default,e.createStringToBytes=function(g,v){var u=(function(){for(var l=R(g),b=function(){var q=l.read();if(q==-1)throw"eof";return q},y=0,p={};;){var L=l.read();if(L==-1)break;var E=b(),A=b(),F=b(),B=String.fromCharCode(L<<8|E),N=A<<8|F;p[B]=N,y+=1}if(y!=v)throw y+" != "+v;return p})(),d=63;return function(l){for(var b=[],y=0;y<l.length;y+=1){var p=l.charCodeAt(y);if(p<128)b.push(p);else{var L=u[l.charAt(y)];typeof L=="number"?(L&255)==L?b.push(L):(b.push(L>>>8),b.push(L&255)):b.push(d)}}return b}};var t={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},n={L:1,M:0,Q:3,H:2},o={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},r=(function(){var g=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],v=1335,u=7973,d=21522,l={},b=function(y){for(var p=0;y!=0;)p+=1,y>>>=1;return p};return l.getBCHTypeInfo=function(y){for(var p=y<<10;b(p)-b(v)>=0;)p^=v<<b(p)-b(v);return(y<<10|p)^d},l.getBCHTypeNumber=function(y){for(var p=y<<12;b(p)-b(u)>=0;)p^=u<<b(p)-b(u);return y<<12|p},l.getPatternPosition=function(y){return g[y-1]},l.getMaskFunction=function(y){switch(y){case o.PATTERN000:return function(p,L){return(p+L)%2==0};case o.PATTERN001:return function(p,L){return p%2==0};case o.PATTERN010:return function(p,L){return L%3==0};case o.PATTERN011:return function(p,L){return(p+L)%3==0};case o.PATTERN100:return function(p,L){return(Math.floor(p/2)+Math.floor(L/3))%2==0};case o.PATTERN101:return function(p,L){return p*L%2+p*L%3==0};case o.PATTERN110:return function(p,L){return(p*L%2+p*L%3)%2==0};case o.PATTERN111:return function(p,L){return(p*L%3+(p+L)%2)%2==0};default:throw"bad maskPattern:"+y}},l.getErrorCorrectPolynomial=function(y){for(var p=i([1],0),L=0;L<y;L+=1)p=p.multiply(i([1,s.gexp(L)],0));return p},l.getLengthInBits=function(y,p){if(1<=p&&p<10)switch(y){case t.MODE_NUMBER:return 10;case t.MODE_ALPHA_NUM:return 9;case t.MODE_8BIT_BYTE:return 8;case t.MODE_KANJI:return 8;default:throw"mode:"+y}else if(p<27)switch(y){case t.MODE_NUMBER:return 12;case t.MODE_ALPHA_NUM:return 11;case t.MODE_8BIT_BYTE:return 16;case t.MODE_KANJI:return 10;default:throw"mode:"+y}else if(p<41)switch(y){case t.MODE_NUMBER:return 14;case t.MODE_ALPHA_NUM:return 13;case t.MODE_8BIT_BYTE:return 16;case t.MODE_KANJI:return 12;default:throw"mode:"+y}else throw"type:"+p},l.getLostPoint=function(y){for(var p=y.getModuleCount(),L=0,E=0;E<p;E+=1)for(var A=0;A<p;A+=1){for(var F=0,B=y.isDark(E,A),N=-1;N<=1;N+=1)if(!(E+N<0||p<=E+N))for(var q=-1;q<=1;q+=1)A+q<0||p<=A+q||N==0&&q==0||B==y.isDark(E+N,A+q)&&(F+=1);F>5&&(L+=3+F-5)}for(var E=0;E<p-1;E+=1)for(var A=0;A<p-1;A+=1){var Y=0;y.isDark(E,A)&&(Y+=1),y.isDark(E+1,A)&&(Y+=1),y.isDark(E,A+1)&&(Y+=1),y.isDark(E+1,A+1)&&(Y+=1),(Y==0||Y==4)&&(L+=3)}for(var E=0;E<p;E+=1)for(var A=0;A<p-6;A+=1)y.isDark(E,A)&&!y.isDark(E,A+1)&&y.isDark(E,A+2)&&y.isDark(E,A+3)&&y.isDark(E,A+4)&&!y.isDark(E,A+5)&&y.isDark(E,A+6)&&(L+=40);for(var A=0;A<p;A+=1)for(var E=0;E<p-6;E+=1)y.isDark(E,A)&&!y.isDark(E+1,A)&&y.isDark(E+2,A)&&y.isDark(E+3,A)&&y.isDark(E+4,A)&&!y.isDark(E+5,A)&&y.isDark(E+6,A)&&(L+=40);for(var Z=0,A=0;A<p;A+=1)for(var E=0;E<p;E+=1)y.isDark(E,A)&&(Z+=1);var te=Math.abs(100*Z/p/p-50)/5;return L+=te*10,L},l})(),s=(function(){for(var g=new Array(256),v=new Array(256),u=0;u<8;u+=1)g[u]=1<<u;for(var u=8;u<256;u+=1)g[u]=g[u-4]^g[u-5]^g[u-6]^g[u-8];for(var u=0;u<255;u+=1)v[g[u]]=u;var d={};return d.glog=function(l){if(l<1)throw"glog("+l+")";return v[l]},d.gexp=function(l){for(;l<0;)l+=255;for(;l>=256;)l-=255;return g[l]},d})();function i(g,v){if(typeof g.length=="undefined")throw g.length+"/"+v;var u=(function(){for(var l=0;l<g.length&&g[l]==0;)l+=1;for(var b=new Array(g.length-l+v),y=0;y<g.length-l;y+=1)b[y]=g[y+l];return b})(),d={};return d.getAt=function(l){return u[l]},d.getLength=function(){return u.length},d.multiply=function(l){for(var b=new Array(d.getLength()+l.getLength()-1),y=0;y<d.getLength();y+=1)for(var p=0;p<l.getLength();p+=1)b[y+p]^=s.gexp(s.glog(d.getAt(y))+s.glog(l.getAt(p)));return i(b,0)},d.mod=function(l){if(d.ge Line truncated
`),hostName:s,mtu:n.mtu,persistent_keep_alive:n.persistent_keep_alive,port:Number(n.port),psk_key:n.psk_key,server_pub_key:n.server_pub_key},c={containers:[{container:"amnezia-awg",awg:{isThirdPartyConfig:!0,last_config:JSON.stringify(i),port:String(n.port),protocol_version:o.header_protection_key?"3.1":"2",transport_proto:"udp"}}],defaultContainer:"amnezia-awg",description:t,hostName:s};return n.dns[0]&&(c.dns1=n.dns[0],c.dns2=n.dns[1]||n.dns[0]),c}function bc(e){let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function xc(e){let t=globalThis;if(typeof t.CompressionStream=="undefined")return null;try{let n=new t.Blob([e]).stream().pipeThrough(new t.CompressionStream("deflate")),o=new Uint8Array(await new t.Response(n).arrayBuffer()),r=new Uint8Array(4+o.length);return new DataView(r.buffer).setUint32(0,e.length,!1),r.set(o,4),r}catch{return null}}async function Oo(e,t,n=!0){let o=new TextEncoder().encode(JSON.stringify(vc(e,t))),r=n?await xc(o):null;return`vpn://${bc(r!=null?r:o)}`}var Us=e=>e.replace(/^vpn:\/\//,"");var Ys=["height","marginTop","marginBottom","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],wc={opacity:0,filter:"blur(2px)"};function js(e,t,n){let o=e.getAnimations();D(e,t,n),o.forEach(r=>r.cancel())}var Mc=new Set(["offset","computedOffset","easing","composite"]),Ec=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`);function Gt(...e){let t=[],n=[],o=new Set;for(let s of e)for(let i=s;i&&!o.has(i);i=i.parentElement)if(o.add(i),!(!(i instanceof HTMLElement)||i.classList.contains("closing")))for(let c of i.getAnimations()){let f=c.playState==="running"&&c.effect instanceof KeyframeEffect?c.effect.getKeyframes():[],m=f[f.length-1];if(m&&("width"in m||"maxWidth"in m)&&n.push({a:c,t:c.currentTime}),!(m!=null&&m.height)||m.height==="0px")continue;let M=getComputedStyle(i),h={},x={};for(let w of Object.keys(m))Mc.has(w)||(h[w]=M.getPropertyValue(Ec(w)),x[w]=m[w]);t.push({el:i,a:c,t:c.currentTime,cur:h,to:x})}if(!t.length)return;[...t,...n].forEach(s=>s.a.cancel());let r=t.map(s=>getComputedStyle(s.el).height);for(let s of n)s.a.play(),s.a.currentTime=s.t;t.forEach((s,i)=>{s.a.play(),Math.abs(parseFloat(r[i])-parseFloat(String(s.to.height)))<.5?s.a.currentTime=s.t:s.a.effect.setKeyframes([s.cur,{...s.to,height:r[i]}])})}function ut(e,t={}){let n=a("div",{class:`acc${t.inset?" inset":""}`}),o=e.map((h,x)=>{var v;let w=h.body.filter(d=>!!d),T=!w.length,O=[h.icon,a("span",{class:"acc-title"},a("span",{class:"t"},h.title),(v=h.tag)!=null?v:null),h.val?a("span",{class:`acc-val${h.valHide?" hide-open":""}`},h.val):null],B=x===t.open&&!T,E=T?a("div",{class:"acc-head"},...O):a("button",{type:"button",class:"acc-head","aria-expanded":String(B),onclick:()=>M(g)},...O,V("chevron","i acc-chev")),g=a("div",{class:`acc-row${T?" still":""}${B?" open":""}${h.aside?" has-aside":""}`},E,h.aside?a("div",{class:"acc-aside"},h.aside):null,a("div",{class:"acc-body"},...w));return n.appendChild(g),g}),r=h=>h.querySelector(".acc-body"),s=()=>{let h=o.filter(x=>!x.hidden);h.forEach((x,w)=>{let T=x.classList.contains("open");x.classList.toggle("rt",w===0||T||h[w-1].classList.contains("open")),x.classList.toggle("rb",w===h.length-1||T||h[w+1].classList.contains("open"))}),o.forEach(x=>{x.classList.toggle("first",x===h[0]),x.classList.toggle("last",x===h[h.length-1])})},i=h=>{let x=getComputedStyle(h),w={};for(let T of Ys)w[T]=T==="height"?`${h.getBoundingClientRect().height}px`:x[T];return w},c=()=>o.forEach(h=>{var x;return(x=h.querySelector("button.acc-head"))==null?void 0:x.setAttribute("aria-expanded",String(h.classList.contains("open")))}),f=h=>h.classList.contains("open")||h.classList.contains("closing"),m=h=>{if(!f(h))return wc;let x=getComputedStyle(r(h));return{opacity:x.opacity,filter:x.filter==="none"?"blur(0px)":x.filter}};function M(h){var v,d;let x=o.map(i),w=o.map(m),T=(v=t.hold)==null?void 0:v.call(t);o.forEach(u=>u.getAnimations().forEach(l=>l.cancel()));let O=!h.classList.contains("open"),B=o.filter(u=>f(u)&&!(u===h&&O));o.forEach(u=>{u.classList.remove("closing"),u!==h&&u.classList.remove("open")}),h.classList.toggle("open",O),O&&h.classList.add("opened"),s();let E=Ot(),g=o.map(i);if(T==null||T(),Gt(n.parentElement),o.forEach((u,l)=>{let b=()=>{u.classList.remove("closing"),u.classList.contains("open")||u.classList.remove("opened")};if(!Ys.some(y=>x[l][y]!==g[l][y]))return b();B.includes(u)&&u.classList.add("closing"),D(u,[x[l],g[l]],{duration:_e.duration,easing:_e.easing}).onfinish=b}),B.forEach(u=>{let l=w[o.indexOf(u)];js(r(u),[l,{opacity:0,filter:"blur(2px)"}],{duration:160*Number(l.opacity),easing:J,fill:"forwards"})}),O){let u=w[o.indexOf(h)];js(r(h),[u,{opacity:1,filter:"blur(0px)"}],{duration:300*(1-Number(u.opacity)),easing:"cubic-bezier(0,0,.58,1)"})}Rt(E),c(),(d=t.onToggle)==null||d.call(t,o.indexOf(h),O,!1)}return s(),{el:n,openInde Line truncated `),hostName:s,mtu:n.mtu,persistent_keep_alive:n.persistent_keep_alive,port:Number(n.port),psk_key:n.psk_key,server_pub_key:n.server_pub_key},c={containers:[{container:"amnezia-awg",awg:{isThirdPartyConfig:!0,last_config:JSON.stringify(i),port:String(n.port),protocol_version:o.header_protection_key?"3.1":"2",transport_proto:"udp"}}],defaultContainer:"amnezia-awg",description:t,hostName:s};return n.dns[0]&&(c.dns1=n.dns[0],c.dns2=n.dns[1]||n.dns[0]),c}function bc(e){let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function xc(e){let t=globalThis;if(typeof t.CompressionStream=="undefined")return null;try{let n=new t.Blob([e]).stream().pipeThrough(new t.CompressionStream("deflate")),o=new Uint8Array(await new t.Response(n).arrayBuffer()),r=new Uint8Array(4+o.length);return new DataView(r.buffer).setUint32(0,e.length,!1),r.set(o,4),r}catch{return null}}async function Oo(e,t,n=!0){let o=new TextEncoder().encode(JSON.stringify(vc(e,t))),r=n?await xc(o):null;return`vpn://${bc(r!=null?r:o)}`}var Us=e=>e.replace(/^vpn:\/\//,"");var Ys=["height","marginTop","marginBottom","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],wc={opacity:0,filter:"blur(2px)"};function js(e,t,n){let o=e.getAnimations();O(e,t,n),o.forEach(r=>r.cancel())}var Mc=new Set(["offset","computedOffset","easing","composite"]),Ec=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`);function Gt(...e){let t=[],n=[],o=new Set;for(let s of e)for(let i=s;i&&!o.has(i);i=i.parentElement)if(o.add(i),!(!(i instanceof HTMLElement)||i.classList.contains("closing")))for(let c of i.getAnimations()){let f=c.playState==="running"&&c.effect instanceof KeyframeEffect?c.effect.getKeyframes():[],m=f[f.length-1];if(m&&("width"in m||"maxWidth"in m)&&n.push({a:c,t:c.currentTime}),!(m!=null&&m.height)||m.height==="0px")continue;let M=getComputedStyle(i),h={},x={};for(let w of Object.keys(m))Mc.has(w)||(h[w]=M.getPropertyValue(Ec(w)),x[w]=m[w]);t.push({el:i,a:c,t:c.currentTime,cur:h,to:x})}if(!t.length)return;[...t,...n].forEach(s=>s.a.cancel());let r=t.map(s=>getComputedStyle(s.el).height);for(let s of n)s.a.play(),s.a.currentTime=s.t;t.forEach((s,i)=>{s.a.play(),Math.abs(parseFloat(r[i])-parseFloat(String(s.to.height)))<.5?s.a.currentTime=s.t:s.a.effect.setKeyframes([s.cur,{...s.to,height:r[i]}])})}function ut(e,t={}){let n=a("div",{class:`acc${t.inset?" inset":""}`}),o=e.map((h,x)=>{var v;let w=h.body.filter(u=>!!u),C=!w.length,R=[h.icon,a("span",{class:"acc-title"},a("span",{class:"t"},h.title),(v=h.tag)!=null?v:null),h.val?a("span",{class:`acc-val${h.valHide?" hide-open":""}`},h.val):null],P=x===t.open&&!C,T=C?a("div",{class:"acc-head"},...R):a("button",{type:"button",class:"acc-head","aria-expanded":String(P),onclick:()=>M(g)},...R,V("chevron","i acc-chev")),g=a("div",{class:`acc-row${C?" still":""}${P?" open":""}${h.aside?" has-aside":""}`},T,h.aside?a("div",{class:"acc-aside"},h.aside):null,a("div",{class:"acc-body"},...w));return n.appendChild(g),g}),r=h=>h.querySelector(".acc-body"),s=()=>{let h=o.filter(x=>!x.hidden);h.forEach((x,w)=>{let C=x.classList.contains("open");x.classList.toggle("rt",w===0||C||h[w-1].classList.contains("open")),x.classList.toggle("rb",w===h.length-1||C||h[w+1].classList.contains("open"))}),o.forEach(x=>{x.classList.toggle("first",x===h[0]),x.classList.toggle("last",x===h[h.length-1])})},i=h=>{let x=getComputedStyle(h),w={};for(let C of Ys)w[C]=C==="height"?`${h.getBoundingClientRect().height}px`:x[C];return w},c=()=>o.forEach(h=>{var x;return(x=h.querySelector("button.acc-head"))==null?void 0:x.setAttribute("aria-expanded",String(h.classList.contains("open")))}),f=h=>h.classList.contains("open")||h.classList.contains("closing"),m=h=>{if(!f(h))return wc;let x=getComputedStyle(r(h));return{opacity:x.opacity,filter:x.filter==="none"?"blur(0px)":x.filter}};function M(h){var v,u;let x=o.map(i),w=o.map(m),C=(v=t.hold)==null?void 0:v.call(t);o.forEach(d=>d.getAnimations().forEach(l=>l.cancel()));let R=!h.classList.contains("open"),P=o.filter(d=>f(d)&&!(d===h&&R));o.forEach(d=>{d.classList.remove("closing"),d!==h&&d.classList.remove("open")}),h.classList.toggle("open",R),R&&h.classList.add("opened"),s();let T=Ot(),g=o.map(i);if(C==null||C(),Gt(n.parentElement),o.forEach((d,l)=>{let b=()=>{d.classList.remove("closing"),d.classList.contains("open")||d.classList.remove("opened")};if(!Ys.some(y=>x[l][y]!==g[l][y]))return b();P.includes(d)&&d.classList.add("closing"),O(d,[x[l],g[l]],{duration:he.duration,easing:he.easing}).onfinish=b}),P.forEach(d=>{let l=w[o.indexOf(d)];js(r(d),[l,{opacity:0,filter:"blur(2px)"}],{duration:160*Number(l.opacity),easing:J,fill:"forwards"})}),R){let d=w[o.indexOf(h)];js(r(h),[d,{opacity:1,filter:"blur(0px)"}],{duration:300*(1-Number(d.opacity)),easing:"cubic-bezier(0,0,.58,1)"})}Rt(T),c(),(u=t.onToggle)==null||u.call(t,o.indexOf(h),R,!1)}return s(),{el:n,openInde Line truncated
`).flatMap((h,x)=>x?[` `).flatMap((h,x)=>x?[`
`,ei(h)]:[ei(h)])),o=!!at(e.filename,e.conf),r=V("key"),s=V("x"),i=a("span",{},_("Show key")),c=a("button",{type:"button",class:"btn soft sm",onclick:()=>{t=!t,ee(i,t?_("Hide key"):_("Show key")),n.querySelectorAll(".secret").forEach(h=>Xn(h,t,Js)),n.querySelectorAll(".mask").forEach(h=>Xn(h,!t,Js)),Xn(r,!t,Zs),Xn(s,t,Zs)}},ci(r,s),i),f=a("button",{type:"button",class:"btn soft sm",onclick:h=>ge(e.conf,_("Configuration copied"),h.currentTarget)},V("copy"),a("span",{class:"lbl"},_("Copy"))),m=a("div",{class:"filecard"},a("div",{class:"fc-row"},a("span",{class:"filecard-ic"},".conf"),a("span",{class:"t"},a("span",{class:"mono"},e.filename),a("span",{},_("For computers and routers")))),a("button",{type:"button",class:"btn accent sm block",onclick:()=>Xt(e.filename,e.conf)},V(o?"open":"download"),a("span",{},o?_("Share file"):_("Download")))),M=ut([{icon:ne("file"),title:_("Configuration"),body:[a("div",{class:"confbar"},c,f),n]}],{inset:!0});return a("div",{class:"step-box"},m,M.el)}function di(e){let t=a("span",{class:"osm-p"},we[e]),n=ds(Kt(e,"ios"),Kt(e,"android"));return{el:a("span",{class:"scanline"},a("span",{},...ht(_("In %s:"),t)),n.el),set(o){ee(t,we[o],void 0,{whole:!0}),n.set(Kt(o,"ios"),Kt(o,"android"))}}}function ui(e){let t=a("span",{class:"tt"}),n=a("span",{class:"tt-m"}),o=a("span",{class:"hp-tip","aria-hidden":"true"},t,n),r=a("button",{type:"button",class:"hp-b",onclick:()=>Xt(e().file,e().text)},V("download")),s=a("button",{type:"button",class:"hp-b"},V("copy")),i=a("div",{class:"hpill",role:"group","aria-label":_("The connection"),"data-key":"conn"},r,s,o),c=null,f=0,m=0,M=l=>{var b;return l===s&&s.classList.contains("done")?_("Copied"):(b=l.getAttribute("aria-label"))!=null?b:""},h=(l,b)=>{n.textContent=b;let y=n.offsetWidth+20;return Math.min(l.offsetLeft+l.offsetWidth/2,i.offsetWidth+30-y/2)},x=l=>`translateX(${l}px) translateX(-50%)`,w=()=>{let l=getComputedStyle(o);return{opacity:l.opacity,filter:l.filter==="none"?"blur(0px)":l.filter,transform:l.transform}},T=(l,b)=>{let y=o.getAnimations();D(o,l,b),y.forEach(p=>p.cancel())},O=l=>{let b=w();o.style.transform=x(l),T([b,{opacity:1,filter:"blur(0px)",transform:x(l)}],{duration:K.duration,easing:K.easing})},B=l=>ee(t,l),E=l=>{if(clearTimeout(f),c===l&&o.classList.contains("on"))return;if(c=l,o.classList.contains("on")||+getComputedStyle(o).opacity>0){let y=M(l);return o.classList.add("on"),O(h(l,y)),B(y)}let b=()=>{let y=M(l);se(t,y);let p=h(l,y);o.style.transform=x(p),o.classList.add("on"),T([{opacity:0,transform:`${x(p)} translateY(-3px) scale(.96)`,filter:"blur(3px)"},{opacity:1,transform:x(p),filter:"blur(0px)"}],{duration:220,easing:Q})};performance.now()<m?b():f=window.setTimeout(b,420)},g=()=>{if(clearTimeout(f),c=null,!o.classList.contains("on"))return;m=performance.now()+500;let l=w();o.classList.remove("on"),T([l,{...l,opacity:0}],{duration:120,easing:"ease-out"})};for(let l of[r,s])l.addEventListener("pointerenter",b=>{b.pointerType==="mouse"&&E(l)}),l.addEventListener("focus",()=>{l.matches(":focus-visible")&&E(l)}),l.addEventListener("blur",b=>{i.contains(b.relatedTarget)||g()});i.addEventListener("pointerleave",g);let v=l=>{let b=V(l);s.querySelector("svg").replaceWith(b),D(b,[{opacity:0,transform:"scale(.6)",filter:"blur(3px)"},{opacity:1,transform:"none",filter:"none"}],{duration:Se.duration,easing:Se.easing})},d=()=>{if(c!==s||!o.classList.contains("on"))return;let l=M(s);O(h(s,l)),B(l)},u=0;return s.addEventListener("click",()=>{let l=e();ge(l.text,l.msg),clearTimeout(u),s.classList.contains("done")||(s.classList.add("done"),v("check"),d()),u=window.setTimeout(()=>{s.classList.remove("done"),v("copy"),d()},1600)}),{el:i,sync(){let l=e().app;r.setAttribute("aria-label",z(_("Download %s config"),l)),s.setAttribute("aria-label",z(_("Copy %s config"),l))}}}function pi(e,t){var n,o,r;return e?((n=e.setup)==null?void 0:n.state)==="trying"?"trying":e.handshake<=t?"waiting":((o=e.setup)==null?void 0:o.state)==="flowing"?"connected":((r=e.setup)==null?void 0:r.state)==="nodata"?"nodata":"waiting":"waiting"}function Tc(e,t){switch(e){case"trying":return[_("Unable to complete the handshake"),_("Your network may be blocking the connection.")];case"connected":return[z(_("%s connected"),t.name),""];case"nodata":return[_("Handshake complete, but no data"),_("The router drops its traffic: the address does not match.")];case"waiting":return[_("Waiting for the connection"),""]}}var fi={waiting:"",trying:"trying",connected:"done",nodata:"nodata"};function hi(e){let t=a("b",{},_("Waiting for the connection")),n=a("span",{class:"ws",hidden:!0}),o=a("span",{class:"t"},t,n),r=a("div",{class:"way-text"},o),s=a("span",{class:"way-track"},a("span",{class:"way-glow"},a("span",{class:"run"},a("i")),a("span",{class:"knock"},a("i"))),a("span",{class:"way-fill"}),a("span",{class:"way-break"},a("i"))),i=a("div",{class:"way",role:"status","aria-live":"polite"},a("div",{class:"way-row"},a("span",{class:"way-end"},V(e.kind)),s,a("span",{class:"way-end ho Line truncated `,ei(h)]:[ei(h)])),o=!!at(e.filename,e.conf),r=V("key"),s=V("x"),i=a("span",{},_("Show key")),c=a("button",{type:"button",class:"btn soft sm",onclick:()=>{t=!t,ee(i,t?_("Hide key"):_("Show key")),n.querySelectorAll(".secret").forEach(h=>Xn(h,t,Js)),n.querySelectorAll(".mask").forEach(h=>Xn(h,!t,Js)),Xn(r,!t,Zs),Xn(s,t,Zs)}},ci(r,s),i),f=a("button",{type:"button",class:"btn soft sm",onclick:h=>ve(e.conf,_("Configuration copied"),h.currentTarget)},V("copy"),a("span",{class:"lbl"},_("Copy"))),m=a("div",{class:"filecard"},a("div",{class:"fc-row"},a("span",{class:"filecard-ic"},".conf"),a("span",{class:"t"},a("span",{class:"mono"},e.filename),a("span",{},_("For computers and routers")))),a("button",{type:"button",class:"btn accent sm block",onclick:()=>Xt(e.filename,e.conf)},V(o?"open":"download"),a("span",{},o?_("Share file"):_("Download")))),M=ut([{icon:ne("file"),title:_("Configuration"),body:[a("div",{class:"confbar"},c,f),n]}],{inset:!0});return a("div",{class:"step-box"},m,M.el)}function di(e){let t=a("span",{class:"osm-p"},Ee[e]),n=ds(Kt(e,"ios"),Kt(e,"android"));return{el:a("span",{class:"scanline"},a("span",{},...ht(_("In %s:"),t)),n.el),set(o){ee(t,Ee[o],void 0,{whole:!0}),n.set(Kt(o,"ios"),Kt(o,"android"))}}}function ui(e){let t=a("span",{class:"tt"}),n=a("span",{class:"tt-m"}),o=a("span",{class:"hp-tip","aria-hidden":"true"},t,n),r=a("button",{type:"button",class:"hp-b",onclick:()=>Xt(e().file,e().text)},V("download")),s=a("button",{type:"button",class:"hp-b"},V("copy")),i=a("div",{class:"hpill",role:"group","aria-label":_("The connection"),"data-key":"conn"},r,s,o),c=null,f=0,m=0,M=l=>{var b;return l===s&&s.classList.contains("done")?_("Copied"):(b=l.getAttribute("aria-label"))!=null?b:""},h=(l,b)=>{n.textContent=b;let y=n.offsetWidth+20;return Math.min(l.offsetLeft+l.offsetWidth/2,i.offsetWidth+30-y/2)},x=l=>`translateX(${l}px) translateX(-50%)`,w=()=>{let l=getComputedStyle(o);return{opacity:l.opacity,filter:l.filter==="none"?"blur(0px)":l.filter,transform:l.transform}},C=(l,b)=>{let y=o.getAnimations();O(o,l,b),y.forEach(p=>p.cancel())},R=l=>{let b=w();o.style.transform=x(l),C([b,{opacity:1,filter:"blur(0px)",transform:x(l)}],{duration:K.duration,easing:K.easing})},P=l=>ee(t,l),T=l=>{if(clearTimeout(f),c===l&&o.classList.contains("on"))return;if(c=l,o.classList.contains("on")||+getComputedStyle(o).opacity>0){let y=M(l);return o.classList.add("on"),R(h(l,y)),P(y)}let b=()=>{let y=M(l);se(t,y);let p=h(l,y);o.style.transform=x(p),o.classList.add("on"),C([{opacity:0,transform:`${x(p)} translateY(-3px) scale(.96)`,filter:"blur(3px)"},{opacity:1,transform:x(p),filter:"blur(0px)"}],{duration:220,easing:Q})};performance.now()<m?b():f=window.setTimeout(b,420)},g=()=>{if(clearTimeout(f),c=null,!o.classList.contains("on"))return;m=performance.now()+500;let l=w();o.classList.remove("on"),C([l,{...l,opacity:0}],{duration:120,easing:"ease-out"})};for(let l of[r,s])l.addEventListener("pointerenter",b=>{b.pointerType==="mouse"&&T(l)}),l.addEventListener("focus",()=>{l.matches(":focus-visible")&&T(l)}),l.addEventListener("blur",b=>{i.contains(b.relatedTarget)||g()});i.addEventListener("pointerleave",g);let v=l=>{let b=V(l);s.querySelector("svg").replaceWith(b),O(b,[{opacity:0,transform:"scale(.6)",filter:"blur(3px)"},{opacity:1,transform:"none",filter:"none"}],{duration:Fe.duration,easing:Fe.easing})},u=()=>{if(c!==s||!o.classList.contains("on"))return;let l=M(s);R(h(s,l)),P(l)},d=0;return s.addEventListener("click",()=>{let l=e();ve(l.text,l.msg),clearTimeout(d),s.classList.contains("done")||(s.classList.add("done"),v("check"),u()),d=window.setTimeout(()=>{s.classList.remove("done"),v("copy"),u()},1600)}),{el:i,sync(){let l=e().app;r.setAttribute("aria-label",z(_("Download %s config"),l)),s.setAttribute("aria-label",z(_("Copy %s config"),l))}}}function pi(e,t){var n,o,r;return e?((n=e.setup)==null?void 0:n.state)==="trying"?"trying":e.handshake<=t?"waiting":((o=e.setup)==null?void 0:o.state)==="flowing"?"connected":((r=e.setup)==null?void 0:r.state)==="nodata"?"nodata":"waiting":"waiting"}function Tc(e,t){switch(e){case"trying":return[_("Unable to complete the handshake"),_("Your network may be blocking the connection.")];case"connected":return[z(_("%s connected"),t.name),""];case"nodata":return[_("Handshake complete, but no data"),_("The router drops its traffic: the address does not match.")];case"waiting":return[_("Waiting for the connection"),""]}}var fi={waiting:"",trying:"trying",connected:"done",nodata:"nodata"};function hi(e){let t=a("b",{},_("Waiting for the connection")),n=a("span",{class:"ws",hidden:!0}),o=a("span",{class:"t"},t,n),r=a("div",{class:"way-text"},o),s=a("span",{class:"way-track"},a("span",{class:"way-glow"},a("span",{class:"run"},a("i")),a("span",{class:"knock"},a("i"))),a("span",{class:"way-fill"}),a("span",{class:"way-break"},a("i"))),i=a("div",{class:"way",role:"status","aria-live":"polite"},a("div",{class:"way-row"},a("span",{class:"way-end"},V(e.kind)),s,a("span",{class:"way-end ho Line truncated
@@ -5,7 +5,7 @@
import { open, readfile, writefile, rename, mkdir, stat, unlink, popen, lsdir } from 'fs'; import { open, readfile, writefile, rename, mkdir, stat, unlink, popen, lsdir } from 'fs';
import { _ } from 'dawnline.i18n'; import { _ } from 'dawnline.i18n';
export const VERSION = '0.15.0'; export const VERSION = '0.15.1';
/** GitHub repository with Dawnline releases (updates and the installer). */ /** GitHub repository with Dawnline releases (updates and the installer). */
export const REPO = 'tickcount/luci-app-dawnline'; export const REPO = 'tickcount/luci-app-dawnline';
export const RUN_DIR = '/var/run/dawnline'; export const RUN_DIR = '/var/run/dawnline';
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "dawnline-web", "name": "dawnline-web",
"version": "0.15.0", "version": "0.15.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "dawnline-web", "name": "dawnline-web",
"version": "0.15.0", "version": "0.15.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"qrcode-generator": "1.4.4" "qrcode-generator": "1.4.4"
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "dawnline-web", "name": "dawnline-web",
"version": "0.15.0", "version": "0.15.1",
"private": true, "private": true,
"license": "MIT", "license": "MIT",
"type": "module", "type": "module",
+19 -12
View File
@@ -1,9 +1,9 @@
// Renaming a device where its name stands on the card: a click on the name (or Rename in its ⋯ menu) turns it // Renaming a device where its name stands on the card: a click on the name (or Rename in its ⋯ menu) turns it
// into its own input, in the name's font and place, with nothing around it but the field's caret and selection // into its own input, in the name's font and place, with nothing around it but the field's caret and selection
// (ui/caret.ts), the name selected. The status line under it says how to finish. Return saves: the words shimmer // (ui/caret.ts), the name selected. The status line under it blurs across to how to finish. Return saves: the words
// while the router answers (ui/shimmer.ts), settle, and the card is drawn again with the new name, its status // shimmer while the router answers (ui/shimmer.ts), settle, and the card is drawn again with the new name, its
// morphing back from the hint. Esc or a click away puts the name it had back, whatever was typed. What the router // status blurring back from the hint. Esc or a click away puts the name it had back, whatever was typed. What the
// won't take never gets in (shared/name-guard.ts): the words shake and the status line says why in red; the // router won't take never gets in (shared/name-guard.ts): the words shake and the status line says why in red; the
// router's own refusals (a name taken) say so the same way. // router's own refusals (a name taken) say so the same way.
import type { Device } from '../../shared/types'; import type { Device } from '../../shared/types';
@@ -13,22 +13,25 @@ import { call } from '../api';
import { h } from '../dom'; import { h } from '../dom';
import { repaint, setState, state, type State } from '../state'; import { repaint, setState, state, type State } from '../state';
import { smoothCaret } from '../ui/caret'; import { smoothCaret } from '../ui/caret';
import { morphText } from '../ui/morph'; import { morphText, textOf } from '../ui/morph';
import { shimmer } from '../ui/shimmer'; import { shimmer } from '../ui/shimmer';
/** The status line's colours (page/devices.ts), and the red of a refusal. */ /** The status line's colours (page/devices.ts), and the red of a refusal. */
const TONES = ['ok-t', 'warn-t', 'here-t', 'bad-t']; const TONES = ['ok-t', 'warn-t', 'here-t', 'bad-t'];
/** /**
* The status line says something else in another tone: its words morph and the colour turns from the one it * The status line says something else in another tone: the hint or a refusal stands in for the status, so the
* had, as a repaint's status does. Only the tone classes change hands: a morph under way keeps its own. * words blur across whole (not letter by letter) and the colour turns from the one it had. Marked `data-whole`
* meanwhile: the repaint after a save brings the status back the same way. Only the tone classes change hands: a
* morph under way keeps its own.
*/ */
function say(stat: HTMLElement, text: string, tone: string, title = text) { function say(stat: HTMLElement, text: string, tone: string, title = text) {
const color = getComputedStyle(stat).color; const color = getComputedStyle(stat).color;
for (const t of TONES) stat.classList.toggle(t, t === tone); for (const t of TONES) stat.classList.toggle(t, t === tone);
// The line is one line: a long reason (the router's own) reads in full on hover. // The line is one line: a long reason (the router's own) reads in full on hover.
stat.title = title; stat.title = title;
morphText(stat, text, undefined, { color }); stat.dataset.whole = '';
morphText(stat, text, undefined, { color, whole: true });
} }
/** /**
@@ -54,7 +57,8 @@ export function renameOnCard(d: Device, card: HTMLElement) {
const name = card.querySelector<HTMLElement>('.dev-name'); const name = card.querySelector<HTMLElement>('.dev-name');
const stat = card.querySelector<HTMLElement>('.dev-stat'); const stat = card.querySelector<HTMLElement>('.dev-stat');
if (!name || !stat) return; if (!name || !stat) return;
const was = { text: stat.textContent ?? '', tone: TONES.find((t) => stat.classList.contains(t)) ?? '', title: stat.title }; // What it says, not what shows: still morphing (a rename just let go), it holds both its old and new letters.
const was = { text: textOf(stat), tone: TONES.find((t) => stat.classList.contains(t)) ?? '', title: stat.title };
// How to finish, where a keyboard says it; on a touch screen its Done key saves. // How to finish, where a keyboard says it; on a touch screen its Done key saves.
const hint = matchMedia('(pointer: fine)').matches ? _('Return to save, Esc to cancel') : ''; const hint = matchMedia('(pointer: fine)').matches ? _('Return to save, Esc to cancel') : '';
@@ -100,9 +104,12 @@ export function renameOnCard(d: Device, card: HTMLElement) {
if (saved) name.textContent = saved; if (saved) name.textContent = saved;
name.hidden = false; name.hidden = false;
form.remove(); form.remove();
// Saved: the hint stays for the repaint, which morphs it into the status (words and colour) as it does any // Saved: the hint stays for the repaint, which blurs it into the status (words and colour). Let go: it turns
// status that changed. Let go: it turns back here. // back here, and is the status again (a repaint morphs it letter by letter).
if (!saved) say(stat, was.text, was.tone, was.title); if (!saved) {
say(stat, was.text, was.tone, was.title);
delete stat.dataset.whole;
}
if (!back) return; if (!back) return;
// After a save the card is drawn again: the name is found anew then. // After a save the card is drawn again: the name is found anew then.
if (saved) if (saved)
+2 -2
View File
@@ -71,11 +71,11 @@ export function spring(k: number, c: number, m = 1): Spring {
export const BOUNCY = spring(300, 20); export const BOUNCY = spring(300, 20);
/** Pills, widths and heights: no overshoot. */ /** Pills, widths and heights: no overshoot. */
export const SMOOTH = spring(300, 35); export const SMOOTH = spring(300, 35);
/** Small things that pop: a check, a menu. */ /** Small things that pop: a check, a mark turning in. */
export const POP = spring(520, 24); export const POP = spring(520, 24);
/** The leading edge of a stretching pill: faster than SMOOTH, no overshoot. */ /** The leading edge of a stretching pill: faster than SMOOTH, no overshoot. */
export const LEAD = spring(520, 46); export const LEAD = spring(520, 46);
/** A dialog on a computer and the accordions: the menu's pop made softer (about 4% over, 90% there at ~140 ms). */ /** The dropdowns, a dialog on a computer and the accordions: POP made softer (about 4% over, 90% there at ~140 ms). */
export const SOFT = spring(380, 28); export const SOFT = spring(380, 28);
/** What follows the pointer (a menu's highlight): there in about 130 ms, no overshoot. */ /** What follows the pointer (a menu's highlight): there in about 130 ms, no overshoot. */
export const QUICK = spring(900, 60); export const QUICK = spring(900, 60);
+3 -3
View File
@@ -4,7 +4,7 @@
// towards it, from where it stands), and the same ways to shut it: a press outside it and its button, Escape (the // towards it, from where it stands), and the same ways to shut it: a press outside it and its button, Escape (the
// sheet under it stays; focus goes back to the button), a resize (at once). Each lays out and fills its own. // sheet under it stays; focus goes back to the button), a resize (at once). Each lays out and fills its own.
import { EASE_IN, POP, play } from '../motion'; import { EASE_IN, SOFT, play } from '../motion';
/** From its button, and from the screen's edge. */ /** From its button, and from the screen's edge. */
export const GAP = 8; export const GAP = 8;
@@ -26,7 +26,7 @@ function standing(el: Element): Keyframe {
return { opacity: s.opacity, transform: s.transform, filter: s.filter === 'none' ? 'blur(0px)' : s.filter }; return { opacity: s.opacity, transform: s.transform, filter: s.filter === 'none' ? 'blur(0px)' : s.filter };
} }
/** In: a spring out of its transform origin. */ /** In: a soft spring out of its transform origin (a little over, no wobble). */
export function appear(el: Element) { export function appear(el: Element) {
play( play(
el, el,
@@ -34,7 +34,7 @@ export function appear(el: Element) {
{ opacity: 0, transform: 'scale(.5)', filter: 'blur(6px)' }, { opacity: 0, transform: 'scale(.5)', filter: 'blur(6px)' },
{ opacity: 1, transform: 'none', filter: 'blur(0px)' }, { opacity: 1, transform: 'none', filter: 'blur(0px)' },
], ],
{ duration: POP.duration, easing: POP.easing }, { duration: SOFT.duration, easing: SOFT.easing },
); );
} }
+4 -2
View File
@@ -357,6 +357,8 @@ export function morphText(el: HTMLElement, next: string, from = textOf(el), o: M
export interface Said { export interface Said {
text: string; text: string;
color: string; color: string;
/** Its words change as a whole (`data-whole`: a hint standing in for a card's status): they blur across. */
whole: boolean;
} }
/** The keyed texts under `root` (`data-t`), before a repaint rebuilds them. */ /** The keyed texts under `root` (`data-t`), before a repaint rebuilds them. */
@@ -364,7 +366,7 @@ export function textsOf(root: ParentNode): Map<string, Said> {
return new Map( return new Map(
[...root.querySelectorAll<HTMLElement>('[data-t]')].map((el) => [ [...root.querySelectorAll<HTMLElement>('[data-t]')].map((el) => [
el.dataset.t!, el.dataset.t!,
{ text: textOf(el), color: getComputedStyle(el).color }, { text: textOf(el), color: getComputedStyle(el).color, whole: el.hasAttribute('data-whole') },
]), ]),
); );
} }
@@ -378,7 +380,7 @@ export function morphChanged(root: ParentNode, was: Map<string, Said>, fresh: El
const before = was.get(el.dataset.t!); const before = was.get(el.dataset.t!);
const now = textOf(el); const now = textOf(el);
if (!before || before.text === now || runs.has(el) || fresh.some((f) => f.contains(el))) return; if (!before || before.text === now || runs.has(el) || fresh.some((f) => f.contains(el))) return;
morphText(el, now, before.text, { color: before.color }); morphText(el, now, before.text, { color: before.color, whole: before.whole });
}); });
} }