Work on sync element, now a custom HTML element

This commit is contained in:
Magnus Åhall 2026-05-03 09:17:20 +02:00
parent 99063d34be
commit 9fc4a14ce3
10 changed files with 190 additions and 1001 deletions

View file

@ -1,5 +1,9 @@
@import "theme.css";
:root {
--content-width: 900px;
}
html {
background-color: #fff;
}
@ -10,19 +14,18 @@ html {
display: grid;
grid-template-areas:
"tree crumbs"
"tree sync"
"tree name"
"tree sync"
"tree content"
/*
"tree checklist"
"tree schedule"
"tree files"
*/
"tree blank"
;
grid-template-columns: min-content 1fr;
grid-template-rows:
48px 56px 48px min-content 1fr;
min-content min-content 48px 1fr;
@media only screen and (max-width: 600px) {
@ -33,7 +36,6 @@ html {
"content"
/*
"checklist"
"schedule"
"files"
*/
"blank"
@ -43,7 +45,14 @@ html {
#tree {
display: none;
}
n2-syncprogress {
.el-count {
top: 4px;
}
}
}
}
#tree {
@ -141,9 +150,10 @@ html {
display: grid;
align-items: start;
justify-items: center;
height: min-content;
margin: 16px 16px;
.crumbs {
n2-crumbs {
background: #e4e4e4;
display: flex;
flex-wrap: wrap;
@ -162,7 +172,7 @@ html {
}
}
.crumb {
n2-crumb {
margin-right: 8px;
cursor: pointer;
user-select: none;
@ -174,17 +184,17 @@ html {
}
}
.crumb:after {
content: "";
margin-left: 8px;
n2-crumb:after {
content: ">";
font-weight: bold;
color: var(--color1)
}
.crumb:last-child {
n2-crumb:last-child {
margin-right: 0;
}
.crumb:last-child:after {
n2-crumb:last-child:after {
content: '';
margin-left: 0px;
}
@ -193,143 +203,112 @@ html {
}
#sync-progress {
n2-syncprogress {
--radius: 8px;
display: grid;
grid-area: sync;
display: grid;
justify-items: center;
align-items: center;
width: 100%;
height: 56px;
position: relative;
.container {
position: relative;
opacity: 0;
transition: height 0s 500ms, opacity 500ms linear, visibility 0s 500ms;
progress {
width: 900px;
padding: 0 7px;
max-width: 900px;
height: 24px;
border-radius: 8px;
}
.count {
position: absolute;
top: 5px;
width: 100%;
white-space: nowrap;
color: #888;
text-align: center;
font-size: 12pt;
font-weight: bold;
}
progress[value]::-webkit-progress-bar {
background-color: #eee;
box-shadow: 0 2px var(--radius) rgba(0, 0, 0, 0.25) inset;
border-radius: var(--radius);
}
progress[value]::-moz-progress-bar {
background-color: #eee;
box-shadow: 0 2px var(--radius) rgba(0, 0, 0, 0.25) inset;
border-radius: var(--radius);
}
progress[value]::-webkit-progress-value {
background: rgb(186, 95, 89);
background: linear-gradient(180deg, rgba(186, 95, 89, 1) 0%, rgba(254, 95, 85, 1) 50%, rgba(186, 95, 89, 1) 100%);
border-radius: var(--radius);
}
progress[value]::-moz-progress-value {
background: rgb(186, 95, 89);
background: linear-gradient(180deg, rgba(186, 95, 89, 1) 0%, rgba(254, 95, 85, 1) 50%, rgba(186, 95, 89, 1) 100%);
border-radius: var(--radius);
}
&.show {
opacity: 1;
transition: visibility, height 0s, opacity 500ms linear;
}
&.hidden {
visibility: hidden;
opacity: 0;
transition: visibility 0s 500ms, opacity 500ms linear;
progress {
width: calc(100% - 32px);
max-width: var(--content-width);
height: 24px;
border-radius: 8px;
}
}
.count {
position: absolute;
top: 16px;
width: 100%;
white-space: nowrap;
color: #888;
text-align: center;
font-size: 12pt;
font-weight: bold;
}
#name {
color: #333;
font-weight: bold;
text-align: center;
font-size: 1.15em;
margin-top: 0px;
margin-bottom: 16px;
}
progress[value]::-webkit-progress-bar {
background-color: #eee;
box-shadow: 0 2px var(--radius) rgba(0, 0, 0, 0.25) inset;
border-radius: var(--radius);
}
/* ============================================================= *
* Textarea replicates the height of an element expanding height *
* ============================================================= */
.grow-wrap {
/* easy way to plop the elements on top of each other and have them both sized based on the tallest one's height */
display: grid;
grid-area: content;
font-size: 1.0em;
}
progress[value]::-moz-progress-bar {
background-color: #eee;
box-shadow: 0 2px var(--radius) rgba(0, 0, 0, 0.25) inset;
border-radius: var(--radius);
}
.grow-wrap::after {
/* Note the weird space! Needed to preventy jumpy behavior */
content: attr(data-replicated-value) " ";
progress[value]::-webkit-progress-value {
background: rgb(186, 95, 89);
background: linear-gradient(180deg, rgba(186, 95, 89, 1) 0%, rgba(254, 95, 85, 1) 50%, rgba(186, 95, 89, 1) 100%);
border-radius: var(--radius);
}
/* This is how textarea text behaves */
width: calc(100% - 32px);
max-width: 900px;
white-space: pre-wrap;
word-wrap: break-word;
background: rgba(0, 255, 255, 0.5);
justify-self: center;
progress[value]::-moz-progress-value {
background: rgb(186, 95, 89);
background: linear-gradient(180deg, rgba(186, 95, 89, 1) 0%, rgba(254, 95, 85, 1) 50%, rgba(186, 95, 89, 1) 100%);
border-radius: var(--radius);
}
/* Hidden from view, clicks, and screen readers */
visibility: hidden;
}
.grow-wrap>textarea {
/* You could leave this, but after a user resizes, then it ruins the auto sizing */
resize: none;
/* Firefox shows scrollbar on growth, you can hide like this. */
overflow: hidden;
}
.grow-wrap>textarea,
.grow-wrap::after {
/* Identical styling required!! */
padding: 0.5rem;
font: inherit;
/* Place on top of each other */
grid-area: 1 / 1 / 2 / 2;
}
/* ============================================================= */
#node-content {
justify-self: center;
word-wrap: break-word;
font-family: monospace;
color: #333;
width: calc(100% - 32px);
max-width: 900px;
resize: none;
border: none;
outline: none;
n2-nodeui {
margin-bottom: 32px;
&:invalid {
background: #f5f5f5;
padding-top: 16px;
.el-name {
color: #333;
font-weight: bold;
text-align: center;
font-size: 1.15em;
margin-top: 8px;
margin-bottom: 0px;
}
.el-node-content {
justify-self: center;
word-wrap: break-word;
font-family: monospace;
color: #333;
/*
width: 100%;
max-width: var(--content-width);
field-sizing: content;
*/
width: calc(100% - 32px);
max-width: var(--content-width);
field-sizing: content;
resize: none;
border: none;
outline: none;
padding: 16px 0;
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
margin-bottom: 32px;
&:invalid {
background: #f5f5f5;
padding-top: 16px;
}
}
}