Notes/static/css/main.css
2024-01-09 16:28:40 +01:00

628 lines
13 KiB
CSS

/*
@theme_gradient: linear-gradient(to right, #009fff, #ec2f4b);
@theme_gradient: linear-gradient(to right, #f5af19, #f12711);
@theme_gradient: linear-gradient(to right, #fdc830, #f37335);
@theme_gradient: linear-gradient(to right, #8a2387, #e94057, #f27121);
@theme_gradient: linear-gradient(to right, #659999, #f4791f);
*/
html {
box-sizing: border-box;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
[onClick] {
cursor: pointer;
}
html,
body {
margin: 0px;
padding: 0px;
font-family: 'Liberation Mono', monospace;
font-size: 11pt;
background-color: #fff;
height: 100%;
}
h1 {
margin-top: 0px;
font-size: 1.5em;
}
h2 {
margin-top: 32px;
font-size: 1.25em;
}
button {
font-size: 1em;
padding: 6px;
}
#blackout {
position: absolute;
left: 0px;
right: 0px;
top: 0px;
bottom: 0px;
z-index: 1024;
background: rgba(0, 0, 0, 0.35);
}
#menu {
position: absolute;
top: 24px;
right: 24px;
background: #fff;
color: #000;
border: 2px solid #000;
box-shadow: 5px 5px 8px 0px rgba(0, 0, 0, 0.5);
z-index: 1025;
width: min-content;
}
#menu .section {
padding: 16px 16px 0px 16px;
font-weight: bold;
white-space: nowrap;
color: #c84a37;
}
#menu .item {
padding: 16px;
border-bottom: 1px solid #aaa;
user-select: none;
-webkit-tap-highlight-color: transparent;
}
#menu .item.separator {
border-bottom: 2px solid #000;
}
#menu .item:hover {
background: #ddd;
}
#menu .item:last-child {
border-bottom: none;
}
#upload {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #333;
background: #fff;
border: 2px solid #000;
padding: 16px;
z-index: 1025;
}
#upload input {
border: 1px solid #000;
}
#upload .files {
display: grid;
grid-template-columns: 1fr min-content;
padding-top: 12px;
}
#upload .files .file {
margin-top: 8px;
padding-top: 8px;
border-top: 1px solid #ddd;
}
#upload .files .file:nth-child(1) {
padding-top: 0px;
margin-top: 0px;
border-top: none;
}
#upload .files .file.done {
color: #0a0;
}
#upload .files .progress {
justify-self: end;
margin-top: 8px;
padding-top: 8px;
padding-left: 8px;
border-top: 1px solid #ddd;
}
#upload .files .progress:nth-child(2) {
padding-top: 0px;
margin-top: 0px;
border-top: none;
}
#upload .files .progress.done {
color: #0a0;
}
#properties {
color: #333;
padding: 16px;
}
#properties .key {
margin-top: 8px;
}
#properties .key.locked {
color: #888;
}
#properties .key.locked:after {
content: " (locked)";
}
#properties .key label {
margin-left: 8px;
}
header {
display: grid;
grid-area: header;
grid-template-columns: min-content 1fr repeat(4, min-content);
align-items: center;
padding: 8px 0px;
color: #333c11;
background: linear-gradient(to right, #3e5151, #decba4);
color: #fff;
}
header.modified {
background: #c84a37;
color: #faedeb;
}
header .tree {
padding-left: 16px;
}
header .tree img {
display: block;
height: 24px;
width: 24px;
}
header .name {
font-weight: bold;
padding-left: 16px;
font-size: 1.25em;
}
header .markdown,
header .search,
header .add,
header .keys {
padding-right: 16px;
}
header .markdown img,
header .search img,
header .add img,
header .keys img {
cursor: pointer;
height: 24px;
}
header .menu {
font-size: 1.75em;
padding-right: 16px;
cursor: pointer;
user-select: none;
-webkit-tap-highlight-color: transparent;
}
#tree {
grid-area: tree;
padding: 16px;
background-color: #333;
color: #ddd;
}
#tree .node {
display: grid;
grid-template-columns: 24px min-content;
grid-template-rows: min-content 1fr;
margin-top: 12px;
}
#tree .node .expand-toggle img {
width: 16px;
height: 16px;
}
#tree .node .name {
white-space: nowrap;
cursor: pointer;
user-select: none;
}
#tree .node .name:hover {
color: #ecbf00;
}
#tree .node .name.selected {
color: #ecbf00;
font-weight: bold;
}
#tree .node .children {
padding-left: 24px;
margin-left: 8px;
border-left: 1px solid #555;
grid-column: 1 / -1;
}
#tree .node .children.collapsed {
display: none;
}
#crumbs {
grid-area: crumbs;
background: linear-gradient(to right, #fdc830, #f37335);
}
.crumbs {
display: flex;
flex-wrap: wrap;
padding: 8px 16px;
background: #505050;
color: #fff;
box-shadow: 0px 5px 8px 0px rgba(128, 128, 128, 0.5);
}
.crumbs .crumb {
margin-right: 8px;
cursor: pointer;
user-select: none;
-webkit-tap-highlight-color: transparent;
}
.crumbs .crumb:after {
content: "•";
margin-left: 8px;
color: #abc837;
}
.crumbs .crumb:last-child {
margin-right: 0;
}
.crumbs .crumb:last-child:after {
content: '';
margin-left: 0px;
}
.child-nodes {
grid-area: child-nodes;
display: flex;
flex-wrap: wrap;
padding: 16px 16px 0px 16px;
}
.child-nodes .child-node {
padding: 8px;
border-radius: 8px;
background-color: #333;
margin-right: 12px;
margin-bottom: 16px;
white-space: nowrap;
cursor: pointer;
user-select: none;
-webkit-tap-highlight-color: transparent;
}
.node-name {
grid-area: name;
background: #fff;
color: #000;
text-align: center;
font-weight: bold;
margin-top: 32px;
margin-bottom: 32px;
font-size: 1.5em;
}
#notes-version {
margin-top: 64px;
color: #888;
text-align: center;
}
#node-content.encrypted {
color: #a00;
}
.node-content {
grid-area: 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;
}
.node-content:invalid {
background: #f5f5f5;
padding-top: 16px;
}
#markdown {
padding: 16px;
color: #333;
grid-area: content;
max-width: 900px;
}
#markdown table {
border-collapse: collapse;
}
#markdown table th,
#markdown table td {
border: 1px solid #ddd;
padding: 4px 8px;
}
/* ============================================================= *
* 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: 1em;
}
.grow-wrap::after {
/* Note the weird space! Needed to preventy jumpy behavior */
content: attr(data-replicated-value) " ";
/* This is how textarea text behaves */
width: calc(100% - 32px);
max-width: 900px;
white-space: pre-wrap;
word-wrap: break-word;
color: #f0f;
background: rgba(0, 255, 255, 0.5);
justify-self: center;
/* 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;
}
/* ============================================================= */
#file-section {
grid-area: files;
justify-self: center;
width: calc(100% - 32px);
max-width: 900px;
padding: 32px;
background: #f5f5f5;
border-radius: 8px;
margin-top: 32px;
margin-bottom: 32px;
}
#file-section .header {
font-weight: bold;
color: #000;
margin-bottom: 16px;
}
#file-section .files {
display: grid;
grid-template-columns: 1fr min-content;
grid-gap: 8px 16px;
color: #444;
}
#file-section .files .filename {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
}
#file-section .files .filename:hover {
text-decoration: underline;
}
#file-section .files .size {
white-space: nowrap;
text-align: right;
}
#keys {
padding: 32px;
color: #333;
}
#keys p {
max-width: 80ex;
}
#keys .key-list {
display: grid;
grid-template-columns: min-content min-content min-content;
grid-gap: 12px 12px;
align-items: end;
margin-top: 16px;
}
#keys .key-list .status {
cursor: pointer;
}
#keys .key-list .status img {
height: 32px;
}
#keys .key-list .status .locked {
color: #a00;
}
#keys .key-list .status .unlocked {
color: #0a0;
}
#keys .key-list .description {
cursor: pointer;
padding-bottom: 4px;
user-select: none;
text-decoration: underline;
white-space: nowrap;
}
#keys .key-list .view {
cursor: pointer;
padding-bottom: 4px;
margin-left: 16px;
user-select: none;
text-decoration: underline;
white-space: nowrap;
}
#keys .key-list .hex-key {
grid-column: 1 / -1;
border: 1px solid #aaa;
padding: 16px;
margin-bottom: 16px;
}
#key-create .fields {
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: 16px;
max-width: 48ex;
}
#key-create .fields #key-description {
grid-column: 1 / -1;
font-size: 1em;
font-family: monospace;
}
#key-create .fields #key-key {
grid-column: 1 / -1;
height: 4em;
resize: none;
font-size: 1em;
}
#key-create .fields #key-pass1,
#key-create .fields #key-pass2 {
font-size: 1em;
}
#key-create .fields button.generate {
margin-right: 16px;
}
.layout-tree {
display: grid;
grid-template-areas: "header header" "tree crumbs" "tree child-nodes" "tree name" "tree content" "tree files" "tree blank";
grid-template-columns: min-content 1fr;
grid-template-rows: min-content /* header */ min-content /* crumbs */ min-content /* child-nodes */ min-content /* name */ min-content /* content */ min-content /* files */ 1fr;
/* blank */
color: #fff;
min-height: 100%;
}
.layout-tree-only {
display: grid;
grid-template-areas: "header" "tree";
grid-template-columns: 1fr;
grid-template-rows: min-content /* header */ 1fr;
/* blank */
color: #fff;
min-height: 100%;
}
.layout-tree-only #crumbs {
display: none;
}
.layout-tree-only .child-nodes {
display: none;
}
.layout-tree-only .node-name {
display: none;
}
.layout-tree-only .grow-wrap {
display: none;
}
.layout-tree-only #file-section {
display: none;
}
.layout-tree-only #tree {
display: block;
}
.layout-crumbs {
grid-template-areas: "header" "crumbs" "child-nodes" "name" "content" "files" "blank";
grid-template-columns: 1fr;
grid-template-rows: min-content /* header */ min-content /* crumbs */ min-content /* child-nodes */ min-content /* name */ min-content /* content */ min-content /* files */ 1fr;
/* blank */
}
.layout-crumbs #tree {
display: none;
}
.layout-keys {
display: grid;
grid-template-areas: "header" "keys";
grid-template-columns: 1fr;
grid-template-rows: min-content /* header */ 1fr;
/* blank */
color: #fff;
height: 100%;
}
.layout-keys #crumbs {
display: none;
}
.layout-keys .child-nodes {
display: none;
}
.layout-keys .node-name {
display: none;
}
.layout-keys .grow-wrap {
display: none;
}
.layout-keys #file-section {
display: none;
}
.layout-keys #tree {
display: none;
}
.layout-keys #keys {
display: block;
}
#app.login {
padding-top: 64px;
display: grid;
grid-template-columns: minmax(min-content, 300px);
justify-content: center;
}
#app.node {
display: grid;
grid-template-areas: "header header" "tree crumbs" "tree child-nodes" "tree name" "tree content" "tree files" "tree blank";
grid-template-columns: min-content 1fr;
grid-template-rows: min-content /* header */ min-content /* crumbs */ min-content /* child-nodes */ min-content /* name */ min-content /* content */ min-content /* files */ 1fr;
/* blank */
color: #fff;
min-height: 100%;
}
#app.node.toggle-tree {
grid-template-areas: "header" "crumbs" "child-nodes" "name" "content" "files" "blank";
grid-template-columns: 1fr;
grid-template-rows: min-content /* header */ min-content /* crumbs */ min-content /* child-nodes */ min-content /* name */ min-content /* content */ min-content /* files */ 1fr;
/* blank */
}
#app.node.toggle-tree #tree {
display: none;
}
#profile-settings {
color: #333;
padding: 16px;
}
#profile-settings .passwords {
display: grid;
grid-template-columns: min-content 200px;
grid-gap: 8px 16px;
margin-bottom: 16px;
}
#profile-settings .passwords div {
white-space: nowrap;
}
@media only screen and (max-width: 932px) {
#app.node {
grid-template-areas: "header" "crumbs" "child-nodes" "name" "content" "files" "blank";
grid-template-columns: 1fr;
grid-template-rows: min-content /* header */ min-content /* crumbs */ min-content /* child-nodes */ min-content /* name */ min-content /* content */ min-content /* files */ 1fr;
/* blank */
}
#app.node #tree {
display: none;
}
#app.node.toggle-tree {
display: grid;
grid-template-areas: "header" "tree";
grid-template-columns: 1fr;
grid-template-rows: min-content /* header */ 1fr;
/* blank */
color: #fff;
min-height: 100%;
}
#app.node.toggle-tree #crumbs {
display: none;
}
#app.node.toggle-tree .child-nodes {
display: none;
}
#app.node.toggle-tree .node-name {
display: none;
}
#app.node.toggle-tree .grow-wrap {
display: none;
}
#app.node.toggle-tree #file-section {
display: none;
}
#app.node.toggle-tree #tree {
display: block;
}
.node-content {
margin-left: 16px;
padding: 16px;
justify-self: start;
}
#file-section {
width: calc(100% - 32px);
padding: 16px;
margin-left: 16px;
justify-self: start;
}
}