diff --git a/assets/globe.svg b/assets/globe.svg new file mode 100644 index 0000000..c693e79 --- /dev/null +++ b/assets/globe.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/paper-plane.svg b/assets/paper-plane.svg new file mode 100644 index 0000000..e6768d0 --- /dev/null +++ b/assets/paper-plane.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/working-intern.svg b/assets/working-intern.svg new file mode 100644 index 0000000..6b3eed2 --- /dev/null +++ b/assets/working-intern.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components-old.js b/components-old.js deleted file mode 100644 index 62b535b..0000000 --- a/components-old.js +++ /dev/null @@ -1,3640 +0,0 @@ -/*jshint esversion: 6 */ -//Button -const smButton = document.createElement('template') -smButton.innerHTML = ` - -`; -customElements.define('sm-button', - class extends HTMLElement { - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smButton.content.cloneNode(true)) - } - - get disabled() { - return this.isDisabled - } - - set disabled(value) { - if (value && !this.isDisabled) { - this.isDisabled = true - this.setAttribute('disabled', '') - this.button.removeAttribute('tabindex') - } else if (!value && this.isDisabled) { - this.isDisabled = false - this.removeAttribute('disabled') - } - } - - dispatch() { - if (this.isDisabled) { - this.dispatchEvent(new CustomEvent('disabled', { - bubbles: true, - composed: true - })) - } else { - this.dispatchEvent(new CustomEvent('clicked', { - bubbles: true, - composed: true - })) - } - } - - connectedCallback() { - this.isDisabled = false - this.button = this.shadowRoot.querySelector('.button') - if (this.hasAttribute('disabled') && !this.isDisabled) - this.isDisabled = true - this.addEventListener('click', (e) => { - this.dispatch() - }) - } - }) - -//Input -const smInput = document.createElement('template') -smInput.innerHTML = ` - -
- -
-
-`; -customElements.define('sm-input', - class extends HTMLElement { - - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smInput.content.cloneNode(true)) - } - - static get observedAttributes() { - return ['placeholder'] - } - - get value() { - return this.shadowRoot.querySelector('input').value - } - - set value(val) { - this.shadowRoot.querySelector('input').value = val; - this.checkInput() - this.fireEvent() - } - - get placeholder() { - return this.getAttribute('placeholder') - } - - set placeholder(val) { - this.setAttribute('placeholder', val) - } - - get type() { - return this.getAttribute('type') - } - - get isValid() { - return this.shadowRoot.querySelector('input').checkValidity() - } - - get validity() { - return this.shadowRoot.querySelector('input').validity - } - - set disabled(value) { - if (value) - this.shadowRoot.querySelector('.input').classList.add('disabled') - else - this.shadowRoot.querySelector('.input').classList.remove('disabled') - } - set readOnly(value) { - if (value) { - this.shadowRoot.querySelector('input').setAttribute('readonly', '') - this.shadowRoot.querySelector('.input').classList.add('readonly') - } else { - this.shadowRoot.querySelector('input').removeAttribute('readonly') - this.shadowRoot.querySelector('.input').classList.remove('readonly') - } - } - - setValidity = (message) => { - this.feedbackText.textContent = message - } - - showValidity = () => { - this.feedbackText.classList.remove('hide-completely') - } - - hideValidity = () => { - this.feedbackText.classList.add('hide-completely') - } - - focusIn = () => { - this.input.focus() - } - - focusOut = () => { - this.input.blur() - } - - fireEvent = () => { - let event = new Event('input', { - bubbles: true, - cancelable: true, - composed: true - }); - this.dispatchEvent(event); - } - - checkInput = (e) => { - if (!this.readonly) { - if (this.input.value !== '') { - this.clearBtn.classList.remove('hide') - } else { - this.clearBtn.classList.add('hide') - } - } - if (!this.hasAttribute('placeholder') || this.getAttribute('placeholder') === '') return; - if (this.input.value !== '') { - if (this.animate) - this.inputParent.classList.add('animate-label') - else - this.label.classList.add('hide') - } else { - if (this.animate) - this.inputParent.classList.remove('animate-label') - else - this.label.classList.remove('hide') - } - } - - - connectedCallback() { - this.inputParent = this.shadowRoot.querySelector('.input') - this.clearBtn = this.shadowRoot.querySelector('.clear') - this.label = this.shadowRoot.querySelector('.label') - this.feedbackText = this.shadowRoot.querySelector('.feedback-text') - this.valueChanged = false; - this.readonly = false - this.isNumeric = false - this.min - this.max - this.animate = this.hasAttribute('animate') - this.input = this.shadowRoot.querySelector('input') - this.shadowRoot.querySelector('.label').textContent = this.getAttribute('placeholder') - if (this.hasAttribute('value')) { - this.input.value = this.getAttribute('value') - this.checkInput() - } - if (this.hasAttribute('required')) { - this.input.setAttribute('required', '') - } - if (this.hasAttribute('min')) { - let minValue = this.getAttribute('min') - this.input.setAttribute('min', minValue) - this.min = parseInt(minValue) - } - if (this.hasAttribute('max')) { - let maxValue = this.getAttribute('max') - this.input.setAttribute('max', maxValue) - this.max = parseInt(maxValue) - } - if (this.hasAttribute('minlength')) { - const minValue = this.getAttribute('minlength') - this.input.setAttribute('minlength', minValue) - } - if (this.hasAttribute('maxlength')) { - const maxValue = this.getAttribute('maxlength') - this.input.setAttribute('maxlength', maxValue) - } - if (this.hasAttribute('step')) { - const steps = this.getAttribute('step') - this.input.setAttribute('step', steps) - } - if (this.hasAttribute('pattern')) { - this.input.setAttribute('pattern', this.getAttribute('pattern')) - } - if (this.hasAttribute('readonly')) { - this.input.setAttribute('readonly', '') - this.readonly = true - } - if (this.hasAttribute('disabled')) { - this.inputParent.classList.add('disabled') - } - if (this.hasAttribute('error-text')) { - this.feedbackText.textContent = this.getAttribute('error-text') - } - if (this.hasAttribute('type')) { - if (this.getAttribute('type') === 'number') { - this.input.setAttribute('inputmode', 'numeric') - this.input.setAttribute('type', 'number') - this.isNumeric = true - } else - this.input.setAttribute('type', this.getAttribute('type')) - } else - this.input.setAttribute('type', 'text') - this.input.addEventListener('input', e => { - this.checkInput(e) - }) - this.clearBtn.addEventListener('click', e => { - this.value = '' - }) - } - - attributeChangedCallback(name, oldValue, newValue) { - if (oldValue !== newValue) { - if (name === 'placeholder') { - this.shadowRoot.querySelector('.label').textContent = newValue; - this.setAttribute('aria-label', newValue); - } - } - } - }) - -//textarea -const smTextarea = document.createElement('template') -smTextarea.innerHTML = ` - - -`; -customElements.define('sm-textarea', - class extends HTMLElement { - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smTextarea.content.cloneNode(true)) - this.textarea = this.shadowRoot.querySelector('textarea') - } - get value() { - return this.textarea.value - } - set value(val) { - this.textarea.value = val; - this.textareaBox.dataset.value = val - this.checkInput() - this.fireEvent() - } - focusIn = () => { - this.textarea.focus() - } - fireEvent() { - let event = new Event('input', { - bubbles: true, - cancelable: true, - composed: true - }); - this.dispatchEvent(event); - } - checkInput = () => { - if (!this.hasAttribute('placeholder') || this.getAttribute('placeholder') === '') - return; - if (this.textarea.value !== '') { - this.placeholder.classList.add('hide') - } else { - this.placeholder.classList.remove('hide') - } - } - connectedCallback() { - this.textareaBox = this.shadowRoot.querySelector('.textarea') - this.placeholder = this.shadowRoot.querySelector('.placeholder') - - if(this.hasAttribute('placeholder')) - this.placeholder.textContent = this.getAttribute('placeholder') - - if (this.hasAttribute('value')) { - this.textarea.value = this.getAttribute('value') - this.checkInput() - } - if (this.hasAttribute('required')) { - this.textarea.setAttribute('required', '') - } - if (this.hasAttribute('readonly')) { - this.textarea.setAttribute('readonly', '') - } - if (this.hasAttribute('rows')) { - this.textarea.setAttribute('rows', this.getAttribute('rows')) - } - this.textarea.addEventListener('input', e => { - this.textareaBox.dataset.value = this.textarea.value - this.checkInput() - }) - } - }) - -// tab -const smTab = document.createElement('template') -smTab.innerHTML = ` - -
- -
-`; - -customElements.define('sm-tab', class extends HTMLElement { - constructor() { - super() - this.shadow = this.attachShadow({ - mode: 'open' - }).append(smTab.content.cloneNode(true)) - } -}) - -//chcekbox - -const smCheckbox = document.createElement('template') -smCheckbox.innerHTML = ` - -` -customElements.define('sm-checkbox', class extends HTMLElement { - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smCheckbox.content.cloneNode(true)) - - this.checkbox = this.shadowRoot.querySelector('.checkbox'); - this.input = this.shadowRoot.querySelector('input') - - this.isChecked = false - this.isDisabled = false - } - - static get observedAttributes() { - return ['disabled', 'checked'] - } - - get disabled() { - return this.isDisabled - } - - set disabled(val) { - if (val) { - this.setAttribute('disabled', '') - } else { - this.removeAttribute('disabled') - } - } - - get checked() { - return this.isChecked - } - - set checked(value) { - if (value) { - this.setAttribute('checked', '') - } - else { - this.removeAttribute('checked') - } - } - - set value(val) { - this.val = val - this.setAttribute('value', value) - } - - get value() { - return getAttribute('value') - } - - dispatch = () => { - this.dispatchEvent(new CustomEvent('change', { - bubbles: true, - composed: true - })) - } - handleKeyup = e => { - if ((e.code === "Enter" || e.code === "Space") && this.isDisabled == false) { - if (this.hasAttribute('checked')) { - this.input.checked = false - this.removeAttribute('checked') - } - else { - this.input.checked = true - this.setAttribute('checked', '') - } - } - } - handleChange = e => { - if (this.input.checked) { - this.setAttribute('checked', '') - } - else { - this.removeAttribute('checked') - } - } - - connectedCallback() { - this.val = '' - this.addEventListener('keyup', this.handleKeyup) - this.input.addEventListener('change', this.handleChange) - } - attributeChangedCallback(name, oldValue, newValue) { - if (oldValue !== newValue) { - if (name === 'disabled') { - if (newValue === 'true') { - this.isDisabled = true - } else { - this.isDisabled = false - } - } - else if (name === 'checked') { - if (this.hasAttribute('checked')) { - this.isChecked = true - this.input.checked = true - } - else { - this.input.checked = false - this.isChecked = false - } - this.dispatch() - } - } - } - disconnectedCallback() { - this.removeEventListener('keyup', this.handleKeyup) - this.removeEventListener('change', this.handleChange) - } -}) - -//switch - -const smSwitch = document.createElement('template') -smSwitch.innerHTML = ` - -` - -customElements.define('sm-switch', class extends HTMLElement { - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smSwitch.content.cloneNode(true)) - this.switch = this.shadowRoot.querySelector('.switch'); - this.input = this.shadowRoot.querySelector('input') - this.isChecked = false - this.isDisabled = false - } - - static get observedAttributes() { - return ['disabled', 'checked'] - } - - get disabled() { - return this.isDisabled - } - - set disabled(val) { - if (val) { - this.setAttribute('disabled', '') - } else { - this.removeAttribute('disabled') - } - } - - get checked() { - return this.isChecked - } - - set checked(value) { - if (value) { - this.setAttribute('checked', '') - } else { - this.removeAttribute('checked') - } - } - - dispatch = () => { - this.dispatchEvent(new CustomEvent('change', { - bubbles: true, - composed: true, - detail: { - value: this.isChecked - } - })) - } - - connectedCallback() { - this.addEventListener('keyup', e => { - if ((e.code === "Enter" || e.code === "Space") && !this.isDisabled) { - this.input.click() - } - }) - this.input.addEventListener('click', e => { - if (this.input.checked) - this.checked = true - else - this.checked = false - this.dispatch() - }) - } - attributeChangedCallback(name, oldValue, newValue) { - if (oldValue !== newValue) { - if (name === 'disabled') { - if (this.hasAttribute('disabled')) { - this.disabled = true - } - else { - this.disabled = false - } - } - else if (name === 'checked') { - if (this.hasAttribute('checked')) { - this.isChecked = true - this.input.checked = true - } - else { - this.isChecked = false - this.input.checked = false - } - } - } - } - -}) - -// select -const smSelect = document.createElement('template') -smSelect.innerHTML = ` - -
-
-
- - - -
-
- -
-
`; -customElements.define('sm-select', class extends HTMLElement { - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smSelect.content.cloneNode(true)) - } - static get observedAttributes() { - return ['value'] - } - get value() { - return this.getAttribute('value') - } - set value(val) { - this.setAttribute('value', val) - } - - collapse() { - this.chevron.classList.remove('rotate') - this.optionList.animate(this.slideUp, this.animationOptions) - .onfinish = () => { - this.optionList.classList.add('hide') - this.open = false - } - } - connectedCallback() { - this.availableOptions - this.optionList = this.shadowRoot.querySelector('.options') - this.chevron = this.shadowRoot.querySelector('.toggle') - let slot = this.shadowRoot.querySelector('.options slot'), - selection = this.shadowRoot.querySelector('.selection'), - previousOption - this.open = false; - this.slideDown = [{ - transform: `translateY(-0.5rem)`, - opacity: 0 - }, - { - transform: `translateY(0)`, - opacity: 1 - } - ] - this.slideUp = [{ - transform: `translateY(0)`, - opacity: 1 - }, - { - transform: `translateY(-0.5rem)`, - opacity: 0 - } - ] - this.animationOptions = { - duration: 300, - fill: "forwards", - easing: 'ease' - } - selection.addEventListener('click', e => { - if (!this.open) { - this.optionList.classList.remove('hide') - this.optionList.animate(this.slideDown, this.animationOptions) - this.chevron.classList.add('rotate') - this.open = true - } else { - this.collapse() - } - }) - selection.addEventListener('keydown', e => { - if (e.code === 'ArrowDown' || e.code === 'ArrowRight') { - e.preventDefault() - this.availableOptions[0].focus() - } - if (e.code === 'Enter' || e.code === 'Space') - if (!this.open) { - this.optionList.classList.remove('hide') - this.optionList.animate(this.slideDown, this.animationOptions) - this.chevron.classList.add('rotate') - this.open = true - } else { - this.collapse() - } - }) - this.optionList.addEventListener('keydown', e => { - if (e.code === 'ArrowUp' || e.code === 'ArrowRight') { - e.preventDefault() - if (document.activeElement.previousElementSibling) { - document.activeElement.previousElementSibling.focus() - } - } - if (e.code === 'ArrowDown' || e.code === 'ArrowLeft') { - e.preventDefault() - if (document.activeElement.nextElementSibling) - document.activeElement.nextElementSibling.focus() - } - }) - this.addEventListener('optionSelected', e => { - if (previousOption !== e.target) { - this.setAttribute('value', e.detail.value) - this.shadowRoot.querySelector('.option-text').textContent = e.detail.text; - this.dispatchEvent(new CustomEvent('change', { - bubbles: true, - composed: true, - detail: { - value: e.detail.value - } - })) - if (previousOption) { - previousOption.classList.remove('check-selected') - } - previousOption = e.target; - } - if (!e.detail.switching) - this.collapse() - - e.target.classList.add('check-selected') - }) - slot.addEventListener('slotchange', e => { - this.availableOptions = slot.assignedElements() - if (this.availableOptions[0]) { - let firstElement = this.availableOptions[0]; - previousOption = firstElement; - firstElement.classList.add('check-selected') - this.setAttribute('value', firstElement.getAttribute('value')) - this.shadowRoot.querySelector('.option-text').textContent = firstElement.textContent - this.availableOptions.forEach((element, index) => { - element.setAttribute('data-rank', index + 1); - element.setAttribute('tabindex', "0"); - }) - } - }); - document.addEventListener('mousedown', e => { - if (!this.contains(e.target) && this.open) { - this.collapse() - } - }) - } -}) - -// option -const smOption = document.createElement('template') -smOption.innerHTML = ` - -
- - - - -
`; -customElements.define('sm-option', class extends HTMLElement { - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smOption.content.cloneNode(true)) - } - - sendDetails(switching) { - let optionSelected = new CustomEvent('optionSelected', { - bubbles: true, - composed: true, - detail: { - text: this.textContent, - value: this.getAttribute('value'), - switching: switching - } - }) - this.dispatchEvent(optionSelected) - } - - connectedCallback() { - let validKey = [ - 'ArrowUp', - 'ArrowDown', - 'ArrowLeft', - 'ArrowRight' - ] - this.addEventListener('click', e => { - this.sendDetails() - }) - this.addEventListener('keyup', e => { - if (e.code === 'Enter' || e.code === 'Space') { - e.preventDefault() - this.sendDetails(false) - } - if (validKey.includes(e.code)) { - e.preventDefault() - this.sendDetails(true) - } - }) - if (this.hasAttribute('default')) { - setTimeout(() => { - this.sendDetails() - }, 0); - } - } -}) - -// strip select -const stripSelect = document.createElement('template') -stripSelect.innerHTML = ` - -
-
- -
- -
- -
-
- -` -customElements.define('strip-select', class extends HTMLElement{ - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(stripSelect.content.cloneNode(true)) - this.stripSelect = this.shadowRoot.querySelector('.strip-select') - this.slottedOptions - this._value - this.scrollDistance - } - get value() { - return this._value - } - scrollLeft = () => { - this.stripSelect.scrollBy({ - left: -this.scrollDistance, - behavior: 'smooth' - }) - } - - scrollRight = () => { - this.stripSelect.scrollBy({ - left: this.scrollDistance, - behavior: 'smooth' - }) - } - fireEvent = () => { - this.dispatchEvent( - new CustomEvent("change", { - bubbles: true, - composed: true, - detail: { - value: this._value - } - }) - ) - } - connectedCallback() { - const slot = this.shadowRoot.querySelector('slot') - const coverLeft = this.shadowRoot.querySelector('.cover--left') - const coverRight = this.shadowRoot.querySelector('.cover--right') - const navButtonLeft = this.shadowRoot.querySelector('.nav-button--left') - const navButtonRight = this.shadowRoot.querySelector('.nav-button--right') - slot.addEventListener('slotchange', e => { - const assignedElements = slot.assignedElements() - assignedElements.forEach(elem => { - if (elem.hasAttribute('selected')) { - elem.setAttribute('active', '') - this._value = elem.value - } - }) - if (assignedElements.length > 0) { - firstOptionObserver.observe(slot.assignedElements()[0]) - lastOptionObserver.observe(slot.assignedElements()[slot.assignedElements().length - 1]) - } - else { - navButtonLeft.classList.add('hide') - navButtonRight.classList.add('hide') - coverLeft.classList.add('hide') - coverRight.classList.add('hide') - firstOptionObserver.disconnect() - lastOptionObserver.disconnect() - } - }) - const resObs = new ResizeObserver(entries => { - entries.forEach(entry => { - if(entry.contentBoxSize) { - // Firefox implements `contentBoxSize` as a single content rect, rather than an array - const contentBoxSize = Array.isArray(entry.contentBoxSize) ? entry.contentBoxSize[0] : entry.contentBoxSize; - - this.scrollDistance = contentBoxSize.inlineSize * 0.6 - } else { - this.scrollDistance = entry.contentRect.width * 0.6 - } - }) - }) - resObs.observe(this) - this.stripSelect.addEventListener('option-clicked', e => { - if (this._value !== e.target.value) { - this._value = e.target.value - slot.assignedElements().forEach(elem => elem.removeAttribute('active')) - e.target.setAttribute('active', '') - e.target.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "center" }) - this.fireEvent() - } - }) - const firstOptionObserver = new IntersectionObserver(entries => { - entries.forEach(entry => { - if (entry.isIntersecting) { - navButtonLeft.classList.add('hide') - coverLeft.classList.add('hide') - } - else { - navButtonLeft.classList.remove('hide') - coverLeft.classList.remove('hide') - } - }) - }, - { - threshold: 0.9, - root: this - }) - const lastOptionObserver = new IntersectionObserver(entries => { - entries.forEach(entry => { - if (entry.isIntersecting) { - navButtonRight.classList.add('hide') - coverRight.classList.add('hide') - } - else { - navButtonRight.classList.remove('hide') - coverRight.classList.remove('hide') - } - }) - }, - { - threshold: 0.9, - root: this - }) - navButtonLeft.addEventListener('click', this.scrollLeft) - navButtonRight.addEventListener('click', this.scrollRight) - } -}) - -const stripOption = document.createElement('template') -stripOption.innerHTML = ` - - -` - -//Strip option -customElements.define('strip-option', class extends HTMLElement{ - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(stripOption.content.cloneNode(true)) - this._value - this.radioButton = this.shadowRoot.querySelector('input') - } - get value() { - return this._value - } - fireEvent = () => { - this.dispatchEvent( - new CustomEvent("option-clicked", { - bubbles: true, - composed: true, - detail: { - value: this._value - } - }) - ) - } - handleKeyDown = (e) => { - if (e.key === 'Enter' || e.key === 'Space') { - this.fireEvent() - } - } - connectedCallback() { - this._value = this.getAttribute('value') - this.addEventListener('click', this.fireEvent) - this.addEventListener('keydown', this.handleKeyDown) - } - disconnectedCallback() { - this.removeEventListener('click', this.fireEvent) - this.removeEventListener('keydown', this.handleKeyDown) - } -}) - - -//popup -const smPopup = document.createElement('template') -smPopup.innerHTML = ` - - -`; -customElements.define('sm-popup', class extends HTMLElement { - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smPopup.content.cloneNode(true)) - - this.allowClosing = false - this.isOpen = false - } - - get open() { - return this.isOpen - } - - resumeScrolling = () => { - const scrollY = document.body.style.top; - window.scrollTo(0, parseInt(scrollY || '0') * -1); - setTimeout(() => { - document.body.style.overflow = 'auto'; - document.body.style.top= 'initial' - }, 300); - } - - show = (pinned, popupStack) => { - if (popupStack) - this.popupStack = popupStack - if (this.popupStack && !this.hasAttribute('open')) { - this.popupStack.push({ - popup: this, - permission: pinned - }) - if (this.popupStack.items.length > 1) { - this.popupStack.items[this.popupStack.items.length - 2].popup.classList.add('stacked') - } - this.dispatchEvent( - new CustomEvent("popupopened", { - bubbles: true, - detail: { - popup: this, - popupStack: this.popupStack - } - }) - ) - this.setAttribute('open', '') - this.pinned = pinned - this.isOpen = true - } - this.popupContainer.classList.remove('hide') - this.popup.style.transform = 'none'; - document.body.style.overflow = 'hidden'; - document.body.style.top= `-${window.scrollY}px` - return this.popupStack - } - hide = () => { - if (window.innerWidth < 640) - this.popup.style.transform = 'translateY(100%)'; - else - this.popup.style.transform = 'translateY(3rem)'; - this.popupContainer.classList.add('hide') - this.removeAttribute('open') - if (typeof this.popupStack !== 'undefined') { - this.popupStack.pop() - if (this.popupStack.items.length) { - this.popupStack.items[this.popupStack.items.length - 1].popup.classList.remove('stacked') - } else { - this.resumeScrolling() - } - } else { - this.resumeScrolling() - } - - if (this.inputFields.length) { - setTimeout(() => { - this.inputFields.forEach(field => { - if (field.type === 'radio' || field.tagName === 'SM-CHECKBOX') - field.checked = false - if (field.tagName === 'SM-INPUT' || field.tagName === 'TEXTAREA'|| field.tagName === 'SM-TEXTAREA') - field.value = '' - }) - }, 300); - } - setTimeout(() => { - this.dispatchEvent( - new CustomEvent("popupclosed", { - bubbles: true, - detail: { - popup: this, - popupStack: this.popupStack - } - }) - ) - this.isOpen = false - }, 300); - } - - handleTouchStart = (e) => { - this.touchStartY = e.changedTouches[0].clientY - this.popup.style.transition = 'transform 0.1s' - this.touchStartTime = e.timeStamp - } - - handleTouchMove = (e) => { - if (this.touchStartY < e.changedTouches[0].clientY) { - this.offset = e.changedTouches[0].clientY - this.touchStartY; - this.touchEndAnimataion = window.requestAnimationFrame(() => this.movePopup()) - } - /*else { - this.offset = this.touchStartY - e.changedTouches[0].clientY; - this.popup.style.transform = `translateY(-${this.offset}px)` - }*/ - } - - handleTouchEnd = (e) => { - this.touchEndTime = e.timeStamp - cancelAnimationFrame(this.touchEndAnimataion) - this.touchEndY = e.changedTouches[0].clientY - this.popup.style.transition = 'transform 0.3s' - this.threshold = this.popup.getBoundingClientRect().height * 0.3 - if (this.touchEndTime - this.touchStartTime > 200) { - if (this.touchEndY - this.touchStartY > this.threshold) { - if (this.pinned) { - this.show() - return - } else - this.hide() - } else { - this.show() - } - } else { - if (this.touchEndY > this.touchStartY) - if (this.pinned) { - this.show() - return - } - else - this.hide() - } - } - - movePopup = () => { - this.popup.style.transform = `translateY(${this.offset}px)` - } - - connectedCallback() { - this.pinned = false - this.popupStack - this.popupContainer = this.shadowRoot.querySelector('.popup-container') - this.popup = this.shadowRoot.querySelector('.popup') - this.popupBodySlot = this.shadowRoot.querySelector('.popup-body slot') - this.offset - this.popupHeader = this.shadowRoot.querySelector('.popup-top') - this.touchStartY = 0 - this.touchEndY = 0 - this.touchStartTime = 0 - this.touchEndTime = 0 - this.touchEndAnimataion; - this.threshold = this.popup.getBoundingClientRect().height * 0.3 - - if (this.hasAttribute('open')) - this.show() - this.popupContainer.addEventListener('mousedown', e => { - if (e.target === this.popupContainer && !this.pinned) { - if (this.pinned) { - this.show() - return - } else - this.hide() - } - }) - - this.popupBodySlot.addEventListener('slotchange', () => { - setTimeout(() => { - this.threshold = this.popup.getBoundingClientRect().height * 0.3 - }, 200); - this.inputFields = this.querySelectorAll('sm-input', 'sm-checkbox', 'textarea', 'sm-textarea', 'radio') - }) - - this.popupHeader.addEventListener('touchstart', (e) => { this.handleTouchStart(e) }, {passive: true}) - this.popupHeader.addEventListener('touchmove', (e) => {this.handleTouchMove(e)}, {passive: true}) - this.popupHeader.addEventListener('touchend', (e) => {this.handleTouchEnd(e)}, {passive: true}) - } - disconnectedCallback() { - this.popupHeader.removeEventListener('touchstart', this.handleTouchStart, {passive: true}) - this.popupHeader.removeEventListener('touchmove', this.handleTouchMove, {passive: true}) - this.popupHeader.removeEventListener('touchend', this.handleTouchEnd, {passive: true}) - } -}) - -//carousel - -const smCarousel = document.createElement('template') -smCarousel.innerHTML = ` - - -`; - -customElements.define('sm-carousel', class extends HTMLElement { - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smCarousel.content.cloneNode(true)) - - this.isAutoPlaying = false - this.autoPlayInterval = 5000 - this.autoPlayTimeout - this.initialTimeout - this.activeSlideNum = 0 - this.carouselItems - this.indicators - this.showIndicator = false - this.carousel = this.shadowRoot.querySelector('.carousel') - this.carouselContainer = this.shadowRoot.querySelector('.carousel-container') - this.carouselSlot = this.shadowRoot.querySelector('slot') - this.nextArrow = this.shadowRoot.querySelector('.carousel__button--right') - this.previousArrow = this.shadowRoot.querySelector('.carousel__button--left') - this.indicatorsContainer = this.shadowRoot.querySelector('.indicators') - } - - static get observedAttributes() { - return ['indicator', 'autoplay', 'interval'] - } - - scrollLeft = () => { - this.carousel.scrollBy({ - left: -this.scrollDistance, - behavior: 'smooth' - }) - } - - scrollRight = () => { - this.carousel.scrollBy({ - left: this.scrollDistance, - behavior: 'smooth' - }) - } - - handleIndicatorClick = (e) => { - if (e.target.closest('.dot')) { - const slideNum = parseInt(e.target.closest('.dot').dataset.rank) - if (this.activeSlideNum !== slideNum) { - this.showSlide(slideNum) - } - } - } - - showSlide = (slideNum) => { - this.carousel.scrollTo({ - left: (this.carouselItems[slideNum].getBoundingClientRect().left - this.carousel.getBoundingClientRect().left + this.carousel.scrollLeft), - behavior: 'smooth' - }) - } - - nextSlide = () => { - if (!this.carouselItems) return - let showSlideNo = (this.activeSlideNum + 1) < this.carouselItems.length ? this.activeSlideNum + 1 : 0 - this.showSlide(showSlideNo) - } - - autoPlay = () => { - this.nextSlide() - if (this.isAutoPlaying) { - this.autoPlayTimeout = setTimeout(() => { - this.autoPlay() - }, this.autoPlayInterval); - } - } - - startAutoPlay = () => { - this.setAttribute('autoplay', '') - } - - stopAutoPlay = () => { - this.removeAttribute('autoplay') - } - - connectedCallback() { - this.scrollDistance = this.carouselContainer.getBoundingClientRect().width / 3 - let frag = document.createDocumentFragment(); - if (this.hasAttribute('indicator')) - this.showIndicator = true - - - let firstVisible = false, - lastVisible = false - const allElementsObserver = new IntersectionObserver(entries => { - entries.forEach(entry => { - if (this.showIndicator) { - const activeRank = parseInt(entry.target.dataset.rank) - if (entry.isIntersecting) { - this.indicators[activeRank].classList.add('active') - this.activeSlideNum = activeRank - } - else - this.indicators[activeRank].classList.remove('active') - } - if (!entry.target.previousElementSibling) - if (entry.isIntersecting) { - this.previousArrow.classList.remove('expand') - firstVisible = true - } - else { - this.previousArrow.classList.add('expand') - firstVisible = false - } - if (!entry.target.nextElementSibling) - if (entry.isIntersecting) { - this.nextArrow.classList.remove('expand') - lastVisible = true - } - else { - this.nextArrow.classList.add('expand') - lastVisible = false - } - if (firstVisible && lastVisible) - this.indicatorsContainer.classList.add('hide') - else - this.indicatorsContainer.classList.remove('hide') - }) - }, { - root: this.carouselContainer, - threshold: 0.9 - }) - - const carouselObserver = new IntersectionObserver(entries => { - if (entries[0].isIntersecting) { - this.scrollDistance = this.carouselContainer.getBoundingClientRect().width / 3 - } - }) - - carouselObserver.observe(this.carouselContainer) - - this.carouselSlot.addEventListener('slotchange', e => { - this.carouselItems = this.carouselSlot.assignedElements() - this.carouselItems.forEach(item => allElementsObserver.observe(item)) - if (this.showIndicator) { - this.indicatorsContainer.innerHTML = `` - this.carouselItems.forEach((item, index) => { - let dot = document.createElement('div') - dot.classList.add('dot') - dot.dataset.rank = index - frag.append(dot) - item.dataset.rank = index - }) - this.indicatorsContainer.append(frag) - this.indicators = this.indicatorsContainer.children - } - }) - - this.addEventListener('keyup', e => { - if (e.code === 'ArrowLeft') - this.scrollRight() - else if (e.code === 'ArrowRight') - this.scrollRight() - }) - - this.nextArrow.addEventListener('click', this.scrollRight) - this.previousArrow.addEventListener('click', this.scrollLeft) - this.indicatorsContainer.addEventListener('click', this.handleIndicatorClick) - } - - async attributeChangedCallback(name, oldValue, newValue) { - if (oldValue !== newValue) { - if (name === 'indicator') { - if (this.hasAttribute('indicator')) - this.showIndicator = true - else - this.showIndicator = false - } - if (name === 'autoplay') { - if (this.hasAttribute('autoplay')) { - this.initialTimeout = setTimeout(() => { - this.isAutoPlaying = true - this.autoPlay() - }, this.autoPlayInterval); - } - else { - this.isAutoPlaying = false - clearTimeout(this.autoPlayTimeout) - clearTimeout(this.initialTimeout) - } - - } - if (name === 'interval') { - if (this.hasAttribute('interval') && this.getAttribute('interval').trim() !== '') { - this.autoPlayInterval = Math.abs(parseInt(this.getAttribute('interval').trim())) - } - else { - this.autoPlayInterval = 5000 - } - } - } - } - - disconnectedCallback() { - this.nextArrow.removeEventListener('click', this.scrollRight) - this.previousArrow.removeEventListener('click', this.scrollLeft) - this.indicatorsContainer.removeEventListener('click', this.handleIndicatorClick) - } -}) - -//notifications - -const smNotifications = document.createElement('template') -smNotifications.innerHTML = ` - -
-` - -customElements.define('sm-notifications', class extends HTMLElement { - constructor() { - super() - this.shadow = this.attachShadow({ - mode: 'open' - }).append(smNotifications.content.cloneNode(true)) - } - - handleTouchStart = (e) => { - this.notification = e.target.closest('.notification') - this.touchStartX = e.changedTouches[0].clientX - this.notification.style.transition = 'initial' - this.touchStartTime = e.timeStamp - } - - handleTouchMove = (e) => { - e.preventDefault() - if (this.touchStartX < e.changedTouches[0].clientX) { - this.offset = e.changedTouches[0].clientX - this.touchStartX; - this.touchEndAnimataion = requestAnimationFrame(this.movePopup) - } else { - this.offset = -(this.touchStartX - e.changedTouches[0].clientX); - this.touchEndAnimataion = requestAnimationFrame(this.movePopup) - } - } - - handleTouchEnd = (e) => { - this.notification.style.transition = 'transform 0.3s, opacity 0.3s' - this.touchEndTime = e.timeStamp - cancelAnimationFrame(this.touchEndAnimataion) - this.touchEndX = e.changedTouches[0].clientX - if (this.touchEndTime - this.touchStartTime > 200) { - if (this.touchEndX - this.touchStartX > this.threshold) { - this.removeNotification(this.notification) - } else if (this.touchStartX - this.touchEndX > this.threshold) { - this.removeNotification(this.notification, true) - } else { - this.resetPosition() - } - } else { - if (this.touchEndX > this.touchStartX) { - this.removeNotification(this.notification) - } else { - this.removeNotification(this.notification, true) - } - } - } - - movePopup = () => { - this.notification.style.transform = `translateX(${this.offset}px)` - } - - resetPosition = () => { - this.notification.style.transform = `translateX(0)` - } - - push = (messageBody, type, pinned) => { - let notification = document.createElement('div'), - composition = `` - notification.classList.add('notification') - if (pinned) - notification.classList.add('pinned') - if (type === 'error') { - composition += ` - - - - - ` - } else if (type === 'success') { - composition += ` - - - ` - } - composition += ` -

${messageBody}

