diff --git a/components.js b/components.js index 9a65a38..f14dc99 100644 --- a/components.js +++ b/components.js @@ -1007,7 +1007,6 @@ smPopup.innerHTML = ` --height: auto; --min-width: auto; --min-height: auto; - --body-padding: 1.5rem; --backdrop-background: rgba(0, 0, 0, 0.6); --border-radius: 0.8rem 0.8rem 0 0; } @@ -1087,13 +1086,13 @@ smPopup.innerHTML = ` -ms-flex: 1; flex: 1; width: 100%; - padding: var(--body-padding); + padding: var(--body-padding, 1.5rem); overflow-y: auto; } .hide{ opacity: 0; pointer-events: none; - visiblity: none; + visibility: none; } @media screen and (min-width: 640px){ :host{ @@ -1169,7 +1168,10 @@ customElements.define('sm-popup', class extends HTMLElement { this.touchEndY = 0; this.touchStartTime = 0; this.touchEndTime = 0; - this.touchEndAnimataion = undefined; + this.touchEndAnimation = undefined; + this.focusable + this.autoFocus + this.mutationObserver this.popupContainer = this.shadowRoot.querySelector('.popup-container'); this.popup = this.shadowRoot.querySelector('.popup'); @@ -1183,6 +1185,7 @@ customElements.define('sm-popup', class extends HTMLElement { this.handleTouchMove = this.handleTouchMove.bind(this); this.handleTouchEnd = this.handleTouchEnd.bind(this); this.movePopup = this.movePopup.bind(this); + this.detectFocus = this.detectFocus.bind(this); } static get observedAttributes() { @@ -1231,6 +1234,8 @@ customElements.define('sm-popup', class extends HTMLElement { this.popup.style.transform = 'none'; document.body.style.overflow = 'hidden'; document.body.style.top = `-${window.scrollY}px`; + const elementToFocus = this.autoFocus || this.focusable[0]; + elementToFocus.tagName.includes('SM-') ? elementToFocus.focusIn() : elementToFocus.focus(); return this.popupStack; } hide() { @@ -1279,13 +1284,13 @@ customElements.define('sm-popup', class extends HTMLElement { handleTouchMove(e) { if (this.touchStartY < e.changedTouches[0].clientY) { this.offset = e.changedTouches[0].clientY - this.touchStartY; - this.touchEndAnimataion = window.requestAnimationFrame(() => this.movePopup()); + this.touchEndAnimation = window.requestAnimationFrame(() => this.movePopup()); } } handleTouchEnd(e) { this.touchEndTime = e.timeStamp; - cancelAnimationFrame(this.touchEndAnimataion); + cancelAnimationFrame(this.touchEndAnimation); this.touchEndY = e.changedTouches[0].clientY; this.popup.style.transition = 'transform 0.3s'; this.threshold = this.popup.getBoundingClientRect().height * 0.3; @@ -1314,6 +1319,20 @@ customElements.define('sm-popup', class extends HTMLElement { this.popup.style.transform = `translateY(${this.offset}px)`; } + detectFocus(e) { + if (e.code === 'Tab') { + const lastElement = this.focusable[this.focusable.length - 1]; + const firstElement = this.focusable[0]; + if (e.shiftKey && document.activeElement === firstElement) { + e.preventDefault(); + lastElement.tagName.includes('SM-') ? lastElement.focusIn() : lastElement.focus(); + } else if (!e.shiftKey && document.activeElement === lastElement) { + e.preventDefault(); + firstElement.tagName.includes('SM-') ? firstElement.focusIn() : firstElement.focus(); + } + } + } + connectedCallback() { this.popupBodySlot.addEventListener('slotchange', () => { this.forms = this.querySelectorAll('sm-form'); @@ -1340,16 +1359,26 @@ customElements.define('sm-popup', class extends HTMLElement { }); resizeObserver.observe(this); + this.mutationObserver = new MutationObserver(entries => { + entries.forEach(mutation => { + this.focusable = this.querySelectorAll('sm-button:not([disabled]), button:not([disabled]), [href], sm-input, input, sm-select, select, sm-checkbox, sm-textarea, textarea, [tabindex]:not([tabindex="-1"])') + this.autoFocus = this.querySelector('[autofocus]') + }) + }) + this.mutationObserver.observe(this, { attributes: true, childList: true, subtree: true }) + this.addEventListener('keydown', this.detectFocus); this.popupHeader.addEventListener('touchstart', this.handleTouchStart, { passive: true }); this.popupHeader.addEventListener('touchmove', this.handleTouchMove, { passive: true }); this.popupHeader.addEventListener('touchend', this.handleTouchEnd, { passive: true }); } disconnectedCallback() { + this.removeEventListener('keydown', this.detectFocus); this.popupHeader.removeEventListener('touchstart', this.handleTouchStart, { passive: true }); this.popupHeader.removeEventListener('touchmove', this.handleTouchMove, { passive: true }); this.popupHeader.removeEventListener('touchend', this.handleTouchEnd, { passive: true }); resizeObserver.unobserve(); + this.mutationObserver.disconnect() } attributeChangedCallback(name) { if (name === 'open') { @@ -2329,7 +2358,7 @@ smSelect.innerHTML = ` } } -
+
@@ -2345,6 +2374,7 @@ customElements.define('sm-select', class extends HTMLElement { mode: 'open' }).append(smSelect.content.cloneNode(true)) + this.focusIn = this.focusIn.bind(this) this.reset = this.reset.bind(this) this.open = this.open.bind(this) this.collapse = this.collapse.bind(this) @@ -2413,6 +2443,10 @@ customElements.define('sm-select', class extends HTMLElement { } } + focusIn() { + this.selection.focus() + } + open() { this.optionList.classList.remove('hide') this.optionList.animate(this.slideDown, this.animationOptions) @@ -2757,6 +2791,10 @@ customElements.define('sm-checkbox', class extends HTMLElement { return this.getAttribute('value') } + focusIn() { + this.focus() + } + reset() { this.removeAttribute('checked') } @@ -3447,7 +3485,6 @@ textField.innerHTML = ` align-items: center; } .text{ - padding: 0.6rem 0; transition: background-color 0.3s; border-bottom: 0.15rem solid transparent; overflow-wrap: break-word; @@ -3657,4 +3694,314 @@ customElements.define('text-field', class extends HTMLElement { this.editButton.removeEventListener('click', this.setEditable) this.saveButton.removeEventListener('click', this.setNonEditable) } +}) +const smMenu = document.createElement('template') +smMenu.innerHTML = ` + +
+ +
+ +
+
`; +customElements.define('sm-menu', class extends HTMLElement { + constructor() { + super() + this.attachShadow({ + mode: 'open' + }).append(smMenu.content.cloneNode(true)) + + this.isOpen = false; + this.availableOptions + this.containerDimensions + this.animOptions = { + duration: 200, + easing: 'ease' + } + + this.optionList = this.shadowRoot.querySelector('.options') + this.menu = this.shadowRoot.querySelector('.menu') + this.icon = this.shadowRoot.querySelector('.icon') + + this.expand = this.expand.bind(this) + this.collapse = this.collapse.bind(this) + this.toggle = this.toggle.bind(this) + this.handleKeyDown = this.handleKeyDown.bind(this) + this.handleClickOutside = this.handleClickOutside.bind(this) + + } + static get observedAttributes() { + return ['value'] + } + get value() { + return this.getAttribute('value') + } + set value(val) { + this.setAttribute('value', val) + } + expand() { + if (!this.isOpen) { + this.optionList.classList.remove('hide') + this.optionList.animate([ + { + transform: window.innerWidth < 640 ? 'translateY(1.5rem)' : 'translateY(-1rem)', + opacity: '0' + }, + { + transform: 'none', + opacity: '1' + }, + ], this.animOptions) + .onfinish = () => { + this.isOpen = true + this.icon.classList.add('focused') + } + } + } + collapse() { + if (this.isOpen) { + this.optionList.animate([ + { + transform: 'none', + opacity: '1' + }, + { + transform: window.innerWidth < 640 ? 'translateY(1.5rem)' : 'translateY(-1rem)', + opacity: '0' + }, + ], this.animOptions) + .onfinish = () => { + this.isOpen = false + this.icon.classList.remove('focused') + this.optionList.classList.add('hide') + } + } + } + toggle() { + if (!this.isOpen) { + this.expand() + } else { + this.collapse() + } + } + handleKeyDown(e) { + // If key is pressed on menu button + if (e.target === this) { + if (e.code === 'ArrowDown') { + e.preventDefault() + this.availableOptions[0].focus() + } + else if (e.code === 'Enter' || e.code === 'Space') { + e.preventDefault() + this.toggle() + } + } else { // If key is pressed over menu options + if (e.code === 'ArrowUp') { + e.preventDefault() + if (document.activeElement.previousElementSibling) { + document.activeElement.previousElementSibling.focus() + } else { + this.availableOptions[this.availableOptions.length - 1].focus() + } + } + else if (e.code === 'ArrowDown') { + e.preventDefault() + if (document.activeElement.nextElementSibling) { + document.activeElement.nextElementSibling.focus() + } else { + this.availableOptions[0].focus() + } + } + else if (e.code === 'Enter' || e.code === 'Space') { + e.preventDefault() + e.target.click() + } + } + } + handleClickOutside(e) { + if (!this.contains(e.target) && e.button !== 2) { + this.collapse() + } + } + connectedCallback() { + this.setAttribute('role', 'listbox') + this.setAttribute('aria-label', 'dropdown menu') + const slot = this.shadowRoot.querySelector('.options slot') + slot.addEventListener('slotchange', e => { + this.availableOptions = e.target.assignedElements() + this.containerDimensions = this.optionList.getBoundingClientRect() + }); + this.addEventListener('click', this.toggle) + this.addEventListener('keydown', this.handleKeyDown) + document.addEventListener('mousedown', this.handleClickOutside) + } + disconnectedCallback() { + this.removeEventListener('click', this.toggle) + this.removeEventListener('keydown', this.handleKeyDown) + document.removeEventListener('mousedown', this.handleClickOutside) + } +}) + +// option +const menuOption = document.createElement('template') +menuOption.innerHTML = ` + +
+ +
`; +customElements.define('menu-option', class extends HTMLElement { + constructor() { + super() + this.attachShadow({ + mode: 'open' + }).append(menuOption.content.cloneNode(true)) + } + + connectedCallback() { + this.setAttribute('role', 'option') + this.setAttribute('tabindex', '0') + this.addEventListener('keyup', e => { + if (e.code === 'Enter' || e.code === 'Space') { + e.preventDefault() + this.click() + } + }) + } }) \ No newline at end of file diff --git a/css/main.css b/css/main.css index 6c40768..1e1c9d5 100644 --- a/css/main.css +++ b/css/main.css @@ -22,8 +22,7 @@ body { } body, body * { - --accent-color: #504dff; - --accent-color--light: #eeeeff; + --accent-color: rgb(0, 156, 78); --text-color: 36, 36, 36; --background-color: 248, 248, 248; --foreground-color: rgb(255, 255, 255); @@ -36,8 +35,7 @@ body * { body[data-theme=dark], body[data-theme=dark] * { - --accent-color: #a3a1ff; - --accent-color--light: rgba(142, 140, 255, 0.06); + --accent-color: rgb(14, 230, 122); --text-color: 230, 230, 230; --text-color-light: 170, 170, 170; --background-color: 10, 10, 10; @@ -501,6 +499,14 @@ sm-checkbox { -webkit-tap-highlight-color: transparent; } +sm-menu { + --background: var(--foreground-color); +} + +menu-option { + font-size: 0.9rem; +} + .warning { background-color: khaki; color: rgba(0, 0, 0, 0.7); @@ -524,11 +530,11 @@ sm-checkbox { #main_header { display: grid; gap: 1rem; - padding: 1rem 1.5rem; + padding: 1rem; -webkit-box-align: center; -ms-flex-align: center; align-items: center; - grid-template-columns: auto 1fr auto auto; + grid-template-columns: 1fr auto auto; grid-column: 1/-1; background-color: var(--foreground-color); } @@ -556,6 +562,24 @@ sm-checkbox { font-weight: 700; } +#article_list_popup { + --width: min(64rem, 100%); + --min-height: 70vh; +} +#article_list_popup::part(popup-header), #article_list_popup::part(popup-body) { + padding: 0.5rem; +} +#article_list_popup .popup__header { + padding: 1rem; + gap: 1rem; + padding-bottom: 0; + grid-template-columns: minmax(0, 1fr); +} + +#article_list { + grid-template-columns: repeat(auto-fill, minmax(30ch, 1fr)); +} + .article-link { padding: 1rem; color: rgba(var(--text-color), 0.8); @@ -577,6 +601,40 @@ sm-checkbox { color: rgba(var(--text-color), 0.8); } +#edit_sections_popup { + --body-padding: 1.2rem; +} + +#section_list_container { + background-color: rgba(var(--text-color), 0.06); + margin: 1rem 0; + padding: 0 0.8rem; + border-radius: 0.5rem; +} + +.section-card { + font-weight: 500; +} +.section-card:not(.section-card--new) { + padding: 0.8rem 0; +} +.section-card--new input { + border: none; + font-size: inherit; + background: inherit; + color: inherit; + width: 100%; + padding: 0.8rem 0; +} +.section-card--new input:focus { + outline: var(--accent-color) solid; +} + +#insert_section_button { + -ms-flex-item-align: start; + align-self: flex-start; +} + #article_wrapper { display: -webkit-box; display: -ms-flexbox; @@ -608,7 +666,7 @@ sm-checkbox { display: -webkit-box; display: -ms-flexbox; display: flex; - gap: 0.5rem; + gap: 1rem; overflow-x: auto; -ms-flex-negative: 0; flex-shrink: 0; @@ -623,7 +681,7 @@ sm-checkbox { } .content-card { - scroll-snap-align: center; + scroll-snap-align: start; width: min(46ch, 100%); -ms-flex-negative: 0; flex-shrink: 0; @@ -806,7 +864,8 @@ sm-checkbox { background-color: #00e67650; } .entry__changes .removed { - background-color: #ff3a4a50; + -webkit-text-decoration-color: red; + text-decoration-color: red; } @media screen and (max-width: 40rem) and (any-hover: none) { @@ -819,6 +878,17 @@ sm-checkbox { --padding: 0.9rem 1.6rem; } + #article_name_wrapper { + grid-row: 2/3; + grid-column: 1/-1; + -webkit-box-pack: start; + -ms-flex-pack: start; + justify-content: flex-start; + } + #article_name_wrapper sm-menu { + margin-left: auto; + } + .hide-on-mobile { display: none; } @@ -861,6 +931,11 @@ sm-checkbox { display: none; } + #main_header { + padding: 1rem 1.5rem; + grid-template-columns: auto 1fr auto auto; + } + #main_page.active-sidebar { height: 100%; overflow-y: hidden; @@ -871,6 +946,15 @@ sm-checkbox { height: 100%; overflow-y: auto; } + + #article_list_popup .popup__header { + grid-template-columns: auto 1fr auto; + padding-bottom: 1rem; + } + + #article_list_search { + width: 16rem; + } } @media (any-hover: hover) { ::-webkit-scrollbar { diff --git a/css/main.min.css b/css/main.min.css index c1b7c7d..a5ee019 100644 --- a/css/main.min.css +++ b/css/main.min.css @@ -1 +1 @@ -*{padding:0;margin:0;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter",sans-serif}:root{font-size:clamp(1rem, 1.2vmax, 1.2rem)}html,body{height:100%;scroll-behavior:smooth}body{color:rgba(var(--text-color), 1);background:rgba(var(--background-color), 1)}body,body *{--accent-color: #504dff;--accent-color--light: #eeeeff;--text-color: 36, 36, 36;--background-color: 248, 248, 248;--foreground-color: rgb(255, 255, 255);--danger-color: rgb(255, 75, 75);--green: #1cad59;--yellow: #f3a600;--loan-color: rgb(255, 171, 93);scrollbar-width:thin}body[data-theme=dark],body[data-theme=dark] *{--accent-color: #a3a1ff;--accent-color--light: rgba(142, 140, 255, 0.06);--text-color: 230, 230, 230;--text-color-light: 170, 170, 170;--background-color: 10, 10, 10;--foreground-color: rgb(24, 24, 24);--danger-color: rgb(255, 106, 106);--green: #00e676;--yellow: #ffd13a;--loan-color: rgb(255, 232, 170)}body[data-theme=dark] sm-popup::part(popup){background-color:var(--foreground-color)}p,strong{font-size:.9rem;max-width:70ch;line-height:1.7;color:rgba(var(--text-color), 0.8)}p:not(:last-of-type),strong:not(:last-of-type){margin-bottom:1.5rem}a:where([class]){color:inherit;text-decoration:none}a:where([class]):focus-visible{-webkit-box-shadow:0 0 0 .1rem rgba(var(--text-color), 1) inset;box-shadow:0 0 0 .1rem rgba(var(--text-color), 1) inset}a{color:var(--accent-color)}button,.button{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;border:none;background-color:transparent;overflow:hidden;color:inherit;cursor:pointer;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s, -webkit-transform .3s;-webkit-tap-highlight-color:transparent;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:.9rem;font-weight:500}.button{white-space:nowrap;padding:.6rem 1rem;border-radius:.3rem;background-color:rgba(var(--text-color), 0.06);color:rgba(var(--text-color), 0.8);-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.button--primary{background-color:var(--accent-color);color:rgba(var(--background-color), 1)}button:disabled{opacity:.5}a:-webkit-any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}a:-moz-any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}a:any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}sm-input{font-size:.9rem;--border-radius: 0.3rem}sm-button{--padding: 0.7rem 1rem}sm-button[variant=primary] .icon{fill:rgba(var(--background-color), 1)}sm-button[disabled] .icon{fill:rgba(var(--text-color), 0.6)}sm-button.uppercase{letter-spacing:.05em}sm-button.danger{--background: var(--danger-color);color:rgba(var(--background-color), 1)}ul{list-style:none}.flex{display:-webkit-box;display:-ms-flexbox;display:flex}.grid{display:grid}.hide{opacity:0;pointer-events:none}.hide-completely{display:none !important}.overflow-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.breakable{overflow-wrap:break-word;word-wrap:break-word;-ms-word-break:break-all;word-break:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.full-bleed{grid-column:1/4}.h1{font-size:1.5rem}.h2{font-size:1.2rem}.h3{font-size:1rem}.h4{font-size:.9rem}.h5{font-size:.8rem}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.flex{display:-webkit-box;display:-ms-flexbox;display:flex}.grid{display:grid}.grid-3{grid-template-columns:1fr auto auto}.flow-column{grid-auto-flow:column}.gap-0-5{gap:.5rem}.gap-1{gap:1rem}.gap-1-5{gap:1.5rem}.gap-2{gap:2rem}.gap-3{gap:3rem}.text-align-right{text-align:right}.align-start{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.align-center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.text-center{text-align:center}.justify-start{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:start}.justify-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.justify-right{margin-left:auto}.align-self-center{-ms-flex-item-align:center;align-self:center}.justify-self-center{justify-self:center}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.direction-column{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.space-between{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.w-100{width:100%}.interact{position:relative;cursor:pointer;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s, -webkit-transform .3s;-webkit-tap-highlight-color:transparent}.empty-state{display:grid;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center;width:100%;padding:1.5rem}.observe-empty-state:empty{display:none}.observe-empty-state:not(:empty)+.empty-state{display:none}.icon{width:1.2rem;height:1.2rem;fill:rgba(var(--text-color), 0.8)}.button__icon{height:1.2rem;width:1.2rem}.button__icon--left{margin-right:.5rem}.button__icon--right{margin-left:.5rem}.icon-button{padding:.6rem;border-radius:.8rem;background-color:rgba(var(--text-color), 0.1);height:-webkit-max-content;height:-moz-max-content;height:max-content}.icon-button .icon{fill:var(--accent-color)}#confirmation_popup,#prompt_popup{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}#confirmation_popup h4,#prompt_popup h4{font-weight:500;margin-bottom:.5rem}#confirmation_popup sm-button,#prompt_popup sm-button{margin:0}#confirmation_popup .flex,#prompt_popup .flex{padding:0;margin-top:1rem}#confirmation_popup .flex sm-button:first-of-type,#prompt_popup .flex sm-button:first-of-type{margin-right:.6rem;margin-left:auto}#prompt_message{margin-bottom:1.5rem}button:active,.button:active,.interact:active{-webkit-transform:scale(0.96);transform:scale(0.96)}.popup__header{display:grid;gap:.5rem;width:100%;padding:0 1.5rem 0 .5rem;-webkit-box-align:center;-ms-flex-align:center;align-items:center;grid-template-columns:auto 1fr auto}.popup__header__close{padding:.5rem;cursor:pointer}.logo{display:grid;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;grid-template-columns:auto 1fr;gap:0 .5rem;margin-right:1rem}.logo h4{text-transform:capitalize;font-size:.9rem;font-weight:600}.logo .main-logo{height:1.4rem;width:1.4rem;fill:rgba(var(--text-color), 1);stroke:none}details summary{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}details[open]>summary{margin-bottom:1rem}details[open]>summary .icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}sm-select,sm-option{font-size:.9rem}sm-checkbox{--height: 1rem;--width: 1rem;-webkit-tap-highlight-color:transparent}.warning{background-color:khaki;color:rgba(0,0,0,.7);padding:1rem;border-radius:.5rem;line-height:1.5}.page-layout{display:grid;grid-template-columns:1rem minmax(0, 1fr) 1rem}.page-layout>*{grid-column:2/3}.page{height:100%}#main_header{display:grid;gap:1rem;padding:1rem 1.5rem;-webkit-box-align:center;-ms-flex-align:center;align-items:center;grid-template-columns:auto 1fr auto auto;grid-column:1/-1;background-color:var(--foreground-color)}.label{font-size:.8rem;color:rgba(var(--text-color), 0.8);margin-bottom:.2rem}.icon--success{fill:var(--green)}.icon--failure,.icon--error{fill:var(--danger-color)}#main_page{grid-template-columns:minmax(0, 1fr)}#current_article_title{font-weight:700}.article-link{padding:1rem;color:rgba(var(--text-color), 0.8);font-weight:500;border-radius:.3rem}.article-link::first-letter{text-transform:uppercase}.default-article{margin-left:auto;font-size:.7rem;background-color:#00e67650;padding:.2rem .4rem;border-radius:.3rem;font-weight:700;letter-spacing:.05em;color:rgba(var(--text-color), 0.8)}#article_wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding:1rem;gap:1rem 0}.heading{font-weight:700;display:-webkit-box;display:-ms-flexbox;display:flex}.heading::before{content:"";width:.3rem;height:100%;margin-right:.7rem;border-radius:.5rem;background-color:var(--accent-color)}.article-section{display:-webkit-box;display:-ms-flexbox;display:flex;gap:.5rem;overflow-x:auto;-ms-flex-negative:0;flex-shrink:0;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory}.article-section:not(:last-of-type){margin-bottom:1.5rem}.article-section::-webkit-scrollbar{display:none}.content-card{scroll-snap-align:center;width:min(46ch, 100%);-ms-flex-negative:0;flex-shrink:0;border-radius:.5rem;background-color:var(--foreground-color);border:solid thin rgba(var(--text-color), 0.16)}.content__area{border-radius:inherit;padding:1rem;white-space:pre-line;font-size:.9rem;line-height:1.7;color:rgba(var(--text-color), 0.8);background-color:rgba(var(--text-color), 0.02);border-radius:.5rem;-webkit-transition:-webkit-box-shadow .1s;transition:-webkit-box-shadow .1s;transition:box-shadow .1s;transition:box-shadow .1s, -webkit-box-shadow .1s;height:60vh;overflow-y:auto}.content__area:empty::before{content:attr(placeholder);opacity:.6;pointer-events:none}.content__area:focus-within{outline:none;-webkit-box-shadow:0 0 0 .1rem var(--accent-color) inset;box-shadow:0 0 0 .1rem var(--accent-color) inset}.content__options{gap:.5rem;padding:.5rem 1rem;grid-template-columns:auto auto 1fr auto}.content__editor{font-size:.8rem;background-color:rgba(var(--text-color), 0.06);border-radius:.3rem;padding:.2rem .3rem;color:rgba(var(--text-color), 0.8)}.actionable-button{padding:.5rem .8rem;background-color:rgba(var(--text-color), 0.1);border-radius:2rem;border:solid thin rgba(var(--text-color), 0.3)}.actionable-button__title{font-size:.8rem;margin-left:.3rem}#text_toolbar{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;z-index:1;left:0;top:0;-webkit-transition:-webkit-transform .1s;transition:-webkit-transform .1s;transition:transform .1s;transition:transform .1s, -webkit-transform .1s;background-color:var(--foreground-color);border:solid thin rgba(var(--text-color), 0.2);padding:.2rem;border-radius:.3rem;-webkit-box-shadow:0 .1rem .2rem rgba(0,0,0,.06),0 1rem 1.5rem -0.5rem rgba(0,0,0,.2);box-shadow:0 .1rem .2rem rgba(0,0,0,.06),0 1rem 1.5rem -0.5rem rgba(0,0,0,.2)}.formatting-button{padding:.3rem;border-radius:.3rem;-webkit-transition:background-color .1s;transition:background-color .1s}.formatting-button.active:hover{background-color:var(--accent-color)}.active{background-color:var(--accent-color)}.active .icon{fill:#fff}.quote-template{position:relative;padding:1rem;margin:1rem 0;background-color:var(--foreground-color);border:solid thin rgba(var(--text-color), 0.2);border-radius:.5rem;overflow:hidden;justify-self:center;padding-left:1.3rem}.quote-template::before{display:-webkit-box;display:-ms-flexbox;display:flex;position:absolute;content:"";height:100%;width:.3rem;background-color:var(--accent-color)}.quote-template blockquote{display:-webkit-box;display:-ms-flexbox;display:flex}.quote-template figcaption{margin-top:.5rem;color:rgba(var(--text-color), 0.8);font-size:.8rem}#version_history_panel{border-radius:.5rem;width:min(24rem, 100%);background-color:var(--foreground-color);overflow-y:auto}#version_history_panel>:first-child{padding:1rem}#version_timeline{padding:1rem;height:100%;overflow-y:auto}.history-entry:not(:last-of-type){padding-bottom:1rem;border-bottom:thin solid rgba(var(--text-color), 0.3)}.history-entry:last-of-type::before{content:"CREATED";letter-spacing:.03em;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;justify-self:flex-start;font-weight:500;padding:.2rem .3rem;font-size:.7rem;border-radius:.2rem;border:solid thin rgba(var(--text-color), 0.5)}.entry__time,.entry__author{font-size:.8rem;font-weight:500}.entry__changes{font-size:.9rem;line-height:1.7;color:rgba(var(--text-color), 0.8)}.entry__changes .added>*,.entry__changes .removed>*{background-color:transparent}.entry__changes .added{background-color:#00e67650}.entry__changes .removed{background-color:#ff3a4a50}@media screen and (max-width: 40rem)and (any-hover: none){.cancel-order span{display:none}}@media screen and (max-width: 40rem){sm-button{--padding: 0.9rem 1.6rem}.hide-on-mobile{display:none}}@media screen and (min-width: 40rem){sm-popup{--width: 24rem}.h1{font-size:2rem}.h2{font-size:1.8rem}.h3{font-size:1.3rem}.h4{font-size:1rem}.popup__header{grid-column:1/-1;padding:1rem 1.5rem 0 .5rem}#confirmation_popup{--width: 24rem}.page-layout{grid-template-columns:1.5rem minmax(0, 1fr) 1.5rem}.hide-on-desktop{display:none}#main_page.active-sidebar{height:100%;overflow-y:hidden;grid-template-rows:auto 1fr;grid-template-columns:minmax(0, 1fr) 24rem}#main_page.active-sidebar #article_wrapper{height:100%;overflow-y:auto}}@media(any-hover: hover){::-webkit-scrollbar{width:.5rem;height:.5rem}::-webkit-scrollbar-thumb{background:rgba(var(--text-color), 0.3);border-radius:1rem}::-webkit-scrollbar-thumb:hover{background:rgba(var(--text-color), 0.5)}.interact,button{-webkit-transition:background-color .3s,-webkit-transform .3s;transition:background-color .3s,-webkit-transform .3s;transition:background-color .3s,transform .3s;transition:background-color .3s,transform .3s,-webkit-transform .3s}.interact:hover,button:hover{background-color:rgba(var(--text-color), 0.1)}.transaction-card button{opacity:0;-webkit-transition:opacity .3s;transition:opacity .3s}.transaction-card:hover button{opacity:1}} \ No newline at end of file +*{padding:0;margin:0;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter",sans-serif}:root{font-size:clamp(1rem, 1.2vmax, 1.2rem)}html,body{height:100%;scroll-behavior:smooth}body{color:rgba(var(--text-color), 1);background:rgba(var(--background-color), 1)}body,body *{--accent-color: rgb(0, 156, 78);--text-color: 36, 36, 36;--background-color: 248, 248, 248;--foreground-color: rgb(255, 255, 255);--danger-color: rgb(255, 75, 75);--green: #1cad59;--yellow: #f3a600;--loan-color: rgb(255, 171, 93);scrollbar-width:thin}body[data-theme=dark],body[data-theme=dark] *{--accent-color: rgb(14, 230, 122);--text-color: 230, 230, 230;--text-color-light: 170, 170, 170;--background-color: 10, 10, 10;--foreground-color: rgb(24, 24, 24);--danger-color: rgb(255, 106, 106);--green: #00e676;--yellow: #ffd13a;--loan-color: rgb(255, 232, 170)}body[data-theme=dark] sm-popup::part(popup){background-color:var(--foreground-color)}p,strong{font-size:.9rem;max-width:70ch;line-height:1.7;color:rgba(var(--text-color), 0.8)}p:not(:last-of-type),strong:not(:last-of-type){margin-bottom:1.5rem}a:where([class]){color:inherit;text-decoration:none}a:where([class]):focus-visible{-webkit-box-shadow:0 0 0 .1rem rgba(var(--text-color), 1) inset;box-shadow:0 0 0 .1rem rgba(var(--text-color), 1) inset}a{color:var(--accent-color)}button,.button{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;border:none;background-color:transparent;overflow:hidden;color:inherit;cursor:pointer;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s, -webkit-transform .3s;-webkit-tap-highlight-color:transparent;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:.9rem;font-weight:500}.button{white-space:nowrap;padding:.6rem 1rem;border-radius:.3rem;background-color:rgba(var(--text-color), 0.06);color:rgba(var(--text-color), 0.8);-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.button--primary{background-color:var(--accent-color);color:rgba(var(--background-color), 1)}button:disabled{opacity:.5}a:-webkit-any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}a:-moz-any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}a:any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}sm-input{font-size:.9rem;--border-radius: 0.3rem}sm-button{--padding: 0.7rem 1rem}sm-button[variant=primary] .icon{fill:rgba(var(--background-color), 1)}sm-button[disabled] .icon{fill:rgba(var(--text-color), 0.6)}sm-button.uppercase{letter-spacing:.05em}sm-button.danger{--background: var(--danger-color);color:rgba(var(--background-color), 1)}ul{list-style:none}.flex{display:-webkit-box;display:-ms-flexbox;display:flex}.grid{display:grid}.hide{opacity:0;pointer-events:none}.hide-completely{display:none !important}.overflow-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.breakable{overflow-wrap:break-word;word-wrap:break-word;-ms-word-break:break-all;word-break:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.full-bleed{grid-column:1/4}.h1{font-size:1.5rem}.h2{font-size:1.2rem}.h3{font-size:1rem}.h4{font-size:.9rem}.h5{font-size:.8rem}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.flex{display:-webkit-box;display:-ms-flexbox;display:flex}.grid{display:grid}.grid-3{grid-template-columns:1fr auto auto}.flow-column{grid-auto-flow:column}.gap-0-5{gap:.5rem}.gap-1{gap:1rem}.gap-1-5{gap:1.5rem}.gap-2{gap:2rem}.gap-3{gap:3rem}.text-align-right{text-align:right}.align-start{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.align-center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.text-center{text-align:center}.justify-start{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:start}.justify-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.justify-right{margin-left:auto}.align-self-center{-ms-flex-item-align:center;align-self:center}.justify-self-center{justify-self:center}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.direction-column{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.space-between{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.w-100{width:100%}.interact{position:relative;cursor:pointer;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s, -webkit-transform .3s;-webkit-tap-highlight-color:transparent}.empty-state{display:grid;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center;width:100%;padding:1.5rem}.observe-empty-state:empty{display:none}.observe-empty-state:not(:empty)+.empty-state{display:none}.icon{width:1.2rem;height:1.2rem;fill:rgba(var(--text-color), 0.8)}.button__icon{height:1.2rem;width:1.2rem}.button__icon--left{margin-right:.5rem}.button__icon--right{margin-left:.5rem}.icon-button{padding:.6rem;border-radius:.8rem;background-color:rgba(var(--text-color), 0.1);height:-webkit-max-content;height:-moz-max-content;height:max-content}.icon-button .icon{fill:var(--accent-color)}#confirmation_popup,#prompt_popup{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}#confirmation_popup h4,#prompt_popup h4{font-weight:500;margin-bottom:.5rem}#confirmation_popup sm-button,#prompt_popup sm-button{margin:0}#confirmation_popup .flex,#prompt_popup .flex{padding:0;margin-top:1rem}#confirmation_popup .flex sm-button:first-of-type,#prompt_popup .flex sm-button:first-of-type{margin-right:.6rem;margin-left:auto}#prompt_message{margin-bottom:1.5rem}button:active,.button:active,.interact:active{-webkit-transform:scale(0.96);transform:scale(0.96)}.popup__header{display:grid;gap:.5rem;width:100%;padding:0 1.5rem 0 .5rem;-webkit-box-align:center;-ms-flex-align:center;align-items:center;grid-template-columns:auto 1fr auto}.popup__header__close{padding:.5rem;cursor:pointer}.logo{display:grid;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;grid-template-columns:auto 1fr;gap:0 .5rem;margin-right:1rem}.logo h4{text-transform:capitalize;font-size:.9rem;font-weight:600}.logo .main-logo{height:1.4rem;width:1.4rem;fill:rgba(var(--text-color), 1);stroke:none}details summary{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}details[open]>summary{margin-bottom:1rem}details[open]>summary .icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}sm-select,sm-option{font-size:.9rem}sm-checkbox{--height: 1rem;--width: 1rem;-webkit-tap-highlight-color:transparent}sm-menu{--background: var(--foreground-color)}menu-option{font-size:.9rem}.warning{background-color:khaki;color:rgba(0,0,0,.7);padding:1rem;border-radius:.5rem;line-height:1.5}.page-layout{display:grid;grid-template-columns:1rem minmax(0, 1fr) 1rem}.page-layout>*{grid-column:2/3}.page{height:100%}#main_header{display:grid;gap:1rem;padding:1rem;-webkit-box-align:center;-ms-flex-align:center;align-items:center;grid-template-columns:1fr auto auto;grid-column:1/-1;background-color:var(--foreground-color)}.label{font-size:.8rem;color:rgba(var(--text-color), 0.8);margin-bottom:.2rem}.icon--success{fill:var(--green)}.icon--failure,.icon--error{fill:var(--danger-color)}#main_page{grid-template-columns:minmax(0, 1fr)}#current_article_title{font-weight:700}#article_list_popup{--width: min(64rem, 100%);--min-height: 70vh}#article_list_popup::part(popup-header),#article_list_popup::part(popup-body){padding:.5rem}#article_list_popup .popup__header{padding:1rem;gap:1rem;padding-bottom:0;grid-template-columns:minmax(0, 1fr)}#article_list{grid-template-columns:repeat(auto-fill, minmax(30ch, 1fr))}.article-link{padding:1rem;color:rgba(var(--text-color), 0.8);font-weight:500;border-radius:.3rem}.article-link::first-letter{text-transform:uppercase}.default-article{margin-left:auto;font-size:.7rem;background-color:#00e67650;padding:.2rem .4rem;border-radius:.3rem;font-weight:700;letter-spacing:.05em;color:rgba(var(--text-color), 0.8)}#edit_sections_popup{--body-padding: 1.2rem}#section_list_container{background-color:rgba(var(--text-color), 0.06);margin:1rem 0;padding:0 .8rem;border-radius:.5rem}.section-card{font-weight:500}.section-card:not(.section-card--new){padding:.8rem 0}.section-card--new input{border:none;font-size:inherit;background:inherit;color:inherit;width:100%;padding:.8rem 0}.section-card--new input:focus{outline:var(--accent-color) solid}#insert_section_button{-ms-flex-item-align:start;align-self:flex-start}#article_wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding:1rem;gap:1rem 0}.heading{font-weight:700;display:-webkit-box;display:-ms-flexbox;display:flex}.heading::before{content:"";width:.3rem;height:100%;margin-right:.7rem;border-radius:.5rem;background-color:var(--accent-color)}.article-section{display:-webkit-box;display:-ms-flexbox;display:flex;gap:1rem;overflow-x:auto;-ms-flex-negative:0;flex-shrink:0;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory}.article-section:not(:last-of-type){margin-bottom:1.5rem}.article-section::-webkit-scrollbar{display:none}.content-card{scroll-snap-align:start;width:min(46ch, 100%);-ms-flex-negative:0;flex-shrink:0;border-radius:.5rem;background-color:var(--foreground-color);border:solid thin rgba(var(--text-color), 0.16)}.content__area{border-radius:inherit;padding:1rem;white-space:pre-line;font-size:.9rem;line-height:1.7;color:rgba(var(--text-color), 0.8);background-color:rgba(var(--text-color), 0.02);border-radius:.5rem;-webkit-transition:-webkit-box-shadow .1s;transition:-webkit-box-shadow .1s;transition:box-shadow .1s;transition:box-shadow .1s, -webkit-box-shadow .1s;height:60vh;overflow-y:auto}.content__area:empty::before{content:attr(placeholder);opacity:.6;pointer-events:none}.content__area:focus-within{outline:none;-webkit-box-shadow:0 0 0 .1rem var(--accent-color) inset;box-shadow:0 0 0 .1rem var(--accent-color) inset}.content__options{gap:.5rem;padding:.5rem 1rem;grid-template-columns:auto auto 1fr auto}.content__editor{font-size:.8rem;background-color:rgba(var(--text-color), 0.06);border-radius:.3rem;padding:.2rem .3rem;color:rgba(var(--text-color), 0.8)}.actionable-button{padding:.5rem .8rem;background-color:rgba(var(--text-color), 0.1);border-radius:2rem;border:solid thin rgba(var(--text-color), 0.3)}.actionable-button__title{font-size:.8rem;margin-left:.3rem}#text_toolbar{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;z-index:1;left:0;top:0;-webkit-transition:-webkit-transform .1s;transition:-webkit-transform .1s;transition:transform .1s;transition:transform .1s, -webkit-transform .1s;background-color:var(--foreground-color);border:solid thin rgba(var(--text-color), 0.2);padding:.2rem;border-radius:.3rem;-webkit-box-shadow:0 .1rem .2rem rgba(0,0,0,.06),0 1rem 1.5rem -0.5rem rgba(0,0,0,.2);box-shadow:0 .1rem .2rem rgba(0,0,0,.06),0 1rem 1.5rem -0.5rem rgba(0,0,0,.2)}.formatting-button{padding:.3rem;border-radius:.3rem;-webkit-transition:background-color .1s;transition:background-color .1s}.formatting-button.active:hover{background-color:var(--accent-color)}.active{background-color:var(--accent-color)}.active .icon{fill:#fff}.quote-template{position:relative;padding:1rem;margin:1rem 0;background-color:var(--foreground-color);border:solid thin rgba(var(--text-color), 0.2);border-radius:.5rem;overflow:hidden;justify-self:center;padding-left:1.3rem}.quote-template::before{display:-webkit-box;display:-ms-flexbox;display:flex;position:absolute;content:"";height:100%;width:.3rem;background-color:var(--accent-color)}.quote-template blockquote{display:-webkit-box;display:-ms-flexbox;display:flex}.quote-template figcaption{margin-top:.5rem;color:rgba(var(--text-color), 0.8);font-size:.8rem}#version_history_panel{border-radius:.5rem;width:min(24rem, 100%);background-color:var(--foreground-color);overflow-y:auto}#version_history_panel>:first-child{padding:1rem}#version_timeline{padding:1rem;height:100%;overflow-y:auto}.history-entry:not(:last-of-type){padding-bottom:1rem;border-bottom:thin solid rgba(var(--text-color), 0.3)}.history-entry:last-of-type::before{content:"CREATED";letter-spacing:.03em;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;justify-self:flex-start;font-weight:500;padding:.2rem .3rem;font-size:.7rem;border-radius:.2rem;border:solid thin rgba(var(--text-color), 0.5)}.entry__time,.entry__author{font-size:.8rem;font-weight:500}.entry__changes{font-size:.9rem;line-height:1.7;color:rgba(var(--text-color), 0.8)}.entry__changes .added>*,.entry__changes .removed>*{background-color:transparent}.entry__changes .added{background-color:#00e67650}.entry__changes .removed{-webkit-text-decoration-color:red;text-decoration-color:red}@media screen and (max-width: 40rem)and (any-hover: none){.cancel-order span{display:none}}@media screen and (max-width: 40rem){sm-button{--padding: 0.9rem 1.6rem}#article_name_wrapper{grid-row:2/3;grid-column:1/-1;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}#article_name_wrapper sm-menu{margin-left:auto}.hide-on-mobile{display:none}}@media screen and (min-width: 40rem){sm-popup{--width: 24rem}.h1{font-size:2rem}.h2{font-size:1.8rem}.h3{font-size:1.3rem}.h4{font-size:1rem}.popup__header{grid-column:1/-1;padding:1rem 1.5rem 0 .5rem}#confirmation_popup{--width: 24rem}.page-layout{grid-template-columns:1.5rem minmax(0, 1fr) 1.5rem}.hide-on-desktop{display:none}#main_header{padding:1rem 1.5rem;grid-template-columns:auto 1fr auto auto}#main_page.active-sidebar{height:100%;overflow-y:hidden;grid-template-rows:auto 1fr;grid-template-columns:minmax(0, 1fr) 24rem}#main_page.active-sidebar #article_wrapper{height:100%;overflow-y:auto}#article_list_popup .popup__header{grid-template-columns:auto 1fr auto;padding-bottom:1rem}#article_list_search{width:16rem}}@media(any-hover: hover){::-webkit-scrollbar{width:.5rem;height:.5rem}::-webkit-scrollbar-thumb{background:rgba(var(--text-color), 0.3);border-radius:1rem}::-webkit-scrollbar-thumb:hover{background:rgba(var(--text-color), 0.5)}.interact,button{-webkit-transition:background-color .3s,-webkit-transform .3s;transition:background-color .3s,-webkit-transform .3s;transition:background-color .3s,transform .3s;transition:background-color .3s,transform .3s,-webkit-transform .3s}.interact:hover,button:hover{background-color:rgba(var(--text-color), 0.1)}.transaction-card button{opacity:0;-webkit-transition:opacity .3s;transition:opacity .3s}.transaction-card:hover button{opacity:1}} \ No newline at end of file diff --git a/css/main.scss b/css/main.scss index 6e61e29..cfac62f 100644 --- a/css/main.scss +++ b/css/main.scss @@ -18,8 +18,7 @@ body { body { &, * { - --accent-color: #504dff; - --accent-color--light: #eeeeff; + --accent-color: rgb(0, 156, 78); --text-color: 36, 36, 36; --background-color: 248, 248, 248; --foreground-color: rgb(255, 255, 255); @@ -37,8 +36,7 @@ body { body[data-theme="dark"] { &, * { - --accent-color: #a3a1ff; - --accent-color--light: rgba(142, 140, 255, 0.06); + --accent-color: rgb(14, 230, 122); --text-color: 230, 230, 230; --text-color-light: 170, 170, 170; --background-color: 10, 10, 10; @@ -440,6 +438,12 @@ sm-checkbox { --width: 1rem; -webkit-tap-highlight-color: transparent; } +sm-menu { + --background: var(--foreground-color); +} +menu-option { + font-size: 0.9rem; +} .warning { background-color: khaki; color: rgba(0, 0, 0, 0.7); @@ -461,9 +465,9 @@ sm-checkbox { #main_header { display: grid; gap: 1rem; - padding: 1rem 1.5rem; + padding: 1rem; align-items: center; - grid-template-columns: auto 1fr auto auto; + grid-template-columns: 1fr auto auto; grid-column: 1/-1; background-color: var(--foreground-color); } @@ -489,6 +493,24 @@ sm-checkbox { font-weight: 700; } +#article_list_popup { + --width: min(64rem, 100%); + --min-height: 70vh; + &::part(popup-header), + &::part(popup-body) { + padding: 0.5rem; + } + .popup__header { + padding: 1rem; + gap: 1rem; + padding-bottom: 0; + grid-template-columns: minmax(0, 1fr); + } +} +#article_list { + grid-template-columns: repeat(auto-fill, minmax(30ch, 1fr)); +} + .article-link { padding: 1rem; color: rgba(var(--text-color), 0.8); @@ -509,6 +531,38 @@ sm-checkbox { color: rgba(var(--text-color), 0.8); } +#edit_sections_popup { + --body-padding: 1.2rem; +} +#section_list_container { + background-color: rgba(var(--text-color), 0.06); + margin: 1rem 0; + padding: 0 0.8rem; + border-radius: 0.5rem; +} +.section-card { + font-weight: 500; + &:not(.section-card--new) { + padding: 0.8rem 0; + } + &--new { + input { + border: none; + font-size: inherit; + background: inherit; + color: inherit; + width: 100%; + padding: 0.8rem 0; + &:focus { + outline: var(--accent-color) solid; + } + } + } +} +#insert_section_button { + align-self: flex-start; +} + #article_wrapper { display: flex; flex-direction: column; @@ -531,7 +585,7 @@ sm-checkbox { .article-section { display: flex; - gap: 0.5rem; + gap: 1rem; overflow-x: auto; flex-shrink: 0; scroll-snap-type: x mandatory; @@ -543,7 +597,7 @@ sm-checkbox { } } .content-card { - scroll-snap-align: center; + scroll-snap-align: start; width: min(46ch, 100%); flex-shrink: 0; border-radius: 0.5rem; @@ -704,7 +758,7 @@ sm-checkbox { background-color: #00e67650; } .removed { - background-color: #ff3a4a50; + text-decoration-color: red; } } @@ -719,6 +773,14 @@ sm-checkbox { sm-button { --padding: 0.9rem 1.6rem; } + #article_name_wrapper { + grid-row: 2/3; + grid-column: 1/-1; + justify-content: flex-start; + sm-menu { + margin-left: auto; + } + } .hide-on-mobile { display: none; } @@ -755,6 +817,10 @@ sm-checkbox { .hide-on-desktop { display: none; } + #main_header { + padding: 1rem 1.5rem; + grid-template-columns: auto 1fr auto auto; + } #main_page { &.active-sidebar { height: 100%; @@ -767,6 +833,15 @@ sm-checkbox { } } } + #article_list_popup { + .popup__header { + grid-template-columns: auto 1fr auto; + padding-bottom: 1rem; + } + } + #article_list_search { + width: 16rem; + } } @media (any-hover: hover) { ::-webkit-scrollbar { diff --git a/index.html b/index.html index 36f8774..8829d85 100644 --- a/index.html +++ b/index.html @@ -12,6 +12,7 @@ +