- - Close - - - ` - notification.innerHTML = composition - this.notificationPanel.prepend(notification) - if (window.innerWidth > 640) { - notification.animate([{ - transform: `translateX(1rem)`, - opacity: '0' - }, - { - transform: 'translateX(0)', - opacity: '1' - } - ], this.animationOptions).onfinish = () => { - notification.setAttribute('style', `transform: none;`); - } - } else { - notification.setAttribute('style', `transform: translateY(0); opacity: 1`) - } - notification.addEventListener('touchstart', this.handleTouchStart) - notification.addEventListener('touchmove', this.handleTouchMove) - notification.addEventListener('touchend', this.handleTouchEnd) - } - - removeNotification = (notification, toLeft) => { - if (!this.offset) - this.offset = 0; - - if (toLeft) - notification.animate([{ - transform: `translateX(${this.offset}px)`, - opacity: '1' - }, - { - transform: `translateX(-100%)`, - opacity: '0' - } - ], this.animationOptions).onfinish = () => { - notification.remove() - } - else { - notification.animate([{ - transform: `translateX(${this.offset}px)`, - opacity: '1' - }, - { - transform: `translateX(100%)`, - opacity: '0' - } - ], this.animationOptions).onfinish = () => { - notification.remove() - } - } - } - - clearAll = () => { - Array.from(this.notificationPanel.children).forEach(child => { - this.removeNotification(child) - }) - } - - connectedCallback() { - this.notificationPanel = this.shadowRoot.querySelector('.notification-panel') - this.animationOptions = { - duration: 300, - fill: "forwards", - easing: "ease" - } - this.fontSize = Number(window.getComputedStyle(document.body).getPropertyValue('font-size').match(/\d+/)[0]) - this.notification - this.offset - this.touchStartX = 0 - this.touchEndX = 0 - this.touchStartTime = 0 - this.touchEndTime = 0 - this.threshold = this.notificationPanel.getBoundingClientRect().width * 0.3 - this.touchEndAnimataion; - - this.notificationPanel.addEventListener('click', e => { - if (e.target.closest('.close'))( - this.removeNotification(e.target.closest('.notification')) - ) - }) - - const observer = new MutationObserver(mutationList => { - mutationList.forEach(mutation => { - if (mutation.type === 'childList') { - if (mutation.addedNodes.length) { - if (!mutation.addedNodes[0].classList.contains('pinned')) - setTimeout(() => { - this.removeNotification(mutation.addedNodes[0]) - }, 5000); - if (window.innerWidth > 640) - this.notificationPanel.style.padding = '1.5rem 0 3rem 1.5rem'; - else - this.notificationPanel.style.padding = '1rem 1rem 2rem 1rem'; - } else if (mutation.removedNodes.length && !this.notificationPanel.children.length) { - this.notificationPanel.style.padding = 0; - } - } - }) - }) - observer.observe(this.notificationPanel, { - attributes: true, - childList: true, - subtree: true - }) - } -}) - - - -// sm-menu -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)) - } - static get observedAttributes() { - return ['value'] - } - get value() { - return this.getAttribute('value') - } - set value(val) { - this.setAttribute('value', val) - } - expand = () => { - if (!this.open) { - this.optionList.classList.remove('hide') - this.optionList.classList.add('no-transformations') - this.open = true - this.icon.classList.add('focused') - this.availableOptions.forEach(option => { - option.setAttribute('tabindex', '0') - }) - } - } - collapse() { - if (this.open) { - this.open = false - this.icon.classList.remove('focused') - this.optionList.classList.add('hide') - this.optionList.classList.remove('no-transformations') - this.availableOptions.forEach(option => { - option.removeAttribute('tabindex') - }) - } - } - connectedCallback() { - this.availableOptions - this.containerDimensions - this.optionList = this.shadowRoot.querySelector('.options') - let slot = this.shadowRoot.querySelector('.options slot'), - menu = this.shadowRoot.querySelector('.menu') - this.icon = this.shadowRoot.querySelector('.icon') - this.open = false; - menu.addEventListener('click', e => { - if (!this.open) { - this.expand() - } else { - this.collapse() - } - }) - menu.addEventListener('keydown', e => { - if (e.code === 'ArrowDown' || e.code === 'ArrowRight') { - e.preventDefault() - this.availableOptions[0].focus() - } - if (e.code === 'Enter' || e.code === 'Space') { - e.preventDefault() - if (!this.open) { - this.expand() - } else { - this.collapse() - } - } - }) - this.optionList.addEventListener('keydown', e => { - if (e.code === 'ArrowUp' || e.code === 'ArrowRight') { - e.preventDefault() - if (document.activeElement.previousElementSibling) { - document.activeElement.previousElementSibling.focus() - } - } - if (e.code === 'ArrowDown' || e.code === 'ArrowLeft') { - e.preventDefault() - if (document.activeElement.nextElementSibling) - document.activeElement.nextElementSibling.focus() - } - }) - this.optionList.addEventListener('click', e => { - this.collapse() - }) - slot.addEventListener('slotchange', e => { - this.availableOptions = slot.assignedElements() - this.containerDimensions = this.optionList.getBoundingClientRect() - }); - window.addEventListener('mousedown', e => { - if (!this.contains(e.target) && e.button !== 2) { - this.collapse() - } - }) - } -}) - -// option -const smMenuOption = document.createElement('template') -smMenuOption.innerHTML = ` - -
- -
`; -customElements.define('sm-menu-option', class extends HTMLElement { - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smMenuOption.content.cloneNode(true)) - } - - connectedCallback() { - this.addEventListener('keyup', e => { - if (e.code === 'Enter' || e.code === 'Space') { - e.preventDefault() - this.click() - } - }) - } -}) - -// tab-header - -const smTabHeader = document.createElement('template') -smTabHeader.innerHTML = ` - -
-
- -
-
-
-`; - -customElements.define('sm-tab-header', class extends HTMLElement { - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smTabHeader.content.cloneNode(true)) - - this.indicator = this.shadowRoot.querySelector('.indicator'); - this.tabSlot = this.shadowRoot.querySelector('slot'); - this.tabHeader = this.shadowRoot.querySelector('.tab-header'); - } - - sendDetails(element) { - this.dispatchEvent( - new CustomEvent("switchtab", { - bubbles: true, - detail: { - target: this.target, - rank: parseInt(element.getAttribute('rank')) - } - }) - ) - } - - moveIndiactor(tabDimensions) { - //if(this.isTab) - this.indicator.setAttribute('style', `width: ${tabDimensions.width}px; transform: translateX(${tabDimensions.left - this.tabHeader.getBoundingClientRect().left + this.tabHeader.scrollLeft}px)`) - //else - //this.indicator.setAttribute('style', `width: calc(${tabDimensions.width}px - 1.6rem); transform: translateX(calc(${ tabDimensions.left - this.tabHeader.getBoundingClientRect().left + this.tabHeader.scrollLeft}px + 0.8rem)`) - } - - connectedCallback() { - if (!this.hasAttribute('target') || this.getAttribute('target').value === '') return; - this.prevTab - this.allTabs - this.activeTab - this.isTab = false - this.target = this.getAttribute('target') - - if (this.hasAttribute('variant') && this.getAttribute('variant') === 'tab') { - this.isTab = true - } - - this.tabSlot.addEventListener('slotchange', () => { - this.tabSlot.assignedElements().forEach((tab, index) => { - tab.setAttribute('rank', index) - }) - }) - this.allTabs = this.tabSlot.assignedElements(); - - this.tabSlot.addEventListener('click', e => { - if (e.target === this.prevTab || !e.target.closest('sm-tab')) - return - if (this.prevTab) - this.prevTab.classList.remove('active') - e.target.classList.add('active') - - e.target.scrollIntoView({ - behavior: 'smooth', - block: 'nearest', - inline: 'center' - }) - this.moveIndiactor(e.target.getBoundingClientRect()) - this.sendDetails(e.target) - this.prevTab = e.target; - this.activeTab = e.target; - }) - let resizeObserver = new ResizeObserver(entries => { - entries.forEach((entry) => { - if (this.prevTab) { - let tabDimensions = this.activeTab.getBoundingClientRect(); - this.moveIndiactor(tabDimensions) - } - }) - }) - resizeObserver.observe(this) - let observer = new IntersectionObserver((entries) => { - entries.forEach((entry) => { - if (entry.isIntersecting) { - this.indicator.style.transition = 'none' - if (this.activeTab) { - let tabDimensions = this.activeTab.getBoundingClientRect(); - this.moveIndiactor(tabDimensions) - } else { - this.allTabs[0].classList.add('active') - let tabDimensions = this.allTabs[0].getBoundingClientRect(); - this.moveIndiactor(tabDimensions) - this.sendDetails(this.allTabs[0]) - this.prevTab = this.tabSlot.assignedElements()[0]; - this.activeTab = this.prevTab; - } - } - }) - }, { - threshold: 1.0 - }) - observer.observe(this) - } -}) - -// tab-panels - -const smTabPanels = document.createElement('template') -smTabPanels.innerHTML = ` - -
- Nothing to see here. -
-`; - -customElements.define('sm-tab-panels', class extends HTMLElement { - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smTabPanels.content.cloneNode(true)) - this.panelSlot = this.shadowRoot.querySelector('slot'); - } - connectedCallback() { - - //animations - let flyInLeft = [{ - opacity: 0, - transform: 'translateX(-1rem)' - }, - { - opacity: 1, - transform: 'none' - } - ], - flyInRight = [{ - opacity: 0, - transform: 'translateX(1rem)' - }, - { - opacity: 1, - transform: 'none' - } - ], - flyOutLeft = [{ - opacity: 1, - transform: 'none' - }, - { - opacity: 0, - transform: 'translateX(-1rem)' - } - ], - flyOutRight = [{ - opacity: 1, - transform: 'none' - }, - { - opacity: 0, - transform: 'translateX(1rem)' - } - ], - animationOptions = { - duration: 300, - fill: 'forwards', - easing: 'ease' - } - this.prevPanel - this.allPanels - this.previousRank - - this.panelSlot.addEventListener('slotchange', () => { - this.panelSlot.assignedElements().forEach((panel) => { - panel.classList.add('hide-completely') - }) - }) - this.allPanels = this.panelSlot.assignedElements() - this._targetBodyFlyRight = (targetBody) => { - targetBody.classList.remove('hide-completely') - targetBody.animate(flyInRight, animationOptions) - } - this._targetBodyFlyLeft = (targetBody) => { - targetBody.classList.remove('hide-completely') - targetBody.animate(flyInLeft, animationOptions) - } - document.addEventListener('switchtab', e => { - if (e.detail.target !== this.id) - return - - if (this.prevPanel) { - let targetBody = this.allPanels[e.detail.rank], - currentBody = this.prevPanel; - if (this.previousRank < e.detail.rank) { - if (currentBody && !targetBody) - currentBody.animate(flyOutLeft, animationOptions).onfinish = () => { - currentBody.classList.add('hide-completely') - } - else if (targetBody && !currentBody) { - this._targetBodyFlyRight(targetBody) - } else if (currentBody && targetBody) { - currentBody.animate(flyOutLeft, animationOptions).onfinish = () => { - currentBody.classList.add('hide-completely') - this._targetBodyFlyRight(targetBody) - } - } - } else { - if (currentBody && !targetBody) - currentBody.animate(flyOutRight, animationOptions).onfinish = () => { - currentBody.classList.add('hide-completely') - } - else if (targetBody && !currentBody) { - this._targetBodyFlyLeft(targetBody) - } else if (currentBody && targetBody) { - currentBody.animate(flyOutRight, animationOptions).onfinish = () => { - currentBody.classList.add('hide-completely') - this._targetBodyFlyLeft(targetBody) - } - } - } - } else { - this.allPanels[e.detail.rank].classList.remove('hide-completely') - } - this.previousRank = e.detail.rank - this.prevPanel = this.allPanels[e.detail.rank]; - }) - } -}) diff --git a/components.js b/components.js index ef67c2e..ce4b1a1 100644 --- a/components.js +++ b/components.js @@ -1,3767 +1,18 @@ -const smButton = document.createElement('template') -smButton.innerHTML = ` - -
- -
`; -customElements.define('sm-button', - class extends HTMLElement { - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smButton.content.cloneNode(true)) - } - static get observedAttributes() { - return ['disabled']; - } - - get disabled() { - return this.hasAttribute('disabled') - } - - set disabled(value) { - if (value) { - this.setAttribute('disabled', '') - }else { - this.removeAttribute('disabled') - } - } - - handleKeyDown(e) { - if (!this.hasAttribute('disabled') && (e.key === 'Enter' || e.code === 'Space')) { - e.preventDefault() - this.click() - } - } - - connectedCallback() { - if (!this.hasAttribute('disabled')) { - this.setAttribute('tabindex', '0') - } - this.setAttribute('role', 'button') - this.addEventListener('keydown', this.handleKeyDown) - } - attributeChangedCallback(name, oldVal, newVal) { - if (name === 'disabled') { - this.removeAttribute('tabindex') - this.setAttribute('aria-disabled', 'true') - } - else { - this.setAttribute('tabindex', '0') - this.setAttribute('aria-disabled', 'false') - } - } - }) -const smCheckbox = document.createElement('template') -smCheckbox.innerHTML = ` - -` -customElements.define('sm-checkbox', class extends HTMLElement { - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smCheckbox.content.cloneNode(true)) - - this.checkbox = this.shadowRoot.querySelector('.checkbox'); - - this.reset = this.reset.bind(this) - this.dispatch = this.dispatch.bind(this) - this.handleKeyDown = this.handleKeyDown.bind(this) - this.handleClick = this.handleClick.bind(this) - } - - static get observedAttributes() { - return ['value', 'disabled', 'checked'] - } - - get disabled() { - return this.hasAttribute('disabled') - } - - set disabled(val) { - if (val) { - this.setAttribute('disabled', '') - } else { - this.removeAttribute('disabled') - } - } - - get checked() { - return this.hasAttribute('checked') - } - - set checked(value) { - if (value) { - this.setAttribute('checked', '') - } - else { - this.removeAttribute('checked') - } - } - - set value(val) { - this.setAttribute('value', val) - } - - get value() { - return this.getAttribute('value') - } - - reset() { - this.removeAttribute('checked') - } - - dispatch(){ - this.dispatchEvent(new CustomEvent('change', { - bubbles: true, - composed: true - })) - } - handleKeyDown(e){ - if (e.code === "Space") { - e.preventDefault() - this.click() - } - } - handleClick(e){ - this.toggleAttribute('checked') - } - - connectedCallback() { - if (!this.hasAttribute('disabled')) { - this.setAttribute('tabindex', '0') - } - this.setAttribute('role', 'checkbox') - if (!this.hasAttribute('checked')) { - this.setAttribute('aria-checked', 'false') - } - this.addEventListener('keydown', this.handleKeyDown) - this.addEventListener('click', this.handleClick) - } - attributeChangedCallback(name, oldValue, newValue) { - if (oldValue !== newValue) { - if (name === 'checked') { - this.setAttribute('aria-checked', this.hasAttribute('checked')) - this.dispatch() - } - else if (name === 'disabled') { - if (this.hasAttribute('disabled')) { - this.removeAttribute('tabindex') - } - else { - this.setAttribute('tabindex', '0') - } - } - } - } - disconnectedCallback() { - this.removeEventListener('keydown', this.handleKeyDown) - this.removeEventListener('change', this.handleClick) - } -}) -const smCopy = document.createElement('template') -smCopy.innerHTML = ` - - -
-

- -
-`; -customElements.define('sm-copy', - class extends HTMLElement { - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smCopy.content.cloneNode(true)) - - this.copyContent = this.shadowRoot.querySelector('.copy-content') - this.copyButton = this.shadowRoot.querySelector('.copy-button') - - this.copy = this.copy.bind(this) - } - static get observedAttributes() { - return ['value'] - } - set value(val) { - this.setAttribute('value', val) - } - get value() { - return this.getAttribute('value') - } - fireEvent() { - this.dispatchEvent( - new CustomEvent('copy', { - composed: true, - bubbles: true, - cancelable: true, - }) - ) - } - copy() { - navigator.clipboard.writeText(this.copyContent.textContent) - .then(res => this.fireEvent()) - .catch(err => console.error(err)) - } - connectedCallback() { - this.copyButton.addEventListener('click', this.copy) - } - attributeChangedCallback(name, oldValue, newValue) { - if (name === 'value') { - this.copyContent.textContent = newValue - } - } - disconnectedCallback() { - this.copyButton.removeEventListener('click', this.copy) - } - }) -const smForm = document.createElement('template') -smForm.innerHTML = ` - -
- -
-` - -customElements.define('sm-form', class extends HTMLElement { - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smForm.content.cloneNode(true)) - - this.form = this.shadowRoot.querySelector('form') - this.formElements - this.requiredElements - this.submitButton - this.resetButton - this.allRequiredValid = false - - this.debounce = this.debounce.bind(this) - this.handleInput = this.handleInput.bind(this) - this.handleKeydown = this.handleKeydown.bind(this) - this.reset = this.reset.bind(this) - } - debounce(callback, wait) { - let timeoutId = null; - return (...args) => { - window.clearTimeout(timeoutId); - timeoutId = window.setTimeout(() => { - callback.apply(null, args); - }, wait); - }; - } - handleInput(e) { - this.allRequiredValid = this.requiredElements.every(elem => elem.isValid) - if (!this.submitButton) return; - if (this.allRequiredValid) { - this.submitButton.disabled = false; - } - else { - this.submitButton.disabled = true; - } - } - handleKeydown(e) { - if (e.key === 'Enter' && e.target.tagName !== 'SM-TEXTAREA' ) { - if (this.allRequiredValid) { - this.submitButton.click() - } - else { - this.requiredElements.find(elem => !elem.isValid).vibrate() - } - } - } - reset() { - this.formElements.forEach(elem => elem.reset()) - } - connectedCallback() { - const slot = this.shadowRoot.querySelector('slot') - slot.addEventListener('slotchange', e => { - this.formElements = [...this.querySelectorAll('sm-input, sm-textarea, sm-checkbox, tags-input, file-input, sm-switch, sm-radio')] - this.requiredElements = this.formElements.filter(elem => elem.hasAttribute('required')) - this.submitButton = e.target.assignedElements().find(elem => elem.getAttribute('variant') === 'primary' || elem.getAttribute('type') === 'submit'); - this.resetButton = e.target.assignedElements().find(elem => elem.getAttribute('type') === 'reset'); - if (this.resetButton) { - this.resetButton.addEventListener('click', this.reset) - } - }) - this.addEventListener('input', this.debounce(this.handleInput, 100)) - this.addEventListener('keydown', this.debounce(this.handleKeydown, 100)) - } - disconnectedCallback() { - this.removeEventListener('input', this.debounce(this.handleInput, 100)) - this.removeEventListener('keydown', this.debounce(this.handleKeydown, 100)) - } -}) - -const smInput = document.createElement('template') -smInput.innerHTML = ` - -
- -

-
-`; -customElements.define('sm-input', - class extends HTMLElement { - - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smInput.content.cloneNode(true)) - - this.inputParent = this.shadowRoot.querySelector('.input') - this.input = this.shadowRoot.querySelector('input') - this.clearBtn = this.shadowRoot.querySelector('.clear') - this.label = this.shadowRoot.querySelector('.label') - this.feedbackText = this.shadowRoot.querySelector('.feedback-text') - this.outerContainer = this.shadowRoot.querySelector('.outer-container') - this._helperText - this._errorText - this.isRequired = false - this.validationFunction - this.reflectedAttributes = ['value', 'required', 'disabled', 'type', 'inputmode', 'readonly', 'min', 'max', 'pattern', 'minlength', 'maxlength', 'step'] - - this.reset = this.reset.bind(this) - this.focusIn = this.focusIn.bind(this) - this.focusOut = this.focusOut.bind(this) - this.fireEvent = this.fireEvent.bind(this) - this.checkInput = this.checkInput.bind(this) - this.vibrate = this.vibrate.bind(this) - } - - static get observedAttributes() { - return ['value', 'placeholder', 'required', 'disabled', 'type', 'inputmode', 'readonly', 'min', 'max', 'pattern', 'minlength', 'maxlength', 'step', 'helper-text', 'error-text'] - } - - get value() { - return this.input.value - } - - set value(val) { - this.input.value = val; - this.checkInput() - this.fireEvent() - } - - get placeholder() { - return this.getAttribute('placeholder') - } - - set placeholder(val) { - this.setAttribute('placeholder', val) - } - - get type() { - return this.getAttribute('type') - } - - set type(val) { - this.setAttribute('type', val) - } - - get validity() { - return this.input.validity - } - - set disabled(value) { - if (value) - this.inputParent.classList.add('disabled') - else - this.inputParent.classList.remove('disabled') - } - set readOnly(value) { - if (value) { - this.setAttribute('readonly', '') - } else { - this.removeAttribute('readonly') - } - } - set customValidation(val) { - - this.validationFunction = val - } - set errorText(val) { - this._errorText = val - } - set helperText(val) { - this._helperText = val - } - get isValid() { - if (this.input.value !== '') { - const _isValid = this.input.checkValidity() - let _customValid = true - if (this.validationFunction) { - _customValid = Boolean(this.validationFunction(this.input.value)) - } - if (_isValid && _customValid) { - this.feedbackText.classList.remove('error') - this.feedbackText.classList.add('success') - this.feedbackText.textContent = '' - } else { - if (this._errorText) { - this.feedbackText.classList.add('error') - this.feedbackText.classList.remove('success') - this.feedbackText.innerHTML = ` - - ${this._errorText} - ` - } - } - return (_isValid && _customValid) - } - } - reset(){ - this.value = '' - } - - focusIn(){ - this.input.focus() - } - - focusOut(){ - this.input.blur() - } - - fireEvent(){ - let event = new Event('input', { - bubbles: true, - cancelable: true, - composed: true - }); - this.dispatchEvent(event); - } - - checkInput(e){ - if (!this.hasAttribute('readonly')) { - if (this.input.value.trim() !== '') { - this.clearBtn.classList.remove('hide') - } else { - this.clearBtn.classList.add('hide') - if (this.isRequired) { - this.feedbackText.textContent = '* required' - } - } - } - if (!this.hasAttribute('placeholder') || this.getAttribute('placeholder').trim() === '') return; - if (this.input.value !== '') { - if (this.animate) - this.inputParent.classList.add('animate-label') - else - this.label.classList.add('hide') - } else { - if (this.animate) - this.inputParent.classList.remove('animate-label') - else - this.label.classList.remove('hide') - } - } - vibrate() { - this.outerContainer.animate([ - { transform: 'translateX(-1rem)' }, - { transform: 'translateX(1rem)' }, - { transform: 'translateX(-0.5rem)' }, - { transform: 'translateX(0.5rem)' }, - { transform: 'translateX(0)' }, - ], { - duration: 300, - easing: 'ease' - }) - } - - - connectedCallback() { - this.animate = this.hasAttribute('animate') - this.setAttribute('role', 'textbox') - this.input.addEventListener('input', this.checkInput) - this.clearBtn.addEventListener('click', this.reset) - } - - attributeChangedCallback(name, oldValue, newValue) { - if (oldValue !== newValue) { - if (this.reflectedAttributes.includes(name)) { - if (this.hasAttribute(name)) { - this.input.setAttribute(name, this.getAttribute(name) ? this.getAttribute(name) : '') - } - else { - this.input.removeAttribute(name) - } - } - if (name === 'placeholder') { - this.label.textContent = newValue; - this.setAttribute('aria-label', newValue); - } - else if (this.hasAttribute('value')) { - this.checkInput() - } - else if (name === 'type') { - if (this.hasAttribute('type') && this.getAttribute('type') === 'number') { - this.input.setAttribute('inputmode', 'numeric') - } - } - else if (name === 'helper-text') { - this._helperText = this.getAttribute('helper-text') - } - else if (name === 'error-text') { - this._errorText = this.getAttribute('error-text') - } - else if (name === 'required') { - this.isRequired = this.hasAttribute('required') - if (this.isRequired) { - this.feedbackText.textContent = '* required' - this.setAttribute('aria-required', 'true') - } - else { - this.feedbackText.textContent = '' - this.setAttribute('aria-required', 'false') - } - } - else if (name === 'readonly') { - if (this.hasAttribute('readonly')) { - this.inputParent.classList.add('readonly') - } else { - this.inputParent.classList.remove('readonly') - } - } - else if (name === 'disabled') { - if (this.hasAttribute('disabled')) { - this.inputParent.classList.add('disabled') - } - else { - this.inputParent.classList.remove('disabled') - } - } - } - } - disconnectedCallback() { - this.input.removeEventListener('input', this.checkInput) - this.clearBtn.removeEventListener('click', this.reset) - } - }) -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 mey 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.addEventListener('keyup', e => { - if (e.code === 'Enter' || e.code === 'Space') { - e.preventDefault() - this.click() - } - }) - } -}) -const smPopup = document.createElement('template') -smPopup.innerHTML = ` - - -`; -customElements.define('sm-popup', class extends HTMLElement { - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smPopup.content.cloneNode(true)) - - this.allowClosing = false - this.isOpen = false - this.pinned = false - this.popupStack - this.offset - this.touchStartY = 0 - this.touchEndY = 0 - this.touchStartTime = 0 - this.touchEndTime = 0 - this.touchEndAnimataion - - this.popupContainer = this.shadowRoot.querySelector('.popup-container') - this.popup = this.shadowRoot.querySelector('.popup') - this.popupBodySlot = this.shadowRoot.querySelector('.popup-body slot') - this.popupHeader = this.shadowRoot.querySelector('.popup-top') - - this.resumeScrolling = this.resumeScrolling.bind(this) - this.show = this.show.bind(this) - this.hide = this.hide.bind(this) - this.handleTouchStart = this.handleTouchStart.bind(this) - this.handleTouchMove = this.handleTouchMove.bind(this) - this.handleTouchEnd = this.handleTouchEnd.bind(this) - this.movePopup = this.movePopup.bind(this) - } - - static get observedAttributes() { - return ['open']; - } - - get open() { - return this.isOpen - } - - resumeScrolling() { - const scrollY = document.body.style.top; - window.scrollTo(0, parseInt(scrollY || '0') * -1); - setTimeout(() => { - document.body.style.overflow = 'auto'; - document.body.style.top = 'initial' - }, 300); - } - - show(options = {}) { - const {pinned = false, popupStack = undefined} = options - if (popupStack) - this.popupStack = popupStack - if (this.popupStack && !this.hasAttribute('open')) { - this.popupStack.push({ - popup: this, - permission: pinned - }) - if (this.popupStack.items.length > 1) { - this.popupStack.items[this.popupStack.items.length - 2].popup.classList.add('stacked') - } - this.dispatchEvent( - new CustomEvent("popupopened", { - bubbles: true, - detail: { - popup: this, - popupStack: this.popupStack - } - }) - ) - this.setAttribute('open', '') - this.pinned = pinned - this.isOpen = true - } - this.popupContainer.classList.remove('hide') - this.popup.style.transform = 'none'; - document.body.style.overflow = 'hidden'; - document.body.style.top = `-${window.scrollY}px` - return this.popupStack - } - hide() { - if (window.innerWidth < 640) - this.popup.style.transform = 'translateY(100%)'; - else - this.popup.style.transform = 'translateY(3rem)'; - this.popupContainer.classList.add('hide') - this.removeAttribute('open') - if (typeof this.popupStack !== 'undefined') { - this.popupStack.pop() - if (this.popupStack.items.length) { - this.popupStack.items[this.popupStack.items.length - 1].popup.classList.remove('stacked') - } else { - this.resumeScrolling() - } - } else { - this.resumeScrolling() - } - - if (this.forms.length) { - setTimeout(() => { - this.forms.forEach(form => form.reset()) - }, 300); - } - setTimeout(() => { - this.dispatchEvent( - new CustomEvent("popupclosed", { - bubbles: true, - detail: { - popup: this, - popupStack: this.popupStack - } - }) - ) - this.isOpen = false - }, 300); - } - - handleTouchStart(e) { - this.touchStartY = e.changedTouches[0].clientY - this.popup.style.transition = 'transform 0.1s' - this.touchStartTime = e.timeStamp - } - - handleTouchMove(e) { - if (this.touchStartY < e.changedTouches[0].clientY) { - this.offset = e.changedTouches[0].clientY - this.touchStartY; - this.touchEndAnimataion = window.requestAnimationFrame(() => this.movePopup()) - } - } - - handleTouchEnd(e) { - this.touchEndTime = e.timeStamp - cancelAnimationFrame(this.touchEndAnimataion) - this.touchEndY = e.changedTouches[0].clientY - this.popup.style.transition = 'transform 0.3s' - this.threshold = this.popup.getBoundingClientRect().height * 0.3 - if (this.touchEndTime - this.touchStartTime > 200) { - if (this.touchEndY - this.touchStartY > this.threshold) { - if (this.pinned) { - this.show() - return - } else - this.hide() - } else { - this.show() - } - } else { - if (this.touchEndY > this.touchStartY) - if (this.pinned) { - this.show() - return - } - else - this.hide() - } - } - - movePopup() { - this.popup.style.transform = `translateY(${this.offset}px)` - } - - connectedCallback() { - this.popupBodySlot.addEventListener('slotchange', () => { - this.forms = this.querySelectorAll('sm-form') - }) - this.popupContainer.addEventListener('mousedown', e => { - if (e.target === this.popupContainer && !this.pinned) { - if (this.pinned) { - this.show() - } else - this.hide() - } - }) - - const resizeObserver = new ResizeObserver(entries => { - for (let entry of entries) { - if (entry.contentBoxSize) { - // Firefox implements `contentBoxSize` as a single content rect, rather than an array - const contentBoxSize = Array.isArray(entry.contentBoxSize) ? entry.contentBoxSize[0] : entry.contentBoxSize; - this.threshold = contentBoxSize.blockSize.height * 0.3 - } else { - this.threshold = entry.contentRect.height * 0.3 - } - } - }); - resizeObserver.observe(this) - - - this.popupHeader.addEventListener('touchstart', (e) => { this.handleTouchStart(e) }, { passive: true }) - this.popupHeader.addEventListener('touchmove', (e) => { this.handleTouchMove(e) }, { passive: true }) - this.popupHeader.addEventListener('touchend', (e) => { this.handleTouchEnd(e) }, { passive: true }) - } - disconnectedCallback() { - 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() - } - attributeChangedCallback(name, oldVal, newVal) { - if (name === 'open') { - if (this.hasAttribute('open')) { - this.show() - } - } - } -}) - -const smSwitch = document.createElement('template') -smSwitch.innerHTML = ` - -` - -customElements.define('sm-switch', class extends HTMLElement { - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smSwitch.content.cloneNode(true)) - this.switch = this.shadowRoot.querySelector('.switch'); - this.input = this.shadowRoot.querySelector('input') - this.isChecked = false - this.isDisabled = false - - this.dispatch = this.dispatch.bind(this) - } - - static get observedAttributes() { - return ['disabled', 'checked'] - } - - get disabled() { - return this.isDisabled - } - - set disabled(val) { - if (val) { - this.setAttribute('disabled', '') - } else { - this.removeAttribute('disabled') - } - } - - get checked() { - return this.isChecked - } - - set checked(value) { - if (value) { - this.setAttribute('checked', '') - } else { - this.removeAttribute('checked') - } - } - - dispatch(){ - this.dispatchEvent(new CustomEvent('change', { - bubbles: true, - composed: true, - detail: { - value: this.isChecked - } - })) - } - - connectedCallback() { - this.addEventListener('keydown', e => { - if (e.code === "Space" && !this.isDisabled) { - e.preventDefault() - this.input.click() - } - }) - this.input.addEventListener('click', e => { - if (this.input.checked) - this.checked = true - else - this.checked = false - this.dispatch() - }) - } - attributeChangedCallback(name, oldValue, newValue) { - if (oldValue !== newValue) { - if (name === 'disabled') { - if (this.hasAttribute('disabled')) { - this.disabled = true - } - else { - this.disabled = false - } - } - else if (name === 'checked') { - if (this.hasAttribute('checked')) { - this.isChecked = true - this.input.checked = true - } - else { - this.isChecked = false - this.input.checked = false - } - } - } - } - -}) -const spinner = document.createElement('template') -spinner.innerHTML = ` - - - -` -class SquareLoader extends HTMLElement { - constructor() { - super(); - this.attachShadow({ - mode: 'open' - }).append(spinner.content.cloneNode(true)) - } -} - -window.customElements.define('sm-spinner', SquareLoader); -const smTabHeader = document.createElement('template') -smTabHeader.innerHTML = ` - -
-
- -
-
-
-`; - -customElements.define('sm-tab-header', class extends HTMLElement { - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smTabHeader.content.cloneNode(true)) - - this.prevTab - this.allTabs - this.activeTab - - this.indicator = this.shadowRoot.querySelector('.indicator'); - this.tabSlot = this.shadowRoot.querySelector('slot'); - this.tabHeader = this.shadowRoot.querySelector('.tab-header'); - - this.changeTab = this.changeTab.bind(this) - this.handleClick = this.handleClick.bind(this) - this.handlePanelChange = this.handlePanelChange.bind(this) - this.moveIndiactor = this.moveIndiactor.bind(this) - } - - fireEvent(index) { - this.dispatchEvent( - new CustomEvent(`switchedtab${this.target}`, { - bubbles: true, - detail: { - index: parseInt(index) - } - }) - ) - } - - moveIndiactor(tabDimensions) { - this.indicator.setAttribute('style', `width: ${tabDimensions.width}px; transform: translateX(${tabDimensions.left - this.tabHeader.getBoundingClientRect().left + this.tabHeader.scrollLeft}px)`) - } - - - changeTab(target) { - if (target === this.prevTab || !target.closest('sm-tab')) - return - if (this.prevTab) - this.prevTab.classList.remove('active') - target.classList.add('active') - - this.tabHeader.scrollTo({ - behavior: 'smooth', - left: target.getBoundingClientRect().left - this.tabHeader.getBoundingClientRect().left + this.tabHeader.scrollLeft - }) - this.moveIndiactor(target.getBoundingClientRect()) - this.prevTab = target; - this.activeTab = target; - } - handleClick(e) { - if (e.target.closest('sm-tab')) { - this.changeTab(e.target) - this.fireEvent(e.target.dataset.index) - } - } - - handlePanelChange(e) { - this.changeTab(this.allTabs[e.detail.index]) - } - - connectedCallback() { - if (!this.hasAttribute('target') || this.getAttribute('target').value === '') return; - this.target = this.getAttribute('target') - - this.tabSlot.addEventListener('slotchange', () => { - this.allTabs = this.tabSlot.assignedElements(); - this.allTabs.forEach((tab, index) => { - tab.dataset.index = index - }) - }) - - this.addEventListener('click', this.handleClick) - document.addEventListener(`switchedpanel${this.target}`, this.handlePanelChange) - - let resizeObserver = new ResizeObserver(entries => { - entries.forEach((entry) => { - if (this.prevTab) { - let tabDimensions = this.activeTab.getBoundingClientRect(); - this.moveIndiactor(tabDimensions) - } - }) - }) - resizeObserver.observe(this) - let observer = new IntersectionObserver((entries) => { - entries.forEach((entry) => { - if (entry.isIntersecting) { - this.indicator.style.transition = 'none' - if (this.activeTab) { - let tabDimensions = this.activeTab.getBoundingClientRect(); - this.moveIndiactor(tabDimensions) - } else { - this.allTabs[0].classList.add('active') - let tabDimensions = this.allTabs[0].getBoundingClientRect(); - this.moveIndiactor(tabDimensions) - this.fireEvent(0) - this.prevTab = this.tabSlot.assignedElements()[0]; - this.activeTab = this.prevTab; - } - } - }) - }, { - threshold: 1.0 - }) - observer.observe(this) - } - disconnectedCallback() { - this.removeEventListener('click', this.handleClick) - document.removeEventListener(`switchedpanel${this.target}`, this.handlePanelChange) - } -}) - -// tab -const smTab = document.createElement('template') -smTab.innerHTML = ` - -
- -
-`; - -customElements.define('sm-tab', class extends HTMLElement { - constructor() { - super() - this.shadow = this.attachShadow({ - mode: 'open' - }).append(smTab.content.cloneNode(true)) - } -}) - -// tab-panels - -const smTabPanels = document.createElement('template') -smTabPanels.innerHTML = ` - -
- Nothing to see here. -
-`; - -customElements.define('sm-tab-panels', class extends HTMLElement { - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smTabPanels.content.cloneNode(true)) - - this.isTransitioning = false - - this.panelContainer = this.shadowRoot.querySelector('.panel-container'); - this.handleTabChange = this.handleTabChange.bind(this) - } - handleTabChange(e) { - this.isTransitioning = true - this.panelContainer.scrollTo({ - left: this.allPanels[e.detail.index].getBoundingClientRect().left - this.panelContainer.getBoundingClientRect().left + this.panelContainer.scrollLeft, - behavior: 'smooth' - }) - setTimeout(() => { - this.isTransitioning = false - }, 300); - } - fireEvent(index) { - this.dispatchEvent( - new CustomEvent(`switchedpanel${this.id}`, { - bubbles: true, - detail: { - index: parseInt(index) - } - }) - ) - } - connectedCallback() { - const slot = this.shadowRoot.querySelector('slot'); - slot.addEventListener('slotchange', (e) => { - this.allPanels = e.target.assignedElements() - this.allPanels.forEach((panel, index) => { - panel.dataset.index = index - intersectionObserver.observe(panel) - }) - }) - document.addEventListener(`switchedtab${this.id}`, this.handleTabChange) - - const intersectionObserver = new IntersectionObserver(entries => { - - entries.forEach(entry => { - if (!this.isTransitioning && entry.isIntersecting) { - this.fireEvent(entry.target.dataset.index) - } - }) - }, { - threshold: 0.6 - }) - } - disconnectedCallback() { - intersectionObserver.disconnect() - document.removeEventListener(`switchedtab${this.id}`, this.handleTabChange) - } -}) - -const themeToggle = document.createElement('template') -themeToggle.innerHTML = ` - - -` - -class ThemeToggle extends HTMLElement { - constructor() { - super(); - - this.attachShadow({ - mode: 'open' - }).append(themeToggle.content.cloneNode(true)) - - this.isChecked = false - this.hasTheme = 'light' - - this.toggleState = this.toggleState.bind(this) - this.fireEvent = this.fireEvent.bind(this) - this.handleThemeChange = this.handleThemeChange.bind(this) - } - static get observedAttributes() { - return ['checked']; - } - - daylight() { - this.hasTheme = 'light' - document.body.dataset.theme = 'light' - this.setAttribute('aria-checked', 'false') - } - - nightlight() { - this.hasTheme = 'dark' - document.body.dataset.theme = 'dark' - this.setAttribute('aria-checked', 'true') - } - - toggleState() { - this.toggleAttribute('checked') - this.fireEvent() - } - handleKeyDown(e) { - if (e.code === 'Space') { - this.toggleState() - } - } - handleThemeChange(e) { - if (e.detail.theme !== this.hasTheme) { - if (e.detail.theme === 'dark') { - this.setAttribute('checked', '') - } - else { - this.removeAttribute('checked') - } - } - } - - fireEvent() { - this.dispatchEvent( - new CustomEvent('themechange', { - bubbles: true, - composed: true, - detail: { - theme: this.hasTheme - } - }) - ) - } - - connectedCallback() { - this.setAttribute('role', 'switch') - this.setAttribute('aria-label', 'theme toggle') - if (localStorage.getItem(`${window.location.hostname}-theme`) === "dark") { - this.nightlight(); - this.setAttribute('checked', '') - } else if (localStorage.getItem(`${window.location.hostname}-theme`) === "light") { - this.daylight(); - this.removeAttribute('checked') - } - else { - if (window.matchMedia(`(prefers-color-scheme: dark)`).matches) { - this.nightlight(); - this.setAttribute('checked', '') - } else { - this.daylight(); - this.removeAttribute('checked') - } - } - this.addEventListener("click", this.toggleState); - this.addEventListener("keydown", this.handleKeyDown); - document.addEventListener('themechange', this.handleThemeChange) - } - - disconnectedCallback() { - this.removeEventListener("click", this.toggleState); - this.removeEventListener("keydown", this.handleKeyDown); - document.removeEventListener('themechange', this.handleThemeChange) - } - - attributeChangedCallback(name, oldVal, newVal) { - if (name === 'checked') { - if (this.hasAttribute('checked')) { - this.nightlight(); - localStorage.setItem(`${window.location.hostname}-theme`, "dark"); - } else { - this.daylight(); - localStorage.setItem(`${window.location.hostname}-theme`, "light"); - } - } - } -} - -window.customElements.define('theme-toggle', ThemeToggle); - -const smTextarea = document.createElement('template') -smTextarea.innerHTML = ` - - -`; -customElements.define('sm-textarea', - class extends HTMLElement { - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smTextarea.content.cloneNode(true)) - - this.textarea = this.shadowRoot.querySelector('textarea') - this.textareaBox = this.shadowRoot.querySelector('.textarea') - this.placeholder = this.shadowRoot.querySelector('.placeholder') - this.reflectedAttributes = ['disabled', 'required', 'readonly', 'rows', 'minlength', 'maxlength'] - - this.reset = this.reset.bind(this) - this.focusIn = this.focusIn.bind(this) - this.fireEvent = this.fireEvent.bind(this) - this.checkInput = this.checkInput.bind(this) - } - static get observedAttributes() { - return ['disabled', 'value', 'placeholder', 'required', 'readonly', 'rows', 'minlength', 'maxlength'] - } - get value() { - return this.textarea.value - } - set value(val) { - this.setAttribute('value', val) - this.fireEvent() - } - get disabled() { - return this.hasAttribute('disabled') - } - set disabled(val) { - if (val) { - this.setAttribute('disabled', '') - } else { - this.removeAttribute('disabled') - } - } - get isValid() { - return this.textarea.checkValidity() - } - reset(){ - this.setAttribute('value', '') - } - focusIn(){ - this.textarea.focus() - } - fireEvent(){ - let event = new Event('input', { - bubbles: true, - cancelable: true, - composed: true - }); - this.dispatchEvent(event); - } - checkInput(){ - if (!this.hasAttribute('placeholder') || this.getAttribute('placeholder') === '') - return; - if (this.textarea.value !== '') { - this.placeholder.classList.add('hide') - } else { - this.placeholder.classList.remove('hide') - } - } - connectedCallback() { - this.textarea.addEventListener('input', e => { - this.textareaBox.dataset.value = this.textarea.value - this.checkInput() - }) - } - attributeChangedCallback(name, oldValue, newValue) { - if (this.reflectedAttributes.includes(name)) { - if (this.hasAttribute(name)) { - this.textarea.setAttribute(name, this.getAttribute(name) ? this.getAttribute(name) : '') - } - else { - this.textContent.removeAttribute(name) - } - } - else if (name === 'placeholder') { - this.placeholder.textContent = this.getAttribute('placeholder') - } - else if (name === 'value') { - this.textarea.value = newValue; - this.textareaBox.dataset.value = newValue - this.checkInput() - } - } - }) - const smNotifications = document.createElement('template') -smNotifications.innerHTML = ` - -
-` - -customElements.define('sm-notifications', class extends HTMLElement { - constructor() { - super() - this.shadow = this.attachShadow({ - mode: 'open' - }).append(smNotifications.content.cloneNode(true)) - - this.notificationPanel = this.shadowRoot.querySelector('.notification-panel') - this.animationOptions = { - duration: 300, - fill: "forwards", - easing: "cubic-bezier(0.175, 0.885, 0.32, 1.275)" - } - - this.push = this.push.bind(this) - this.createNotification = this.createNotification.bind(this) - this.removeNotification = this.removeNotification.bind(this) - this.clearAll = this.clearAll.bind(this) - - } - - randString(length) { - let result = ''; - const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; - for (let i = 0; i < length; i++) - result += characters.charAt(Math.floor(Math.random() * characters.length)); - return result; - } - - createNotification(message, options) { - const { pinned = false, icon = '' } = options - const notification = document.createElement('div') - notification.id = this.randString(8) - notification.classList.add('notification') - let composition = `` - composition += ` -
${icon}
-

${message}

- ` - if (pinned) { - notification.classList.add('pinned') - composition += ` - - ` - } - notification.innerHTML = composition - return notification - } - - push(message, options = {}) { - const notification = this.createNotification(message, options) - this.notificationPanel.append(notification) - notification.animate([ - { - transform: `translateY(1rem)`, - opacity: '0' - }, - { - transform: `none`, - opacity: '1' - }, - ], this.animationOptions) - return notification.id - } - - removeNotification(notification) { - notification.animate([ - { - transform: `none`, - opacity: '1' - }, - { - transform: `translateY(0.5rem)`, - opacity: '0' - } - ], this.animationOptions).onfinish = () => { - notification.remove() - } - } - - clearAll() { - Array.from(this.notificationPanel.children).forEach(child => { - this.removeNotification(child) - }) - } - - connectedCallback() { - this.notificationPanel.addEventListener('click', e => { - if (e.target.closest('.close')) ( - this.removeNotification(e.target.closest('.notification')) - ) - }) - - const observer = new MutationObserver(mutationList => { - mutationList.forEach(mutation => { - if (mutation.type === 'childList') { - if (mutation.addedNodes.length && !mutation.addedNodes[0].classList.contains('pinned')) { - setTimeout(() => { - this.removeNotification(mutation.addedNodes[0]) - }, 5000); - } - } - }) - }) - observer.observe(this.notificationPanel, { - childList: true, - }) - } -}) - -const stripSelect = document.createElement('template') -stripSelect.innerHTML = ` - -
-
- -
- -
- -
-
- -` -customElements.define('strip-select', class extends HTMLElement{ - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(stripSelect.content.cloneNode(true)) - this.stripSelect = this.shadowRoot.querySelector('.strip-select') - this.slottedOptions - this._value - this.scrollDistance - - this.scrollLeft = this.scrollLeft.bind(this) - this.scrollRight = this.scrollRight.bind(this) - this.fireEvent = this.fireEvent.bind(this) - } - get value() { - return this._value - } - scrollLeft(){ - this.stripSelect.scrollBy({ - left: -this.scrollDistance, - behavior: 'smooth' - }) - } - - scrollRight(){ - this.stripSelect.scrollBy({ - left: this.scrollDistance, - behavior: 'smooth' - }) - } - fireEvent(){ - this.dispatchEvent( - new CustomEvent("change", { - bubbles: true, - composed: true, - detail: { - value: this._value - } - }) - ) - } - connectedCallback() { - this.setAttribute('role', 'listbox') - - const slot = this.shadowRoot.querySelector('slot') - const coverLeft = this.shadowRoot.querySelector('.cover--left') - const coverRight = this.shadowRoot.querySelector('.cover--right') - const navButtonLeft = this.shadowRoot.querySelector('.nav-button--left') - const navButtonRight = this.shadowRoot.querySelector('.nav-button--right') - slot.addEventListener('slotchange', e => { - const assignedElements = slot.assignedElements() - assignedElements.forEach(elem => { - if (elem.hasAttribute('selected')) { - elem.setAttribute('active', '') - this._value = elem.value - } - }) - if (!this.hasAttribute('multiline')) { - if (assignedElements.length > 0) { - firstOptionObserver.observe(slot.assignedElements()[0]) - lastOptionObserver.observe(slot.assignedElements()[slot.assignedElements().length - 1]) - } - else { - navButtonLeft.classList.add('hide') - navButtonRight.classList.add('hide') - coverLeft.classList.add('hide') - coverRight.classList.add('hide') - firstOptionObserver.disconnect() - lastOptionObserver.disconnect() - } - } - }) - const resObs = new ResizeObserver(entries => { - entries.forEach(entry => { - if(entry.contentBoxSize) { - // Firefox implements `contentBoxSize` as a single content rect, rather than an array - const contentBoxSize = Array.isArray(entry.contentBoxSize) ? entry.contentBoxSize[0] : entry.contentBoxSize; - - this.scrollDistance = contentBoxSize.inlineSize * 0.6 - } else { - this.scrollDistance = entry.contentRect.width * 0.6 - } - }) - }) - resObs.observe(this) - this.stripSelect.addEventListener('option-clicked', e => { - if (this._value !== e.target.value) { - this._value = e.target.value - slot.assignedElements().forEach(elem => elem.removeAttribute('active')) - e.target.setAttribute('active', '') - e.target.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "center" }) - this.fireEvent() - } - }) - const firstOptionObserver = new IntersectionObserver(entries => { - entries.forEach(entry => { - if (entry.isIntersecting) { - navButtonLeft.classList.add('hide') - coverLeft.classList.add('hide') - } - else { - navButtonLeft.classList.remove('hide') - coverLeft.classList.remove('hide') - } - }) - }, - { - threshold: 0.9, - root: this - }) - const lastOptionObserver = new IntersectionObserver(entries => { - entries.forEach(entry => { - if (entry.isIntersecting) { - navButtonRight.classList.add('hide') - coverRight.classList.add('hide') - } - else { - navButtonRight.classList.remove('hide') - coverRight.classList.remove('hide') - } - }) - }, - { - threshold: 0.9, - root: this - }) - navButtonLeft.addEventListener('click', this.scrollLeft) - navButtonRight.addEventListener('click', this.scrollRight) - } - disconnectedCallback() { - navButtonLeft.removeEventListener('click', this.scrollLeft) - navButtonRight.removeEventListener('click', this.scrollRight) - } -}) - -//Strip option -const stripOption = document.createElement('template') -stripOption.innerHTML = ` - - -` -customElements.define('strip-option', class extends HTMLElement{ - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(stripOption.content.cloneNode(true)) - this._value - this.radioButton = this.shadowRoot.querySelector('input') - - this.fireEvent = this.fireEvent.bind(this) - this.handleKeyDown = this.handleKeyDown.bind(this) - } - get value() { - return this._value - } - fireEvent(){ - this.dispatchEvent( - new CustomEvent("option-clicked", { - bubbles: true, - composed: true, - detail: { - value: this._value - } - }) - ) - } - handleKeyDown(e){ - if (e.key === 'Enter' || e.key === 'Space') { - this.fireEvent() - } - } - connectedCallback() { - this.setAttribute('role', 'option') - this.setAttribute('tabindex', '0') - this._value = this.getAttribute('value') - this.addEventListener('click', this.fireEvent) - this.addEventListener('keydown', this.handleKeyDown) - } - disconnectedCallback() { - this.removeEventListener('click', this.fireEvent) - this.removeEventListener('keydown', this.handleKeyDown) - } -}) - -const smSelect = document.createElement('template') -smSelect.innerHTML = ` - -
-
-
- -
-
- -
-
`; -customElements.define('sm-select', class extends HTMLElement { - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smSelect.content.cloneNode(true)) - - this.reset = this.reset.bind(this) - this.open = this.open.bind(this) - this.collapse = this.collapse.bind(this) - this.toggle = this.toggle.bind(this) - this.handleOptionsNavigation = this.handleOptionsNavigation.bind(this) - this.handleOptionSelection = this.handleOptionSelection.bind(this) - this.handleKeydown = this.handleKeydown.bind(this) - this.handleClickOutside = this.handleClickOutside.bind(this) - - this.availableOptions - this.previousOption - this.isOpen = false; - this.slideDown = [{ - transform: `translateY(-0.5rem)`, - opacity: 0 - }, - { - transform: `translateY(0)`, - opacity: 1 - } - ] - this.slideUp = [{ - transform: `translateY(0)`, - opacity: 1 - }, - { - transform: `translateY(-0.5rem)`, - opacity: 0 - } - ] - this.animationOptions = { - duration: 300, - fill: "forwards", - easing: 'ease' - } - - this.optionList = this.shadowRoot.querySelector('.options') - this.chevron = this.shadowRoot.querySelector('.toggle') - this.selection = this.shadowRoot.querySelector('.selection') - this.selectedOptionText = this.shadowRoot.querySelector('.selected-option-text') - } - static get observedAttributes() { - return ['value', 'disabled'] - } - get value() { - return this.getAttribute('value') - } - set value(val) { - this.setAttribute('value', val) - } - - reset(fire = true) { - if (this.availableOptions[0] && this.previousOption !== this.availableOptions[0]) { - const firstElement = this.availableOptions[0]; - if (this.previousOption) { - this.previousOption.classList.remove('check-selected') - } - firstElement.classList.add('check-selected') - this.value = firstElement.getAttribute('value') - this.selectedOptionText.textContent = firstElement.textContent - this.previousOption = firstElement; - if (fire) { - this.fireEvent() - } - } - } - - open() { - this.optionList.classList.remove('hide') - this.optionList.animate(this.slideDown, this.animationOptions) - this.chevron.classList.add('rotate') - this.isOpen = true - } - collapse() { - this.chevron.classList.remove('rotate') - this.optionList.animate(this.slideUp, this.animationOptions) - .onfinish = () => { - this.optionList.classList.add('hide') - this.isOpen = false - } - } - toggle() { - if (!this.isOpen && !this.hasAttribute('disabled')) { - this.open() - } else { - this.collapse() - } - } - - fireEvent() { - this.dispatchEvent(new CustomEvent('change', { - bubbles: true, - composed: true, - detail: { - value: this.value - } - })) - } - - handleOptionsNavigation(e) { - 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() - } - } - } - handleOptionSelection(e) { - if (this.previousOption !== document.activeElement) { - this.value = document.activeElement.getAttribute('value') - this.selectedOptionText.textContent = document.activeElement.textContent; - this.fireEvent() - if (this.previousOption) { - this.previousOption.classList.remove('check-selected') - } - document.activeElement.classList.add('check-selected') - this.previousOption = document.activeElement - } - } - handleClick(e) { - if (e.target === this) { - this.toggle() - } - else { - this.handleOptionSelection() - this.collapse() - } - } - handleKeydown(e) { - if (e.target === this) { - if (this.isOpen && e.code === 'ArrowDown') { - e.preventDefault() - this.availableOptions[0].focus() - this.handleOptionSelection(e) - } - else if (e.code === 'Enter' || e.code === 'Space') { - e.preventDefault() - this.toggle() - } - } - else { - this.handleOptionsNavigation(e) - this.handleOptionSelection(e) - if (e.code === 'Enter' || e.code === 'Space') { - e.preventDefault() - this.collapse() - } - } - } - handleClickOutside(e) { - if (this.isOpen && !this.contains(e.target)) { - this.collapse() - } - } - connectedCallback() { - this.setAttribute('role', 'listbox') - if (!this.hasAttribute('disabled')) { - this.selection.setAttribute('tabindex', '0') - } - let slot = this.shadowRoot.querySelector('slot') - slot.addEventListener('slotchange', e => { - this.availableOptions = slot.assignedElements() - this.reset(false) - }); - this.addEventListener('click', this.handleClick) - 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) - } - attributeChangedCallback(name) { - if (name === "disabled") { - if (this.hasAttribute('disabled')) { - this.selection.removeAttribute('tabindex') - } else { - this.selection.setAttribute('tabindex', '0') - } - } - } -}) - -// option -const smOption = document.createElement('template') -smOption.innerHTML = ` - -
- - -
`; -customElements.define('sm-option', class extends HTMLElement { - constructor() { - super() - this.attachShadow({ - mode: 'open' - }).append(smOption.content.cloneNode(true)) - } - - connectedCallback() { - this.setAttribute('role', 'option') - this.setAttribute('tabindex', '0') - } -}) +const smButton = document.createElement("template"); smButton.innerHTML = "\n\n
\n \n
", customElements.define("sm-button", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smButton.content.cloneNode(!0)) } static get observedAttributes() { return ["disabled"] } get disabled() { return this.hasAttribute("disabled") } set disabled(t) { t ? this.setAttribute("disabled", "") : this.removeAttribute("disabled") } focusIn() { this.focus() } handleKeyDown(t) { this.hasAttribute("disabled") || "Enter" !== t.key && " " !== t.key || (t.preventDefault(), this.click()) } connectedCallback() { this.hasAttribute("disabled") || this.setAttribute("tabindex", "0"), this.setAttribute("role", "button"), this.addEventListener("keydown", this.handleKeyDown) } attributeChangedCallback(t) { "disabled" === t && (this.hasAttribute("disabled") ? this.removeAttribute("tabindex") : this.setAttribute("tabindex", "0"), this.setAttribute("aria-disabled", this.hasAttribute("disabled"))) } }); +const smCheckbox = document.createElement("template"); smCheckbox.innerHTML = '\n\n', customElements.define("sm-checkbox", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smCheckbox.content.cloneNode(!0)), this.defaultState, this.checkbox = this.shadowRoot.querySelector(".checkbox"), this.reset = this.reset.bind(this), this.dispatch = this.dispatch.bind(this), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleClick = this.handleClick.bind(this) } static get observedAttributes() { return ["value", "disabled", "checked"] } get disabled() { return this.hasAttribute("disabled") } set disabled(e) { e ? this.setAttribute("disabled", "") : this.removeAttribute("disabled") } get checked() { return this.hasAttribute("checked") } set checked(e) { e ? this.setAttribute("checked", "") : this.removeAttribute("checked") } set value(e) { this.setAttribute("value", e) } get value() { return this.getAttribute("value") } focusIn() { this.focus() } reset() { this.value = this.defaultState } dispatch() { this.dispatchEvent(new CustomEvent("change", { bubbles: !0, composed: !0 })) } handleKeyDown(e) { " " === e.key && (e.preventDefault(), this.click()) } handleClick(e) { this.toggleAttribute("checked") } connectedCallback() { this.hasAttribute("disabled") || this.setAttribute("tabindex", "0"), this.setAttribute("role", "checkbox"), this.defaultState = this.hasAttribute("checked"), this.hasAttribute("checked") || this.setAttribute("aria-checked", "false"), this.addEventListener("keydown", this.handleKeyDown), this.addEventListener("click", this.handleClick) } attributeChangedCallback(e, t, n) { t !== n && ("checked" === e ? (this.setAttribute("aria-checked", this.hasAttribute("checked")), this.dispatch()) : "disabled" === e && (this.hasAttribute("disabled") ? this.removeAttribute("tabindex") : this.setAttribute("tabindex", "0"))) } disconnectedCallback() { this.removeEventListener("keydown", this.handleKeyDown), this.removeEventListener("change", this.handleClick) } }); +const smCopy = document.createElement("template"); smCopy.innerHTML = '\n\n
\n

\n \n
\n', customElements.define("sm-copy", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smCopy.content.cloneNode(!0)), this.copyContent = this.shadowRoot.querySelector(".copy-content"), this.copyButton = this.shadowRoot.querySelector(".copy-button"), this.copy = this.copy.bind(this) } static get observedAttributes() { return ["value"] } set value(n) { this.setAttribute("value", n) } get value() { return this.getAttribute("value") } fireEvent() { this.dispatchEvent(new CustomEvent("copy", { composed: !0, bubbles: !0, cancelable: !0 })) } copy() { navigator.clipboard.writeText(this.copyContent.textContent).then(n => this.fireEvent()).catch(n => console.error(n)) } connectedCallback() { this.copyButton.addEventListener("click", this.copy) } attributeChangedCallback(n, t, o) { "value" === n && (this.copyContent.textContent = o) } disconnectedCallback() { this.copyButton.removeEventListener("click", this.copy) } }); +const smForm = document.createElement("template"); smForm.innerHTML = '\n \n
\n \n
\n ', customElements.define("sm-form", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smForm.content.cloneNode(!0)), this.form = this.shadowRoot.querySelector("form"), this.formElements, this.requiredElements, this.submitButton, this.resetButton, this.invalidFields = !1, this.mutationObserver, this.debounce = this.debounce.bind(this), this._checkValidity = this._checkValidity.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.reset = this.reset.bind(this), this.elementsChanged = this.elementsChanged.bind(this) } debounce(t, e) { let i = null; return (...s) => { window.clearTimeout(i), i = window.setTimeout(() => { t.apply(null, s) }, e) } } _checkValidity() { this.submitButton && (this.invalidFields = this.requiredElements.filter(t => !t.isValid), this.submitButton.disabled = this.invalidFields.length) } handleKeydown(t) { "Enter" === t.key && t.target.tagName.includes("SM-INPUT") && (this.invalidFields.length ? this.requiredElements.forEach(t => { t.isValid || t.vibrate() }) : (this.submitButton && this.submitButton.click(), this.dispatchEvent(new CustomEvent("submit", { bubbles: !0, composed: !0 })))) } reset() { this.formElements.forEach(t => t.reset()) } elementsChanged() { this.formElements = [...this.querySelectorAll("sm-input, sm-textarea, sm-checkbox, tags-input, file-input, sm-switch, sm-radio")], this.requiredElements = this.formElements.filter(t => t.hasAttribute("required")), this.submitButton = this.querySelector('[variant="primary"], [type="submit"]'), this.resetButton = this.querySelector('[type="reset"]'), this.resetButton && this.resetButton.addEventListener("click", this.reset), this._checkValidity() } connectedCallback() { this.shadowRoot.querySelector("slot").addEventListener("slotchange", this.elementsChanged), this.addEventListener("input", this.debounce(this._checkValidity, 100)), this.addEventListener("keydown", this.debounce(this.handleKeydown, 100)), this.mutationObserver = new MutationObserver(t => { t.forEach(t => { "childList" === t.type && this.elementsChanged() }) }), this.mutationObserver.observe(this, { childList: !0, subtree: !0 }) } disconnectedCallback() { this.removeEventListener("input", this.debounce(this._checkValidity, 100)), this.removeEventListener("keydown", this.debounce(this.handleKeydown, 100)), this.mutationObserver.disconnect() } }); +const smInput = document.createElement("template"); smInput.innerHTML = '\n \n
\n \n \n

\n
\n ', customElements.define("sm-input", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smInput.content.cloneNode(!0)), this.inputParent = this.shadowRoot.querySelector(".input"), this.input = this.shadowRoot.querySelector("input"), this.clearBtn = this.shadowRoot.querySelector(".clear"), this.label = this.shadowRoot.querySelector(".label"), this.feedbackText = this.shadowRoot.querySelector(".feedback-text"), this.outerContainer = this.shadowRoot.querySelector(".outer-container"), this.optionList = this.shadowRoot.querySelector(".datalist"), this._helperText = "", this._errorText = "", this.isRequired = !1, this.datalist = [], this.validationFunction = void 0, this.reflectedAttributes = ["value", "required", "disabled", "type", "inputmode", "readonly", "min", "max", "pattern", "minlength", "maxlength", "step", "list", "autocomplete"], this.reset = this.reset.bind(this), this.clear = this.clear.bind(this), this.focusIn = this.focusIn.bind(this), this.focusOut = this.focusOut.bind(this), this.fireEvent = this.fireEvent.bind(this), this.checkInput = this.checkInput.bind(this), this.allowOnlyNum = this.allowOnlyNum.bind(this), this.vibrate = this.vibrate.bind(this), this.handleOptionClick = this.handleOptionClick.bind(this), this.handleInputNavigation = this.handleInputNavigation.bind(this), this.handleDatalistNavigation = this.handleDatalistNavigation.bind(this) } static get observedAttributes() { return ["value", "placeholder", "required", "disabled", "type", "inputmode", "readonly", "min", "max", "pattern", "minlength", "maxlength", "step", "helper-text", "error-text", "list"] } get value() { return this.input.value } set value(t) { t !== this.input.value && (this.input.value = t, this.checkInput()) } get placeholder() { return this.getAttribute("placeholder") } set placeholder(t) { this.setAttribute("placeholder", t) } get type() { return this.getAttribute("type") } set type(t) { this.setAttribute("type", t) } get validity() { return this.input.validity } get disabled() { return this.hasAttribute("disabled") } set disabled(t) { t ? this.inputParent.classList.add("disabled") : this.inputParent.classList.remove("disabled") } get readOnly() { return this.hasAttribute("readonly") } set readOnly(t) { t ? this.setAttribute("readonly", "") : this.removeAttribute("readonly") } set customValidation(t) { this.validationFunction = t } set errorText(t) { this._errorText = t } set helperText(t) { this._helperText = t } get isValid() { if ("" !== this.input.value) { const t = this.input.checkValidity(); let e = !0; return this.validationFunction && (e = Boolean(this.validationFunction(this.input.value))), t && e ? (this.feedbackText.classList.remove("error"), this.feedbackText.classList.add("success"), this.feedbackText.textContent = "") : this._errorText && (this.feedbackText.classList.add("error"), this.feedbackText.classList.remove("success"), this.feedbackText.innerHTML = `\n \n ${this._errorText}`), t && e } } reset() { this.value = "" } clear() { this.value = "", this.input.focus(), this.fireEvent() } focusIn() { this.input.focus() } focusOut() { this.input.blur() } fireEvent() { let t = new Event("input", { bubbles: !0, cancelable: !0, composed: !0 }); this.dispatchEvent(t) } searchDatalist(t) { const e = this.datalist.filter(e => e.toLowerCase().includes(t.toLowerCase())); if (e.sort((e, n) => { const i = e.toLowerCase().indexOf(t.toLowerCase()), s = n.toLowerCase().indexOf(t.toLowerCase()); return i - s }), e.length) { if (this.optionList.children.length > e.length) { const t = this.optionList.children.length - e.length; for (let e = 0; e < t; e++)this.optionList.removeChild(this.optionList.lastChild) } e.forEach((t, e) => { if (this.optionList.children[e]) this.optionList.children[e].textContent = t; else { const e = document.createElement("li"); e.textContent = t, e.classList.add("datalist-item"), e.setAttribute("tabindex", "0"), this.optionList.appendChild(e) } }), this.optionList.classList.remove("hidden") } else this.optionList.classList.add("hidden") } checkInput(t) { this.hasAttribute("readonly") || (this.clearBtn.style.visibility = "" !== this.input.value ? "visible" : "hidden"), this.hasAttribute("placeholder") && "" !== this.getAttribute("placeholder").trim() && ("" !== this.input.value ? (this.animate ? this.inputParent.classList.add("animate-placeholder") : this.label.classList.add("hidden"), this.datalist.length && (this.searchTimeout && clearTimeout(this.searchTimeout), this.searchTimeout = setTimeout(() => { this.searchDatalist(this.input.value.trim()) }, 100))) : (this.animate ? this.inputParent.classList.remove("animate-placeholder") : this.label.classList.remove("hidden"), this.feedbackText.textContent = "", this.datalist.length && (this.optionList.innerHTML = "", this.optionList.classList.add("hidden")))) } allowOnlyNum(t) { 1 === t.key.length && (("." !== t.key || !t.target.value.includes(".") && 0 !== t.target.value.length) && ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "."].includes(t.key) || t.preventDefault()) } vibrate() { this.outerContainer.animate([{ transform: "translateX(-1rem)" }, { transform: "translateX(1rem)" }, { transform: "translateX(-0.5rem)" }, { transform: "translateX(0.5rem)" }, { transform: "translateX(0)" }], { duration: 300, easing: "ease" }) } handleOptionClick(t) { this.input.value = t.target.textContent, this.optionList.classList.add("hidden"), this.input.focus() } handleInputNavigation(t) { "ArrowDown" === t.key ? (t.preventDefault(), this.optionList.children.length && this.optionList.children[0].focus()) : "ArrowUp" === t.key && (t.preventDefault(), this.optionList.children.length && this.optionList.children[this.optionList.children.length - 1].focus()) } handleDatalistNavigation(t) { "ArrowUp" === t.key ? (t.preventDefault(), this.shadowRoot.activeElement.previousElementSibling ? this.shadowRoot.activeElement.previousElementSibling.focus() : this.input.focus()) : "ArrowDown" === t.key ? (t.preventDefault(), this.shadowRoot.activeElement.nextElementSibling ? this.shadowRoot.activeElement.nextElementSibling.focus() : this.input.focus()) : "Enter" !== t.key && " " !== t.key || (t.preventDefault(), this.input.value = t.target.textContent, this.optionList.classList.add("hidden"), this.input.focus()) } connectedCallback() { this.animate = this.hasAttribute("animate"), this.setAttribute("role", "textbox"), this.input.addEventListener("input", this.checkInput), this.clearBtn.addEventListener("click", this.clear), this.datalist.length && (this.optionList.addEventListener("click", this.handleOptionClick), this.input.addEventListener("keydown", this.handleInputNavigation), this.optionList.addEventListener("keydown", this.handleDatalistNavigation)) } attributeChangedCallback(t, e, n) { e !== n && (this.reflectedAttributes.includes(t) && (this.hasAttribute(t) ? this.input.setAttribute(t, this.getAttribute(t) ? this.getAttribute(t) : "") : this.input.removeAttribute(t)), "placeholder" === t ? (this.label.textContent = n, this.setAttribute("aria-label", n)) : this.hasAttribute("value") ? this.checkInput() : "type" === t ? this.hasAttribute("type") && "number" === this.getAttribute("type") ? (this.input.setAttribute("inputmode", "decimal"), this.input.addEventListener("keydown", this.allowOnlyNum)) : this.input.removeEventListener("keydown", this.allowOnlyNum) : "helper-text" === t ? this._helperText = this.getAttribute("helper-text") : "error-text" === t ? this._errorText = this.getAttribute("error-text") : "required" === t ? (this.isRequired = this.hasAttribute("required"), this.isRequired ? this.setAttribute("aria-required", "true") : this.setAttribute("aria-required", "false")) : "readonly" === t ? this.hasAttribute("readonly") ? this.inputParent.classList.add("readonly") : this.inputParent.classList.remove("readonly") : "disabled" === t ? this.hasAttribute("disabled") ? this.inputParent.classList.add("disabled") : this.inputParent.classList.remove("disabled") : "list" === t && this.hasAttribute("list") && "" !== this.getAttribute("list").trim() && (this.datalist = this.getAttribute("list").split(","))) } disconnectedCallback() { this.input.removeEventListener("input", this.checkInput), this.clearBtn.removeEventListener("click", this.clear), this.input.removeEventListener("keydown", this.allowOnlyNum), this.optionList.removeEventListener("click", this.handleOptionClick), this.input.removeEventListener("keydown", this.handleInputNavigation), this.optionList.removeEventListener("keydown", this.handleDatalistNavigation) } }); +const smMenu = document.createElement("template"); smMenu.innerHTML = '\n\n
\n \n
\n \n
\n
', customElements.define("sm-menu", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smMenu.content.cloneNode(!0)), this.isOpen = !1, 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(n) { this.setAttribute("value", n) } expand() { 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 = !0, this.icon.classList.add("focused") })) } collapse() { 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 = !1, this.icon.classList.remove("focused"), this.optionList.classList.add("hide") })) } toggle() { this.isOpen ? this.collapse() : this.expand() } handleKeyDown(n) { n.target === this ? "ArrowDown" === n.key ? (n.preventDefault(), this.availableOptions[0].focus()) : "Enter" !== n.key && " " !== n.key || (n.preventDefault(), this.toggle()) : "ArrowUp" === n.key ? (n.preventDefault(), document.activeElement.previousElementSibling ? document.activeElement.previousElementSibling.focus() : this.availableOptions[this.availableOptions.length - 1].focus()) : "ArrowDown" === n.key ? (n.preventDefault(), document.activeElement.nextElementSibling ? document.activeElement.nextElementSibling.focus() : this.availableOptions[0].focus()) : "Enter" !== n.key && " " !== n.key || (n.preventDefault(), n.target.click()) } handleClickOutside(n) { this.contains(n.target) || 2 === n.button || this.collapse() } connectedCallback() { this.setAttribute("role", "listbox"), this.setAttribute("aria-label", "dropdown menu"); const n = this.shadowRoot.querySelector(".options slot"); n.addEventListener("slotchange", n => { this.availableOptions = n.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) } }); const menuOption = document.createElement("template"); menuOption.innerHTML = '\n\n
\n \n
', customElements.define("menu-option", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(menuOption.content.cloneNode(!0)) } connectedCallback() { this.setAttribute("role", "option"), this.setAttribute("tabindex", "0"), this.addEventListener("keyup", n => { "Enter" !== n.key && " " !== n.key || (n.preventDefault(), this.click()) }) } }); +const smNotifications = document.createElement("template"); smNotifications.innerHTML = '\n \n
\n ', customElements.define("sm-notifications", class extends HTMLElement { constructor() { super(), this.shadow = this.attachShadow({ mode: "open" }).append(smNotifications.content.cloneNode(!0)), this.notificationPanel = this.shadowRoot.querySelector(".notification-panel"), this.animationOptions = { duration: 300, fill: "forwards", easing: "cubic-bezier(0.175, 0.885, 0.32, 1.275)" }, this.push = this.push.bind(this), this.createNotification = this.createNotification.bind(this), this.removeNotification = this.removeNotification.bind(this), this.clearAll = this.clearAll.bind(this), this.handlePointerMove = this.handlePointerMove.bind(this), this.startX = 0, this.currentX = 0, this.endX = 0, this.swipeDistance = 0, this.swipeDirection = "", this.swipeThreshold = 0, this.startTime = 0, this.swipeTime = 0, this.swipeTimeThreshold = 200, this.currentTarget = null, this.mediaQuery = window.matchMedia("(min-width: 640px)"), this.handleOrientationChange = this.handleOrientationChange.bind(this), this.isLandscape = !1 } randString(n) { let t = ""; const i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; for (let e = 0; e < n; e++)t += i.charAt(Math.floor(Math.random() * i.length)); return t } createNotification(n, t = {}) { const { pinned: i = !1, icon: e = "", action: o } = t, a = document.createElement("div"); a.id = this.randString(8), a.classList.add("notification"); let r = ""; return r += `\n
${e}
\n ${n}\n `, o && (r += `\n \n `), i && (a.classList.add("pinned"), r += '\n \n '), a.innerHTML = r, a } push(n, t = {}) { const i = this.createNotification(n, t); return this.isLandscape ? this.notificationPanel.append(i) : this.notificationPanel.prepend(i), this.notificationPanel.animate([{ transform: `translateY(${this.isLandscape ? "" : "-"}${i.clientHeight}px)` }, { transform: "none" }], this.animationOptions), i.animate([{ transform: "translateY(-1rem)", opacity: "0" }, { transform: "none", opacity: "1" }], this.animationOptions).onfinish = (n => { n.target.commitStyles(), n.target.cancel() }), i.querySelector(".action") && i.querySelector(".action").addEventListener("click", t.action.callback), i.id } removeNotification(n, t = "left") { if (!n) return; const i = "left" === t ? "-" : "+"; n.animate([{ transform: this.currentX ? `translateX(${this.currentX}px)` : "none", opacity: "1" }, { transform: `translateX(calc(${i}${Math.abs(this.currentX)}px ${i} 1rem))`, opacity: "0" }], this.animationOptions).onfinish = (() => { n.remove() }) } clearAll() { Array.from(this.notificationPanel.children).forEach(n => { this.removeNotification(n) }) } handlePointerMove(n) { this.currentX = n.clientX - this.startX, this.currentTarget.style.transform = `translateX(${this.currentX}px)` } handleOrientationChange(n) { this.isLandscape = n.matches, n.matches } connectedCallback() { this.handleOrientationChange(this.mediaQuery), this.mediaQuery.addEventListener("change", this.handleOrientationChange), this.notificationPanel.addEventListener("pointerdown", n => { n.target.closest(".close") ? this.removeNotification(n.target.closest(".notification")) : n.target.closest(".notification") && (this.swipeThreshold = n.target.closest(".notification").getBoundingClientRect().width / 2, this.currentTarget = n.target.closest(".notification"), this.currentTarget.setPointerCapture(n.pointerId), this.startTime = Date.now(), this.startX = n.clientX, this.startY = n.clientY, this.notificationPanel.addEventListener("pointermove", this.handlePointerMove)) }), this.notificationPanel.addEventListener("pointerup", n => { this.endX = n.clientX, this.endY = n.clientY, this.swipeDistance = Math.abs(this.endX - this.startX), this.swipeTime = Date.now() - this.startTime, this.endX > this.startX ? this.swipeDirection = "right" : this.swipeDirection = "left", this.swipeTime < this.swipeTimeThreshold ? this.swipeDistance > 50 && this.removeNotification(this.currentTarget, this.swipeDirection) : this.swipeDistance > this.swipeThreshold ? this.removeNotification(this.currentTarget, this.swipeDirection) : this.currentTarget.animate([{ transform: `translateX(${this.currentX}px)` }, { transform: "none" }], this.animationOptions).onfinish = (n => { n.target.commitStyles(), n.target.cancel() }), this.notificationPanel.removeEventListener("pointermove", this.handlePointerMove), this.notificationPanel.releasePointerCapture(n.pointerId), this.currentX = 0 }); const n = new MutationObserver(n => { n.forEach(n => { "childList" === n.type && n.addedNodes.length && !n.addedNodes[0].classList.contains("pinned") && setTimeout(() => { this.removeNotification(n.addedNodes[0]) }, 5e3) }) }); n.observe(this.notificationPanel, { childList: !0 }) } disconnectedCallback() { mediaQueryList.removeEventListener("change", handleOrientationChange) } }); +class Stack { constructor() { this.items = [] } push(t) { this.items.push(t) } pop() { return 0 == this.items.length ? "Underflow" : this.items.pop() } peek() { return this.items[this.items.length - 1] } } const popupStack = new Stack, smPopup = document.createElement("template"); smPopup.innerHTML = '\n\n\n', customElements.define("sm-popup", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smPopup.content.cloneNode(!0)), this.allowClosing = !1, this.isOpen = !1, this.pinned = !1, this.offset = 0, this.touchStartY = 0, this.touchEndY = 0, this.touchStartTime = 0, this.touchEndTime = 0, this.touchEndAnimation = void 0, this.focusable, this.autoFocus, this.mutationObserver, this.popupContainer = this.shadowRoot.querySelector(".popup-container"), this.backdrop = this.shadowRoot.querySelector(".background"), this.dialogBox = this.shadowRoot.querySelector(".popup"), this.popupBodySlot = this.shadowRoot.querySelector(".popup-body slot"), this.popupHeader = this.shadowRoot.querySelector(".popup-top"), this.resumeScrolling = this.resumeScrolling.bind(this), this.setStateOpen = this.setStateOpen.bind(this), this.show = this.show.bind(this), this.hide = this.hide.bind(this), this.handleTouchStart = this.handleTouchStart.bind(this), this.handleTouchMove = this.handleTouchMove.bind(this), this.handleTouchEnd = this.handleTouchEnd.bind(this), this.detectFocus = this.detectFocus.bind(this) } static get observedAttributes() { return ["open"] } get open() { return this.isOpen } animateTo(t, e, n) { const i = t.animate(e, { ...n, fill: "both" }); return i.finished.then(() => { i.commitStyles(), i.cancel() }), i } resumeScrolling() { const t = document.body.style.top; window.scrollTo(0, -1 * parseInt(t || "0")), document.body.style.overflow = "", document.body.style.top = "initial" } setStateOpen() { if (!this.isOpen || this.offset) { const t = { duration: 300, easing: "ease" }, e = window.innerWidth > 640 ? "scale(1.1)" : `translateY(${this.offset ? `${this.offset}px` : "100%"})`; this.animateTo(this.dialogBox, [{ opacity: this.offset ? 1 : 0, transform: e }, { opacity: 1, transform: "none" }], t) } } show(t = {}) { const { pinned: e = !1 } = t; if (!this.isOpen) { const t = { duration: 300, easing: "ease" }; popupStack.push({ popup: this, permission: e }), popupStack.items.length > 1 && this.animateTo(popupStack.items[popupStack.items.length - 2].popup.shadowRoot.querySelector(".popup"), [{ transform: "none" }, { transform: window.innerWidth > 640 ? "scale(0.95)" : "translateY(-1.5rem)" }], t), this.popupContainer.classList.remove("hide"), this.offset || this.backdrop.animate([{ opacity: 0 }, { opacity: 1 }], t), this.setStateOpen(), this.dispatchEvent(new CustomEvent("popupopened", { bubbles: !0, detail: { popup: this } })), this.pinned = e, this.isOpen = !0, document.body.style.overflow = "hidden", document.body.style.top = `-${window.scrollY}px`; const n = this.autoFocus || this.focusable[0]; n.tagName.includes("SM-") ? n.focusIn() : n.focus(), this.hasAttribute("open") || this.setAttribute("open", "") } } hide() { const t = { duration: 150, easing: "ease" }; this.backdrop.animate([{ opacity: 1 }, { opacity: 0 }], t), this.animateTo(this.dialogBox, [{ opacity: 1, transform: window.innerWidth > 640 ? "none" : `translateY(${this.offset ? `${this.offset}px` : "0"})` }, { opacity: 0, transform: window.innerWidth > 640 ? "scale(1.1)" : "translateY(100%)" }], t).finished.finally(() => { this.popupContainer.classList.add("hide"), this.dialogBox.style = "", this.removeAttribute("open"), this.forms.length && this.forms.forEach(t => t.reset()), this.dispatchEvent(new CustomEvent("popupclosed", { bubbles: !0, detail: { popup: this } })), this.isOpen = !1 }), popupStack.pop(), popupStack.items.length ? this.animateTo(popupStack.items[popupStack.items.length - 1].popup.shadowRoot.querySelector(".popup"), [{ transform: window.innerWidth > 640 ? "scale(0.95)" : "translateY(-1.5rem)" }, { transform: "none" }], t) : this.resumeScrolling() } handleTouchStart(t) { this.offset = 0, this.popupHeader.addEventListener("touchmove", this.handleTouchMove, { passive: !0 }), this.popupHeader.addEventListener("touchend", this.handleTouchEnd, { passive: !0 }), this.touchStartY = t.changedTouches[0].clientY, this.touchStartTime = t.timeStamp } handleTouchMove(t) { this.touchStartY < t.changedTouches[0].clientY && (this.offset = t.changedTouches[0].clientY - this.touchStartY, this.touchEndAnimation = window.requestAnimationFrame(() => { this.dialogBox.style.transform = `translateY(${this.offset}px)` })) } handleTouchEnd(t) { if (this.touchEndTime = t.timeStamp, cancelAnimationFrame(this.touchEndAnimation), this.touchEndY = t.changedTouches[0].clientY, this.threshold = .3 * this.dialogBox.getBoundingClientRect().height, this.touchEndTime - this.touchStartTime > 200) if (this.touchEndY - this.touchStartY > this.threshold) { if (this.pinned) return void this.setStateOpen(); this.hide() } else this.setStateOpen(); else if (this.touchEndY > this.touchStartY) { if (this.pinned) return void this.setStateOpen(); this.hide() } this.popupHeader.removeEventListener("touchmove", this.handleTouchMove, { passive: !0 }), this.popupHeader.removeEventListener("touchend", this.handleTouchEnd, { passive: !0 }) } detectFocus(t) { if ("Tab" === t.key) { const e = this.focusable[this.focusable.length - 1], n = this.focusable[0]; t.shiftKey && document.activeElement === n ? (t.preventDefault(), e.tagName.includes("SM-") ? e.focusIn() : e.focus()) : t.shiftKey || document.activeElement !== e || (t.preventDefault(), n.tagName.includes("SM-") ? n.focusIn() : n.focus()) } } updateFocusableList() { this.focusable = this.querySelectorAll('sm-button:not([disabled]), button:not([disabled]), [href], sm-input, input:not([readonly]), sm-select, select, sm-checkbox, sm-textarea, textarea, [tabindex]:not([tabindex="-1"])'), this.autoFocus = this.querySelector("[autofocus]") } connectedCallback() { this.popupBodySlot.addEventListener("slotchange", () => { this.forms = this.querySelectorAll("sm-form"), this.updateFocusableList() }), this.popupContainer.addEventListener("mousedown", t => { t.target !== this.popupContainer || this.pinned || (this.pinned ? this.setStateOpen() : this.hide()) }); const t = new ResizeObserver(t => { for (let e of t) if (e.contentBoxSize) { const t = Array.isArray(e.contentBoxSize) ? e.contentBoxSize[0] : e.contentBoxSize; this.threshold = .3 * t.blockSize.height } else this.threshold = .3 * e.contentRect.height }); t.observe(this), this.mutationObserver = new MutationObserver(t => { this.updateFocusableList() }), this.mutationObserver.observe(this, { attributes: !0, childList: !0, subtree: !0 }), this.addEventListener("keydown", this.detectFocus), this.popupHeader.addEventListener("touchstart", this.handleTouchStart, { passive: !0 }) } disconnectedCallback() { this.removeEventListener("keydown", this.detectFocus), resizeObserver.unobserve(), this.mutationObserver.disconnect(), this.popupHeader.removeEventListener("touchstart", this.handleTouchStart, { passive: !0 }) } attributeChangedCallback(t) { "open" === t && this.hasAttribute("open") && this.show() } }); +const smSwitch = document.createElement("template"); smSwitch.innerHTML = '\t\n\n', customElements.define("sm-switch", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smSwitch.content.cloneNode(!0)), this.switch = this.shadowRoot.querySelector(".switch"), this.input = this.shadowRoot.querySelector("input"), this.isChecked = !1, this.isDisabled = !1, this.dispatch = this.dispatch.bind(this) } static get observedAttributes() { return ["disabled", "checked"] } get disabled() { return this.isDisabled } set disabled(n) { n ? this.setAttribute("disabled", "") : this.removeAttribute("disabled") } get checked() { return this.isChecked } set checked(n) { n ? this.setAttribute("checked", "") : this.removeAttribute("checked") } get value() { return this.isChecked } reset() { } dispatch() { this.dispatchEvent(new CustomEvent("change", { bubbles: !0, composed: !0, detail: { value: this.isChecked } })) } connectedCallback() { this.addEventListener("keydown", n => { " " !== n.key || this.isDisabled || (n.preventDefault(), this.input.click()) }), this.input.addEventListener("click", n => { this.input.checked ? this.checked = !0 : this.checked = !1, this.dispatch() }) } attributeChangedCallback(n, e, t) { e !== t && ("disabled" === n ? this.hasAttribute("disabled") ? this.disabled = !0 : this.disabled = !1 : "checked" === n && (this.hasAttribute("checked") ? (this.isChecked = !0, this.input.checked = !0) : (this.isChecked = !1, this.input.checked = !1))) } }); +const smSelect = document.createElement("template"); smSelect.innerHTML = '\n\n
\n
\n
\n \n \n
\n \n
', customElements.define("sm-select", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smSelect.content.cloneNode(!0)), this.focusIn = this.focusIn.bind(this), this.reset = this.reset.bind(this), this.open = this.open.bind(this), this.collapse = this.collapse.bind(this), this.toggle = this.toggle.bind(this), this.handleOptionsNavigation = this.handleOptionsNavigation.bind(this), this.handleOptionSelection = this.handleOptionSelection.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.handleClickOutside = this.handleClickOutside.bind(this), this.selectOption = this.selectOption.bind(this), this.debounce = this.debounce.bind(this), this.availableOptions = [], this.previousOption, this.isOpen = !1, this.label = "", this.isUnderViewport = !1, this.animationOptions = { duration: 300, fill: "forwards", easing: "ease" }, this.optionList = this.shadowRoot.querySelector(".options"), this.selection = this.shadowRoot.querySelector(".selection"), this.selectedOptionText = this.shadowRoot.querySelector(".selected-option-text") } static get observedAttributes() { return ["disabled", "label"] } get value() { return this.getAttribute("value") } set value(t) { const e = this.shadowRoot.querySelector("slot").assignedElements().find(e => e.getAttribute("value") === t); e ? (this.setAttribute("value", t), this.selectOption(e)) : console.warn(`There is no option with ${t} as value`) } debounce(t, e) { let n = null; return (...i) => { window.clearTimeout(n), n = window.setTimeout(() => { t.apply(null, i) }, e) } } reset(t = !0) { if (this.availableOptions[0] && this.previousOption !== this.availableOptions[0]) { const e = this.availableOptions.find(t => t.hasAttribute("selected")) || this.availableOptions[0]; this.value = e.getAttribute("value"), t && this.fireEvent() } } selectOption(t) { this.previousOption !== t && (this.querySelectorAll("[selected]").forEach(t => t.removeAttribute("selected")), this.selectedOptionText.textContent = `${this.label}${t.textContent}`, t.setAttribute("selected", ""), this.previousOption = t) } focusIn() { this.selection.focus() } open() { this.availableOptions.forEach(t => t.setAttribute("tabindex", 0)), this.optionList.classList.remove("hidden"), this.isUnderViewport = this.getBoundingClientRect().bottom + this.optionList.getBoundingClientRect().height > window.innerHeight, this.isUnderViewport ? this.setAttribute("isUnder", "") : this.removeAttribute("isUnder"), this.optionList.animate([{ transform: `translateY(${this.isUnderViewport ? "" : "-"}0.5rem)`, opacity: 0 }, { transform: "translateY(0)", opacity: 1 }], this.animationOptions), this.setAttribute("open", ""), this.style.zIndex = 1e3, (this.availableOptions.find(t => t.hasAttribute("selected")) || this.availableOptions[0]).focus(), this.isOpen = !0 } collapse() { this.removeAttribute("open"), this.optionList.animate([{ transform: "translateY(0)", opacity: 1 }, { transform: `translateY(${this.isUnderViewport ? "" : "-"}0.5rem)`, opacity: 0 }], this.animationOptions).onfinish = (() => { this.availableOptions.forEach(t => t.removeAttribute("tabindex")), this.optionList.classList.add("hidden"), this.isOpen = !1, this.style.zIndex = "auto" }) } toggle() { this.isOpen || this.hasAttribute("disabled") ? this.collapse() : this.open() } fireEvent() { this.dispatchEvent(new CustomEvent("change", { bubbles: !0, composed: !0, detail: { value: this.value } })) } handleOptionsNavigation(t) { "ArrowUp" === t.key ? (t.preventDefault(), document.activeElement.previousElementSibling ? document.activeElement.previousElementSibling.focus() : this.availableOptions[this.availableOptions.length - 1].focus()) : "ArrowDown" === t.key && (t.preventDefault(), document.activeElement.nextElementSibling ? document.activeElement.nextElementSibling.focus() : this.availableOptions[0].focus()) } handleOptionSelection(t) { this.previousOption !== document.activeElement && (this.value = document.activeElement.getAttribute("value"), this.fireEvent()) } handleClick(t) { t.target === this ? this.toggle() : (this.handleOptionSelection(), this.collapse()) } handleKeydown(t) { t.target === this ? this.isOpen && "ArrowDown" === t.key ? (t.preventDefault(), (this.availableOptions.find(t => t.hasAttribute("selected")) || this.availableOptions[0]).focus(), this.handleOptionSelection(t)) : " " === t.key && (t.preventDefault(), this.toggle()) : (this.handleOptionsNavigation(t), this.handleOptionSelection(t), ["Enter", " ", "Escape", "Tab"].includes(t.key) && (t.preventDefault(), this.collapse(), this.focusIn())) } handleClickOutside(t) { this.isOpen && !this.contains(t.target) && this.collapse() } connectedCallback() { this.setAttribute("role", "listbox"), this.hasAttribute("disabled") || this.selection.setAttribute("tabindex", "0"); let t = this.shadowRoot.querySelector("slot"); t.addEventListener("slotchange", this.debounce(e => { this.availableOptions = t.assignedElements(), this.reset(!1) }, 100)), new IntersectionObserver((t, e) => { t.forEach(t => { if (t.isIntersecting) { const t = this.selection.getBoundingClientRect().left; t < window.innerWidth / 2 ? this.setAttribute("align-select", "left") : this.setAttribute("align-select", "right") } }) }).observe(this), this.addEventListener("click", this.handleClick), this.addEventListener("keydown", this.handleKeydown), document.addEventListener("mousedown", this.handleClickOutside) } disconnectedCallback() { this.removeEventListener("click", this.handleClick), this.removeEventListener("click", this.toggle), this.removeEventListener("keydown", this.handleKeydown), document.removeEventListener("mousedown", this.handleClickOutside) } attributeChangedCallback(t) { "disabled" === t ? this.hasAttribute("disabled") ? this.selection.removeAttribute("tabindex") : this.selection.setAttribute("tabindex", "0") : "label" === t && (this.label = this.hasAttribute("label") ? `${this.getAttribute("label")} ` : "") } }); const smOption = document.createElement("template"); smOption.innerHTML = "\n\n
\n \n
", customElements.define("sm-option", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smOption.content.cloneNode(!0)) } connectedCallback() { this.setAttribute("role", "option") } }); +const spinner = document.createElement("template"); spinner.innerHTML = '\n\n\n\n'; class SpinnerLoader extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(spinner.content.cloneNode(!0)) } } window.customElements.define("sm-spinner", SpinnerLoader); +const stripSelect = document.createElement("template"); stripSelect.innerHTML = '\n\n
\n
\n \n
\n \n
\n \n
\n
\n\n', customElements.define("strip-select", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(stripSelect.content.cloneNode(!0)), this.stripSelect = this.shadowRoot.querySelector(".strip-select"), this.slottedOptions = void 0, this._value = void 0, this.scrollDistance = 0, this.assignedElements = [], this.scrollLeft = this.scrollLeft.bind(this), this.scrollRight = this.scrollRight.bind(this), this.fireEvent = this.fireEvent.bind(this), this.setSelectedOption = this.setSelectedOption.bind(this) } get value() { return this._value } set value(t) { this.setSelectedOption(t) } scrollLeft() { this.stripSelect.scrollBy({ left: -this.scrollDistance, behavior: "smooth" }) } scrollRight() { this.stripSelect.scrollBy({ left: this.scrollDistance, behavior: "smooth" }) } setSelectedOption(t) { this._value !== t && (this._value = t, this.assignedElements.forEach(e => { e.value === t ? (e.setAttribute("active", ""), e.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "center" })) : e.removeAttribute("active") })) } fireEvent() { this.dispatchEvent(new CustomEvent("change", { bubbles: !0, composed: !0, detail: { value: this._value } })) } connectedCallback() { this.setAttribute("role", "listbox"); const t = this.shadowRoot.querySelector("slot"), e = this.shadowRoot.querySelector(".cover--left"), n = this.shadowRoot.querySelector(".cover--right"), i = this.shadowRoot.querySelector(".nav-button--left"), s = this.shadowRoot.querySelector(".nav-button--right"); t.addEventListener("slotchange", o => { this.assignedElements = t.assignedElements(), this.assignedElements.forEach(t => { t.hasAttribute("selected") && (t.setAttribute("active", ""), this._value = t.value) }), this.hasAttribute("multiline") || (this.assignedElements.length > 0 ? (r.observe(this.assignedElements[0]), a.observe(this.assignedElements[this.assignedElements.length - 1])) : (i.classList.add("hide"), s.classList.add("hide"), e.classList.add("hide"), n.classList.add("hide"), r.disconnect(), a.disconnect())) }); const o = new ResizeObserver(t => { t.forEach(t => { if (t.contentBoxSize) { const e = Array.isArray(t.contentBoxSize) ? t.contentBoxSize[0] : t.contentBoxSize; this.scrollDistance = .6 * e.inlineSize } else this.scrollDistance = .6 * t.contentRect.width }) }); o.observe(this), this.stripSelect.addEventListener("option-clicked", t => { this._value !== t.target.value && (this.setSelectedOption(t.target.value), this.fireEvent()) }); const r = new IntersectionObserver(t => { t.forEach(t => { t.isIntersecting ? (i.classList.add("hide"), e.classList.add("hide")) : (i.classList.remove("hide"), e.classList.remove("hide")) }) }, { threshold: .9, root: this }), a = new IntersectionObserver(t => { t.forEach(t => { t.isIntersecting ? (s.classList.add("hide"), n.classList.add("hide")) : (s.classList.remove("hide"), n.classList.remove("hide")) }) }, { threshold: .9, root: this }); i.addEventListener("click", this.scrollLeft), s.addEventListener("click", this.scrollRight) } disconnectedCallback() { navButtonLeft.removeEventListener("click", this.scrollLeft), navButtonRight.removeEventListener("click", this.scrollRight) } }); const stripOption = document.createElement("template"); stripOption.innerHTML = '\n\n\n', customElements.define("strip-option", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(stripOption.content.cloneNode(!0)), this._value = void 0, this.radioButton = this.shadowRoot.querySelector("input"), this.fireEvent = this.fireEvent.bind(this), this.handleKeyDown = this.handleKeyDown.bind(this) } get value() { return this._value } fireEvent() { this.dispatchEvent(new CustomEvent("option-clicked", { bubbles: !0, composed: !0, detail: { value: this._value } })) } handleKeyDown(t) { "Enter" !== t.key && "Space" !== t.key || this.fireEvent() } connectedCallback() { this.setAttribute("role", "option"), this.setAttribute("tabindex", "0"), this._value = this.getAttribute("value"), this.addEventListener("click", this.fireEvent), this.addEventListener("keydown", this.handleKeyDown) } disconnectedCallback() { this.removeEventListener("click", this.fireEvent), this.removeEventListener("keydown", this.handleKeyDown) } }); +const smTabHeader = document.createElement("template"); smTabHeader.innerHTML = '\n\n
\n
\n \n
\n
\n
\n', customElements.define("sm-tab-header", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smTabHeader.content.cloneNode(!0)), this.prevTab, this.allTabs, this.activeTab, this.indicator = this.shadowRoot.querySelector(".indicator"), this.tabSlot = this.shadowRoot.querySelector("slot"), this.tabHeader = this.shadowRoot.querySelector(".tab-header"), this.changeTab = this.changeTab.bind(this), this.handleClick = this.handleClick.bind(this), this.handlePanelChange = this.handlePanelChange.bind(this), this.moveIndiactor = this.moveIndiactor.bind(this) } fireEvent(t) { this.dispatchEvent(new CustomEvent(`switchedtab${this.target}`, { bubbles: !0, detail: { index: parseInt(t) } })) } moveIndiactor(t) { this.indicator.setAttribute("style", `width: ${t.width}px; transform: translateX(${t.left - this.tabHeader.getBoundingClientRect().left + this.tabHeader.scrollLeft}px)`) } changeTab(t) { t !== this.prevTab && t.closest("sm-tab") && (this.prevTab && this.prevTab.classList.remove("active"), t.classList.add("active"), this.tabHeader.scrollTo({ behavior: "smooth", left: t.getBoundingClientRect().left - this.tabHeader.getBoundingClientRect().left + this.tabHeader.scrollLeft }), this.moveIndiactor(t.getBoundingClientRect()), this.prevTab = t, this.activeTab = t) } handleClick(t) { t.target.closest("sm-tab") && (this.changeTab(t.target), this.fireEvent(t.target.dataset.index)) } handlePanelChange(t) { this.changeTab(this.allTabs[t.detail.index]) } connectedCallback() { if (!this.hasAttribute("target") || "" === this.getAttribute("target").value) return; this.target = this.getAttribute("target"), this.tabSlot.addEventListener("slotchange", () => { this.allTabs = this.tabSlot.assignedElements(), this.allTabs.forEach((t, e) => { t.dataset.index = e }) }), this.addEventListener("click", this.handleClick), document.addEventListener(`switchedpanel${this.target}`, this.handlePanelChange); let t = new ResizeObserver(t => { t.forEach(t => { if (this.prevTab) { let t = this.activeTab.getBoundingClientRect(); this.moveIndiactor(t) } }) }); t.observe(this); let e = new IntersectionObserver(t => { t.forEach(t => { if (t.isIntersecting) if (this.indicator.style.transition = "none", this.activeTab) { let t = this.activeTab.getBoundingClientRect(); this.moveIndiactor(t) } else { this.allTabs[0].classList.add("active"); let t = this.allTabs[0].getBoundingClientRect(); this.moveIndiactor(t), this.fireEvent(0), this.prevTab = this.tabSlot.assignedElements()[0], this.activeTab = this.prevTab } }) }, { threshold: 1 }); e.observe(this) } disconnectedCallback() { this.removeEventListener("click", this.handleClick), document.removeEventListener(`switchedpanel${this.target}`, this.handlePanelChange) } }); const smTab = document.createElement("template"); smTab.innerHTML = '\n\n
\n\n
\n', customElements.define("sm-tab", class extends HTMLElement { constructor() { super(), this.shadow = this.attachShadow({ mode: "open" }).append(smTab.content.cloneNode(!0)) } }); const smTabPanels = document.createElement("template"); smTabPanels.innerHTML = '\n\n
\n Nothing to see here.\n
\n', customElements.define("sm-tab-panels", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smTabPanels.content.cloneNode(!0)), this.isTransitioning = !1, this.panelContainer = this.shadowRoot.querySelector(".panel-container"), this.handleTabChange = this.handleTabChange.bind(this) } handleTabChange(t) { this.isTransitioning = !0, this.panelContainer.scrollTo({ left: this.allPanels[t.detail.index].getBoundingClientRect().left - this.panelContainer.getBoundingClientRect().left + this.panelContainer.scrollLeft, behavior: "smooth" }), setTimeout(() => { this.isTransitioning = !1 }, 300) } fireEvent(t) { this.dispatchEvent(new CustomEvent(`switchedpanel${this.id}`, { bubbles: !0, detail: { index: parseInt(t) } })) } connectedCallback() { const t = this.shadowRoot.querySelector("slot"); t.addEventListener("slotchange", t => { this.allPanels = t.target.assignedElements(), this.allPanels.forEach((t, n) => { t.dataset.index = n, e.observe(t) }) }), document.addEventListener(`switchedtab${this.id}`, this.handleTabChange); const e = new IntersectionObserver(t => { t.forEach(t => { !this.isTransitioning && t.isIntersecting && this.fireEvent(t.target.dataset.index) }) }, { threshold: .6 }) } disconnectedCallback() { intersectionObserver.disconnect(), document.removeEventListener(`switchedtab${this.id}`, this.handleTabChange) } }); +const smTextarea = document.createElement("template"); smTextarea.innerHTML = '\n \n \n ', customElements.define("sm-textarea", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smTextarea.content.cloneNode(!0)), this.textarea = this.shadowRoot.querySelector("textarea"), this.textareaBox = this.shadowRoot.querySelector(".textarea"), this.placeholder = this.shadowRoot.querySelector(".placeholder"), this.reflectedAttributes = ["disabled", "required", "readonly", "rows", "minlength", "maxlength"], this.reset = this.reset.bind(this), this.focusIn = this.focusIn.bind(this), this.fireEvent = this.fireEvent.bind(this), this.checkInput = this.checkInput.bind(this) } static get observedAttributes() { return ["disabled", "value", "placeholder", "required", "readonly", "rows", "minlength", "maxlength"] } get value() { return this.textarea.value } set value(e) { this.setAttribute("value", e), this.fireEvent() } get disabled() { return this.hasAttribute("disabled") } set disabled(e) { e ? this.setAttribute("disabled", "") : this.removeAttribute("disabled") } get isValid() { return this.textarea.checkValidity() } reset() { this.setAttribute("value", "") } focusIn() { this.textarea.focus() } fireEvent() { let e = new Event("input", { bubbles: !0, cancelable: !0, composed: !0 }); this.dispatchEvent(e) } checkInput() { this.hasAttribute("placeholder") && "" !== this.getAttribute("placeholder") && ("" !== this.textarea.value ? this.placeholder.classList.add("hide") : this.placeholder.classList.remove("hide")) } connectedCallback() { this.textarea.addEventListener("input", e => { this.textareaBox.dataset.value = this.textarea.value, this.checkInput() }) } attributeChangedCallback(e, t, n) { this.reflectedAttributes.includes(e) ? this.hasAttribute(e) ? this.textarea.setAttribute(e, this.getAttribute(e) ? this.getAttribute(e) : "") : this.textContent.removeAttribute(e) : "placeholder" === e ? this.placeholder.textContent = this.getAttribute("placeholder") : "value" === e && (this.textarea.value = n, this.textareaBox.dataset.value = n, this.checkInput()) } }); +const themeToggle = document.createElement("template"); themeToggle.innerHTML = '\n \n \n'; class ThemeToggle extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(themeToggle.content.cloneNode(!0)), this.isChecked = !1, this.hasTheme = "light", this.toggleState = this.toggleState.bind(this), this.fireEvent = this.fireEvent.bind(this), this.handleThemeChange = this.handleThemeChange.bind(this) } static get observedAttributes() { return ["checked"] } daylight() { this.hasTheme = "light", document.body.dataset.theme = "light", this.setAttribute("aria-checked", "false") } nightlight() { this.hasTheme = "dark", document.body.dataset.theme = "dark", this.setAttribute("aria-checked", "true") } toggleState() { this.toggleAttribute("checked"), this.fireEvent() } handleKeyDown(e) { " " === e.key && this.toggleState() } handleThemeChange(e) { e.detail.theme !== this.hasTheme && ("dark" === e.detail.theme ? this.setAttribute("checked", "") : this.removeAttribute("checked")) } fireEvent() { this.dispatchEvent(new CustomEvent("themechange", { bubbles: !0, composed: !0, detail: { theme: this.hasTheme } })) } connectedCallback() { this.setAttribute("role", "switch"), this.setAttribute("aria-label", "theme toggle"), "dark" === localStorage.getItem(`${window.location.hostname}-theme`) ? (this.nightlight(), this.setAttribute("checked", "")) : "light" === localStorage.getItem(`${window.location.hostname}-theme`) ? (this.daylight(), this.removeAttribute("checked")) : window.matchMedia("(prefers-color-scheme: dark)").matches ? (this.nightlight(), this.setAttribute("checked", "")) : (this.daylight(), this.removeAttribute("checked")), this.addEventListener("click", this.toggleState), this.addEventListener("keydown", this.handleKeyDown), document.addEventListener("themechange", this.handleThemeChange) } disconnectedCallback() { this.removeEventListener("click", this.toggleState), this.removeEventListener("keydown", this.handleKeyDown), document.removeEventListener("themechange", this.handleThemeChange) } attributeChangedCallback(e, t, n) { "checked" === e && (this.hasAttribute("checked") ? (this.nightlight(), localStorage.setItem(`${window.location.hostname}-theme`, "dark")) : (this.daylight(), localStorage.setItem(`${window.location.hostname}-theme`, "light"))) } } window.customElements.define("theme-toggle", ThemeToggle); +const cubeLoader = document.createElement("template"); cubeLoader.innerHTML = '\n \n
\n
\n
\n
\n
\n'; class CubeLoader extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(cubeLoader.content.cloneNode(!0)) } } window.customElements.define("cube-loader", CubeLoader); +const smCarousel = document.createElement("template"); smCarousel.innerHTML = '\n\n\n', customElements.define("sm-carousel", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smCarousel.content.cloneNode(!0)), this.isAutoPlaying = !1, this.autoPlayInterval = 5e3, this.autoPlayTimeout, this.initialTimeout, this.activeSlideNum = 0, this.carouselItems, this.indicators, this.showIndicator = !1, this.carousel = this.shadowRoot.querySelector(".carousel"), this.carouselContainer = this.shadowRoot.querySelector(".carousel-container"), this.carouselSlot = this.shadowRoot.querySelector("slot"), this.navButtonRight = this.shadowRoot.querySelector(".carousel__button--right"), this.navButtonLeft = this.shadowRoot.querySelector(".carousel__button--left"), this.indicatorsContainer = this.shadowRoot.querySelector(".indicators"), this.scrollLeft = this.scrollLeft.bind(this), this.scrollRight = this.scrollRight.bind(this), this.handleIndicatorClick = this.handleIndicatorClick.bind(this), this.showSlide = this.showSlide.bind(this), this.nextSlide = this.nextSlide.bind(this), this.autoPlay = this.autoPlay.bind(this), this.startAutoPlay = this.startAutoPlay.bind(this), this.stopAutoPlay = this.stopAutoPlay.bind(this) } static get observedAttributes() { return ["indicator", "autoplay", "interval"] } scrollLeft() { this.carousel.scrollBy({ left: -this.scrollDistance, behavior: "smooth" }) } scrollRight() { this.carousel.scrollBy({ left: this.scrollDistance, behavior: "smooth" }) } showSlide(t) { this.carousel.scrollTo({ left: this.carouselItems[t].getBoundingClientRect().left - this.carousel.getBoundingClientRect().left + this.carousel.scrollLeft, behavior: "smooth" }) } nextSlide() { if (!this.carouselItems) return; let t = this.activeSlideNum + 1 < this.carouselItems.length ? this.activeSlideNum + 1 : 0; this.showSlide(t) } autoPlay() { this.nextSlide(), this.isAutoPlaying && (this.autoPlayTimeout = setTimeout(() => { this.autoPlay() }, this.autoPlayInterval)) } startAutoPlay() { this.setAttribute("autoplay", "") } stopAutoPlay() { this.removeAttribute("autoplay") } createIndicator(t) { let n = document.createElement("div"); return n.classList.add("indicator"), n.dataset.rank = t, n } handleIndicatorClick(t) { if (t.target.closest(".indicator")) { const n = parseInt(t.target.closest(".indicator").dataset.rank); this.activeSlideNum !== n && this.showSlide(n) } } handleKeyDown(t) { "ArrowLeft" === t.code ? this.scrollRight() : "ArrowRight" === t.code && this.scrollRight() } connectedCallback() { let t = document.createDocumentFragment(); this.carouselSlot.addEventListener("slotchange", n => { this.carouselItems = this.carouselSlot.assignedElements(), this.carouselItems.forEach(t => i.observe(t)), this.carouselItems.length > 0 ? (e.observe(this.carouselItems[0]), o.observe(this.carouselItems[this.carouselItems.length - 1])) : (navButtonLeft.classList.add("hide"), navButtonRight.classList.add("hide"), e.disconnect(), o.disconnect()), this.showIndicator && (this.indicatorsContainer.innerHTML = "", this.carouselItems.forEach((n, i) => { t.append(this.createIndicator(i)), n.dataset.rank = i }), this.indicatorsContainer.append(t), this.indicators = this.indicatorsContainer.children) }); const n = { threshold: .9, root: this }, i = new IntersectionObserver(t => { t.forEach(t => { if (this.showIndicator) { const n = parseInt(t.target.dataset.rank); t.isIntersecting ? (this.indicators[n].classList.add("active"), this.activeSlideNum = n) : this.indicators[n].classList.remove("active") } }) }, n), e = new IntersectionObserver(t => { t.forEach(t => { t.isIntersecting ? this.navButtonLeft.classList.add("hide") : this.navButtonLeft.classList.remove("hide") }) }, n), o = new IntersectionObserver(t => { t.forEach(t => { t.isIntersecting ? this.navButtonRight.classList.add("hide") : this.navButtonRight.classList.remove("hide") }) }, n), s = new ResizeObserver(t => { t.forEach(t => { if (t.contentBoxSize) { const n = Array.isArray(t.contentBoxSize) ? t.contentBoxSize[0] : t.contentBoxSize; this.scrollDistance = .6 * n.inlineSize } else this.scrollDistance = .6 * t.contentRect.width }) }); s.observe(this), this.addEventListener("keydown", this.handleKeyDown), this.navButtonRight.addEventListener("click", this.scrollRight), this.navButtonLeft.addEventListener("click", this.scrollLeft), this.indicatorsContainer.addEventListener("click", this.handleIndicatorClick) } attributeChangedCallback(t, n, i) { n !== i && ("indicator" === t && (this.showIndicator = this.hasAttribute("indicator")), "autoplay" === t && (this.hasAttribute("autoplay") ? this.initialTimeout = setTimeout(() => { this.isAutoPlaying = !0, this.autoPlay() }, this.autoPlayInterval) : (this.isAutoPlaying = !1, clearTimeout(this.autoPlayTimeout), clearTimeout(this.initialTimeout))), "interval" === t && (this.hasAttribute("interval") && "" !== this.getAttribute("interval").trim() ? this.autoPlayInterval = Math.abs(parseInt(this.getAttribute("interval").trim())) : this.autoPlayInterval = 5e3)) } disconnectedCallback() { this.navButtonRight.removeEventListener("click", this.scrollRight), this.navButtonLeft.removeEventListener("click", this.scrollLeft), this.indicatorsContainer.removeEventListener("click", this.handleIndicatorClick) } }); +const tagsInput = document.createElement("template"); tagsInput.innerHTML = '\n \n
\n \n

\n
\n', customElements.define("tags-input", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(tagsInput.content.cloneNode(!0)), this.input = this.shadowRoot.querySelector("input"), this.tagsWrapper = this.shadowRoot.querySelector(".tags-wrapper"), this.placeholder = this.shadowRoot.querySelector(".placeholder"), this.reflectedAttributes = ["placeholder", "limit"], this.limit = void 0, this.tags = new Set, this.reset = this.reset.bind(this), this.handleInput = this.handleInput.bind(this), this.addTag = this.addTag.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.handleClick = this.handleClick.bind(this), this.removeTag = this.removeTag.bind(this) } static get observedAttributes() { return ["placeholder", "limit"] } get value() { return [...this.tags].filter(t => void 0 !== t) } set value(t) { this.reset(), [...new Set(t.filter(t => void 0 !== t))].forEach(t => this.addTag(t)) } get isValid() { return this.tags.size } focusIn() { this.input.focus() } reset() { for (this.input.value = "", this.tags.clear(); this.input.previousElementSibling;)this.input.previousElementSibling.remove() } addTag(t) { const e = document.createElement("span"); e.dataset.value = t, e.className = "tag", e.innerHTML = `\n ${t}\n \n `, this.input.before(e), this.tags.add(t) } handleInput(t) { const e = t.target.value.trim().length; t.target.setAttribute("size", e || "3"), e ? this.placeholder.classList.add("hide") : e || this.tags.size || this.placeholder.classList.remove("hide") } handleKeydown(t) { if ("," !== t.key && "/" !== t.key || t.preventDefault(), "" !== t.target.value.trim()) { if ("Enter" === t.key || "," === t.key || "/" === t.key) { const e = t.target.value.trim(); if (this.tags.has(e) ? this.tagsWrapper.querySelector(`[data-value="${e}"]`).animate([{ backgroundColor: "initial" }, { backgroundColor: "var(--accent-color,teal)" }, { backgroundColor: "initial" }], { duration: 300, easing: "ease" }) : this.addTag(e), t.target.value = "", t.target.setAttribute("size", "3"), this.limit && this.limit < this.tags.size + 1) return void (this.input.readOnly = !0) } } else "Backspace" === t.key && this.input.previousElementSibling && this.removeTag(this.input.previousElementSibling), this.limit && this.limit > this.tags.size && (this.input.readOnly = !1) } handleClick(t) { t.target.closest(".tag") ? this.removeTag(t.target.closest(".tag")) : this.input.focus() } removeTag(t) { this.tags.delete(t.dataset.value), t.remove(), this.tags.size || this.placeholder.classList.remove("hide") } connectedCallback() { this.input.addEventListener("input", this.handleInput), this.input.addEventListener("keydown", this.handleKeydown), this.tagsWrapper.addEventListener("click", this.handleClick) } attributeChangedCallback(t, e, n) { "placeholder" === t && (this.placeholder.textContent = n), "limit" === t && (this.limit = parseInt(n)) } disconnectedCallback() { this.input.removeEventListener("input", this.handleInput), this.input.removeEventListener("keydown", this.handleKeydown), this.tagsWrapper.removeEventListener("click", this.handleClick) } }); \ No newline at end of file diff --git a/css/main.css b/css/main.css index 0b56e6d..e4fc39a 100644 --- a/css/main.css +++ b/css/main.css @@ -6,53 +6,88 @@ } :root { - font-size: clamp(1rem, 1.2vmax, 3rem); + font-size: clamp(1rem, 1.2vmax, 1.2rem); } html, body { height: 100%; - scroll-behavior: smooth; } body { + --accent-color: #3d5afe; + --secondary-color: #ffac2e; + --text-color: 20, 20, 20; + --foreground-color: 252, 253, 255; + --background-color: 241, 243, 248; + --danger-color: rgb(255, 75, 75); + --green: #1cad59; + --yellow: rgb(220, 165, 0); + --dark-red: #d40e1e; + --red: #f50000; + --kinda-pink: #e40273; + --purple: #462191; + --shady-blue: #324de6; + --nice-blue: #3d5afe; + --maybe-cyan: #00b0ff; + --teal: #00bcd4; + --mint-green: #16c79a; + --yellowish-green: #66bb6a; + --greenish-yellow: #8bc34a; + --dark-teal: #11698e; + --tangerine: #ff6f00; + --orange: #ff9100; + --redish-orange: #ff3d00; color: rgba(var(--text-color), 1); - background: rgba(var(--background-color), 1); -} -body, -body * { - --accent-color: #5D54A4; - --text-color: 17, 17, 17; - --background-color: 240, 240, 255; - --foreground-color: rgb(248, 248, 255); - --danger-color: red; - scrollbar-width: thin; + background-color: rgba(var(--background-color), 1); + overflow-y: hidden; } -body[data-theme=dark], -body[data-theme=dark] * { - --accent-color: #9D65C9; - --text-color: 240, 240, 240; - --text-color-light: 170, 170, 170; - --background-color: 10, 10, 10; - --foreground-color: rgb(20, 20, 20); +body[data-theme=dark] { + --accent-color: #6d83ff; + --secondary-color: #d60739; + --text-color: 200, 200, 200; + --foreground-color: 27, 28, 29; + --background-color: 21, 22, 22; --danger-color: rgb(255, 106, 106); + --green: #00e676; + --yellow: rgb(255, 213, 5); + --dark-red: #ff5e7e; + --red: #ff6098; + --kinda-pink: #c44ae6; + --purple: #9565f7; + --shady-blue: #8295fb; + --nice-blue: #6d83ff; + --maybe-cyan: #66cfff; + --teal: #6aeeff; + --mint-green: #4dffd2; + --yellowish-green: #9effa2; + --greenish-yellow: #c7fc8b; + --dark-teal: #51cbff; + --tangerine: #ffac6d; + --orange: #ffbe68; + --redish-orange: #ff8560; } body[data-theme=dark] ::-webkit-calendar-picker-indicator { filter: invert(1); } -p { - max-width: 70ch; - line-height: 1.7; - color: rgba(var(--text-color), 0.8); +.calistoga { + font-weight: 400; + font-family: "Calistoga", cursive; } -p:not(:last-of-type) { - margin-bottom: 1.5rem; + +p, +strong { + line-height: 1.7; + font-size: 0.9rem; + color: rgba(var(--text-color), 0.9); + max-width: 70ch; } img { - object-fit: cover; + -o-object-fit: cover; + object-fit: cover; } a:where([class]) { @@ -67,31 +102,226 @@ a { color: var(--accent-color); } +a:-webkit-any-link:focus-visible { + outline: rgba(var(--text-color), 1) 0.1rem solid; +} + +a:-moz-any-link:focus-visible { + outline: rgba(var(--text-color), 1) 0.1rem solid; +} + +a:any-link:focus-visible { + outline: rgba(var(--text-color), 1) 0.1rem solid; +} + button, .button { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; position: relative; display: inline-flex; border: none; background-color: transparent; overflow: hidden; color: inherit; + -webkit-tap-highlight-color: transparent; + align-items: center; + font-size: 0.9rem; + font-weight: 500; + white-space: nowrap; + padding: 0.8rem; + border-radius: 0.3rem; + justify-content: center; +} +button:focus-visible, +.button:focus-visible { + outline: var(--accent-color) solid medium; +} +button:not(:disabled), +.button:not(:disabled) { cursor: pointer; } +.button { + background-color: rgba(var(--text-color), 0.02); + border: solid thin rgba(var(--text-color), 0.06); +} +.button--primary { + color: rgba(var(--background-color), 1) !important; +} +.button--primary .icon { + fill: rgba(var(--background-color), 1); +} +.button--danger { + color: var(--danger-color); +} +.button--danger .icon { + fill: var(--danger-color); +} +.button--primary { + background-color: var(--accent-color); +} +.button--colored { + color: var(--accent-color); +} +.button--colored .icon { + fill: var(--accent-color); +} +.button--small { + padding: 0.4rem 0.6rem; +} +.button--outlined { + border: solid rgba(var(--text-color), 0.3) 0.1rem; + background-color: rgba(var(--foreground-color), 1); +} +.button--transparent { + background-color: transparent; +} + +.cta { + text-transform: uppercase; + font-size: 0.8rem; + font-weight: 700; + letter-spacing: 0.05em; + padding: 0.8rem 1rem; +} + +.icon { + width: 1.2rem; + height: 1.2rem; + fill: rgba(var(--text-color), 0.8); + flex-shrink: 0; +} + +.icon-only { + padding: 0.5rem; + border-radius: 0.3rem; + aspect-ratio: 1/1; +} + button:disabled { opacity: 0.5; } -a.button { - padding: 0.6rem 1.2rem; - border-radius: 0.3rem; - background-color: rgba(var(--text-color), 0.06); +a:-webkit-any-link:focus-visible { + outline: rgba(var(--text-color), 1) 0.1rem solid; +} + +a:-moz-any-link:focus-visible { + outline: rgba(var(--text-color), 1) 0.1rem solid; } a:any-link:focus-visible { outline: rgba(var(--text-color), 1) 0.1rem solid; } +details summary { + display: flex; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + cursor: pointer; + align-items: center; + justify-content: space-between; + color: var(--accent-color); +} + +details[open] summary { + margin-bottom: 1rem; +} +details[open] > summary .down-arrow { + transform: rotate(180deg); +} + +fieldset { + border: none; +} + +input { + accent-color: var(--accent-color); +} +input[type=range]:active { + cursor: -webkit-grab; + cursor: grab; +} + +sm-copy { + font-size: 0.9rem; +} + +sm-input, +sm-textarea { + font-size: 0.9rem; + --border-radius: 0.5rem; + --background-color: rgba(var(--foreground-color), 1); +} +sm-input button .icon, +sm-textarea button .icon { + fill: var(--accent-color); +} + +sm-textarea { + --max-height: 32ch; +} + +sm-button { + --padding: 0.8rem; +} +sm-button[variant=primary] .icon { + fill: rgba(var(--background-color), 1); +} +sm-button[disabled] .icon { + fill: rgba(var(--text-color), 0.6); +} +sm-button.danger { + --background: var(--danger-color); + color: rgba(var(--background-color), 1); +} + +sm-spinner { + --size: 1.5rem; + --stroke-width: 0.1rem; +} + +cube-loader { + --size: 1.2rem; +} + +sm-form { + --gap: 1rem; +} + +sm-select { + --padding: 0.8rem; + font-size: 0.9rem; + --min-width: fit-content; + --select-border-radius: 0.5rem; +} +sm-select[open] { + z-index: 10; +} + +sm-option { + font-size: 0.9rem; +} + +strip-select { + --gap: 0; + background-color: rgba(var(--text-color), 0.06); + border-radius: 0.3rem; + padding: 0.3rem; +} + +strip-option { + position: relative; + font-size: 0.8rem; + --border-radius: 0.2rem; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} + sm-button { --border-radius: 0.3rem; } @@ -106,27 +336,6 @@ ul { list-style: none; } -.flex { - display: flex; -} - -.grid { - display: grid; -} - -.hide { - opacity: 0; - pointer-events: none; -} - -.hide-completely { - display: none !important; -} - -.no-transformations { - transform: none !important; -} - .overflow-ellipsis { width: 100%; overflow: hidden; @@ -134,39 +343,16 @@ ul { text-overflow: ellipsis; } -.breakable { +.wrap-around { overflow-wrap: break-word; word-wrap: break-word; - -ms-word-break: break-all; word-break: break-word; - -ms-hyphens: auto; - -moz-hyphens: auto; -webkit-hyphens: auto; - hyphens: auto; + hyphens: auto; } .full-bleed { - grid-column: 1/4; -} - -.h1 { - font-size: 2.5rem; -} - -.h2 { - font-size: 2rem; -} - -.h3 { - font-size: 1.4rem; -} - -.h4 { - font-size: 1rem; -} - -.h5 { - font-size: 0.8rem; + grid-column: 1/-1; } .uppercase { @@ -177,22 +363,43 @@ ul { text-transform: capitalize; } +.sticky { + position: -webkit-sticky; + position: sticky; +} + +.top-0 { + top: 0; +} + .flex { display: flex; } +.flex-wrap { + flex-wrap: wrap; +} + +.flex-1 { + flex: 1; +} + +.flex-shrink-0 { + flex-shrink: 0; +} + .grid { display: grid; } -.grid-3 { - grid-template-columns: 1fr auto auto; -} - .flow-column { grid-auto-flow: column; } +.gap-0-3 { + gap: 0.3rem; +} + .gap-0-5 { gap: 0.5rem; } @@ -217,19 +424,39 @@ ul { text-align: right; } -.align-start { +.text-align-left { + text-align: left; +} + +.align-items-start { align-items: flex-start; } +.align-content-start { + align-content: flex-start; +} + +.align-start { + align-content: flex-start; +} + .align-center { align-items: center; } +.align-end { + align-items: flex-end; +} + .text-center { text-align: center; } .justify-start { + justify-items: start; +} + +.justify-content-start { justify-content: start; } @@ -245,6 +472,10 @@ ul { align-self: center; } +.align-self-end { + align-self: end; +} + .justify-self-center { justify-self: center; } @@ -257,7 +488,7 @@ ul { justify-self: end; } -.direction-column { +.flex-direction-column { flex-direction: column; } @@ -269,6 +500,114 @@ ul { width: 100%; } +.h-100 { + height: 100%; +} + +.padding-block-1 { + padding-block: 1rem; +} + +.margin-right-0-3 { + margin-right: 0.3rem; +} + +.margin-right-0-5 { + margin-right: 0.5rem; +} + +.margin-left-0-5 { + margin-left: 0.5rem; +} + +.margin-left-auto { + margin-left: auto; +} + +.margin-right-auto { + margin-right: auto; +} + +.margin-top-1 { + margin-top: 1rem; +} + +.margin-bottom-0-5 { + margin-bottom: 0.5rem; +} + +.margin-bottom-1 { + margin-bottom: 1rem; +} + +.margin-bottom-2 { + margin-bottom: 2rem; +} + +.margin-block-0-5 { + margin-block: 0.5rem; +} + +.margin-block-1 { + margin-block: 1rem; +} + +.margin-block-1-5 { + margin-block: 1.5rem; +} + +.margin-inline-1 { + margin-inline: 1rem; +} + +.margin-inline-1-5 { + margin-inline: 1.5rem; +} + +.hidden { + display: none !important; +} + +.no-transformations { + transform: none !important; +} + +.full-bleed { + grid-column: 1/4; +} + +.h1 { + font-size: 2.5rem; +} + +.h2 { + font-size: 2rem; +} + +.h3 { + font-size: 1.4rem; +} + +.h4 { + font-size: 1rem; +} + +.h5 { + font-size: 0.8rem; +} + +.grid-3 { + grid-template-columns: 1fr auto auto; +} + +.flow-column { + grid-auto-flow: column; +} + +.w-100 { + width: 100%; +} + .color-0-8 { color: rgba(var(--text-color), 0.8); } @@ -281,11 +620,23 @@ ul { font-weight: 500; } +.ws-pre-line { + white-space: pre-line; +} + +.card { + background-color: rgba(var(--foreground-color), 1); + border-radius: 0.5rem; + padding: max(1rem, 3vw); +} + .ripple { + height: 8rem; + width: 8rem; position: absolute; border-radius: 50%; transform: scale(0); - background: rgba(var(--text-color), 0.16); + background: radial-gradient(circle, rgba(var(--text-color), 0.3) 0%, rgba(0, 0, 0, 0) 50%); pointer-events: none; } @@ -304,12 +655,6 @@ ul { display: none; } -.icon { - width: 1.5rem; - height: 1.5rem; - fill: rgba(var(--text-color), 0.9); -} - .button__icon { height: 1.2rem; width: 1.2rem; @@ -321,6 +666,40 @@ ul { margin-left: 0.5rem; } +[data-editable] { + transition: padding 0.2s; +} +[data-editable]:focus-within { + padding: 0.5em; + border-radius: 0.3rem; + outline: none; + background-color: rgba(var(--text-color), 0.06); + box-shadow: 0 0 0 0.1rem var(--accent-color) inset; +} + +.multi-state-button { + display: grid; + text-align: center; + align-items: center; +} +.multi-state-button > * { + grid-area: 1/1/2/2; +} +.multi-state-button button { + z-index: 1; +} + +.password-field label { + display: flex; + justify-content: center; +} +.password-field label input:checked ~ .visible { + display: none; +} +.password-field label input:not(:checked) ~ .invisible { + display: none; +} + #confirmation_popup, #prompt_popup { flex-direction: column; @@ -359,20 +738,182 @@ ul { cursor: pointer; } +.page { + height: 100%; +} +.page__header { + display: flex; + justify-content: space-between; + margin-bottom: 1.5rem; + min-height: 8rem; +} +.page__header .grid { + margin-top: auto; +} +.page__header h1 { + margin-top: auto; + font-size: 2rem; +} + +.page-layout { + display: grid; + gap: 1.5rem 0; + grid-template-columns: 1.5rem minmax(0, 1fr) 1.5rem; + align-content: flex-start; +} +.page-layout > * { + grid-column: 2/3; +} + +#secondary_pages { + display: grid; + width: 100%; + grid-template-rows: -webkit-min-content minmax(0, 1fr); + grid-template-rows: min-content minmax(0, 1fr); + grid-template-areas: "header" "content"; +} +#secondary_pages header { + padding: 1.5rem 1rem; + background-color: rgba(var(--foreground-color), 0.3); +} +#secondary_pages .inner-page { + width: 100%; + height: 100%; + grid-area: content; +} + +.inner-page { + gap: 1rem; + display: grid; + position: relative; + padding: 1rem; + grid-template-columns: minmax(0, 1fr); + height: 100%; + background-color: rgba(var(--foreground-color), 0.3); +} + +#landing { + padding: 0 1rem; + overflow-y: auto; + padding-bottom: 3rem; +} +#landing sm-carousel { + width: min(100%, 64rem); + margin: 0 auto; + align-self: flex-start; + --nav-background-color: white; + --nav-icon-fill: black; +} + +.landing__card { + position: relative; + width: min(64rem, 100%); + flex-shrink: 0; + margin: 0 auto; + padding: 2rem max(1rem, 6vw); + border-radius: 1rem; + align-items: center; +} +.landing__card h1 { + font-size: max(2rem, 2.5vw); +} +.landing__card img { + width: min(100%, 24rem); +} +.landing__card:first-of-type { + background-color: #2a2c35; + color: white; +} +.landing__card:first-of-type h1 { + mix-blend-mode: soft-light; +} +.landing__card:nth-of-type(2) { + background: url(../assets/globe.svg) no-repeat bottom right, rgba(var(--foreground-color), 1); + background-size: max(60vw, 90vh); + color: white; + min-height: 24rem; +} +.landing__card:nth-of-type(2) img { + align-self: flex-start; + width: 20vmax; +} +.landing__card:nth-of-type(2) .grid { + margin-top: auto; + margin-left: auto; +} +.landing__card:nth-of-type(2) p { + margin-top: auto; + color: rgba(255, 255, 255, 0.9); +} + +#sign_in, +#sign_up { + justify-items: center; + align-content: center; +} +#sign_in section, +#sign_up section { + margin-top: -8rem; + width: min(26rem, 100%); +} +#sign_in sm-form, +#sign_up sm-form { + margin: 2rem 0; +} + +#sign_up .h2 { + margin-bottom: 0.5rem; +} + +.generated-keys-wrapper { + padding: 1rem; + background-color: rgba(var(--foreground-color), 1); + border-radius: 0.5rem; +} + +#flo_id_warning { + padding-bottom: 1.5rem; +} +#flo_id_warning .icon { + height: 3rem; + width: 3rem; + padding: 0.8rem; + overflow: visible; + background-color: #ffc107; + border-radius: 3rem; + fill: rgba(0, 0, 0, 0.8); +} + +#task_details > * { + justify-self: center; + max-width: 64rem; +} + #main_page { height: 100%; grid-template-rows: auto 1fr auto; grid-template-areas: "main-header" "sub-pages" "main-nav"; } +#sub_page_container { + grid-area: sub-pages; + height: 100%; + overflow-y: auto; + display: grid; +} +#sub_page_container > * { + grid-area: 1/1; +} + #main_header { grid-area: main-header; display: flex; gap: 1rem; align-items: center; + position: -webkit-sticky; position: sticky; padding: 0.5rem 1rem; - background: var(--foreground-color); + background: rgba(var(--foreground-color), 1); z-index: 1; } @@ -381,7 +922,7 @@ ul { position: relative; display: flex; align-items: center; - background-color: var(--foreground-color); + background-color: rgba(var(--foreground-color), 1); } .nav-list__item { @@ -417,22 +958,12 @@ ul { margin-bottom: 0.3rem; } -#sub_page_container { - grid-area: sub-pages; - height: 100%; - overflow-y: auto; -} - .container-card { position: relative; - background: var(--foreground-color); + background: rgba(var(--foreground-color), 1); border-radius: 0.5rem; } -.medium-top-bottom-margin { - margin: 0.5rem 0; -} - #sign_in_page { display: grid; position: fixed; @@ -442,34 +973,97 @@ ul { left: 0; right: 0; place-content: center; - background-color: var(--foreground-color); + background-color: rgba(var(--foreground-color), 1); gap: 1rem; } -#sign_in_form { - width: 22rem; +.display-task { + display: flex; + flex-direction: column; + gap: 0.8rem; + padding: max(2vw, 1rem); + border-radius: 0.5rem; + background-color: rgba(var(--foreground-color), 1); + margin: 0 auto; + width: min(100%, 48rem); + border: solid 0.2rem rgba(var(--text-color), 0.8); +} +.display-task__category { + display: inline-flex; + padding: 0.3rem 0.5rem; + background-color: rgba(var(--text-color), 0.06); + border-radius: 0.3rem; + font-size: 0.9rem; + color: rgba(var(--text-color), 0.8); + text-transform: capitalize; + font-weight: 500; + height: 100%; + align-items: center; +} +.display-task__title { + font-size: 1.2rem; +} +.display-task__description { + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + overflow: hidden; + white-space: pre-wrap; +} +.display-task__detail { + display: flex; + gap: 0.3rem; + background-color: rgba(var(--text-color), 0.04); + border-radius: 0.3rem; + padding: 0.3rem 0.5rem; + font-size: 0.9rem; + color: rgba(var(--text-color), 0.8); +} +.display-task__detail__value { + font-weight: 500; +} +.display-task p { + line-height: 1.5; +} + +#application_card { + position: relative; + overflow: hidden; + background-color: rgba(var(--foreground-color), 1); + border: solid thin rgba(var(--text-color), 0.1); + padding: 0; +} +#application_card > div:first-of-type { + padding: max(1rem, 3vw); + z-index: 2; + width: calc(100% - 4rem); + background: linear-gradient(90deg, rgba(var(--foreground-color), 1) 0%, rgba(var(--foreground-color), 0) 100%); +} +#application_card .illustration { + position: absolute; + height: 100%; + right: 0; + width: auto; + margin: 0 -1.5rem -1.5rem 0; } .task { display: grid; grid-template-columns: auto 1fr; - margin: 0 1rem; + margin-right: 1rem; } .task .task__branch_container { padding-bottom: 2rem; } - .task:last-of-type .left .line { transform: scaleY(0); } - .task .left { display: flex; position: relative; justify-content: center; padding-top: 0.5rem; } - .task .left .circle { display: inline-flex; position: relative; @@ -477,11 +1071,10 @@ ul { height: 1rem; width: 1rem; border-radius: 50%; - background: var(--foreground-color); + background: rgba(var(--foreground-color), 1); border: solid 2px rgba(var(--text-color), 0.4); z-index: 1; } - .task .left .line { position: absolute; left: 50%; @@ -490,65 +1083,45 @@ ul { transform: translateX(-50%) scaleY(1); background-color: rgba(var(--text-color), 0.4); } - .task .right { margin-left: 1rem; display: flex; flex-direction: column; width: 100%; + gap: 0.7rem; } - .task .right .apply-cont { width: 100%; display: flex; flex-direction: row; } - .task .right .apply-cont h4 { - -webkit-box-flex: 1; - -ms-flex: 1; flex: 1; } - -.task h4 { - margin-top: 0.4rem; +.task .right:last-child { margin-bottom: 1rem; } - -.timeline-task__description { - white-space: pre-line; +.task h4 { + margin-top: 0.4rem; } - .task .assigned-interns .assigned-intern { padding: 0.4rem; } -.completed-task .left .circle { - border: solid 2px #00C853 !important; - background: #00C853 !important; +.timeline-task__description, +.admin-reply__description { + max-width: 100%; } -.completed-task .left .line { - background-color: #00C853 !important; +.completed .left .circle { + border: solid 2px #00c853 !important; + background: #00c853 !important; } -.page { - gap: 1rem; - display: grid; - position: relative; - padding: 1rem; - animation: fadein 0.3s; - grid-template-columns: minmax(0, 1fr); +.completed .left .line { + background-color: #00c853 !important; } -@keyframes fadein { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} .task-title { font-weight: 500; } @@ -586,6 +1159,8 @@ ul { .project-card { padding: 1rem; + margin: 0.2rem; + border-radius: 0.5rem; font-weight: 500; line-height: 1.5; text-transform: capitalize; @@ -593,11 +1168,21 @@ ul { } .intern-card { - user-select: none; + padding: 1rem; + margin: 0.2rem; + border-radius: 0.5rem; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; padding: 0.8rem 1rem; gap: 0.8rem; grid-template-columns: auto 1fr auto; } +.intern-card .icon { + height: 1rem; + width: 1rem; + margin-left: 0.2rem; +} .intern-card__initials { display: flex; @@ -605,12 +1190,12 @@ ul { width: 2.6rem; justify-content: center; align-items: center; - border-radius: 40%; - color: white; - font-weight: 500; + border-radius: 50%; + color: var(--color); + font-weight: 700; font-size: 1rem; text-transform: uppercase; - background-color: var(--accent-color); + background-color: rgba(var(--text-color), 0.06); } .intern-card__score-wrapper { @@ -618,17 +1203,14 @@ ul { font-size: 1.2rem; } -.intern-card .icon { - fill: #FF5722 !important; - height: 1rem !important; - width: 1rem !important; - margin-left: 0.2rem; -} - .request-card { display: grid; position: relative; padding: 1rem; + margin: 0.2rem; + gap: 0.3rem; + background-color: rgba(var(--text-color), 0.06); + border-radius: 0.5rem; } .request-card sm-button { --padding: 0.5rem 0.8rem; @@ -637,7 +1219,6 @@ ul { .request-card__description { width: 100%; font-size: 1rem; - margin-bottom: 1rem; } .reject-app { @@ -645,6 +1226,9 @@ ul { margin-right: 0.5rem; } +#updates_page { + align-content: flex-start; +} #updates_page sm-select { --max-height: 50vh; } @@ -662,7 +1246,7 @@ ul { gap: 0.5rem; padding: 1rem; border-radius: 0.5rem; - background-color: var(--foreground-color); + background-color: rgba(var(--foreground-color), 1); } .update__topic { @@ -673,10 +1257,14 @@ ul { max-width: 65ch; } -.update__sender { - color: var(--accent-color); - font-size: 0.9rem; +.update__sender, +.admin-reply__title { + font-size: 0.85rem; font-weight: 500; + background-color: rgba(var(--text-color), 0.06); + padding: 0.3rem 0.5rem; + margin: 0 -0.5rem; + border-radius: 1rem; } .update__time { @@ -684,8 +1272,23 @@ ul { color: rgba(var(--text-color), 0.8); } -.update__message { - white-space: pre-line; +.admin-reply { + position: relative; + padding: 1rem; + padding-left: 1.5rem; + margin-left: 0.5rem; + gap: 0.3rem; +} +.admin-reply::before { + content: ""; + position: absolute; + width: 0.1rem; + height: calc(100% - 1rem); + left: 0; + background-color: rgba(var(--text-color), 0.5); +} +.admin-reply__title { + justify-self: flex-start; } .container-header { @@ -709,21 +1312,11 @@ ul { } #intern_info__initials { - margin-bottom: 1rem; position: relative; height: 3rem; width: 3rem; font-size: 1.3rem; -} -#intern_info__initials::before { - content: ""; - position: absolute; - background-color: inherit; - border-radius: inherit; - height: calc(100% + 1.5rem); - width: calc(100% + 1.5rem); - opacity: 0.3; - z-index: -1; + color: var(--color); } #intern_info__name { @@ -731,8 +1324,8 @@ ul { margin-bottom: 0.5rem; } -.gold-fill { - fill: #FF5722; +.icon--star { + fill: var(--orange); } #intern_info__score { @@ -744,58 +1337,51 @@ ul { } .branch-button { - margin-bottom: 0.5rem; display: flex; - border-radius: 0; padding: 0.5rem; border-radius: 0.2rem; text-transform: capitalize; justify-self: start; align-items: center; - user-select: none; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; font-size: 0.85rem; font-weight: 500; } -.branch-button .icon { - height: 1.2rem; - width: 1.2rem; -} - -.active-branch { +.branch-button--active { opacity: 1; color: white; background: var(--accent-color); } #task_list { + gap: 0.5rem; padding: 1rem 0 1.5rem 0; } .task-list-item { display: grid; - grid-template-columns: auto 1fr auto; - grid-template-areas: "status title options" "status interns interns" "status description description" "status . ."; align-content: flex-start; padding: 1rem; gap: 0.5rem; border-radius: 0.5rem; - background: rgba(var(--text-color), 0.02); -} -.task-list-item sm-checkbox { - grid-area: status; - align-self: flex-start; - padding: 0.2rem 0.5rem 0.5rem 0; + background: rgba(var(--foreground-color), 1); } .task-list-item h4 { font-weight: 500; margin: 0; } .task-list-item .task-title { - grid-area: title; line-height: 1.6; } -.task-list-item .assigned-interns { - grid-area: interns; +.task-list-item__task-number { + font-size: 0.8rem; + color: rgba(var(--text-color), 0.8); + border: solid 0.1em var(--accent-color); + border-radius: 0.3rem; + padding: 0.2rem 0.4rem; + font-weight: 500; } .task__branch_container:not(:empty) { @@ -827,39 +1413,31 @@ ul { border-radius: 0 0 0 0.2rem; } .task__branch_container .branch-button + .branch-button::before { - top: calc(-50% - 1.5rem ); + top: calc(-50% - 1.5rem); height: calc(100% + 1.5rem); } .task-option { - grid-area: options; - transition: opacity 0.3s ease; - padding: 0.5rem; -} -.task-option .icon { - height: 1.2rem; - width: 1.2rem; + margin-right: -0.5rem; } .task-description { - grid-area: description; margin: 0; overflow-wrap: break-word; word-wrap: break-word; - white-space: pre-line; } .assigned-interns { display: flex; flex-wrap: wrap; - margin-bottom: 1rem; + gap: 0.5rem; } - .assigned-interns .assigned-intern { - user-select: none; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; display: flex; font-size: 0.8rem; - margin: 0.2rem 0.5rem 0.2rem 0; padding: 0.2rem 0 0.2rem 0.4rem; border-radius: 0.2rem; border: 1px solid rgba(var(--text-color), 0.24); @@ -881,33 +1459,28 @@ ul { right: 0; margin: -1rem 1rem 0 1rem; list-style: none; - padding: 0.5rem 0; - width: max-content; - border-radius: 0.3rem; - transition: 0.3s opacity ease; - background-color: var(--foreground-color); - box-shadow: 0 0.5rem 1rem -0.3rem rgba(0, 0, 0, 0.3); + width: -webkit-fit-content; + width: -moz-fit-content; + width: fit-content; + border-radius: 0.5rem; + transition: 0.3s opacity; + background-color: rgba(var(--foreground-color), 1); + box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.16); + transform-origin: top right; + border: solid thin rgba(var(--text-color), 0.16); } #task_context li { - padding: 0.8rem 1.5rem; display: flex; align-items: center; font-size: 0.9rem; + margin: 0.2rem; + padding: 0.6rem 0.8rem; + border-radius: 0.3rem; } #task_context li .icon { - height: 1.2rem; - width: 1.2rem; margin-right: 0.5rem; } -.temp-task .cancel-task-button { - margin-right: 0.5rem; -} - -#editing_panel__description { - margin-bottom: 2rem; -} - #branch_container { display: flex; flex-flow: row wrap; @@ -926,14 +1499,16 @@ ul { height: 100%; overflow-y: auto; } +#intern_list_container .intern-card { + padding: 0.8rem 0; + margin: 0; +} -#best_interns_container, -#project_list_container { +#best_interns_container { margin-bottom: 1rem; } -#best_interns_container .container-header .icon, -#project_list_container .container-header .icon { +#best_interns_container .container-header .icon { margin-right: 0.5rem; } @@ -943,37 +1518,15 @@ ul { margin: 2rem 0; } -#loading_page { +#loading { display: grid; - position: fixed; - top: 0; - bottom: 0; - left: 0; - right: 0; - z-index: 5; text-align: center; place-content: center; justify-items: center; - background-color: var(--foreground-color); + background-color: rgba(var(--foreground-color), 1); } -.loading-message { - font-size: 1.3rem; - margin: 1.5rem 0 0.5rem 0; -} - -#loading_page__footer { - position: absolute; - bottom: 0; - width: 100%; - padding: 1.5rem; -} -#loading_page__footer .icon { - height: 4rem; - width: 4rem; -} - -#project_watching_section { +#pinned_project_section { position: relative; overflow: hidden; } @@ -989,131 +1542,35 @@ ul { padding: 1rem; } -#explorer_branch_container { - margin-top: 1.5rem; -} - -#watch_project_button { +#pin_project_button { margin-left: 1rem; - text-transform: capitalize; } #admin_page { position: relative; display: grid; - gap: 0; padding: 0; height: 100%; + overflow: hidden; + grid-template-rows: auto 1fr; +} + +#admin_views { + display: grid; + height: 100%; + overflow-y: hidden; +} +#admin_views > * { + grid-area: 1/1; } #project_editing_panel { position: relative; - padding: 1rem 0; height: 100%; + padding: 0 max(4vw, 1rem); overflow-y: auto; -} - -#editing_panel__title { - margin-bottom: 1rem; -} - -.fab-actions { - display: grid; - gap: 1rem; - position: absolute; - bottom: 0; - right: 0; - margin: 1rem; - justify-items: end; - text-align: end; - z-index: 5; -} -.fab-actions[open] .fab-actions__item { - transform: translateY(0); - opacity: 1; -} -.fab-actions[open] .fab .icon:nth-of-type(1) { - transform: scale(0) rotate(180deg); -} -.fab-actions[open] .fab .icon:nth-of-type(2) { - transform: scale(1) rotate(0); -} -.fab-actions[open] ~ #fab_backdrop { - opacity: 1; - clip-path: circle(100%); -} - -.fab-actions__item { - display: flex; - align-items: center; - justify-self: end; - padding: 0.6rem 1rem; - border-radius: 2rem; - transform: translateY(1.5rem); - background-color: var(--foreground-color); - opacity: 0; - transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s; - box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.2); - user-select: none; -} -.fab-actions__item:hover, .fab-actions__item:active { - transform: scale(0.9); -} -.fab-actions__item:nth-of-type(1) { - transition-delay: 0.2s; -} -.fab-actions__item:nth-of-type(2) { - transition-delay: 0.1s; -} -.fab-actions__item .icon { - fill: var(--accent-color); - margin-left: 0.5rem; -} -.fab-actions__item-name { - font-size: 0.9rem; -} - -.fab { - position: relative; - display: flex; - justify-content: center; - align-items: center; - padding: 1rem; - height: 3.2rem; - width: 3.2rem; - border-radius: 50%; - background-color: var(--accent-color); - box-shadow: 0 0.5rem 0.8rem rgba(0, 0, 0, 0.3); - transition: transform 0.3s; - -webkit-tap-highlight-color: transparent; -} -.fab:active { - transform: scale(0.9); -} -.fab .icon { - position: absolute; - height: 100%; - fill: white; - transition: transform 0.3s; -} -.fab .icon:nth-of-type(1) { - transform: scale(1) rotate(0); -} -.fab .icon:nth-of-type(2) { - transform: scale(0) rotate(-180deg); -} - -#fab_backdrop { - position: fixed; - z-index: 3; - top: 0; - bottom: 0; - left: 0; - right: 0; - opacity: 0; - clip-path: circle(0% at 100% 100%); - transition: clip-path 0.5s, opacity 0.5s; - background-color: rgba(0, 0, 0, 0.5); + padding-bottom: 2rem; + flex: 1; } #update_of_project { @@ -1140,84 +1597,99 @@ ul { .task-card { display: grid; + gap: 0.5rem; padding: 1rem; border-radius: 0.5rem; - grid-template-columns: minmax(0, 1fr); - background-color: var(--foreground-color); -} - -.task__header { - display: grid; - gap: 0 0.5rem; - align-items: flex-start; - grid-template-columns: 1fr auto; - grid-template-areas: ". send-button" ". send-button"; + background-color: rgba(var(--foreground-color), 1); } .task__project-title { - font-size: 0.9rem; - font-weight: 500; - border-radius: 0.3rem; + font-size: 0.8rem; + margin: 0 -0.5em; + margin-bottom: 0.5rem; + border-radius: 1rem; padding: 0.3rem 0.5rem; justify-self: flex-start; - margin-bottom: 0.5rem !important; color: rgba(var(--text-color), 0.8); background-color: rgba(var(--text-color), 0.06); } .task__title { - font-size: 1.3rem; - margin-bottom: 1rem !important; + font-size: 1.1rem; } .task__description { word-wrap: break-word; overflow-wrap: break-word; - white-space: pre-line; color: rgba(var(--text-color), 0.8); + font-size: 0.9rem; + margin-top: 0.2rem; } -.send-update-button { - grid-area: send-button; - --padding: 0.6rem 0.8rem; +.send-update-button, +.init-update-replay { color: var(--accent-color); + background-color: rgba(var(--text-color), 0.04); } -.send-update-button .icon { - height: 1.2rem; - width: 1.2rem; +.send-update-button .icon, +.init-update-replay .icon { fill: var(--accent-color); } -#admin_page__left { - height: 100%; - overflow-y: hidden; +.temp-task { + padding: 1rem; + background-color: rgba(var(--foreground-color), 1); + border-radius: 0.5rem; } -#admin_page__left sm-tab-header { - --gap: 0; - --justify-content: stretch; - background-color: var(--foreground-color); - border-bottom: 1px solid rgba(var(--text-color), 0.2); + +#internship_requests_list { + padding-bottom: 2rem; } -#admin_page__left sm-tab { - justify-content: center; + +.status-card { + display: grid; + gap: 1rem; + padding: 1rem; + border-radius: 0.5rem; + background-color: rgba(var(--foreground-color), 1); } -#admin_page__left sm-tab-panels, -#admin_page__left sm-tab-panels > * { - height: 100%; - flex-direction: column; +.status-card__time { + font-size: 0.8rem; + color: rgba(var(--text-color), 0.8); } -#admin_page__left sm-tab-panels { - overflow-y: hidden; +.status-card__status { + justify-content: flex-end; } -#admin_page__left sm-tab-panels > * { +.status-card__status .icon { + height: 1em; + width: 1em; +} +.status-card.accepted .icon { + fill: var(--green); +} +.status-card.rejected .icon { + fill: var(--danger-color); +} +.status-card.pending .icon { + fill: var(--yellow); +} + +#projects_container { display: flex; + height: 100%; + overflow-y: hidden; } -#admin_page__left .list-container { + +#projects_container__left { + height: 100%; + overflow-y: auto; +} +#projects_container__left .list-container { height: 100%; overflow-y: auto; padding-bottom: 2rem; } -#admin_page__left .empty-state { +#projects_container__left .empty-state { padding: 1rem; text-align: center; } @@ -1258,34 +1730,52 @@ input[type=date]:focus { border: solid var(--accent-color) thin; } -#project_watching_section { +#pinned_project_section { display: grid; gap: 1rem; } -#project_watchlist { +#pinned_projects { display: grid; - gap: 1rem; - grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); + gap: 0.3rem; + grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); } -.watchlist_project_card { +.pinned-card { color: inherit; display: grid; border-radius: 0.5rem; - grid-template-rows: auto 1fr; - gap: 1rem; padding: 1rem; - background-color: rgba(var(--text-color), 0.04); + background-color: rgba(var(--foreground-color), 1); + grid-template-columns: auto 1fr; } -.watchlist_project_card .project__title { - font-size: 1.1rem; - line-height: 1.5; +.pinned-card .project-icon { + display: flex; + background-color: rgba(var(--text-color), 0.06); + justify-self: start; + align-self: flex-start; + padding: 0.8rem; + border-radius: 2rem; + margin-right: 0.8rem; + grid-row: span 3; +} +.pinned-card .project-icon .icon { + fill: var(--accent-color); +} +.pinned-card .project__title { + margin-bottom: 0.8rem; + font-weight: 500; + color: inherit; +} +.pinned-card .project__complete-percent { + font-size: 0.8rem; + opacity: 0.8; + margin-top: 0.5rem; } .progress-bar { display: flex; - height: 0.5rem; + height: 0.2rem; background-color: rgba(var(--text-color), 0.2); border-radius: 1rem; overflow: hidden; @@ -1296,13 +1786,8 @@ input[type=date]:focus { transition: width 0.3s; } -#username { - margin-top: 1.5rem; - margin-bottom: 0.5rem; -} - -#logout { - margin-top: 1.5rem; +#settings_page { + align-content: flex-start; } @media only screen and (max-width: 640px) { @@ -1310,28 +1795,29 @@ input[type=date]:focus { .hide-page-on-mobile { display: none; } - - #project_editing_panel { - padding: 1rem; - } - .list-container { padding-bottom: 5rem; } + .status-card__status { + grid-area: 1/2/2/3; + } + .status-card__details { + grid-area: 2/1/3/3; + } } @media only screen and (min-width: 640px) { .hide-on-desktop { display: none !important; } - sm-popup { --width: 26rem; } - .popup__header { padding: 1.5rem 1.5rem 0 0.75rem; } - + #secondary_pages header { + padding: 1.5rem 8vw; + } #main_nav { padding: 0.5rem; background-color: rgba(var(--background-color), 1); @@ -1341,7 +1827,6 @@ input[type=date]:focus { margin: 1rem; margin-top: auto; } - .nav-list__item { flex-direction: row; align-items: center; @@ -1359,65 +1844,49 @@ input[type=date]:focus { .nav-list__item_title { display: none; } - .project-card--active { background-color: rgba(var(--text-color), 0.1); } - - .page { - background-color: var(--foreground-color); + .project-card--active::before { + content: ""; + position: absolute; + top: 0; + left: 0; + bottom: 0; + margin: auto 0; + width: 0.2rem; + height: 1.5em; + background-color: var(--accent-color); + border-radius: 0 0.2rem 0.2rem 0; } - #sign_in { width: 24rem; height: auto; border-radius: 0.4rem; } - #dashboard_page { - grid-template-columns: 3fr 18rem; + grid-template-columns: 1fr 18rem; } - - #dashboard_page #project_watching_section { - align-self: flex-start; - } - #all_interns_page__header { grid-template-columns: 1fr auto; } - #admin_page { - padding: 1rem 0; - gap: 1rem; - grid-template-columns: 18rem minmax(0, 1fr); - grid-template-rows: 1fr; + padding: 0; } - - #admin_page__left { - background-color: var(--foreground-color); + #projects_container__left { + width: 18rem; + background-color: rgba(var(--foreground-color), 0.5); } - - #project_editing_panel { - padding-right: 1rem; - } - - #admin_page__left, -#project_editing_panel { - border-radius: 0.5rem; - } - #edit_data_fig { width: 16rem; justify-self: center; } - #project_explorer { display: grid; height: 100%; grid-template-columns: 16rem 3fr; grid-template-areas: "left right"; } - #project_explorer__left { grid-area: left; height: 100%; @@ -1426,89 +1895,60 @@ input[type=date]:focus { border-right: 1px solid rgba(var(--text-color), 0.06); background-color: rgba(var(--background-color), 1); } - #project_explorer__left h4 { margin-top: 0; margin-bottom: 0.5rem; color: var(--accent-color); font-size: 0.9rem; } - #project_explorer__right { grid-area: right; height: 100%; overflow-y: auto; } - #main_page { grid-template-columns: 4rem minmax(0, 1fr); grid-template-areas: "main-header main-header" "main-nav sub-pages"; } - #post_update_popup { --width: 28rem; } - #updates_page { height: 100%; gap: 1rem; grid-template-areas: "updates update-filters"; grid-template-columns: minmax(0, 1fr) 20rem; + overflow-y: hidden; } - #update_filters_wrapper { padding: 1rem; border-radius: 0.5rem; align-content: flex-start; grid-area: update-filters; - background-color: var(--foreground-color); + background-color: rgba(var(--foreground-color), 1); } - #updates_wrapper { height: 100%; overflow-y: auto; grid-area: updates; } - #all_interns_list { - gap: 1rem; - grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); + gap: 0.5rem; + grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); } #all_interns_list .intern-card { - gap: 1.5rem 0.5rem; - padding: 1.5rem; - grid-template-columns: 1fr; + margin: 0; + gap: 1rem; border-radius: 0.5rem; - background-color: var(--foreground-color); + background-color: rgba(var(--foreground-color), 1); } - #all_interns_list .intern-card__initials { - position: relative; - grid-column: 1/3; - z-index: 1; - } - #all_interns_list .intern-card__initials::after { - content: ""; - position: absolute; - background-color: inherit; - border-radius: inherit; - height: calc(100% + 1rem); - width: calc(100% + 1rem); - opacity: 0.3; - z-index: -1; - } - #intern_list_popup { --height: 80vh; } - - #settings_page { - height: 100%; - align-items: flex-start; - padding: 2rem; - } - - .watchlist_project_card { - padding: 1.5rem; + .status-card { + align-items: center; + font-size: 0.9rem; + grid-template-columns: 6rem 1fr 8rem; } } @media only screen and (min-width: 1280px) { @@ -1516,11 +1956,9 @@ input[type=date]:focus { grid-template-columns: 12rem minmax(0, 1fr); grid-template-areas: "main-header main-header" "main-nav sub-pages"; } - #main_nav { align-items: flex-start; } - .nav-list__item .icon { margin-right: 0.5rem; } @@ -1533,7 +1971,6 @@ input[type=date]:focus { width: 0.5rem; height: 0.5rem; } - ::-webkit-scrollbar-thumb { background: rgba(var(--text-color), 0.3); border-radius: 1rem; @@ -1541,22 +1978,10 @@ input[type=date]:focus { ::-webkit-scrollbar-thumb:hover { background: rgba(var(--text-color), 0.5); } - + .interact { + transition: background-color 0.2s; + } .interact:hover { - background: linear-gradient(rgba(var(--text-color), 0.06), rgba(var(--text-color), 0.06)), var(--foreground-color); - } - - .send-update-button, -.task-option, -.apply-button { - opacity: 0; - transition: opacity 0.3s; - } - - .task-list-item:hover .task-option, -.task-option:focus-within, -.task:hover .apply-button, -.task-card:hover .send-update-button { - opacity: 1; + background-color: rgba(var(--text-color), 0.04); } } \ No newline at end of file diff --git a/css/main.min.css b/css/main.min.css index 3a016e6..dbb5780 100644 --- a/css/main.min.css +++ b/css/main.min.css @@ -1 +1 @@ -.hide,.ripple{pointer-events:none}.fab,.interact,.nav-list__item{-webkit-tap-highlight-color:transparent}#updates,.task-option{transition:opacity .3s ease}*{padding:0;margin:0;box-sizing:border-box;font-family:Roboto,sans-serif}:root{font-size:clamp(1rem,1.2vmax,3rem)}body,html{height:100%;scroll-behavior:smooth}body{color:rgba(var(--text-color),1);background:rgba(var(--background-color),1)}body,body *{--accent-color:#5D54A4;--text-color:17,17,17;--background-color:240,240,255;--foreground-color:rgb(248, 248, 255);--danger-color:red;scrollbar-width:thin}body[data-theme=dark],body[data-theme=dark] *{--accent-color:#9D65C9;--text-color:240,240,240;--text-color-light:170,170,170;--background-color:10,10,10;--foreground-color:rgb(20, 20, 20);--danger-color:rgb(255, 106, 106)}body[data-theme=dark] ::-webkit-calendar-picker-indicator{filter:invert(1)}p{max-width:70ch;line-height:1.7;color:rgba(var(--text-color),.8)}p:not(:last-of-type){margin-bottom:1.5rem}img{object-fit:cover}a:where([class]){color:inherit;text-decoration:none}a:where([class]):focus-visible{box-shadow:0 0 0 .1rem rgba(var(--text-color),1) inset}a{color:var(--accent-color)}.button,button{position:relative;display:inline-flex;border:none;background-color:transparent;overflow:hidden;color:inherit;cursor:pointer}.color-0-8,.nav-list__item{color:rgba(var(--text-color),.8)}button:disabled{opacity:.5}a.button{padding:.6rem 1.2rem;border-radius:.3rem;background-color:rgba(var(--text-color),.06)}a:any-link:focus-visible{outline:solid rgba(var(--text-color),1)}sm-button{--border-radius:0.3rem}sm-button[variant=primary] .icon{fill:rgba(var(--background-color),1)}#edit_data_fig,sm-button[disabled] .icon{fill:rgba(var(--text-color),.6)}.hide{opacity:0}.hide-completely{display:none!important}#main_header,#main_nav,.flex,.nav-list__item{display:flex}.no-transformations{transform:none!important}.overflow-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.breakable,.task-description,.task__description{word-wrap:break-word;overflow-wrap:break-word}.breakable{-ms-word-break:break-all;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.full-bleed{grid-column:1/4}.h1{font-size:2.5rem}.h2{font-size:2rem}.h3{font-size:1.4rem}.h4{font-size:1rem}.h5{font-size:.8rem}.uppercase{text-transform:uppercase}.capitalize,.project-card{text-transform:capitalize}.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}#loading_page,.text-center{text-align:center}.align-start{align-items:flex-start}.align-center,.popup__header{align-items:center}.justify-start{justify-content:start}.justify-center,.task .left{justify-content:center}.justify-right{margin-left:auto}.align-self-center{align-self:center}.justify-self-center{justify-self:center}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.direction-column{flex-direction:column}.space-between{justify-content:space-between}.w-100{width:100%}.weight-400{font-weight:400}.weight-500{font-weight:500}.ripple{position:absolute;border-radius:50%;transform:scale(0);background:rgba(var(--text-color),.16)}.interact{position:relative;overflow:hidden;cursor:pointer}.observe-empty-state:empty{display:none}.observe-empty-state:not(:empty)~.empty-state{display:none}.icon{width:1.5rem;height:1.5rem;fill:rgba(var(--text-color),.9)}.button__icon{height:1.2rem;width:1.2rem}.button__icon--left{margin-right:.5rem}.button__icon--right{margin-left:.5rem}#confirmation_popup,#prompt_popup{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}.popup__header{display:grid;gap:.5rem;width:100%;padding:0 1.5rem 0 .5rem;grid-template-columns:auto 1fr auto}.popup__header__close{padding:.5rem;cursor:pointer}#main_page{height:100%;grid-template-rows:auto 1fr auto;grid-template-areas:"main-header" "sub-pages" "main-nav"}#main_header{grid-area:main-header;gap:1rem;align-items:center;position:sticky;padding:.5rem 1rem;background:var(--foreground-color);z-index:1}#main_nav{grid-area:main-nav;position:relative;align-items:center;background-color:var(--foreground-color)}.nav-list__item{flex-direction:column;align-items:center;width:100%;padding:.5rem 0;font-size:.8rem;font-weight:500}.nav-list__item--active{color:var(--accent-color)}.nav-list__item--active .icon{fill:var(--accent-color)}.nav-list__item--active .icon--outlined{display:none}.nav-list__item--active .icon--filled{display:inline-block}.nav-list__item:not(.nav-list__item--active) .icon--outlined{display:inline-block}.nav-list__item:not(.nav-list__item--active) .icon--filled{display:none}.nav-list__item .icon{margin-bottom:.3rem}#sub_page_container{grid-area:sub-pages;height:100%;overflow-y:auto}.container-card{position:relative;background:var(--foreground-color);border-radius:.5rem}#loading_page,#sign_in_page{position:fixed;place-content:center;z-index:5;top:0;bottom:0;left:0;right:0}.medium-top-bottom-margin{margin:.5rem 0}#sign_in_page{display:grid;background-color:var(--foreground-color);gap:1rem}#sign_in_form{width:22rem}.task{display:grid;grid-template-columns:auto 1fr;margin:0 1rem}#assigned_task_list,.page,.task-card{grid-template-columns:minmax(0,1fr)}.task .task__branch_container{padding-bottom:2rem}.task:last-of-type .left .line{transform:scaleY(0)}.task .left{display:flex;position:relative;padding-top:.5rem}.task .left .circle{display:inline-flex;position:relative;align-self:flex-start;height:1rem;width:1rem;border-radius:50%;background:var(--foreground-color);border:2px solid;z-index:1}.task .left .line{position:absolute;left:50%;height:100%;width:2px;transform:translateX(-50%) scaleY(1);background-color:rgba(var(--text-color),.4)}.task .right{margin-left:1rem;display:flex;flex-direction:column;width:100%}.task .right .apply-cont{width:100%;display:flex;flex-direction:row}.task .right .apply-cont h4{-webkit-box-flex:1;-ms-flex:1;flex:1}.task h4{margin-top:.4rem;margin-bottom:1rem}.timeline-task__description{white-space:pre-line}.task .assigned-interns .assigned-intern{padding:.4rem}.padding,.page{padding:1rem}.completed-task .left .circle{border:2px solid #00C853!important;background:#00C853!important}.completed-task .left .line{background-color:#00C853!important}.page{gap:1rem;display:grid;position:relative;animation:fadein .3s}@keyframes fadein{0%{opacity:0}100%{opacity:1}}.task-title{font-weight:500}#dashboard_page{padding-bottom:5rem;grid-template-columns:auto}.intern-card,.task-list-item{grid-template-columns:auto 1fr auto}.logo{display:flex;align-items:center;font-size:1.2rem;width:100%}.logo .cls-2,.logo .cls-3{fill:rgba(var(--text-color),1);font-size:146.9px;font-family:ArialMT,Arial}.logo svg{height:2.5rem}.logo h4{margin:0}.project-card{padding:1rem;font-weight:500;line-height:1.5;color:rgba(var(--text-color),.8)}.intern-card{user-select:none;padding:.8rem 1rem;gap:.8rem}.intern-card__initials{display:flex;height:2.6rem;width:2.6rem;justify-content:center;align-items:center;border-radius:40%;color:#fff;font-weight:500;font-size:1rem;text-transform:uppercase;background-color:var(--accent-color)}.intern-card__score-wrapper{font-weight:500;font-size:1.2rem}.intern-card .icon{fill:#FF5722!important;height:1rem!important;width:1rem!important;margin-left:.2rem}.request-card{display:grid;position:relative;padding:1rem}.request-card sm-button{--padding:0.5rem 0.8rem}.request-card__description{width:100%;font-size:1rem;margin-bottom:1rem}.reject-app{margin-left:auto;margin-right:.5rem}#updates_page sm-select{--max-height:50vh}#updates_page__project_selector strip-option{font-size:.9rem}.intern-update{display:grid;gap:.5rem;padding:1rem;border-radius:.5rem;background-color:var(--foreground-color)}.update__topic{font-weight:500;font-size:1rem;margin-top:.5rem;text-transform:capitalize;max-width:65ch}.update__sender{color:var(--accent-color);font-size:.9rem;font-weight:500}#update_of_project,.task__description,.task__project-title,.update__time{color:rgba(var(--text-color),.8)}.update__time{font-size:.85rem}.update__message{white-space:pre-line}.container-header{display:flex;align-items:center;width:100%;padding:1rem}.container-header h4{flex:1;font-weight:500}#intern_info_popup .grid>*{justify-self:center}#intern_info_popup #update_intern_score{width:100%;margin-top:1rem}#intern_info__initials{margin-bottom:1rem;position:relative;height:3rem;width:3rem;font-size:1.3rem}#intern_info__initials::before{content:"";position:absolute;background-color:inherit;border-radius:inherit;height:calc(100% + 1.5rem);width:calc(100% + 1.5rem);opacity:.3;z-index:-1}#intern_info__name{font-size:1.5rem;margin-bottom:.5rem}.gold-fill{fill:#FF5722}#intern_info__score{font-size:1.5rem}#project_info{flex-direction:column}#user_role,.branch-button{justify-self:start;font-weight:500}.branch-button{margin-bottom:.5rem;display:flex;padding:.5rem;border-radius:.2rem;text-transform:capitalize;align-items:center;user-select:none;font-size:.85rem}.branch-button .icon{height:1.2rem;width:1.2rem}.active-branch{opacity:1;color:#fff;background:var(--accent-color)}#task_list{padding:1rem 0 1.5rem}.task-list-item{display:grid;grid-template-areas:"status title options" "status interns interns" "status description description" "status . .";align-content:flex-start;padding:1rem;gap:.5rem;border-radius:.5rem;background:rgba(var(--text-color),.02)}.task-list-item sm-checkbox{grid-area:status;align-self:flex-start;padding:.2rem .5rem .5rem 0}.task-list-item h4{font-weight:500;margin:0}.task-list-item .task-title{grid-area:title;line-height:1.6}.task-list-item .assigned-interns{grid-area:interns}.task__branch_container:not(:empty){display:grid;gap:.5rem;padding:.5rem 0}.task__branch_container .branch-button{position:relative;background-color:transparent;padding:0;padding-left:2rem;margin:.5rem 0}#loading_page,#task_context,.fab-actions__item{background-color:var(--foreground-color)}.task__branch_container .branch-button::before{position:absolute;content:"";top:-50%;left:0;display:inline-flex;width:1rem;height:100%;align-self:flex-start;margin-right:.8rem;border-left:solid;border-bottom:solid;border-width:.15rem;border-color:rgba(var(--text-color),.6);border-radius:0 0 0 .2rem}.task__branch_container .branch-button+.branch-button::before{top:calc(-50% - 1.5rem);height:calc(100% + 1.5rem)}.task-option{grid-area:options;padding:.5rem}.task-option .icon{height:1.2rem;width:1.2rem}.task-description{grid-area:description;margin:0;white-space:pre-line}.assigned-interns{display:flex;flex-wrap:wrap;margin-bottom:1rem}.assigned-interns .assigned-intern{user-select:none;display:flex;font-size:.8rem;margin:.2rem .5rem .2rem 0;padding:.2rem 0 .2rem .4rem;border-radius:.2rem;border:1px solid;align-items:center;white-space:nowrap;text-transform:capitalize}.assigned-interns .assigned-intern button{padding:.2rem}.assigned-interns .assigned-intern button .icon{height:1rem;width:1rem}#task_context{position:absolute;top:0;right:0;margin:-1rem 1rem 0;list-style:none;padding:.5rem 0;width:max-content;border-radius:.3rem;transition:.3s opacity ease;box-shadow:0 .5rem 1rem -.3rem rgba(0,0,0,.3)}#task_context li{padding:.8rem 1.5rem;display:flex;align-items:center;font-size:.9rem}#task_context li .icon{height:1.2rem;width:1.2rem;margin-right:.5rem}.temp-task .cancel-task-button{margin-right:.5rem}#editing_panel__description{margin-bottom:2rem}#branch_container{display:flex;flex-flow:row wrap;margin:.5rem 0 1rem}#intern_list_popup{flex-direction:column}#best_interns_container,#intern_search_field,#project_list_container{margin-bottom:1rem}#intern_list_container{height:100%;overflow-y:auto}#best_interns_container .container-header .icon,#project_list_container .container-header .icon{margin-right:.5rem}#edit_data_fig{width:60vw;margin:2rem 0}#loading_page{display:grid;justify-items:center}.loading-message{font-size:1.3rem;margin:1.5rem 0 .5rem}#loading_page__footer{position:absolute;bottom:0;width:100%;padding:1.5rem}#loading_page__footer .icon{height:4rem;width:4rem}#project_watching_section{position:relative;overflow:hidden}#project_explorer{padding:0}#project_explorer__right{gap:1rem;align-items:flex-start;align-content:flex-start;padding:1rem}#explorer_branch_container{margin-top:1.5rem}#watch_project_button{margin-left:1rem;text-transform:capitalize}#admin_page{position:relative;display:grid;gap:0;padding:0;height:100%}#project_editing_panel{position:relative;padding:1rem 0;height:100%;overflow-y:auto}#editing_panel__title{margin-bottom:1rem}.fab-actions{display:grid;gap:1rem;position:absolute;bottom:0;right:0;margin:1rem;justify-items:end;text-align:end;z-index:5}#logout,#username{margin-top:1.5rem}.fab-actions[open] .fab-actions__item{transform:translateY(0);opacity:1}.fab-actions[open] .fab .icon:nth-of-type(1){transform:scale(0) rotate(180deg)}.fab-actions[open] .fab .icon:nth-of-type(2){transform:scale(1) rotate(0)}.fab-actions[open]~#fab_backdrop{opacity:1;clip-path:circle(100%)}.fab-actions__item{display:flex;align-items:center;justify-self:end;padding:.6rem 1rem;border-radius:2rem;transform:translateY(1.5rem);opacity:0;transition:transform .3s cubic-bezier(.175,.885,.32,1.275),opacity .3s;box-shadow:0 .2rem .5rem rgba(0,0,0,.2);user-select:none}.fab-actions__item:active,.fab-actions__item:hover,.fab:active{transform:scale(.9)}.fab-actions__item:nth-of-type(1){transition-delay:.2s}.fab-actions__item:nth-of-type(2){transition-delay:.1s}.fab,.fab .icon{transition:transform .3s}.fab-actions__item .icon{fill:var(--accent-color);margin-left:.5rem}.fab-actions__item-name{font-size:.9rem}.fab{position:relative;display:flex;justify-content:center;align-items:center;padding:1rem;height:3.2rem;width:3.2rem;border-radius:50%;background-color:var(--accent-color);box-shadow:0 .5rem .8rem rgba(0,0,0,.3)}.fab .icon{position:absolute;height:100%;fill:#fff}.fab .icon:nth-of-type(1){transform:scale(1) rotate(0)}.fab .icon:nth-of-type(2){transform:scale(0) rotate(-180deg)}#fab_backdrop{position:fixed;z-index:3;top:0;bottom:0;left:0;right:0;opacity:0;clip-path:circle(0 at 100% 100%);transition:clip-path .5s,opacity .5s;background-color:rgba(0,0,0,.5)}#update_of_task{font-size:1.3rem;margin:.4rem 0 1.8rem}ul{padding:0;list-style:none}#assigned_task_list{display:grid;gap:1rem;margin-top:1rem;align-content:flex-start}.task-card{display:grid;padding:1rem;border-radius:.5rem;background-color:var(--foreground-color)}.task__project-title,input[type=date]{background-color:rgba(var(--text-color),.06)}.task__header{display:grid;gap:0 .5rem;align-items:flex-start;grid-template-columns:1fr auto;grid-template-areas:". send-button" ". send-button"}.task__project-title{font-size:.9rem;font-weight:500;border-radius:.3rem;padding:.3rem .5rem;justify-self:flex-start;margin-bottom:.5rem!important}.task__title{font-size:1.3rem;margin-bottom:1rem!important}.task__description{white-space:pre-line}.send-update-button{grid-area:send-button;--padding:0.6rem 0.8rem;color:var(--accent-color)}.send-update-button .icon{height:1.2rem;width:1.2rem;fill:var(--accent-color)}#admin_page__left{height:100%;overflow-y:hidden}#admin_page__left sm-tab-header{--gap:0;--justify-content:stretch;background-color:var(--foreground-color);border-bottom:1px solid rgba(var(--text-color),.2)}#admin_page__left sm-tab{justify-content:center}#admin_page__left sm-tab-panels,#admin_page__left sm-tab-panels>*{height:100%;flex-direction:column}#admin_page__left sm-tab-panels{overflow-y:hidden}#admin_page__left sm-tab-panels>*{display:flex}#admin_page__left .list-container{height:100%;overflow-y:auto;padding-bottom:2rem}#admin_page__left .empty-state{padding:1rem;text-align:center}#update_filters_wrapper{gap:1.5rem}input[type=date]{display:flex;width:100%;padding:.5rem;border:rgba(var(--text-color),.2) solid thin;border-radius:.3rem;font-family:inherit;font-size:inherit;color:inherit}#project_watching_section,#project_watchlist,.watchlist_project_card{display:grid;gap:1rem}input[type=date]:focus{outline:0;box-shadow:0 0 0 .1rem var(--accent-color)}.search__icon{height:1.2rem;width:1.2rem}#user_role{font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;padding:.4rem .8rem;border-radius:.3rem;border:var(--accent-color) solid thin}#project_watchlist{grid-template-columns:repeat(auto-fill,minmax(15rem,1fr))}.watchlist_project_card{color:inherit;border-radius:.5rem;grid-template-rows:auto 1fr;padding:1rem;background-color:rgba(var(--text-color),.04)}.watchlist_project_card .project__title{font-size:1.1rem;line-height:1.5}.progress-bar{display:flex;height:.5rem;background-color:rgba(var(--text-color),.2);border-radius:1rem;overflow:hidden;align-self:flex-end}.progress-bar .progress-value{background-color:var(--accent-color);transition:width .3s}#username{margin-bottom:.5rem}@media only screen and (max-width:640px){.hide-on-mobile,.hide-page-on-mobile{display:none}#project_editing_panel{padding:1rem}.list-container{padding-bottom:5rem}}@media only screen and (min-width:640px){#admin_page__left,#project_editing_panel,.nav-list__item{border-radius:.5rem}.hide-on-desktop{display:none!important}sm-popup{--width:26rem}.popup__header{padding:1.5rem 1.5rem 0 .75rem}#main_nav{padding:.5rem;background-color:rgba(var(--background-color),1);flex-direction:column}#main_nav theme-toggle{margin:1rem;margin-top:auto}.nav-list__item{flex-direction:row;align-items:center;padding:.8rem;margin-bottom:.25rem;font-size:1rem}.nav-list__item--active{background-color:rgba(var(--text-color),.06)}.nav-list__item .icon{margin-bottom:0}.nav-list__item_title{display:none}.project-card--active{background-color:rgba(var(--text-color),.1)}#admin_page__left,.page{background-color:var(--foreground-color)}#sign_in{width:24rem;height:auto;border-radius:.4rem}#dashboard_page{grid-template-columns:3fr 18rem}#dashboard_page #project_watching_section{align-self:flex-start}#all_interns_page__header{grid-template-columns:1fr auto}#admin_page{padding:1rem 0;gap:1rem;grid-template-columns:18rem minmax(0,1fr);grid-template-rows:1fr}#project_editing_panel{padding-right:1rem}#edit_data_fig{width:16rem;justify-self:center}#project_explorer{display:grid;height:100%;grid-template-columns:16rem 3fr;grid-template-areas:"left right"}#project_explorer__left{grid-area:left;height:100%;overflow-y:auto;padding-bottom:1.5rem;border-right:1px solid rgba(var(--text-color),.06);background-color:rgba(var(--background-color),1)}#all_interns_list .intern-card,#update_filters_wrapper{border-radius:.5rem;background-color:var(--foreground-color)}#project_explorer__left h4{margin-top:0;margin-bottom:.5rem;color:var(--accent-color);font-size:.9rem}#project_explorer__right{grid-area:right;height:100%;overflow-y:auto}#main_page{grid-template-columns:4rem minmax(0,1fr);grid-template-areas:"main-header main-header" "main-nav sub-pages"}#post_update_popup{--width:28rem}#updates_page{height:100%;gap:1rem;grid-template-areas:"updates update-filters";grid-template-columns:minmax(0,1fr) 20rem}#update_filters_wrapper{padding:1rem;align-content:flex-start;grid-area:update-filters}#updates_wrapper{height:100%;overflow-y:auto;grid-area:updates}#all_interns_list{gap:1rem;grid-template-columns:repeat(auto-fill,minmax(14rem,1fr))}#all_interns_list .intern-card{gap:1.5rem .5rem;padding:1.5rem;grid-template-columns:1fr}#all_interns_list .intern-card__initials{position:relative;grid-column:1/3;z-index:1}#all_interns_list .intern-card__initials::after{content:"";position:absolute;background-color:inherit;border-radius:inherit;height:calc(100% + 1rem);width:calc(100% + 1rem);opacity:.3;z-index:-1}#intern_list_popup{--height:80vh}#settings_page{height:100%;align-items:flex-start;padding:2rem}.watchlist_project_card{padding:1.5rem}}@media only screen and (min-width:1280px){#main_page{grid-template-columns:12rem minmax(0,1fr);grid-template-areas:"main-header main-header" "main-nav sub-pages"}#main_nav{align-items:flex-start}.nav-list__item .icon{margin-right:.5rem}.nav-list__item_title{display:inline-block}}@media (any-hover:hover){::-webkit-scrollbar{width:.5rem;height:.5rem}::-webkit-scrollbar-thumb{background:rgba(var(--text-color),.3);border-radius:1rem}::-webkit-scrollbar-thumb:hover{background:rgba(var(--text-color),.5)}.interact:hover{background:linear-gradient(rgba(var(--text-color),.06),rgba(var(--text-color),.06)),var(--foreground-color)}.apply-button,.send-update-button,.task-option{opacity:0;transition:opacity .3s}.task-card:hover .send-update-button,.task-list-item:hover .task-option,.task-option:focus-within,.task:hover .apply-button{opacity:1}} \ No newline at end of file +*{padding:0;margin:0;box-sizing:border-box;font-family:"Roboto",sans-serif}:root{font-size:clamp(1rem,1.2vmax,1.2rem)}html,body{height:100%}body{--accent-color: #3d5afe;--secondary-color: #ffac2e;--text-color: 20, 20, 20;--foreground-color: 252, 253, 255;--background-color: 241, 243, 248;--danger-color: rgb(255, 75, 75);--green: #1cad59;--yellow: rgb(220, 165, 0);--dark-red: #d40e1e;--red: #f50000;--kinda-pink: #e40273;--purple: #462191;--shady-blue: #324de6;--nice-blue: #3d5afe;--maybe-cyan: #00b0ff;--teal: #00bcd4;--mint-green: #16c79a;--yellowish-green: #66bb6a;--greenish-yellow: #8bc34a;--dark-teal: #11698e;--tangerine: #ff6f00;--orange: #ff9100;--redish-orange: #ff3d00;color:rgba(var(--text-color), 1);background-color:rgba(var(--background-color), 1);overflow-y:hidden}body[data-theme=dark]{--accent-color: #6d83ff;--secondary-color: #d60739;--text-color: 200, 200, 200;--foreground-color: 27, 28, 29;--background-color: 21, 22, 22;--danger-color: rgb(255, 106, 106);--green: #00e676;--yellow: rgb(255, 213, 5);--dark-red: #ff5e7e;--red: #ff6098;--kinda-pink: #c44ae6;--purple: #9565f7;--shady-blue: #8295fb;--nice-blue: #6d83ff;--maybe-cyan: #66cfff;--teal: #6aeeff;--mint-green: #4dffd2;--yellowish-green: #9effa2;--greenish-yellow: #c7fc8b;--dark-teal: #51cbff;--tangerine: #ffac6d;--orange: #ffbe68;--redish-orange: #ff8560}body[data-theme=dark] ::-webkit-calendar-picker-indicator{filter:invert(1)}.calistoga{font-weight:400;font-family:"Calistoga",cursive}p,strong{line-height:1.7;font-size:.9rem;color:rgba(var(--text-color), 0.9);max-width:70ch}img{-o-object-fit:cover;object-fit:cover}a:where([class]){color:inherit;text-decoration:none}a:where([class]):focus-visible{box-shadow:0 0 0 .1rem rgba(var(--text-color), 1) inset}a{color:var(--accent-color)}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}button,.button{-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;display:inline-flex;border:none;background-color:rgba(0,0,0,0);overflow:hidden;color:inherit;-webkit-tap-highlight-color:rgba(0,0,0,0);align-items:center;font-size:.9rem;font-weight:500;white-space:nowrap;padding:.8rem;border-radius:.3rem;justify-content:center}button:focus-visible,.button:focus-visible{outline:var(--accent-color) solid medium}button:not(:disabled),.button:not(:disabled){cursor:pointer}.button{background-color:rgba(var(--text-color), 0.02);border:solid thin rgba(var(--text-color), 0.06)}.button--primary{color:rgba(var(--background-color), 1) !important}.button--primary .icon{fill:rgba(var(--background-color), 1)}.button--danger{color:var(--danger-color)}.button--danger .icon{fill:var(--danger-color)}.button--primary{background-color:var(--accent-color)}.button--colored{color:var(--accent-color)}.button--colored .icon{fill:var(--accent-color)}.button--small{padding:.4rem .6rem}.button--outlined{border:solid rgba(var(--text-color), 0.3) .1rem;background-color:rgba(var(--foreground-color), 1)}.button--transparent{background-color:rgba(0,0,0,0)}.cta{text-transform:uppercase;font-size:.8rem;font-weight:700;letter-spacing:.05em;padding:.8rem 1rem}.icon{width:1.2rem;height:1.2rem;fill:rgba(var(--text-color), 0.8);flex-shrink:0}.icon-only{padding:.5rem;border-radius:.3rem;aspect-ratio:1/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}details summary{display:flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer;align-items:center;justify-content:space-between;color:var(--accent-color)}details[open] summary{margin-bottom:1rem}details[open]>summary .down-arrow{transform:rotate(180deg)}fieldset{border:none}input{accent-color:var(--accent-color)}input[type=range]:active{cursor:-webkit-grab;cursor:grab}sm-copy{font-size:.9rem}sm-input,sm-textarea{font-size:.9rem;--border-radius: 0.5rem;--background-color: rgba(var(--foreground-color), 1)}sm-input button .icon,sm-textarea button .icon{fill:var(--accent-color)}sm-textarea{--max-height: 32ch}sm-button{--padding: 0.8rem}sm-button[variant=primary] .icon{fill:rgba(var(--background-color), 1)}sm-button[disabled] .icon{fill:rgba(var(--text-color), 0.6)}sm-button.danger{--background: var(--danger-color);color:rgba(var(--background-color), 1)}sm-spinner{--size: 1.5rem;--stroke-width: 0.1rem}cube-loader{--size: 1.2rem}sm-form{--gap: 1rem}sm-select{--padding: 0.8rem;font-size:.9rem;--min-width: fit-content;--select-border-radius: 0.5rem}sm-select[open]{z-index:10}sm-option{font-size:.9rem}strip-select{--gap: 0;background-color:rgba(var(--text-color), 0.06);border-radius:.3rem;padding:.3rem}strip-option{position:relative;font-size:.8rem;--border-radius: 0.2rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}sm-button{--border-radius: 0.3rem}sm-button[variant=primary] .icon{fill:rgba(var(--background-color), 1)}sm-button[disabled] .icon{fill:rgba(var(--text-color), 0.6)}ul{list-style:none}.overflow-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.wrap-around{overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-webkit-hyphens:auto;hyphens:auto}.full-bleed{grid-column:1/-1}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.sticky{position:-webkit-sticky;position:sticky}.top-0{top:0}.flex{display:flex}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.grid{display:grid}.flow-column{grid-auto-flow:column}.gap-0-3{gap:.3rem}.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}.text-align-left{text-align:left}.align-items-start{align-items:flex-start}.align-content-start{align-content:flex-start}.align-start{align-content:flex-start}.align-center{align-items:center}.align-end{align-items:flex-end}.text-center{text-align:center}.justify-start{justify-items:start}.justify-content-start{justify-content:start}.justify-center{justify-content:center}.justify-right{margin-left:auto}.align-self-center{align-self:center}.align-self-end{align-self:end}.justify-self-center{justify-self:center}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.flex-direction-column{flex-direction:column}.space-between{justify-content:space-between}.w-100{width:100%}.h-100{height:100%}.padding-block-1{padding-block:1rem}.margin-right-0-3{margin-right:.3rem}.margin-right-0-5{margin-right:.5rem}.margin-left-0-5{margin-left:.5rem}.margin-left-auto{margin-left:auto}.margin-right-auto{margin-right:auto}.margin-top-1{margin-top:1rem}.margin-bottom-0-5{margin-bottom:.5rem}.margin-bottom-1{margin-bottom:1rem}.margin-bottom-2{margin-bottom:2rem}.margin-block-0-5{margin-block:.5rem}.margin-block-1{margin-block:1rem}.margin-block-1-5{margin-block:1.5rem}.margin-inline-1{margin-inline:1rem}.margin-inline-1-5{margin-inline:1.5rem}.hidden{display:none !important}.no-transformations{transform:none !important}.full-bleed{grid-column:1/4}.h1{font-size:2.5rem}.h2{font-size:2rem}.h3{font-size:1.4rem}.h4{font-size:1rem}.h5{font-size:.8rem}.grid-3{grid-template-columns:1fr auto auto}.flow-column{grid-auto-flow:column}.w-100{width:100%}.color-0-8{color:rgba(var(--text-color), 0.8)}.weight-400{font-weight:400}.weight-500{font-weight:500}.ws-pre-line{white-space:pre-line}.card{background-color:rgba(var(--foreground-color), 1);border-radius:.5rem;padding:max(1rem,3vw)}.ripple{height:8rem;width:8rem;position:absolute;border-radius:50%;transform:scale(0);background:radial-gradient(circle, rgba(var(--text-color), 0.3) 0%, rgba(0, 0, 0, 0) 50%);pointer-events:none}.interact{position:relative;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.observe-empty-state:empty{display:none}.observe-empty-state:not(:empty)~.empty-state{display:none}.button__icon{height:1.2rem;width:1.2rem}.button__icon--left{margin-right:.5rem}.button__icon--right{margin-left:.5rem}[data-editable]{transition:padding .2s}[data-editable]:focus-within{padding:.5em;border-radius:.3rem;outline:none;background-color:rgba(var(--text-color), 0.06);box-shadow:0 0 0 .1rem var(--accent-color) inset}.multi-state-button{display:grid;text-align:center;align-items:center}.multi-state-button>*{grid-area:1/1/2/2}.multi-state-button button{z-index:1}.password-field label{display:flex;justify-content:center}.password-field label input:checked~.visible{display:none}.password-field label input:not(:checked)~.invisible{display:none}#confirmation_popup,#prompt_popup{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}.popup__header{display:grid;gap:.5rem;width:100%;padding:0 1.5rem 0 .5rem;align-items:center;grid-template-columns:auto 1fr auto}.popup__header__close{padding:.5rem;cursor:pointer}.page{height:100%}.page__header{display:flex;justify-content:space-between;margin-bottom:1.5rem;min-height:8rem}.page__header .grid{margin-top:auto}.page__header h1{margin-top:auto;font-size:2rem}.page-layout{display:grid;gap:1.5rem 0;grid-template-columns:1.5rem minmax(0, 1fr) 1.5rem;align-content:flex-start}.page-layout>*{grid-column:2/3}#secondary_pages{display:grid;width:100%;grid-template-rows:-webkit-min-content minmax(0, 1fr);grid-template-rows:min-content minmax(0, 1fr);grid-template-areas:"header" "content"}#secondary_pages header{padding:1.5rem 1rem;background-color:rgba(var(--foreground-color), 0.3)}#secondary_pages .inner-page{width:100%;height:100%;grid-area:content}.inner-page{gap:1rem;display:grid;position:relative;padding:1rem;grid-template-columns:minmax(0, 1fr);height:100%;background-color:rgba(var(--foreground-color), 0.3)}#landing{padding:0 1rem;overflow-y:auto;padding-bottom:3rem}#landing sm-carousel{width:min(100%,64rem);margin:0 auto;align-self:flex-start;--nav-background-color: white;--nav-icon-fill: black}.landing__card{position:relative;width:min(64rem,100%);flex-shrink:0;margin:0 auto;padding:2rem max(1rem,6vw);border-radius:1rem;align-items:center}.landing__card h1{font-size:max(2rem,2.5vw)}.landing__card img{width:min(100%,24rem)}.landing__card:first-of-type{background-color:#2a2c35;color:#fff}.landing__card:first-of-type h1{mix-blend-mode:soft-light}.landing__card:nth-of-type(2){background:url(../assets/globe.svg) no-repeat bottom right,rgba(var(--foreground-color), 1);background-size:max(60vw,90vh);color:#fff;min-height:24rem}.landing__card:nth-of-type(2) img{align-self:flex-start;width:20vmax}.landing__card:nth-of-type(2) .grid{margin-top:auto;margin-left:auto}.landing__card:nth-of-type(2) p{margin-top:auto;color:rgba(255,255,255,.9)}#sign_in,#sign_up{justify-items:center;align-content:center}#sign_in section,#sign_up section{margin-top:-8rem;width:min(26rem,100%)}#sign_in sm-form,#sign_up sm-form{margin:2rem 0}#sign_up .h2{margin-bottom:.5rem}.generated-keys-wrapper{padding:1rem;background-color:rgba(var(--foreground-color), 1);border-radius:.5rem}#flo_id_warning{padding-bottom:1.5rem}#flo_id_warning .icon{height:3rem;width:3rem;padding:.8rem;overflow:visible;background-color:#ffc107;border-radius:3rem;fill:rgba(0,0,0,.8)}#task_details>*{justify-self:center;max-width:64rem}#main_page{height:100%;grid-template-rows:auto 1fr auto;grid-template-areas:"main-header" "sub-pages" "main-nav"}#sub_page_container{grid-area:sub-pages;height:100%;overflow-y:auto;display:grid}#sub_page_container>*{grid-area:1/1}#main_header{grid-area:main-header;display:flex;gap:1rem;align-items:center;position:-webkit-sticky;position:sticky;padding:.5rem 1rem;background:rgba(var(--foreground-color), 1);z-index:1}#main_nav{grid-area:main-nav;position:relative;display:flex;align-items:center;background-color:rgba(var(--foreground-color), 1)}.nav-list__item{display:flex;flex-direction:column;align-items:center;width:100%;padding:.5rem 0;-webkit-tap-highlight-color:rgba(0,0,0,0);font-size:.8rem;font-weight:500;color:rgba(var(--text-color), 0.8)}.nav-list__item--active{color:var(--accent-color)}.nav-list__item--active .icon{fill:var(--accent-color)}.nav-list__item--active .icon--outlined{display:none}.nav-list__item--active .icon--filled{display:inline-block}.nav-list__item:not(.nav-list__item--active) .icon--outlined{display:inline-block}.nav-list__item:not(.nav-list__item--active) .icon--filled{display:none}.nav-list__item .icon{margin-bottom:.3rem}.container-card{position:relative;background:rgba(var(--foreground-color), 1);border-radius:.5rem}#sign_in_page{display:grid;position:fixed;z-index:5;top:0;bottom:0;left:0;right:0;place-content:center;background-color:rgba(var(--foreground-color), 1);gap:1rem}.display-task{display:flex;flex-direction:column;gap:.8rem;padding:max(2vw,1rem);border-radius:.5rem;background-color:rgba(var(--foreground-color), 1);margin:0 auto;width:min(100%,48rem);border:solid .2rem rgba(var(--text-color), 0.8)}.display-task__category{display:inline-flex;padding:.3rem .5rem;background-color:rgba(var(--text-color), 0.06);border-radius:.3rem;font-size:.9rem;color:rgba(var(--text-color), 0.8);text-transform:capitalize;font-weight:500;height:100%;align-items:center}.display-task__title{font-size:1.2rem}.display-task__description{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;white-space:pre-wrap}.display-task__detail{display:flex;gap:.3rem;background-color:rgba(var(--text-color), 0.04);border-radius:.3rem;padding:.3rem .5rem;font-size:.9rem;color:rgba(var(--text-color), 0.8)}.display-task__detail__value{font-weight:500}.display-task p{line-height:1.5}#application_card{position:relative;overflow:hidden;background-color:rgba(var(--foreground-color), 1);border:solid thin rgba(var(--text-color), 0.1);padding:0}#application_card>div:first-of-type{padding:max(1rem,3vw);z-index:2;width:calc(100% - 4rem);background:linear-gradient(90deg, rgba(var(--foreground-color), 1) 0%, rgba(var(--foreground-color), 0) 100%)}#application_card .illustration{position:absolute;height:100%;right:0;width:auto;margin:0 -1.5rem -1.5rem 0}.task{display:grid;grid-template-columns:auto 1fr;margin-right:1rem}.task .task__branch_container{padding-bottom:2rem}.task:last-of-type .left .line{transform:scaleY(0)}.task .left{display:flex;position:relative;justify-content:center;padding-top:.5rem}.task .left .circle{display:inline-flex;position:relative;align-self:flex-start;height:1rem;width:1rem;border-radius:50%;background:rgba(var(--foreground-color), 1);border:solid 2px rgba(var(--text-color), 0.4);z-index:1}.task .left .line{position:absolute;left:50%;height:100%;width:2px;transform:translateX(-50%) scaleY(1);background-color:rgba(var(--text-color), 0.4)}.task .right{margin-left:1rem;display:flex;flex-direction:column;width:100%;gap:.7rem}.task .right .apply-cont{width:100%;display:flex;flex-direction:row}.task .right .apply-cont h4{flex:1}.task .right:last-child{margin-bottom:1rem}.task h4{margin-top:.4rem}.task .assigned-interns .assigned-intern{padding:.4rem}.timeline-task__description,.admin-reply__description{max-width:100%}.completed .left .circle{border:solid 2px #00c853 !important;background:#00c853 !important}.completed .left .line{background-color:#00c853 !important}.task-title{font-weight:500}.padding{padding:1rem}#dashboard_page{padding-bottom:5rem;grid-template-columns:auto}.logo{display:flex;align-items:center;font-size:1.2rem;width:100%}.logo .cls-2,.logo .cls-3{fill:rgba(var(--text-color), 1);font-size:146.9px;font-family:ArialMT,Arial}.logo svg{height:2.5rem}.logo h4{margin:0}.project-card{padding:1rem;margin:.2rem;border-radius:.5rem;font-weight:500;line-height:1.5;text-transform:capitalize;color:rgba(var(--text-color), 0.8)}.intern-card{padding:1rem;margin:.2rem;border-radius:.5rem;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:.8rem 1rem;gap:.8rem;grid-template-columns:auto 1fr auto}.intern-card .icon{height:1rem;width:1rem;margin-left:.2rem}.intern-card__initials{display:flex;height:2.6rem;width:2.6rem;justify-content:center;align-items:center;border-radius:50%;color:var(--color);font-weight:700;font-size:1rem;text-transform:uppercase;background-color:rgba(var(--text-color), 0.06)}.intern-card__score-wrapper{font-weight:500;font-size:1.2rem}.request-card{display:grid;position:relative;padding:1rem;margin:.2rem;gap:.3rem;background-color:rgba(var(--text-color), 0.06);border-radius:.5rem}.request-card sm-button{--padding: 0.5rem 0.8rem}.request-card__description{width:100%;font-size:1rem}.reject-app{margin-left:auto;margin-right:.5rem}#updates_page{align-content:flex-start}#updates_page sm-select{--max-height: 50vh}#updates{transition:opacity .3s ease}#updates_page__project_selector strip-option{font-size:.9rem}.intern-update{display:grid;gap:.5rem;padding:1rem;border-radius:.5rem;background-color:rgba(var(--foreground-color), 1)}.update__topic{font-weight:500;font-size:1rem;margin-top:.5rem;text-transform:capitalize;max-width:65ch}.update__sender,.admin-reply__title{font-size:.85rem;font-weight:500;background-color:rgba(var(--text-color), 0.06);padding:.3rem .5rem;margin:0 -0.5rem;border-radius:1rem}.update__time{font-size:.85rem;color:rgba(var(--text-color), 0.8)}.admin-reply{position:relative;padding:1rem;padding-left:1.5rem;margin-left:.5rem;gap:.3rem}.admin-reply::before{content:"";position:absolute;width:.1rem;height:calc(100% - 1rem);left:0;background-color:rgba(var(--text-color), 0.5)}.admin-reply__title{justify-self:flex-start}.container-header{display:flex;align-items:center;width:100%;padding:1rem}.container-header h4{flex:1;font-weight:500}#intern_info_popup .grid>*{justify-self:center}#intern_info_popup #update_intern_score{width:100%;margin-top:1rem}#intern_info__initials{position:relative;height:3rem;width:3rem;font-size:1.3rem;color:var(--color)}#intern_info__name{font-size:1.5rem;margin-bottom:.5rem}.icon--star{fill:var(--orange)}#intern_info__score{font-size:1.5rem}#project_info{flex-direction:column}.branch-button{display:flex;padding:.5rem;border-radius:.2rem;text-transform:capitalize;justify-self:start;align-items:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;font-size:.85rem;font-weight:500}.branch-button--active{opacity:1;color:#fff;background:var(--accent-color)}#task_list{gap:.5rem;padding:1rem 0 1.5rem 0}.task-list-item{display:grid;align-content:flex-start;padding:1rem;gap:.5rem;border-radius:.5rem;background:rgba(var(--foreground-color), 1)}.task-list-item h4{font-weight:500;margin:0}.task-list-item .task-title{line-height:1.6}.task-list-item__task-number{font-size:.8rem;color:rgba(var(--text-color), 0.8);border:solid .1em var(--accent-color);border-radius:.3rem;padding:.2rem .4rem;font-weight:500}.task__branch_container:not(:empty){display:grid;gap:.5rem;padding:.5rem 0}.task__branch_container .branch-button{position:relative;background-color:rgba(0,0,0,0);padding:0;padding-left:2rem;margin:.5rem 0}.task__branch_container .branch-button::before{position:absolute;content:"";top:-50%;left:0;display:inline-flex;width:1rem;height:100%;align-self:flex-start;margin-right:.8rem;border-left:solid;border-bottom:solid;border-width:.15rem;border-color:rgba(var(--text-color), 0.6);border-radius:0 0 0 .2rem}.task__branch_container .branch-button+.branch-button::before{top:calc(-50% - 1.5rem);height:calc(100% + 1.5rem)}.task-option{margin-right:-0.5rem}.task-description{margin:0;overflow-wrap:break-word;word-wrap:break-word}.assigned-interns{display:flex;flex-wrap:wrap;gap:.5rem}.assigned-interns .assigned-intern{-webkit-user-select:none;-moz-user-select:none;user-select:none;display:flex;font-size:.8rem;padding:.2rem 0 .2rem .4rem;border-radius:.2rem;border:1px solid rgba(var(--text-color), 0.24);align-items:center;white-space:nowrap;text-transform:capitalize}.assigned-interns .assigned-intern button{padding:.2rem}.assigned-interns .assigned-intern button .icon{height:1rem;width:1rem}#task_context{position:absolute;top:0;right:0;margin:-1rem 1rem 0 1rem;list-style:none;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-radius:.5rem;transition:.3s opacity;background-color:rgba(var(--foreground-color), 1);box-shadow:0 1rem 2rem rgba(0,0,0,.16);transform-origin:top right;border:solid thin rgba(var(--text-color), 0.16)}#task_context li{display:flex;align-items:center;font-size:.9rem;margin:.2rem;padding:.6rem .8rem;border-radius:.3rem}#task_context li .icon{margin-right:.5rem}#branch_container{display:flex;flex-flow:row wrap;margin:.5rem 0 1rem 0}#intern_list_popup{flex-direction:column}#intern_search_field{margin-bottom:1rem}#intern_list_container{height:100%;overflow-y:auto}#intern_list_container .intern-card{padding:.8rem 0;margin:0}#best_interns_container{margin-bottom:1rem}#best_interns_container .container-header .icon{margin-right:.5rem}#edit_data_fig{fill:rgba(var(--text-color), 0.6);width:60vw;margin:2rem 0}#loading{display:grid;text-align:center;place-content:center;justify-items:center;background-color:rgba(var(--foreground-color), 1)}#pinned_project_section{position:relative;overflow:hidden}#project_explorer{padding:0}#project_explorer__right{gap:1rem;align-items:flex-start;align-content:flex-start;padding:1rem}#pin_project_button{margin-left:1rem}#admin_page{position:relative;display:grid;padding:0;height:100%;overflow:hidden;grid-template-rows:auto 1fr}#admin_views{display:grid;height:100%;overflow-y:hidden}#admin_views>*{grid-area:1/1}#project_editing_panel{position:relative;height:100%;padding:0 max(4vw,1rem);overflow-y:auto;padding-bottom:2rem;flex:1}#update_of_project{color:rgba(var(--text-color), 0.8)}#update_of_task{font-size:1.3rem;margin:.4rem 0 1.8rem 0}ul{padding:0;list-style:none}#assigned_task_list{display:grid;gap:1rem;margin-top:1rem;align-content:flex-start;grid-template-columns:minmax(0, 1fr)}.task-card{display:grid;gap:.5rem;padding:1rem;border-radius:.5rem;background-color:rgba(var(--foreground-color), 1)}.task__project-title{font-size:.8rem;margin:0 -0.5em;margin-bottom:.5rem;border-radius:1rem;padding:.3rem .5rem;justify-self:flex-start;color:rgba(var(--text-color), 0.8);background-color:rgba(var(--text-color), 0.06)}.task__title{font-size:1.1rem}.task__description{word-wrap:break-word;overflow-wrap:break-word;color:rgba(var(--text-color), 0.8);font-size:.9rem;margin-top:.2rem}.send-update-button,.init-update-replay{color:var(--accent-color);background-color:rgba(var(--text-color), 0.04)}.send-update-button .icon,.init-update-replay .icon{fill:var(--accent-color)}.temp-task{padding:1rem;background-color:rgba(var(--foreground-color), 1);border-radius:.5rem}#internship_requests_list{padding-bottom:2rem}.status-card{display:grid;gap:1rem;padding:1rem;border-radius:.5rem;background-color:rgba(var(--foreground-color), 1)}.status-card__time{font-size:.8rem;color:rgba(var(--text-color), 0.8)}.status-card__status{justify-content:flex-end}.status-card__status .icon{height:1em;width:1em}.status-card.accepted .icon{fill:var(--green)}.status-card.rejected .icon{fill:var(--danger-color)}.status-card.pending .icon{fill:var(--yellow)}#projects_container{display:flex;height:100%;overflow-y:hidden}#projects_container__left{height:100%;overflow-y:auto}#projects_container__left .list-container{height:100%;overflow-y:auto;padding-bottom:2rem}#projects_container__left .empty-state{padding:1rem;text-align:center}#update_filters_wrapper{gap:1.5rem}input[type=date]{display:flex;width:100%;padding:.5rem;border:rgba(var(--text-color), 0.2) solid thin;border-radius:.3rem;font-family:inherit;font-size:inherit;color:inherit;background-color:rgba(var(--text-color), 0.06)}input[type=date]:focus{outline:none;box-shadow:0 0 0 .1rem var(--accent-color)}.search__icon{height:1.2rem;width:1.2rem}#user_role{justify-self:start;font-size:.7rem;font-weight:500;text-transform:uppercase;letter-spacing:.05em;padding:.4rem .8rem;border-radius:.3rem;border:solid var(--accent-color) thin}#pinned_project_section{display:grid;gap:1rem}#pinned_projects{display:grid;gap:.3rem;grid-template-columns:repeat(auto-fill, minmax(20rem, 1fr))}.pinned-card{color:inherit;display:grid;border-radius:.5rem;padding:1rem;background-color:rgba(var(--foreground-color), 1);grid-template-columns:auto 1fr}.pinned-card .project-icon{display:flex;background-color:rgba(var(--text-color), 0.06);justify-self:start;align-self:flex-start;padding:.8rem;border-radius:2rem;margin-right:.8rem;grid-row:span 3}.pinned-card .project-icon .icon{fill:var(--accent-color)}.pinned-card .project__title{margin-bottom:.8rem;font-weight:500;color:inherit}.pinned-card .project__complete-percent{font-size:.8rem;opacity:.8;margin-top:.5rem}.progress-bar{display:flex;height:.2rem;background-color:rgba(var(--text-color), 0.2);border-radius:1rem;overflow:hidden;align-self:flex-end}.progress-bar .progress-value{background-color:var(--accent-color);transition:width .3s}#settings_page{align-content:flex-start}@media only screen and (max-width: 640px){.hide-on-mobile,.hide-page-on-mobile{display:none}.list-container{padding-bottom:5rem}.status-card__status{grid-area:1/2/2/3}.status-card__details{grid-area:2/1/3/3}}@media only screen and (min-width: 640px){.hide-on-desktop{display:none !important}sm-popup{--width: 26rem}.popup__header{padding:1.5rem 1.5rem 0 .75rem}#secondary_pages header{padding:1.5rem 8vw}#main_nav{padding:.5rem;background-color:rgba(var(--background-color), 1);flex-direction:column}#main_nav theme-toggle{margin:1rem;margin-top:auto}.nav-list__item{flex-direction:row;align-items:center;border-radius:.5rem;padding:.8rem;margin-bottom:.25rem;font-size:1rem}.nav-list__item--active{background-color:rgba(var(--text-color), 0.06)}.nav-list__item .icon{margin-bottom:0}.nav-list__item_title{display:none}.project-card--active{background-color:rgba(var(--text-color), 0.1)}.project-card--active::before{content:"";position:absolute;top:0;left:0;bottom:0;margin:auto 0;width:.2rem;height:1.5em;background-color:var(--accent-color);border-radius:0 .2rem .2rem 0}#sign_in{width:24rem;height:auto;border-radius:.4rem}#dashboard_page{grid-template-columns:1fr 18rem}#all_interns_page__header{grid-template-columns:1fr auto}#admin_page{padding:0}#projects_container__left{width:18rem;background-color:rgba(var(--foreground-color), 0.5)}#edit_data_fig{width:16rem;justify-self:center}#project_explorer{display:grid;height:100%;grid-template-columns:16rem 3fr;grid-template-areas:"left right"}#project_explorer__left{grid-area:left;height:100%;overflow-y:auto;padding-bottom:1.5rem;border-right:1px solid rgba(var(--text-color), 0.06);background-color:rgba(var(--background-color), 1)}#project_explorer__left h4{margin-top:0;margin-bottom:.5rem;color:var(--accent-color);font-size:.9rem}#project_explorer__right{grid-area:right;height:100%;overflow-y:auto}#main_page{grid-template-columns:4rem minmax(0, 1fr);grid-template-areas:"main-header main-header" "main-nav sub-pages"}#post_update_popup{--width: 28rem}#updates_page{height:100%;gap:1rem;grid-template-areas:"updates update-filters";grid-template-columns:minmax(0, 1fr) 20rem;overflow-y:hidden}#update_filters_wrapper{padding:1rem;border-radius:.5rem;align-content:flex-start;grid-area:update-filters;background-color:rgba(var(--foreground-color), 1)}#updates_wrapper{height:100%;overflow-y:auto;grid-area:updates}#all_interns_list{gap:.5rem;grid-template-columns:repeat(auto-fill, minmax(16rem, 1fr))}#all_interns_list .intern-card{margin:0;gap:1rem;border-radius:.5rem;background-color:rgba(var(--foreground-color), 1)}#intern_list_popup{--height: 80vh}.status-card{align-items:center;font-size:.9rem;grid-template-columns:6rem 1fr 8rem}}@media only screen and (min-width: 1280px){#main_page{grid-template-columns:12rem minmax(0, 1fr);grid-template-areas:"main-header main-header" "main-nav sub-pages"}#main_nav{align-items:flex-start}.nav-list__item .icon{margin-right:.5rem}.nav-list__item_title{display:inline-block}}@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{transition:background-color .2s}.interact:hover{background-color:rgba(var(--text-color), 0.04)}} \ No newline at end of file diff --git a/css/main.scss b/css/main.scss index ddd2ea4..aa68006 100644 --- a/css/main.scss +++ b/css/main.scss @@ -1,895 +1,1441 @@ * { - padding: 0; - margin: 0; - box-sizing: border-box; - font-family: 'Roboto', sans-serif; + padding: 0; + margin: 0; + box-sizing: border-box; + font-family: "Roboto", sans-serif; } :root { - font-size: clamp(1rem, 1.2vmax, 3rem); + font-size: clamp(1rem, 1.2vmax, 1.2rem); } html, body { - height: 100%; - scroll-behavior: smooth; + height: 100%; } body { - - &, - * { - --accent-color: #5D54A4; - --text-color: 17, 17, 17; - --background-color: 240, 240, 255; - --foreground-color: rgb(248, 248, 255); - --danger-color: red; - scrollbar-width: thin; - } - - color: rgba(var(--text-color), 1); - background: rgba(var(--background-color), 1); + --accent-color: #3d5afe; + --secondary-color: #ffac2e; + --text-color: 20, 20, 20; + --foreground-color: 252, 253, 255; + --background-color: 241, 243, 248; + --danger-color: rgb(255, 75, 75); + --green: #1cad59; + --yellow: rgb(220, 165, 0); + // Accent colors + --dark-red: #d40e1e; + --red: #f50000; + --kinda-pink: #e40273; + --purple: #462191; + --shady-blue: #324de6; + --nice-blue: #3d5afe; + --maybe-cyan: #00b0ff; + --teal: #00bcd4; + --mint-green: #16c79a; + --yellowish-green: #66bb6a; + --greenish-yellow: #8bc34a; + --dark-teal: #11698e; + --tangerine: #ff6f00; + --orange: #ff9100; + --redish-orange: #ff3d00; + color: rgba(var(--text-color), 1); + background-color: rgba(var(--background-color), 1); + overflow-y: hidden; } -body[data-theme='dark'] { - - &, - * { - --accent-color: #9D65C9; - --text-color: 240, 240, 240; - --text-color-light: 170, 170, 170; - --background-color: 10, 10, 10; - --foreground-color: rgb(20, 20, 20); - --danger-color: rgb(255, 106, 106); - } - ::-webkit-calendar-picker-indicator { - filter: invert(1); - } +body[data-theme="dark"] { + --accent-color: #6d83ff; + --secondary-color: #d60739; + --text-color: 200, 200, 200; + --foreground-color: 27, 28, 29; + --background-color: 21, 22, 22; + --danger-color: rgb(255, 106, 106); + --green: #00e676; + --yellow: rgb(255, 213, 5); + // Accent colors + --dark-red: #ff5e7e; + --red: #ff6098; + --kinda-pink: #c44ae6; + --purple: #9565f7; + --shady-blue: #8295fb; + --nice-blue: #6d83ff; + --maybe-cyan: #66cfff; + --teal: #6aeeff; + --mint-green: #4dffd2; + --yellowish-green: #9effa2; + --greenish-yellow: #c7fc8b; + --dark-teal: #51cbff; + --tangerine: #ffac6d; + --orange: #ffbe68; + --redish-orange: #ff8560; + ::-webkit-calendar-picker-indicator { + filter: invert(1); + } } - -p { - max-width: 70ch; - line-height: 1.7; - color: rgba(var(--text-color), 0.8); - - &:not(:last-of-type) { - margin-bottom: 1.5rem; - } +.calistoga { + font-weight: 400; + font-family: "Calistoga", cursive; +} +p, +strong { + line-height: 1.7; + font-size: 0.9rem; + color: rgba(var(--text-color), 0.9); + max-width: 70ch; } img { - object-fit: cover; + object-fit: cover; } a:where([class]) { - color: inherit; - text-decoration: none; + color: inherit; + text-decoration: none; - &:focus-visible { - box-shadow: 0 0 0 0.1rem rgba(var(--text-color), 1) inset; - } + &:focus-visible { + box-shadow: 0 0 0 0.1rem rgba(var(--text-color), 1) inset; + } } -a{ - color: var(--accent-color); +a { + color: var(--accent-color); +} + +a:any-link:focus-visible { + outline: rgba(var(--text-color), 1) 0.1rem solid; } button, .button { - position: relative; - display: inline-flex; - border: none; + user-select: none; + position: relative; + display: inline-flex; + border: none; + background-color: transparent; + overflow: hidden; + color: inherit; + -webkit-tap-highlight-color: transparent; + align-items: center; + font-size: 0.9rem; + font-weight: 500; + white-space: nowrap; + padding: 0.8rem; + border-radius: 0.3rem; + justify-content: center; + + &:focus-visible { + outline: var(--accent-color) solid medium; + } + + &:not(:disabled) { + cursor: pointer; + } +} + +.button { + background-color: rgba(var(--text-color), 0.02); + border: solid thin rgba(var(--text-color), 0.06); + &--primary { + color: rgba(var(--background-color), 1) !important; + + .icon { + fill: rgba(var(--background-color), 1); + } + } + &--danger { + color: var(--danger-color); + .icon { + fill: var(--danger-color); + } + } + + &--primary { + background-color: var(--accent-color); + } + &--colored { + color: var(--accent-color); + .icon { + fill: var(--accent-color); + } + } + + &--small { + padding: 0.4rem 0.6rem; + } + + &--outlined { + border: solid rgba(var(--text-color), 0.3) 0.1rem; + background-color: rgba(var(--foreground-color), 1); + } + &--transparent { background-color: transparent; - overflow: hidden; - color: inherit; - cursor: pointer; -} -button:disabled{ - opacity: 0.5; + } } -a.button{ - padding: 0.6rem 1.2rem; - border-radius: 0.3rem; - background-color: rgba(var(--text-color), 0.06); -} - -a:any-link:focus-visible { - outline: rgba(var(--text-color), 1) 0.1rem solid; -} - -sm-button { - --border-radius: 0.3rem; - - &[variant="primary"] { - .icon { - fill: rgba(var(--background-color), 1); - } - } - - &[disabled] { - .icon { - fill: rgba(var(--text-color), 0.6); - } - } -} - -ul { - list-style: none; -} - -.flex { - display: flex; -} - -.grid { - display: grid; -} - -.hide { - opacity: 0; - pointer-events: none; -} - -.hide-completely { - display: none !important; -} - -.no-transformations { - transform: 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; - -moz-hyphens: auto; - -webkit-hyphens: auto; - hyphens: auto; -} - -.full-bleed { - grid-column: 1/4; -} - -.h1 { - font-size: 2.5rem; -} - -.h2 { - font-size: 2rem; -} - -.h3 { - font-size: 1.4rem; -} - -.h4 { - font-size: 1rem; -} - -.h5 { - font-size: 0.8rem; -} - -.uppercase { - text-transform: uppercase; -} - -.capitalize { - text-transform: capitalize; -} - -.flex { - display: flex; -} - -.grid { - display: grid; -} - -.grid-3 { - grid-template-columns: 1fr auto auto; -} - -.flow-column { - grid-auto-flow: column; -} - -.gap-0-5 { - gap: 0.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 { - align-items: flex-start; -} - -.align-center { - align-items: center; -} - -.text-center { - text-align: center; -} - -.justify-start { - justify-content: start; -} - -.justify-center { - justify-content: center; -} - -.justify-right { - margin-left: auto; -} - -.align-self-center { - align-self: center; -} - -.justify-self-center { - justify-self: center; -} - -.justify-self-start { - justify-self: start; -} - -.justify-self-end { - justify-self: end; -} - -.direction-column { - flex-direction: column; -} - -.space-between { - justify-content: space-between; -} - -.w-100 { - width: 100%; -} - -.color-0-8 { - color: rgba(var(--text-color), 0.8); -} - -.weight-400 { - font-weight: 400; -} - -.weight-500 { - font-weight: 500; -} - -.ripple { - position: absolute; - border-radius: 50%; - transform: scale(0); - background: rgba(var(--text-color), 0.16); - pointer-events: none; -} - -.interact { - position: relative; - overflow: hidden; - cursor: pointer; - -webkit-tap-highlight-color: transparent; -} - -.observe-empty-state:empty { - display: none; -} - -.observe-empty-state:not(:empty)~.empty-state { - display: none; +.cta { + text-transform: uppercase; + font-size: 0.8rem; + font-weight: 700; + letter-spacing: 0.05em; + padding: 0.8rem 1rem; } .icon { - width: 1.5rem; - height: 1.5rem; - fill: rgba(var(--text-color), 0.9); + width: 1.2rem; + height: 1.2rem; + fill: rgba(var(--text-color), 0.8); + flex-shrink: 0; +} + +.icon-only { + padding: 0.5rem; + border-radius: 0.3rem; + aspect-ratio: 1/1; +} + +button:disabled { + opacity: 0.5; +} + +a:any-link:focus-visible { + outline: rgba(var(--text-color), 1) 0.1rem solid; +} + +details summary { + display: flex; + user-select: none; + cursor: pointer; + align-items: center; + justify-content: space-between; + color: var(--accent-color); +} + +details[open] { + & summary { + margin-bottom: 1rem; + } + + & > summary .down-arrow { + transform: rotate(180deg); + } +} + +fieldset { + border: none; +} + +input { + accent-color: var(--accent-color); + + &[type="range"] { + &:active { + cursor: grab; + } + } +} + +sm-copy { + font-size: 0.9rem; +} + +sm-input, +sm-textarea { + font-size: 0.9rem; + --border-radius: 0.5rem; + --background-color: rgba(var(--foreground-color), 1); + + button { + .icon { + fill: var(--accent-color); + } + } +} + +sm-textarea { + --max-height: 32ch; +} + +sm-button { + --padding: 0.8rem; + + &[variant="primary"] { + .icon { + fill: rgba(var(--background-color), 1); + } + } + + &[disabled] { + .icon { + fill: rgba(var(--text-color), 0.6); + } + } + + &.danger { + --background: var(--danger-color); + color: rgba(var(--background-color), 1); + } +} + +sm-spinner { + --size: 1.5rem; + --stroke-width: 0.1rem; +} +cube-loader { + --size: 1.2rem; +} + +sm-form { + --gap: 1rem; +} + +sm-select { + --padding: 0.8rem; + font-size: 0.9rem; + --min-width: fit-content; + --select-border-radius: 0.5rem; + &[open] { + z-index: 10; + } +} + +sm-option { + font-size: 0.9rem; +} + +strip-select { + --gap: 0; + background-color: rgba(var(--text-color), 0.06); + border-radius: 0.3rem; + padding: 0.3rem; +} + +strip-option { + position: relative; + font-size: 0.8rem; + --border-radius: 0.2rem; + user-select: none; +} + +sm-button { + --border-radius: 0.3rem; + + &[variant="primary"] { + .icon { + fill: rgba(var(--background-color), 1); + } + } + + &[disabled] { + .icon { + fill: rgba(var(--text-color), 0.6); + } + } +} + +ul { + list-style: none; +} + +.overflow-ellipsis { + width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.wrap-around { + overflow-wrap: break-word; + word-wrap: break-word; + word-break: break-word; + hyphens: auto; +} + +.full-bleed { + grid-column: 1/-1; +} + +.uppercase { + text-transform: uppercase; +} + +.capitalize { + text-transform: capitalize; +} + +.sticky { + position: sticky; +} + +.top-0 { + top: 0; +} + +.flex { + display: flex; +} + +.flex-wrap { + flex-wrap: wrap; +} + +.flex-1 { + flex: 1; +} +.flex-shrink-0 { + flex-shrink: 0; +} + +.grid { + display: grid; +} + +.flow-column { + grid-auto-flow: column; +} + +.gap-0-3 { + gap: 0.3rem; +} + +.gap-0-5 { + gap: 0.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; +} +.text-align-left { + text-align: left; +} + +.align-items-start { + align-items: flex-start; +} +.align-content-start { + align-content: flex-start; +} + +.align-start { + align-content: flex-start; +} + +.align-center { + align-items: center; +} + +.align-end { + align-items: flex-end; +} + +.text-center { + text-align: center; +} + +.justify-start { + justify-items: start; +} +.justify-content-start { + justify-content: start; +} + +.justify-center { + justify-content: center; +} + +.justify-right { + margin-left: auto; +} + +.align-self-center { + align-self: center; +} + +.align-self-end { + align-self: end; +} + +.justify-self-center { + justify-self: center; +} + +.justify-self-start { + justify-self: start; +} + +.justify-self-end { + justify-self: end; +} + +.flex-direction-column { + flex-direction: column; +} + +.space-between { + justify-content: space-between; +} + +.w-100 { + width: 100%; +} + +.h-100 { + height: 100%; +} + +.padding-block-1 { + padding-block: 1rem; +} + +.margin-right-0-3 { + margin-right: 0.3rem; +} +.margin-right-0-5 { + margin-right: 0.5rem; +} + +.margin-left-0-5 { + margin-left: 0.5rem; +} + +.margin-left-auto { + margin-left: auto; +} +.margin-right-auto { + margin-right: auto; +} +.margin-top-1 { + margin-top: 1rem; +} +.margin-bottom-0-5 { + margin-bottom: 0.5rem; +} +.margin-bottom-1 { + margin-bottom: 1rem; +} +.margin-bottom-2 { + margin-bottom: 2rem; +} + +.margin-block-0-5 { + margin-block: 0.5rem; +} +.margin-block-1 { + margin-block: 1rem; +} + +.margin-block-1-5 { + margin-block: 1.5rem; +} + +.margin-inline-1 { + margin-inline: 1rem; +} + +.margin-inline-1-5 { + margin-inline: 1.5rem; +} + +.hidden { + display: none !important; +} + +.no-transformations { + transform: none !important; +} + +.full-bleed { + grid-column: 1/4; +} + +.h1 { + font-size: 2.5rem; +} + +.h2 { + font-size: 2rem; +} + +.h3 { + font-size: 1.4rem; +} + +.h4 { + font-size: 1rem; +} + +.h5 { + font-size: 0.8rem; +} + +.grid-3 { + grid-template-columns: 1fr auto auto; +} + +.flow-column { + grid-auto-flow: column; +} +.w-100 { + width: 100%; +} + +.color-0-8 { + color: rgba(var(--text-color), 0.8); +} + +.weight-400 { + font-weight: 400; +} + +.weight-500 { + font-weight: 500; +} +.ws-pre-line { + white-space: pre-line; +} + +.card { + background-color: rgba(var(--foreground-color), 1); + border-radius: 0.5rem; + padding: max(1rem, 3vw); +} + +.ripple { + height: 8rem; + width: 8rem; + position: absolute; + border-radius: 50%; + transform: scale(0); + background: radial-gradient( + circle, + rgba(var(--text-color), 0.3) 0%, + rgba(0, 0, 0, 0) 50% + ); + pointer-events: none; +} +.interact { + position: relative; + overflow: hidden; + cursor: pointer; + -webkit-tap-highlight-color: transparent; +} + +.observe-empty-state:empty { + display: none; +} + +.observe-empty-state:not(:empty) ~ .empty-state { + display: none; } .button__icon { - height: 1.2rem; - width: 1.2rem; + height: 1.2rem; + width: 1.2rem; - &--left { - margin-right: 0.5rem; - } + &--left { + margin-right: 0.5rem; + } - &--right { - margin-left: 0.5rem; + &--right { + margin-left: 0.5rem; + } +} + +[data-editable] { + transition: padding 0.2s; + &:focus-within { + padding: 0.5em; + border-radius: 0.3rem; + outline: none; + background-color: rgba(var(--text-color), 0.06); + box-shadow: 0 0 0 0.1rem var(--accent-color) inset; + } +} +.multi-state-button { + display: grid; + text-align: center; + align-items: center; + + & > * { + grid-area: 1/1/2/2; + } + + button { + z-index: 1; + } +} +.password-field { + label { + display: flex; + justify-content: center; + input:checked ~ .visible { + display: none; } + input:not(:checked) ~ .invisible { + display: none; + } + } } #confirmation_popup, #prompt_popup { - flex-direction: column; + flex-direction: column; - h4 { - font-weight: 500; - margin-bottom: 0.5rem; - } - - sm-button { - margin: 0; - } - - .flex { - padding: 0; - margin-top: 1rem; - - sm-button:first-of-type { - margin-right: 0.6rem; - margin-left: auto; - } + h4 { + font-weight: 500; + margin-bottom: 0.5rem; + } + + sm-button { + margin: 0; + } + + .flex { + padding: 0; + margin-top: 1rem; + + sm-button:first-of-type { + margin-right: 0.6rem; + margin-left: auto; } + } } .popup__header { - display: grid; - gap: 0.5rem; - width: 100%; - padding: 0 1.5rem 0 0.5rem; - align-items: center; - grid-template-columns: auto 1fr auto; + display: grid; + gap: 0.5rem; + width: 100%; + padding: 0 1.5rem 0 0.5rem; + align-items: center; + grid-template-columns: auto 1fr auto; } .popup__header__close { - padding: 0.5rem; - cursor: pointer; + padding: 0.5rem; + cursor: pointer; +} +.page { + height: 100%; + + &__header { + display: flex; + justify-content: space-between; + margin-bottom: 1.5rem; + min-height: 8rem; + + .grid { + margin-top: auto; + } + + h1 { + margin-top: auto; + font-size: 2rem; + } + } +} +.page-layout { + display: grid; + gap: 1.5rem 0; + grid-template-columns: 1.5rem minmax(0, 1fr) 1.5rem; + align-content: flex-start; + + & > * { + grid-column: 2/3; + } +} +#secondary_pages { + display: grid; + width: 100%; + grid-template-rows: min-content minmax(0, 1fr); + grid-template-areas: "header" "content"; + header { + padding: 1.5rem 1rem; + background-color: rgba(var(--foreground-color), 0.3); + } + + .inner-page { + width: 100%; + height: 100%; + grid-area: content; + } +} + +.inner-page { + gap: 1rem; + display: grid; + position: relative; + padding: 1rem; + grid-template-columns: minmax(0, 1fr); + height: 100%; + background-color: rgba(var(--foreground-color), 0.3); +} + +#landing { + padding: 0 1rem; + overflow-y: auto; + padding-bottom: 3rem; + sm-carousel { + width: min(100%, 64rem); + margin: 0 auto; + align-self: flex-start; + --nav-background-color: white; + --nav-icon-fill: black; + } +} +.landing__card { + position: relative; + width: min(64rem, 100%); + flex-shrink: 0; + margin: 0 auto; + padding: 2rem max(1rem, 6vw); + border-radius: 1rem; + align-items: center; + h1 { + font-size: max(2rem, 2.5vw); + } + img { + width: min(100%, 24rem); + } + &:first-of-type { + background-color: #2a2c35; + color: white; + h1 { + mix-blend-mode: soft-light; + } + } + &:nth-of-type(2) { + background: url(../assets/globe.svg) no-repeat bottom right, + rgba(var(--foreground-color), 1); + background-size: max(60vw, 90vh); + color: white; + min-height: 24rem; + img { + align-self: flex-start; + width: 20vmax; + } + .grid { + margin-top: auto; + margin-left: auto; + } + p { + margin-top: auto; + color: rgba(255, 255, 255, 0.9); + } + } +} +#sign_in, +#sign_up { + justify-items: center; + align-content: center; + + section { + margin-top: -8rem; + width: min(26rem, 100%); + } + + sm-form { + margin: 2rem 0; + } +} + +#sign_up { + .h2 { + margin-bottom: 0.5rem; + } +} +.generated-keys-wrapper { + padding: 1rem; + background-color: rgba(var(--foreground-color), 1); + border-radius: 0.5rem; +} +#flo_id_warning { + padding-bottom: 1.5rem; + .icon { + height: 3rem; + width: 3rem; + padding: 0.8rem; + overflow: visible; + background-color: #ffc107; + border-radius: 3rem; + fill: rgba(0, 0, 0, 0.8); + } +} + +#task_details { + & > * { + justify-self: center; + max-width: 64rem; + } } #main_page { - height: 100%; - grid-template-rows: auto 1fr auto; - grid-template-areas: 'main-header''sub-pages''main-nav'; + height: 100%; + grid-template-rows: auto 1fr auto; + grid-template-areas: "main-header" "sub-pages" "main-nav"; +} +#sub_page_container { + grid-area: sub-pages; + height: 100%; + overflow-y: auto; + display: grid; + & > * { + grid-area: 1/1; + } } #main_header { - grid-area: main-header; - display: flex; - gap: 1rem; - align-items: center; - position: sticky; - padding: 0.5rem 1rem; - background: var(--foreground-color); - z-index: 1; + grid-area: main-header; + display: flex; + gap: 1rem; + align-items: center; + position: sticky; + padding: 0.5rem 1rem; + background: rgba(var(--foreground-color), 1); + z-index: 1; } #main_nav { - grid-area: main-nav; - position: relative; - display: flex; - align-items: center; - background-color: var(--foreground-color); + grid-area: main-nav; + position: relative; + display: flex; + align-items: center; + background-color: rgba(var(--foreground-color), 1); } .nav-list__item { - display: flex; - flex-direction: column; - align-items: center; + display: flex; + flex-direction: column; + align-items: center; - width: 100%; - padding: 0.5rem 0; - -webkit-tap-highlight-color: transparent; + width: 100%; + padding: 0.5rem 0; + -webkit-tap-highlight-color: transparent; - font-size: 0.8rem; - font-weight: 500; - color: rgba(var(--text-color), 0.8); + font-size: 0.8rem; + font-weight: 500; + color: rgba(var(--text-color), 0.8); - &--active { - color: var(--accent-color); - - .icon { - fill: var(--accent-color); - } - .icon--outlined{ - display: none; - } - .icon--filled{ - display: inline-block; - } - } - &:not(.nav-list__item--active) { - .icon--outlined{ - display: inline-block; - } - .icon--filled{ - display: none; - } - } + &--active { + color: var(--accent-color); .icon { - margin-bottom: 0.3rem; + fill: var(--accent-color); } -} + .icon--outlined { + display: none; + } + .icon--filled { + display: inline-block; + } + } + &:not(.nav-list__item--active) { + .icon--outlined { + display: inline-block; + } + .icon--filled { + display: none; + } + } -#sub_page_container { - grid-area: sub-pages; - height: 100%; - overflow-y: auto; + .icon { + margin-bottom: 0.3rem; + } } .container-card { - position: relative; - background: var(--foreground-color); - border-radius: 0.5rem; -} - -.medium-top-bottom-margin { - margin: 0.5rem 0; + position: relative; + background: rgba(var(--foreground-color), 1); + border-radius: 0.5rem; } #sign_in_page { - display: grid; - position: fixed; - z-index: 5; - top: 0; - bottom: 0; - left: 0; + display: grid; + position: fixed; + z-index: 5; + top: 0; + bottom: 0; + left: 0; + right: 0; + place-content: center; + background-color: rgba(var(--foreground-color), 1); + gap: 1rem; +} + +.display-task { + display: flex; + flex-direction: column; + gap: 0.8rem; + padding: max(2vw, 1rem); + border-radius: 0.5rem; + background-color: rgba(var(--foreground-color), 1); + margin: 0 auto; + width: min(100%, 48rem); + border: solid 0.2rem rgba(var(--text-color), 0.8); + &__category { + display: inline-flex; + padding: 0.3rem 0.5rem; + background-color: rgba(var(--text-color), 0.06); + border-radius: 0.3rem; + font-size: 0.9rem; + color: rgba(var(--text-color), 0.8); + text-transform: capitalize; + font-weight: 500; + height: 100%; + align-items: center; + } + &__title { + font-size: 1.2rem; + } + &__description { + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + overflow: hidden; + white-space: pre-wrap; + } + &__detail { + display: flex; + gap: 0.3rem; + background-color: rgba(var(--text-color), 0.04); + border-radius: 0.3rem; + padding: 0.3rem 0.5rem; + font-size: 0.9rem; + color: rgba(var(--text-color), 0.8); + &__value { + font-weight: 500; + } + } + p { + line-height: 1.5; + } +} + +#application_card { + position: relative; + overflow: hidden; + background-color: rgba(var(--foreground-color), 1); + border: solid thin rgba(var(--text-color), 0.1); + padding: 0; + & > div { + &:first-of-type { + padding: max(1rem, 3vw); + z-index: 2; + width: calc(100% - 4rem); + background: linear-gradient( + 90deg, + rgba(var(--foreground-color), 1) 0%, + rgba(var(--foreground-color), 0) 100% + ); + } + } + .illustration { + position: absolute; + height: 100%; right: 0; - place-content: center; - background-color: var(--foreground-color); - gap: 1rem; + width: auto; + margin: 0 -1.5rem -1.5rem 0; + } } -#sign_in_form { - width: 22rem; -} - - .task { - display: grid; - grid-template-columns: auto 1fr; - margin: 0 1rem; - .task__branch_container{ - padding-bottom: 2rem; - } -} - -.task:last-of-type .left .line { + display: grid; + grid-template-columns: auto 1fr; + margin-right: 1rem; + .task__branch_container { + padding-bottom: 2rem; + } + &:last-of-type .left .line { transform: scaleY(0); -} + } -.task .left { + .left { display: flex; position: relative; justify-content: center; padding-top: 0.5rem; -} - -.task .left .circle { - display: inline-flex; - position: relative; - align-self: flex-start; - height: 1rem; - width: 1rem; - border-radius: 50%; - background: var(--foreground-color); - border: solid 2px rgba(var(--text-color), 0.4); - z-index: 1; -} - -.task .left .line { - position: absolute; - left: 50%; - height: 100%; - width: 2px; - transform: translateX(-50%) scaleY(1); - background-color: rgba(var(--text-color), 0.4); -} - -.task .right { + .circle { + display: inline-flex; + position: relative; + align-self: flex-start; + height: 1rem; + width: 1rem; + border-radius: 50%; + background: rgba(var(--foreground-color), 1); + border: solid 2px rgba(var(--text-color), 0.4); + z-index: 1; + } + .line { + position: absolute; + left: 50%; + height: 100%; + width: 2px; + transform: translateX(-50%) scaleY(1); + background-color: rgba(var(--text-color), 0.4); + } + } + .right { margin-left: 1rem; display: flex; flex-direction: column; width: 100%; -} + gap: 0.7rem; + .apply-cont { + width: 100%; + display: flex; + flex-direction: row; + h4 { + flex: 1; + } + } + &:last-child { + margin-bottom: 1rem; + } + } -.task .right .apply-cont { - width: 100%; - display: flex; - flex-direction: row; -} - -.task .right .apply-cont h4 { - -webkit-box-flex: 1; - -ms-flex: 1; - flex: 1; -} - -.task h4 { + h4 { margin-top: 0.4rem; - margin-bottom: 1rem; -} + } -.timeline-task__description{ - white-space: pre-line; -} - - -.task .assigned-interns .assigned-intern { + .assigned-interns .assigned-intern { padding: 0.4rem; + } +} +.timeline-task__description, +.admin-reply__description { + max-width: 100%; } -.completed-task .left .circle { - border: solid 2px #00C853 !important; - background: #00C853 !important; +.completed .left .circle { + border: solid 2px #00c853 !important; + background: #00c853 !important; } -.completed-task .left .line { - background-color: #00C853 !important; -} - -.page { - gap: 1rem; - display: grid; - position: relative; - padding: 1rem; - animation: fadein 0.3s; - grid-template-columns: minmax(0, 1fr); -} -@keyframes fadein { - 0% { - opacity: 0; - } - - 100% { - opacity: 1; - } +.completed .left .line { + background-color: #00c853 !important; } .task-title { - font-weight: 500; + font-weight: 500; } .padding { - padding: 1rem; + padding: 1rem; } #dashboard_page { - padding-bottom: 5rem; - grid-template-columns: auto; + padding-bottom: 5rem; + grid-template-columns: auto; } .logo { - display: flex; - align-items: center; - font-size: 1.2rem; - width: 100%; + display: flex; + align-items: center; + font-size: 1.2rem; + width: 100%; } .logo .cls-2, .logo .cls-3 { - fill: rgba(var(--text-color), 1); - font-size: 146.9px; - font-family: ArialMT, Arial; + fill: rgba(var(--text-color), 1); + font-size: 146.9px; + font-family: ArialMT, Arial; } .logo svg { - height: 2.5rem; + height: 2.5rem; } .logo h4 { - margin: 0; + margin: 0; } .project-card { - padding: 1rem; - font-weight: 500; - line-height: 1.5; - text-transform: capitalize; - color: rgba(var(--text-color), 0.8); + padding: 1rem; + margin: 0.2rem; + border-radius: 0.5rem; + font-weight: 500; + line-height: 1.5; + text-transform: capitalize; + color: rgba(var(--text-color), 0.8); } .intern-card { - user-select: none; - padding: 0.8rem 1rem; - gap: 0.8rem; - grid-template-columns: auto 1fr auto; + padding: 1rem; + margin: 0.2rem; + border-radius: 0.5rem; + user-select: none; + padding: 0.8rem 1rem; + gap: 0.8rem; + grid-template-columns: auto 1fr auto; + .icon { + height: 1rem; + width: 1rem; + margin-left: 0.2rem; + } } -.intern-card__initials{ - display: flex; - height: 2.6rem; - width: 2.6rem; - justify-content: center; - align-items: center; - border-radius: 40%; - color: white; - font-weight: 500; - font-size: 1rem; - text-transform: uppercase; - background-color: var(--accent-color); +.intern-card__initials { + display: flex; + height: 2.6rem; + width: 2.6rem; + justify-content: center; + align-items: center; + border-radius: 50%; + color: var(--color); + font-weight: 700; + font-size: 1rem; + text-transform: uppercase; + background-color: rgba(var(--text-color), 0.06); } .intern-card__score-wrapper { - font-weight: 500; - font-size: 1.2rem; -} - -.intern-card .icon { - fill: #FF5722 !important; - height: 1rem !important; - width: 1rem !important; - margin-left: 0.2rem; + font-weight: 500; + font-size: 1.2rem; } .request-card { - display: grid; - position: relative; - padding: 1rem; - sm-button{ - --padding: 0.5rem 0.8rem; - } + display: grid; + position: relative; + padding: 1rem; + margin: 0.2rem; + gap: 0.3rem; + background-color: rgba(var(--text-color), 0.06); + border-radius: 0.5rem; + sm-button { + --padding: 0.5rem 0.8rem; + } } -.request-card__description{ - width: 100%; - font-size: 1rem; - margin-bottom: 1rem; +.request-card__description { + width: 100%; + font-size: 1rem; } -.reject-app{ - margin-left: auto; - margin-right: 0.5rem; +.reject-app { + margin-left: auto; + margin-right: 0.5rem; } -#updates_page{ - sm-select{ - --max-height: 50vh; - } +#updates_page { + align-content: flex-start; + sm-select { + --max-height: 50vh; + } } #updates { - transition: opacity 0.3s ease; + transition: opacity 0.3s ease; } -#updates_page__project_selector{ - strip-option{ - font-size: 0.9rem; - } -} -#all_updates_list{ +#updates_page__project_selector { + strip-option { + font-size: 0.9rem; + } } .intern-update { - display: grid; - gap: 0.5rem; - padding: 1rem; - border-radius: 0.5rem; - background-color: var(--foreground-color); + display: grid; + gap: 0.5rem; + padding: 1rem; + border-radius: 0.5rem; + background-color: rgba(var(--foreground-color), 1); } .update__topic { - font-weight: 500; - font-size: 1rem; - margin-top: 0.5rem; - text-transform: capitalize; - max-width: 65ch; + font-weight: 500; + font-size: 1rem; + margin-top: 0.5rem; + text-transform: capitalize; + max-width: 65ch; } -.update__sender { - color: var(--accent-color); - font-size: 0.9rem; - font-weight: 500; +.update__sender, +.admin-reply__title { + font-size: 0.85rem; + font-weight: 500; + background-color: rgba(var(--text-color), 0.06); + padding: 0.3rem 0.5rem; + margin: 0 -0.5rem; + border-radius: 1rem; } .update__time { - font-size: 0.85rem; - color: rgba(var(--text-color), 0.8); + font-size: 0.85rem; + color: rgba(var(--text-color), 0.8); } - -.update__message { - white-space: pre-line; +.admin-reply { + position: relative; + padding: 1rem; + padding-left: 1.5rem; + margin-left: 0.5rem; + gap: 0.3rem; + &::before { + content: ""; + position: absolute; + width: 0.1rem; + height: calc(100% - 1rem); + left: 0; + background-color: rgba(var(--text-color), 0.5); + } + &__title { + justify-self: flex-start; + } } .container-header { - display: flex; - align-items: center; - width: 100%; - padding: 1rem; + display: flex; + align-items: center; + width: 100%; + padding: 1rem; } .container-header h4 { - flex: 1; - font-weight: 500; + flex: 1; + font-weight: 500; } #intern_info_popup { - .grid{ - & > *{ - justify-self: center; - } - } - #update_intern_score{ - width: 100%; - margin-top: 1rem; + .grid { + & > * { + justify-self: center; } + } + #update_intern_score { + width: 100%; + margin-top: 1rem; + } } -#intern_info__initials{ - margin-bottom: 1rem; - position: relative; - height: 3rem; - width: 3rem; - font-size: 1.3rem; - &::before{ - content: ''; - position: absolute; - background-color: inherit; - border-radius: inherit; - height: calc(100% + 1.5rem); - width: calc(100% + 1.5rem); - opacity: 0.3; - z-index: -1; - } +#intern_info__initials { + position: relative; + height: 3rem; + width: 3rem; + font-size: 1.3rem; + color: var(--color); } -#intern_info__name{ - font-size: 1.5rem; - margin-bottom: 0.5rem; +#intern_info__name { + font-size: 1.5rem; + margin-bottom: 0.5rem; } -.gold-fill { - fill: #FF5722; +.icon--star { + fill: var(--orange); } -#intern_info__score{ - font-size: 1.5rem; +#intern_info__score { + font-size: 1.5rem; } #project_info { - flex-direction: column; + flex-direction: column; } .branch-button { - margin-bottom: 0.5rem; - display: flex; - border-radius: 0; - padding: 0.5rem; - border-radius: 0.2rem; - text-transform: capitalize; - justify-self: start; - align-items: center; - user-select: none; - font-size: 0.85rem; - font-weight: 500; - .icon{ - height: 1.2rem; - width: 1.2rem; - } -} - -.active-branch { + display: flex; + padding: 0.5rem; + border-radius: 0.2rem; + text-transform: capitalize; + justify-self: start; + align-items: center; + user-select: none; + font-size: 0.85rem; + font-weight: 500; + &--active { opacity: 1; color: white; background: var(--accent-color); + } } -#task_list{ - padding: 1rem 0 1.5rem 0; +#task_list { + gap: 0.5rem; + padding: 1rem 0 1.5rem 0; } .task-list-item { - display: grid; - grid-template-columns: auto 1fr auto; - grid-template-areas: 'status title options' - 'status interns interns' - 'status description description' - 'status . .'; - align-content: flex-start; - padding: 1rem; - gap: 0.5rem; - border-radius: 0.5rem; - background: rgba(var(--text-color), 0.02); - sm-checkbox { - grid-area: status; - align-self: flex-start; - padding: 0.2rem 0.5rem 0.5rem 0; - } - h4 { - font-weight: 500; - margin: 0; - } - - .task-title { - grid-area: title; - line-height: 1.6; - } - .assigned-interns { - grid-area: interns; - } + display: grid; + align-content: flex-start; + padding: 1rem; + gap: 0.5rem; + border-radius: 0.5rem; + background: rgba(var(--foreground-color), 1); + h4 { + font-weight: 500; + margin: 0; + } + .task-title { + line-height: 1.6; + } + &__task-number { + font-size: 0.8rem; + color: rgba(var(--text-color), 0.8); + border: solid 0.1em var(--accent-color); + border-radius: 0.3rem; + padding: 0.2rem 0.4rem; + font-weight: 500; + } } -.task__branch_container{ - &:not(:empty){ - display: grid; - gap: 0.5rem; - padding: 0.5rem 0; +.task__branch_container { + &:not(:empty) { + display: grid; + gap: 0.5rem; + padding: 0.5rem 0; + } + .branch-button { + position: relative; + background-color: transparent; + padding: 0; + padding-left: 2rem; + margin: 0.5rem 0; + &::before { + position: absolute; + content: ""; + top: -50%; + left: 0; + display: inline-flex; + width: 1rem; + height: 100%; + align-self: flex-start; + margin-right: 0.8rem; + border-left: solid; + border-bottom: solid; + border-width: 0.15rem; + border-color: rgba(var(--text-color), 0.6); + border-radius: 0 0 0 0.2rem; } - .branch-button{ - position: relative; - background-color: transparent; - padding: 0; - padding-left: 2rem; - margin: 0.5rem 0; - &::before{ - position: absolute; - content: ''; - top: -50%; - left: 0; - display: inline-flex; - width: 1rem; - height: 100%; - align-self: flex-start; - margin-right: 0.8rem; - border-left: solid; - border-bottom: solid; - border-width: 0.15rem; - border-color: rgba(var(--text-color), 0.6); - border-radius: 0 0 0 0.2rem; - } - } - .branch-button + .branch-button{ - &::before{ - top: calc(-50% - 1.5rem ); - height: calc(100% + 1.5rem); - } + } + .branch-button + .branch-button { + &::before { + top: calc(-50% - 1.5rem); + height: calc(100% + 1.5rem); } + } } .task-option { - grid-area: options; - transition: opacity 0.3s ease; - padding: 0.5rem; - .icon{ - height: 1.2rem; - width: 1.2rem; - } + margin-right: -0.5rem; } -.task-description{ - grid-area: description; - margin: 0; - overflow-wrap: break-word; - word-wrap: break-word; - white-space: pre-line; +.task-description { + margin: 0; + overflow-wrap: break-word; + word-wrap: break-word; } .assigned-interns { - display: flex; - flex-wrap: wrap; - margin-bottom: 1rem; -} - -.assigned-interns .assigned-intern { + display: flex; + flex-wrap: wrap; + gap: 0.5rem; + .assigned-intern { user-select: none; display: flex; font-size: 0.8rem; - margin: 0.2rem 0.5rem 0.2rem 0; padding: 0.2rem 0 0.2rem 0.4rem; border-radius: 0.2rem; border: 1px solid rgba(var(--text-color), 0.24); @@ -897,686 +1443,556 @@ ul { white-space: nowrap; text-transform: capitalize; button { - padding: 0.2rem; - .icon { - height: 1rem; - width: 1rem; - } + padding: 0.2rem; + .icon { + height: 1rem; + width: 1rem; + } } + } } #task_context { - position: absolute; - top: 0; - right: 0; - margin: -1rem 1rem 0 1rem; - list-style: none; - padding: 0.5rem 0; - width: max-content; + position: absolute; + top: 0; + right: 0; + margin: -1rem 1rem 0 1rem; + list-style: none; + width: fit-content; + border-radius: 0.5rem; + transition: 0.3s opacity; + background-color: rgba(var(--foreground-color), 1); + box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.16); + transform-origin: top right; + border: solid thin rgba(var(--text-color), 0.16); + + li { + display: flex; + align-items: center; + font-size: 0.9rem; + margin: 0.2rem; + padding: 0.6rem 0.8rem; border-radius: 0.3rem; - transition: 0.3s opacity ease; - background-color: var(--foreground-color); - box-shadow: 0 0.5rem 1rem -0.3rem rgba(0, 0, 0, 0.3); - - li { - padding: 0.8rem 1.5rem; - display: flex; - align-items: center; - font-size: 0.9rem; - .icon { - height: 1.2rem; - width: 1.2rem; - margin-right: 0.5rem; - } + .icon { + margin-right: 0.5rem; } -} - -.temp-task { - .cancel-task-button{ - margin-right: 0.5rem; - } -} -#editing_panel__description{ - margin-bottom: 2rem; + } } #branch_container { - display: flex; - flex-flow: row wrap; - margin: 0.5rem 0 1rem 0; + display: flex; + flex-flow: row wrap; + margin: 0.5rem 0 1rem 0; } #intern_list_popup { - flex-direction: column; + flex-direction: column; } -#intern_search_field{ - margin-bottom: 1rem; +#intern_search_field { + margin-bottom: 1rem; } #intern_list_container { - height: 100%; - overflow-y: auto; + height: 100%; + overflow-y: auto; + .intern-card { + padding: 0.8rem 0; + margin: 0; + } } -#best_interns_container, -#project_list_container { - margin-bottom: 1rem; +#best_interns_container { + margin-bottom: 1rem; } -#best_interns_container .container-header .icon, -#project_list_container .container-header .icon { - margin-right: 0.5rem; +#best_interns_container .container-header .icon { + margin-right: 0.5rem; } #edit_data_fig { - fill: rgba(var(--text-color), 0.6); - width: 60vw; - margin: 2rem 0; + fill: rgba(var(--text-color), 0.6); + width: 60vw; + margin: 2rem 0; } -#loading_page { - display: grid; - position: fixed; - top: 0; - bottom: 0; - left: 0; - right: 0; - z-index: 5; - text-align: center; - place-content: center; - justify-items: center; - background-color: var(--foreground-color); +#loading { + display: grid; + text-align: center; + place-content: center; + justify-items: center; + background-color: rgba(var(--foreground-color), 1); } -.loading-message { - font-size: 1.3rem; - margin: 1.5rem 0 0.5rem 0; -} - -#loading_page__footer { - position: absolute; - bottom: 0; - width: 100%; - padding: 1.5rem; - - .icon { - height: 4rem; - width: 4rem; - } -} - -#project_watching_section { - position: relative; - overflow: hidden; +#pinned_project_section { + position: relative; + overflow: hidden; } #project_explorer { - padding: 0; + padding: 0; } #project_explorer__right { - gap: 1rem; - align-items: flex-start; - align-content: flex-start; - padding: 1rem; + gap: 1rem; + align-items: flex-start; + align-content: flex-start; + padding: 1rem; } -#explorer_branch_container{ - margin-top: 1.5rem; +#pin_project_button { + margin-left: 1rem; } -#watch_project_button{ - margin-left: 1rem; - text-transform: capitalize; -} - #admin_page { - position: relative; - display: grid; - gap: 0; - padding: 0; - height: 100%; + position: relative; + display: grid; + padding: 0; + height: 100%; + overflow: hidden; + grid-template-rows: auto 1fr; +} +#admin_views { + display: grid; + height: 100%; + overflow-y: hidden; + & > * { + grid-area: 1/1; + } } - #project_editing_panel { - position: relative; - padding: 1rem 0; - height: 100%; - overflow-y: auto; -} -#editing_panel__title{ - margin-bottom: 1rem; -} - -.fab-actions{ - display: grid; - gap: 1rem; - position: absolute; - bottom: 0; - right: 0; - margin: 1rem; - justify-items: end; - text-align: end; - z-index: 5; - &[open]{ - .fab-actions__item{ - transform: translateY(0); - opacity: 1; - } - .fab{ - .icon{ - &:nth-of-type(1){ - transform: scale(0) rotate(180deg); - } - &:nth-of-type(2){ - transform: scale(1) rotate(0); - } - } - } - & ~ #fab_backdrop{ - opacity: 1; - clip-path: circle(100%); - } - } -} -.fab-actions__item{ - display: flex; - align-items: center; - justify-self: end; - padding: 0.6rem 1rem; - border-radius: 2rem; - transform: translateY(1.5rem); - background-color: var(--foreground-color); - opacity: 0; - transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s; - box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.2); - user-select: none; - &:hover, - &:active{ - transform: scale(0.9); - } - &:nth-of-type(1){ - transition-delay: 0.2s; - } - &:nth-of-type(2){ - transition-delay: 0.1s; - } - .icon{ - fill: var(--accent-color); - margin-left: 0.5rem; - } - &-name{ - font-size: 0.9rem; - } -} -.fab{ - position: relative; - display: flex; - justify-content: center; - align-items: center; - padding: 1rem; - height: 3.2rem; - width: 3.2rem; - border-radius: 50%; - background-color: var(--accent-color); - box-shadow: 0 0.5rem 0.8rem rgba(0, 0, 0, 0.3); - transition: transform 0.3s; - -webkit-tap-highlight-color: transparent; - &:active{ - transform: scale(0.9); - } - .icon{ - position: absolute; - height: 100%; - fill: white; - transition: transform 0.3s; - &:nth-of-type(1){ - transform: scale(1) rotate(0); - } - &:nth-of-type(2){ - transform: scale(0) rotate(-180deg); - } - } -} -#fab_backdrop{ - position: fixed; - z-index: 3; - top: 0; - bottom: 0; - left: 0; - right: 0; - opacity: 0; - clip-path: circle(0% at 100% 100%); - transition: clip-path 0.5s, opacity 0.5s; - background-color: rgba(0, 0, 0, 0.5); + position: relative; + height: 100%; + padding: 0 max(4vw, 1rem); + overflow-y: auto; + padding-bottom: 2rem; + flex: 1; } #update_of_project { - color: rgba(var(--text-color), 0.8); + color: rgba(var(--text-color), 0.8); } #update_of_task { - font-size: 1.3rem; - margin: 0.4rem 0 1.8rem 0; + font-size: 1.3rem; + margin: 0.4rem 0 1.8rem 0; } ul { - padding: 0; - list-style: none; -} -#intern_view{ + padding: 0; + list-style: none; } #assigned_task_list { - display: grid; - gap: 1rem; - margin-top: 1rem; - align-content: flex-start; - grid-template-columns: minmax(0, 1fr); + display: grid; + gap: 1rem; + margin-top: 1rem; + align-content: flex-start; + grid-template-columns: minmax(0, 1fr); } .task-card { - display: grid; - padding: 1rem; - border-radius: 0.5rem; - grid-template-columns: minmax(0, 1fr); - background-color: var(--foreground-color); -} - -.task__header { - display: grid; - gap: 0 0.5rem; - align-items: flex-start; - grid-template-columns: 1fr auto; - grid-template-areas: '. send-button''. send-button'; + display: grid; + gap: 0.5rem; + padding: 1rem; + border-radius: 0.5rem; + background-color: rgba(var(--foreground-color), 1); } .task__project-title { - font-size: 0.9rem; - font-weight: 500; - border-radius: 0.3rem; - padding: 0.3rem 0.5rem; - justify-self: flex-start; - margin-bottom: 0.5rem !important; - color: rgba(var(--text-color), 0.8); - background-color: rgba(var(--text-color), 0.06); + font-size: 0.8rem; + margin: 0 -0.5em; + margin-bottom: 0.5rem; + border-radius: 1rem; + padding: 0.3rem 0.5rem; + justify-self: flex-start; + color: rgba(var(--text-color), 0.8); + background-color: rgba(var(--text-color), 0.06); } - .task__title { - font-size: 1.3rem; - margin-bottom: 1rem !important; + font-size: 1.1rem; } - .task__description { - word-wrap: break-word; - overflow-wrap: break-word; - white-space: pre-line; + word-wrap: break-word; + overflow-wrap: break-word; + color: rgba(var(--text-color), 0.8); + font-size: 0.9rem; + margin-top: 0.2rem; +} + +.send-update-button, +.init-update-replay { + color: var(--accent-color); + background-color: rgba(var(--text-color), 0.04); + .icon { + fill: var(--accent-color); + } +} + +.temp-task { + padding: 1rem; + background-color: rgba(var(--foreground-color), 1); + border-radius: 0.5rem; +} + +#internship_requests_list { + padding-bottom: 2rem; +} + +.status-card { + display: grid; + gap: 1rem; + padding: 1rem; + border-radius: 0.5rem; + background-color: rgba(var(--foreground-color), 1); + &__time { + font-size: 0.8rem; color: rgba(var(--text-color), 0.8); -} - -.send-update-button { - grid-area: send-button; - --padding: 0.6rem 0.8rem; - color: var(--accent-color); - + } + &__status { + justify-content: flex-end; .icon { - height: 1.2rem; - width: 1.2rem; - fill: var(--accent-color); + height: 1em; + width: 1em; } + } + &.accepted { + .icon { + fill: var(--green); + } + } + &.rejected { + .icon { + fill: var(--danger-color); + } + } + &.pending { + .icon { + fill: var(--yellow); + } + } } - -#admin_page__left{ +#projects_container { + display: flex; + height: 100%; + overflow-y: hidden; +} +#projects_container__left { + height: 100%; + overflow-y: auto; + .list-container { height: 100%; - overflow-y: hidden; - sm-tab-header{ - --gap: 0; - --justify-content: stretch; - background-color: var(--foreground-color); - border-bottom: 1px solid rgba(var(--text-color), 0.2); - } - sm-tab{ - justify-content: center; - } - sm-tab-panels, - sm-tab-panels > *{ - height: 100%; - flex-direction: column; - } - sm-tab-panels{ - overflow-y: hidden; - } - sm-tab-panels > *{ - display: flex; - } - .list-container{ - height: 100%; - overflow-y: auto; - padding-bottom: 2rem; - } - .empty-state{ - padding: 1rem; - text-align: center; - } -} -#update_filters_wrapper{ - gap: 1.5rem; -} -input[type="date"]{ - display: flex; - width: 100%; - padding: 0.5rem; - border: rgba(var(--text-color), 0.2) solid thin; - border-radius: 0.3rem; - font-family: inherit; - font-size: inherit; - color: inherit; - background-color: rgba(var(--text-color), 0.06); - &:focus{ - outline: none; - box-shadow: 0 0 0 0.1rem var(--accent-color); - } -} -.search__icon{ - height: 1.2rem; - width: 1.2rem; -} -#user_role{ - justify-self: start; - font-size: 0.7rem; - font-weight: 500; - text-transform: uppercase; - letter-spacing: 0.05em; - padding: 0.4rem 0.8rem; - border-radius: 0.3rem; - border: solid var(--accent-color) thin; -} -#project_watching_section{ - display: grid; - gap: 1rem; -} -#project_watchlist{ - display: grid; - gap: 1rem; - grid-template-columns: repeat(auto-fill, minmax(15rem ,1fr)); - -} -.watchlist_project_card{ - color: inherit; - display: grid; - border-radius: 0.5rem; - grid-template-rows: auto 1fr; - gap: 1rem; + overflow-y: auto; + padding-bottom: 2rem; + } + .empty-state { padding: 1rem; - background-color: rgba(var(--text-color), 0.04); - .project__title{ - font-size: 1.1rem; - line-height: 1.5; - } + text-align: center; + } } -.progress-bar{ +#update_filters_wrapper { + gap: 1.5rem; +} +input[type="date"] { + display: flex; + width: 100%; + padding: 0.5rem; + border: rgba(var(--text-color), 0.2) solid thin; + border-radius: 0.3rem; + font-family: inherit; + font-size: inherit; + color: inherit; + background-color: rgba(var(--text-color), 0.06); + &:focus { + outline: none; + box-shadow: 0 0 0 0.1rem var(--accent-color); + } +} +.search__icon { + height: 1.2rem; + width: 1.2rem; +} +#user_role { + justify-self: start; + font-size: 0.7rem; + font-weight: 500; + text-transform: uppercase; + letter-spacing: 0.05em; + padding: 0.4rem 0.8rem; + border-radius: 0.3rem; + border: solid var(--accent-color) thin; +} +#pinned_project_section { + display: grid; + gap: 1rem; +} +#pinned_projects { + display: grid; + gap: 0.3rem; + grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); +} +.pinned-card { + color: inherit; + display: grid; + border-radius: 0.5rem; + padding: 1rem; + background-color: rgba(var(--foreground-color), 1); + grid-template-columns: auto 1fr; + .project-icon { display: flex; - height: 0.5rem; - background-color: rgba(var(--text-color), 0.2); - border-radius: 1rem; - overflow: hidden; - align-self: flex-end; - .progress-value{ - background-color: var(--accent-color); - transition: width 0.3s; + background-color: rgba(var(--text-color), 0.06); + justify-self: start; + align-self: flex-start; + padding: 0.8rem; + border-radius: 2rem; + margin-right: 0.8rem; + grid-row: span 3; + .icon { + fill: var(--accent-color); } + } + .project__title { + margin-bottom: 0.8rem; + font-weight: 500; + color: inherit; + } + .project__complete-percent { + font-size: 0.8rem; + opacity: 0.8; + margin-top: 0.5rem; + } } -#username{ - margin-top: 1.5rem; - margin-bottom: 0.5rem; +.progress-bar { + display: flex; + height: 0.2rem; + background-color: rgba(var(--text-color), 0.2); + border-radius: 1rem; + overflow: hidden; + align-self: flex-end; + .progress-value { + background-color: var(--accent-color); + transition: width 0.3s; + } } -#logout{ - margin-top: 1.5rem; +#settings_page { + align-content: flex-start; } @media only screen and (max-width: 640px) { - .hide-on-mobile, - .hide-page-on-mobile { - display: none; + .hide-on-mobile, + .hide-page-on-mobile { + display: none; + } + .list-container { + padding-bottom: 5rem; + } + .status-card { + &__status { + grid-area: 1/2/2/3; } - #project_editing_panel{ - padding: 1rem; - } - .list-container{ - padding-bottom: 5rem; + &__details { + grid-area: 2/1/3/3; } + } } @media only screen and (min-width: 640px) { - .hide-on-desktop { - display: none !important; + .hide-on-desktop { + display: none !important; + } + + sm-popup { + --width: 26rem; + } + + .popup__header { + padding: 1.5rem 1.5rem 0 0.75rem; + } + #secondary_pages { + header { + padding: 1.5rem 8vw; + } + } + + #main_nav { + padding: 0.5rem; + background-color: rgba(var(--background-color), 1); + flex-direction: column; + theme-toggle { + margin: 1rem; + margin-top: auto; + } + } + + .nav-list__item { + flex-direction: row; + align-items: center; + + border-radius: 0.5rem; + padding: 0.8rem; + margin-bottom: 0.25rem; + + font-size: 1rem; + + &--active { + background-color: rgba(var(--text-color), 0.06); } - sm-popup { - --width: 26rem; + .icon { + margin-bottom: 0; } + &_title { + display: none; + } + } + .project-card { + &--active { + background-color: rgba(var(--text-color), 0.1); + &::before { + content: ""; + position: absolute; + top: 0; + left: 0; + bottom: 0; + margin: auto 0; + width: 0.2rem; + height: 1.5em; + background-color: var(--accent-color); + border-radius: 0 0.2rem 0.2rem 0; + } + } + } - .popup__header { - padding: 1.5rem 1.5rem 0 0.75rem; - } + #sign_in { + width: 24rem; + height: auto; + border-radius: 0.4rem; + } - #main_nav { - padding: 0.5rem; - background-color: rgba(var(--background-color), 1); - flex-direction: column; - theme-toggle{ - margin: 1rem; - margin-top: auto; - } - } + #dashboard_page { + grid-template-columns: 1fr 18rem; + } + #all_interns_page__header { + grid-template-columns: 1fr auto; + } - .nav-list__item { - flex-direction: row; - align-items: center; + #admin_page { + padding: 0; + } + #projects_container__left { + width: 18rem; + background-color: rgba(var(--foreground-color), 0.5); + } - border-radius: 0.5rem; - padding: 0.8rem; - margin-bottom: 0.25rem; + #edit_data_fig { + width: 16rem; + justify-self: center; + } - font-size: 1rem; + #project_explorer { + display: grid; + height: 100%; + grid-template-columns: 16rem 3fr; + grid-template-areas: "left right"; + } + #project_explorer__left { + grid-area: left; + height: 100%; + overflow-y: auto; + padding-bottom: 1.5rem; + border-right: 1px solid rgba(var(--text-color), 0.06); + background-color: rgba(var(--background-color), 1); + } - &--active { - background-color: rgba(var(--text-color), 0.06); - } + #project_explorer__left h4 { + margin-top: 0; + margin-bottom: 0.5rem; + color: var(--accent-color); + font-size: 0.9rem; + } - .icon { - margin-bottom: 0; - } - &_title{ - display: none; - } - } - .project-card { - &--active{ - background-color: rgba(var(--text-color), 0.1); - } - } - .page{ - background-color: var(--foreground-color); - } - - #sign_in { - width: 24rem; - height: auto; - border-radius: 0.4rem; - } + #project_explorer__right { + grid-area: right; + height: 100%; + overflow-y: auto; + } + #main_page { + grid-template-columns: 4rem minmax(0, 1fr); + grid-template-areas: "main-header main-header" "main-nav sub-pages"; + } - #dashboard_page { - grid-template-columns: 3fr 18rem; - } - - #dashboard_page #project_watching_section { - align-self: flex-start; - } - #all_interns_page__header{ - grid-template-columns: 1fr auto; - } - - #admin_page { - padding: 1rem 0; - gap: 1rem; - grid-template-columns: 18rem minmax(0, 1fr); - grid-template-rows: 1fr; - } - #admin_page__left{ - background-color: var(--foreground-color); - } - #project_editing_panel{ - padding-right: 1rem; - } - #admin_page__left, - #project_editing_panel{ - border-radius: 0.5rem; - } - - #edit_data_fig { - width: 16rem; - justify-self: center; - } - - #project_explorer { - display: grid; - height: 100%; - grid-template-columns: 16rem 3fr; - grid-template-areas: 'left right'; - } - #project_explorer__left { - grid-area: left; - height: 100%; - overflow-y: auto; - padding-bottom: 1.5rem; - border-right: 1px solid rgba(var(--text-color), 0.06); - background-color: rgba(var(--background-color), 1); - } - - #project_explorer__left h4 { - margin-top: 0; - margin-bottom: 0.5rem; - color: var(--accent-color); - font-size: 0.9rem; - } - - #project_explorer__right { - grid-area: right; - height: 100%; - overflow-y: auto; - } - #main_page { - grid-template-columns: 4rem minmax(0, 1fr); - grid-template-areas: 'main-header main-header''main-nav sub-pages'; - } - - #post_update_popup{ - --width: 28rem; - } - #updates_page{ - height: 100%; - gap: 1rem; - grid-template-areas: 'updates update-filters'; - grid-template-columns: minmax(0, 1fr) 20rem; - } - #update_filters_wrapper{ - padding: 1rem; - border-radius: 0.5rem; - align-content: flex-start; - grid-area: update-filters; - background-color: var(--foreground-color); - } - #updates_wrapper{ - height: 100%; - overflow-y: auto; - grid-area: updates; - } - #all_interns_list{ - gap: 1rem; - grid-template-columns: repeat(auto-fill, minmax(14rem ,1fr)); - .intern-card{ - gap: 1.5rem 0.5rem; - padding: 1.5rem; - grid-template-columns: 1fr; - border-radius: 0.5rem; - background-color: var(--foreground-color); - &__initials{ - position: relative; - grid-column: 1/3; - z-index: 1; - } - &__initials::after{ - content: ''; - position: absolute; - background-color: inherit; - border-radius: inherit; - height: calc(100% + 1rem); - width: calc(100% + 1rem); - opacity: 0.3; - z-index: -1; - } - } - } - #intern_list_popup { - --height: 80vh; - } - #settings_page { - height: 100%; - align-items: flex-start; - padding: 2rem; - } - .watchlist_project_card{ - padding: 1.5rem; + #post_update_popup { + --width: 28rem; + } + #updates_page { + height: 100%; + gap: 1rem; + grid-template-areas: "updates update-filters"; + grid-template-columns: minmax(0, 1fr) 20rem; + overflow-y: hidden; + } + #update_filters_wrapper { + padding: 1rem; + border-radius: 0.5rem; + align-content: flex-start; + grid-area: update-filters; + background-color: rgba(var(--foreground-color), 1); + } + #updates_wrapper { + height: 100%; + overflow-y: auto; + grid-area: updates; + } + #all_interns_list { + gap: 0.5rem; + grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); + .intern-card { + margin: 0; + gap: 1rem; + border-radius: 0.5rem; + background-color: rgba(var(--foreground-color), 1); } + } + #intern_list_popup { + --height: 80vh; + } + .status-card { + align-items: center; + font-size: 0.9rem; + grid-template-columns: 6rem 1fr 8rem; + } + #project_editing_panel { + } } @media only screen and (min-width: 1280px) { - #main_page { - // gap: 0 1.5rem; - grid-template-columns: 12rem minmax(0, 1fr); - grid-template-areas: 'main-header main-header''main-nav sub-pages'; + #main_page { + // gap: 0 1.5rem; + grid-template-columns: 12rem minmax(0, 1fr); + grid-template-areas: "main-header main-header" "main-nav sub-pages"; + } + #main_nav { + align-items: flex-start; + } + .nav-list__item { + .icon { + margin-right: 0.5rem; } - #main_nav{ - align-items: flex-start; - } - .nav-list__item { - - .icon { - margin-right: 0.5rem; - } - &_title{ - display: inline-block; - } + &_title { + display: inline-block; } + } } @media (any-hover: hover) { - ::-webkit-scrollbar { - width: 0.5rem; - height: 0.5rem; - } + ::-webkit-scrollbar { + width: 0.5rem; + height: 0.5rem; + } - ::-webkit-scrollbar-thumb { - background: rgba(var(--text-color), 0.3); - border-radius: 1rem; + ::-webkit-scrollbar-thumb { + background: rgba(var(--text-color), 0.3); + border-radius: 1rem; - &:hover { - background: rgba(var(--text-color), 0.5); - } + &:hover { + background: rgba(var(--text-color), 0.5); } - - .interact:hover { - background: linear-gradient(rgba(var(--text-color), 0.06), rgba(var(--text-color), 0.06)), var(--foreground-color); - } - - .send-update-button, - .task-option, - .apply-button { - opacity: 0; - transition: opacity 0.3s; - } - - - .task-list-item:hover .task-option, - .task-option:focus-within, - .task:hover .apply-button, - .task-card:hover .send-update-button { - opacity: 1; + } + .interact { + transition: background-color 0.2s; + &:hover { + background-color: rgba(var(--text-color), 0.04); } + } } - -@media (any-hover: none) { -} \ No newline at end of file diff --git a/index.html b/index.html index a7da440..dcb7dc5 100644 --- a/index.html +++ b/index.html @@ -1,22 +1,25 @@ + - RIBC + RanchiMall Internships - + @@ -25,125 +28,202 @@ - + + - + -

- Cancel - OK + Cancel + OK
-
- -

Loading RIBC

-

- A FLO Blockchain App by RanchiMall -

- -
-
-

Sign In

-

Welcome to RIBC.

- - - Sign in - -

- Don't have a private key? get it here -
or -

- - Sign in as guest - -
-
+
+
+
+ + RanchiMall + + + +

RanchiMall Internships

+
+ +
+ + + + + +
+
- @@ -179,7 +259,7 @@ Dashboard - + @@ -194,7 +274,36 @@ Updates - + + + + + + + + + + + + + + + + + + + + + + Applications + + + @@ -212,7 +321,7 @@ Manage - + @@ -232,197 +341,284 @@
-
-
-

Projects watchlist

-
-

No project added to watchlist.

- -
-

My tasks

-
    -
    -
    -
    -
    - - - - -

    Leaderboard

    -
    All + + +
    +
    +
    + + + + +

    Leaderboard

    + All +
    +
    +
    -
    -
    -

    -
    - - - +
    + + Projects + Interns + Requests + +
    -
    -
    -
    - - Projects - Interns - Requests - - -
    + Save changes + + +
    +
    +
    +

    No project added

    +
    + -
    -
      -

      No interns added

      -
      -
      -
        -

        No pending requests

        -
        - -
        -
        -

        -

        -

        Tasks

        - -
          -

          No tasks added yet, tasks will appear here after adding them.

          - - - - - - Add task - -
            -
          • - - - - - Edit title -
          • -
          • - - - - - Edit description -
          • -
          • - +
          + -
          -
            -
          • - - Add project - - - - - -
          • -
          • - - Add intern - - - - - -
          • -
          • - - Commit changes - - - - - -
          • -
          - -
          -
          + Add intern + +
            +

            No interns added

            +
            + +
            -
            - Filter + -
            + + -
            + +
            +