From e54513ee8ce0e297cc6f1e0dfe08acb1d7645d47 Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Sat, 2 Jan 2021 14:05:51 +0530 Subject: [PATCH] UI changes --- assets/components.js | 3589 --------------------------------- assets/message-background.svg | 2 +- css/bg.svg | 1 - css/emojipanel.css | 1 - css/main.css | 8 +- css/main.min.css | 2 +- css/main.scss | 8 +- index.html | 229 +-- 8 files changed, 125 insertions(+), 3715 deletions(-) delete mode 100644 assets/components.js delete mode 100644 css/bg.svg delete mode 100644 css/emojipanel.css diff --git a/assets/components.js b/assets/components.js deleted file mode 100644 index 3b1da31..0000000 --- a/assets/components.js +++ /dev/null @@ -1,3589 +0,0 @@ -//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() - }) - this.addEventListener('keyup', (e) => { - if (e.code === "Enter" || e.code === "Space") - 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() - } - - focusIn() { - this.shadowRoot.querySelector('input').focus() - } - - focusOut() { - this.shadowRoot.querySelector('input').blur() - } - - preventNonNumericalInput(e) { - let keyCode = e.keyCode; - if (!((keyCode > 47 && keyCode < 56) || (keyCode > 36 && keyCode < 39) || (keyCode > 95 && keyCode < 104) || keyCode === 110 || (keyCode > 7 && keyCode < 19))) { - e.preventDefault(); - } - } - - 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.input.value !== '') { - if (this.animate) - this.inputParent.classList.add('animate-label') - else - this.label.classList.add('hide') - if(!this.readonly) - this.clearBtn.classList.remove('hide') - } - else { - if (this.animate) - this.inputParent.classList.remove('animate-label') - else - this.label.classList.remove('hide') - if(!this.readonly) - this.clearBtn.classList.add('hide') - } - /*if (this.valueChanged) { - if (this.input.checkValidity()) { - this.helperText.classList.add('hide') - this.inputParent.style.boxShadow = `` - } - else { - this.helperText.classList.remove('hide') - this.inputParent.style.boxShadow = `0 0 0 0.1rem ${this.computedStyle.getPropertyValue('--error-color')}` - } - }*/ - } - - - connectedCallback() { - this.inputParent = this.shadowRoot.querySelector('.input') - this.clearBtn = this.shadowRoot.querySelector('.clear') - this.label = this.shadowRoot.querySelector('.label') - this.helperText = this.shadowRoot.querySelector('.helper-text') - this.valueChanged = false; - this.readonly = false - 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('readonly')) { - this.input.setAttribute('readonly', '') - this.readonly = true - } - if (this.hasAttribute('helper-text')) { - this.helperText.textContent = this.getAttribute('helper-text') - } - if (this.hasAttribute('type')) { - if (this.getAttribute('type') === 'number') { - this.input.setAttribute('inputmode', 'numeric') - } - else - this.input.setAttribute('type', this.getAttribute('type')) - } - else - this.input.setAttribute('type', 'text') - this.input.addEventListener('keydown', e => { - if (this.getAttribute('type') === 'number') - this.preventNonNumericalInput(e); - }) - this.input.addEventListener('input', e => { - this.checkInput() - }) - /*this.input.addEventListener('change', e => { - this.valueChanged = true; - if (this.input.checkValidity()) - this.helperText.classList.add('hide') - else - this.helperText.classList.remove('hide') - })*/ - this.clearBtn.addEventListener('click', e => { - this.value = '' - }) - } - - attributeChangedCallback(name, oldValue, newValue) { - if (oldValue !== newValue) { - if (name === 'placeholder') - this.shadowRoot.querySelector('.label').textContent = 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)) - } - static get observedAttributes() { - return ['placeholder'] - } - - get value() { - return this.shadowRoot.querySelector('textarea').value - } - - set value(val) { - this.shadowRoot.querySelector('textarea').value = val; - this.checkInput() - this.fireEvent() - } - - get placeholder() { - return this.getAttribute('placeholder') - } - - set placeholder(val) { - this.setAttribute('placeholder', val) - } - - 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.input.value !== '') { - if (this.animate) - this.inputParent.classList.add('animate-label') - else - this.label.classList.add('hide') - if(!this.readonly) - this.clearBtn.classList.remove('hide') - } - else { - if (this.animate) - this.inputParent.classList.remove('animate-label') - else - this.label.classList.remove('hide') - if(!this.readonly) - this.clearBtn.classList.add('hide') - } - - this.input.style.height = 'auto' - this.input.style.height = (this.input.scrollHeight) + 'px'; - } - - - connectedCallback() { - this.inputParent = this.shadowRoot.querySelector('.input') - this.clearBtn = this.shadowRoot.querySelector('.clear') - this.label = this.shadowRoot.querySelector('.label') - this.helperText = this.shadowRoot.querySelector('.helper-text') - this.valueChanged = false; - this.readonly = false - this.animate = this.hasAttribute('animate') - this.input = this.shadowRoot.querySelector('textarea') - this.shadowRoot.querySelector('.label').textContent = this.getAttribute('placeholder') - - this.input.setAttribute('style', 'height:' + (this.input.scrollHeight) + 'px;overflow-y:hidden;'); - - if (this.hasAttribute('value')) { - this.input.value = this.getAttribute('value') - this.checkInput() - } - if (this.hasAttribute('required')) { - this.input.setAttribute('required', '') - } - if (this.hasAttribute('readonly')) { - this.input.setAttribute('readonly', '') - this.readonly = true - } - if (this.hasAttribute('helper-text')) { - this.helperText.textContent = this.getAttribute('helper-text') - } - this.input.addEventListener('keydown', e => { - if (this.getAttribute('type') === 'number') - this.preventNonNumericalInput(e); - }) - this.input.addEventListener('input', e => { - this.checkInput() - }) - this.clearBtn.addEventListener('click', e => { - this.value = '' - }) - } - - attributeChangedCallback(name, oldValue, newValue) { - if (oldValue !== newValue) { - if (name === 'placeholder') - this.shadowRoot.querySelector('.label').textContent = newValue; - } - } - }) - -const smTabs = document.createElement('template') -smTabs.innerHTML = ` - -
-
- Nothing to see here -
-
-
- Nothing to see here -
-
-`; - -customElements.define('sm-tabs', class extends HTMLElement { - constructor() { - super() - this.attachShadow({ mode: 'open' }).append(smTabs.content.cloneNode(true)) - this.indicator = this.shadowRoot.querySelector('.indicator'); - this.tabSlot = this.shadowRoot.querySelector('slot[name="tab"]'); - this.panelSlot = this.shadowRoot.querySelector('slot[name="panel"]'); - this.tabHeader = this.shadowRoot.querySelector('.tab-header'); - } - 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.prevTab - this.allTabs - - this.shadowRoot.querySelector('slot[name="panel"]').addEventListener('slotchange', () => { - this.shadowRoot.querySelector('slot[name="panel"]').assignedElements().forEach((panel, index) => { - panel.classList.add('hide-completely') - }) - }) - this.shadowRoot.querySelector('slot[name="tab"]').addEventListener('slotchange', () => { - this.allTabs = this.shadowRoot.querySelector('slot[name="tab"]').assignedElements(); - this.shadowRoot.querySelector('slot[name="tab"]').assignedElements().forEach((panel, index) => { - panel.setAttribute('rank', index + 1) - }) - }) - this._targetBodyFlyRight = (targetBody) => { - targetBody.classList.remove('hide-completely') - targetBody.animate(flyInRight, animationOptions) - } - this._targetBodyFlyLeft = (targetBody) => { - targetBody.classList.remove('hide-completely') - targetBody.animate(flyInLeft, animationOptions) - } - 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.indicator.setAttribute('style', `width: ${e.target.getBoundingClientRect().width}px; transform: translateX(${e.target.getBoundingClientRect().left - e.target.parentNode.getBoundingClientRect().left + this.tabHeader.scrollLeft}px)`) - - if (this.prevTab) { - let targetBody = e.target.nextElementSibling, - currentBody = this.prevTab.nextElementSibling; - - if (this.prevTab.getAttribute('rank') < e.target.getAttribute('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 { - e.target.nextElementSibling.classList.remove('hide-completely') - } - this.prevTab = e.target; - }) - let resizeObserver = new ResizeObserver(entries => { - entries.forEach((entry) => { - if (this.prevTab) { - let tabDimensions = this.prevTab.getBoundingClientRect(); - this.indicator.setAttribute('style', `width: ${tabDimensions.width}px; transform: translateX(${tabDimensions.left - this.tabSlot.assignedElements()[0].parentNode.getBoundingClientRect().left + this.tabHeader.scrollLeft}px)`) - } - }) - }) - resizeObserver.observe(this) - let observer = new IntersectionObserver((entries) => { - entries.forEach((entry) => { - this.indicator.style.transition = 'none' - if (entry.isIntersecting) { - let activeElement = this.tabSlot.assignedElements().filter(element => { - if (element.classList.contains('active')) - return true - }) - if (activeElement.length) { - let tabDimensions = activeElement[0].getBoundingClientRect(); - this.indicator.setAttribute('style', `width: ${tabDimensions.width}px; transform: translateX(${tabDimensions.left - activeElement[0].parentNode.getBoundingClientRect().left + this.tabHeader.scrollLeft}px)`) - } - else { - this.tabSlot.assignedElements()[0].classList.add('active') - this.panelSlot.assignedElements()[0].classList.remove('hide-completely') - let tabDimensions = this.tabSlot.assignedElements()[0].getBoundingClientRect(); - this.indicator.setAttribute('style', `width: ${tabDimensions.width}px; transform: translateX(${tabDimensions.left - this.tabSlot.assignedElements()[0].parentNode.getBoundingClientRect().left + this.tabHeader.scrollLeft}px)`) - this.prevTab = this.tabSlot.assignedElements()[0]; - } - } - }) - }, - { threshold: 1.0 }) - observer.observe(this) - if (this.hasAttribute('enable-flick') && this.getAttribute('enable-flick') == 'true') { - let touchStartTime = 0, - touchEndTime = 0, - swipeTimeThreshold = 200, - swipeDistanceThreshold = 20, - startingPointX = 0, - endingPointX = 0, - currentIndex = 0; - this.addEventListener('touchstart', e => { - touchStartTime = e.timeStamp - startingPointX = e.changedTouches[0].clientX - }) - this.panelSlot.addEventListener('touchend', e => { - touchEndTime = e.timeStamp - endingPointX = e.changedTouches[0].clientX - if (touchEndTime - touchStartTime < swipeTimeThreshold) { - currentIndex = this.allTabs.findIndex(element => element.classList.contains('active')) - if (startingPointX > endingPointX && startingPointX - endingPointX > swipeDistanceThreshold && currentIndex < this.allTabs.length) { - this.allTabs[currentIndex + 1].click() - } - else if (startingPointX < endingPointX && endingPointX - startingPointX > swipeDistanceThreshold && currentIndex > 0) { - this.allTabs[currentIndex - 1].click() - } - } - }) - } - } -}) - -// 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.getAttribute('disabled') - } - - set disabled(val) { - this.setAttribute('disabled', val) - } - - get checked() { - return this.getAttribute('checked') - } - - set checked(value) { - this.setAttribute('checked', value) - } - - dispatch() { - this.dispatchEvent(new CustomEvent('change', { - bubbles: true, - composed: true - })) - } - - connectedCallback() { - this.addEventListener('keyup', e => { - if ((e.code === "Enter" || e.code === "Space") && this.isDisabled == false) { - this.isChecked = !this.isChecked - this.setAttribute('checked', this.isChecked) - } - }) - } - attributeChangedCallback(name, oldValue, newValue) { - if (oldValue !== newValue) { - if (name === 'disabled') { - if (newValue === 'true') { - this.checkbox.classList.add('disabled') - this.isDisabled = true - } - else { - this.checkbox.classList.remove('disabled') - this.isDisabled = false - } - } - if (name === 'checked') { - if (newValue == 'true') { - this.isChecked = true - this.input.checked = true - this.dispatch() - } - else { - this.isChecked = false - this.input.checked = false - this.dispatch() - } - } - } - } - -}) - -//audio - -const smAudio = document.createElement('template') -smAudio.innerHTML = ` - -
- - play - - - - pause - - - -
/
- -
- -`; - -customElements.define('sm-audio', class extends HTMLElement { - constructor() { - super(); - this.attachShadow({ mode: 'open' }).append(smAudio.content.cloneNode(true)) - - this.playing = false; - } - static get observedAttributes() { - return ['src'] - } - play() { - this.audio.play() - this.playing = false; - this.pauseBtn.classList.remove('hide') - this.playBtn.classList.add('hide') - } - pause() { - this.audio.pause() - this.playing = true; - this.pauseBtn.classList.add('hide') - this.playBtn.classList.remove('hide') - } - - get isPlaying() { - return this.playing; - } - - connectedCallback() { - this.playBtn = this.shadowRoot.querySelector('.play'); - this.pauseBtn = this.shadowRoot.querySelector('.pause'); - this.audio = this.shadowRoot.querySelector('audio') - this.playBtn.addEventListener('click', e => { - this.play() - }) - this.pauseBtn.addEventListener('click', e => { - this.pause() - }) - this.audio.addEventListener('ended', e => { - this.pause() - }) - let width; - if ('ResizeObserver' in window) { - let resizeObserver = new ResizeObserver(entries => { - entries.forEach(entry => { - width = entry.contentRect.width; - }) - }) - resizeObserver.observe(this) - } - else { - let observer = new IntersectionObserver((entries, observer) => { - if (entries[0].isIntersecting) - width = this.shadowRoot.querySelector('.audio').offsetWidth; - }, { - threshold: 1 - }) - observer.observe(this) - } - this.audio.addEventListener('timeupdate', e => { - let time = this.audio.currentTime, - minutes = Math.floor(time / 60), - seconds = Math.floor(time - minutes * 60), - y = seconds < 10 ? "0" + seconds : seconds; - this.shadowRoot.querySelector('.current-time').textContent = `${minutes}:${y}` - this.shadowRoot.querySelector('.track').style.width = (width / this.audio.duration) * this.audio.currentTime + 'px' - }) - } - - attributeChangedCallback(name, oldValue, newValue) { - if (oldValue !== newValue) { - if (name === 'src') { - if (this.hasAttribute('src') && newValue.trim() !== '') { - this.shadowRoot.querySelector('audio').src = newValue; - this.shadowRoot.querySelector('audio').onloadedmetadata = () => { - let duration = this.audio.duration, - minutes = Math.floor(duration / 60), - seconds = Math.floor(duration - minutes * 60), - y = seconds < 10 ? "0" + seconds : seconds; - this.shadowRoot.querySelector('.duration').textContent = `${minutes}:${y}`; - } - } - else - this.classList.add('disabled') - } - } - } -}) - -//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 - } - - get disabled() { - return this.getAttribute('disabled') - } - - set disabled(val) { - if (val) { - this.disabled = true - this.setAttribute('disabled', '') - this.switch.classList.add('disabled') - } - else { - this.disabled = false - this.removeAttribute('disabled') - this.switch.classList.remove('disabled') - - } - } - - get checked() { - return this.isChecked - } - - set checked(value) { - if (value) { - this.setAttribute('checked', '') - this.isChecked = true - this.input.checked = true - } - else { - this.removeAttribute('checked') - this.isChecked = false - this.input.checked = false - } - } - - dispatch = () => { - this.dispatchEvent(new CustomEvent('change', { - bubbles: true, - composed: true - })) - } - - connectedCallback() { - if(this.hasAttribute('disabled')) - this.switch.classList.add('disabled') - 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() - }) - } -}) - -// 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.optionList.animate(this.slideUp, this.animationOptions) - this.optionList.classList.add('hide') - this.chevron.classList.remove('rotate') - 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)` }, - { transform: `translateY(0)` } - ], - this.slideUp = [ - { transform: `translateY(0)` }, - { transform: `translateY(-0.5rem)` } - ], - 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 - })) - 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); - } - } -}) - -// select -const smStripSelect = document.createElement('template') -smStripSelect.innerHTML = ` - -
-
- - Previous - - -
- -
- - Next - - -
-
`; -customElements.define('sm-strip-select', class extends HTMLElement { - constructor() { - super() - this.attachShadow({ mode: 'open' }).append(smStripSelect.content.cloneNode(true)) - } - static get observedAttributes() { - return ['value'] - } - get value() { - return this.getAttribute('value') - } - set value(val) { - this.setAttribute('value', val) - } - scrollLeft() { - this.select.scrollBy({ - top: 0, - left: -this.scrollDistance, - behavior: 'smooth' - }) - } - - scrollRight() { - this.select.scrollBy({ - top: 0, - left: this.scrollDistance, - behavior: 'smooth' - }) - } - connectedCallback() { - let previousOption, - slot = this.shadowRoot.querySelector('slot'); - this.selectContainer = this.shadowRoot.querySelector('.select-container') - this.select = this.shadowRoot.querySelector('.select') - this.nextArrow = this.shadowRoot.querySelector('.next-item') - this.previousArrow = this.shadowRoot.querySelector('.previous-item') - this.nextGradient = this.shadowRoot.querySelector('.right') - this.previousGradient = this.shadowRoot.querySelector('.left') - this.selectOptions - this.scrollDistance = this.selectContainer.getBoundingClientRect().width - const firstElementObserver = new IntersectionObserver(entries => { - if (entries[0].isIntersecting) { - this.previousArrow.classList.add('hide') - this.previousGradient.classList.add('hide') - } - else { - this.previousArrow.classList.remove('hide') - this.previousGradient.classList.remove('hide') - } - }, { - root: this.selectContainer, - threshold: 0.95 - }) - const lastElementObserver = new IntersectionObserver(entries => { - if (entries[0].isIntersecting) { - this.nextArrow.classList.add('hide') - this.nextGradient.classList.add('hide') - } - else { - this.nextArrow.classList.remove('hide') - this.nextGradient.classList.remove('hide') - } - }, { - root: this.selectContainer, - threshold: 0.95 - }) - - const selectObserver = new IntersectionObserver(entries => { - if (entries[0].isIntersecting) { - this.scrollDistance = this.selectContainer.getBoundingClientRect().width - } - }) - - selectObserver.observe(this.selectContainer) - this.addEventListener('optionSelected', e => { - if (previousOption === e.target) return; - if (previousOption) - previousOption.classList.remove('active') - e.target.classList.add('active') - e.target.scrollIntoView({ behavior: 'smooth', inline: 'center', block: 'nearest' }) - this.setAttribute('value', e.detail.value) - this.dispatchEvent(new CustomEvent('change', { - bubbles: true, - composed: true - })) - previousOption = e.target; - }) - slot.addEventListener('slotchange', e => { - this.selectOptions = slot.assignedElements() - firstElementObserver.observe(this.selectOptions[0]) - lastElementObserver.observe(this.selectOptions[this.selectOptions.length - 1]) - if (this.selectOptions[0]) { - let firstElement = this.selectOptions[0]; - this.setAttribute('value', firstElement.getAttribute('value')) - firstElement.classList.add('active') - previousOption = firstElement; - } - }); - this.nextArrow.addEventListener('click', this.scrollRight.bind(this)) - this.previousArrow.addEventListener('click', this.scrollLeft.bind(this)) - } - - disconnectedCallback() { - this.nextArrow.removeEventListener('click', this.scrollRight.bind(this)) - this.previousArrow.removeEventListener('click', this.scrollLeft.bind(this)) - } -}) - -// option -const smStripOption = document.createElement('template') -smStripOption.innerHTML = ` - -
- -
`; -customElements.define('sm-strip-option', class extends HTMLElement { - constructor() { - super() - this.attachShadow({ mode: 'open' }).append(smStripOption.content.cloneNode(true)) - } - sendDetails() { - let optionSelected = new CustomEvent('optionSelected', { - bubbles: true, - composed: true, - detail: { - text: this.textContent, - value: this.getAttribute('value') - } - }) - this.dispatchEvent(optionSelected) - } - - connectedCallback() { - this.addEventListener('click', e => { - this.sendDetails() - }) - this.addEventListener('keyup', e => { - if (e.code === 'Enter' || e.code === 'Space') { - e.preventDefault() - this.sendDetails(false) - } - }) - if (this.hasAttribute('default')) { - setTimeout(() => { - this.sendDetails() - }, 0); - } - } -}) - -//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)) - } - - resumeScrolling() { - const scrollY = document.body.style.top; - window.scrollTo(0, parseInt(scrollY || '0') * -1); - setTimeout(() => { - document.body.setAttribute('style', `overflow: auto; top: initial`) - }, 300); - } - - show(pinned, popupStack) { - this.setAttribute('open', '') - this.pinned = pinned - this.popupStack = popupStack - this.popupContainer.classList.remove('hide') - if (window.innerWidth < 648) - this.popup.style.transform = 'translateY(0)'; - else - this.popup.style.transform = 'scale(1)'; - document.body.setAttribute('style', `overflow: hidden; top: -${window.scrollY}px`) - } - hide() { - this.removeAttribute('open') - if (window.innerWidth < 648) - this.popup.style.transform = 'translateY(100%)'; - else - this.popup.style.transform = 'scale(0.9)'; - this.popupContainer.classList.add('hide') - if (typeof this.popupStack !== 'undefined') { - this.popupStack.pop() - if (this.popupStack.items.length === 0) { - 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.value = '' - }) - }, 300); - } - } - - handleTouchStart(e) { - this.touchStartY = e.changedTouches[0].clientY - this.popup.style.transition = 'initial' - this.touchStartTime = e.timeStamp - } - - handleTouchMove(e) { - e.preventDefault() - 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' - if (this.touchEndTime - this.touchStartTime > 200) { - if (this.touchEndY - this.touchStartY > this.threshold) { - this.hide() - } - else { - this.show() - } - } - else { - if (this.touchEndY > this.touchStartY) - 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.threshold = this.popup.getBoundingClientRect().height * 0.3 - this.touchEndAnimataion; - - if (this.hasAttribute('open')) - this.show() - this.popupContainer.addEventListener('mousedown', e => { - if (e.target === this.popupContainer && !this.pinned) { - this.hide() - } - }) - - this.popupBodySlot.addEventListener('slotchange', () => { - this.inputFields = this.popupBodySlot.assignedElements().filter(element => element.tagName === 'SM-INPUT' || element.tagName === 'SM-CHECKBOX' || element.tagName === 'TEXTAREA' || element.type === 'radio') - }) - - this.popupHeader.addEventListener('touchstart', (e) => { - this.handleTouchStart(e) - }) - this.popupHeader.addEventListener('touchmove', (e) => { - this.handleTouchMove(e) - }) - this.popupHeader.addEventListener('touchend', (e) => { - this.handleTouchEnd(e) - }) - } - disconnectedCallback() { - this.popupHeader.removeEventListener('touchstart', this.handleTouchStart.bind(this)) - this.popupHeader.removeEventListener('touchmove', this.handleTouchMove.bind(this)) - this.popupHeader.removeEventListener('touchend', this.handleTouchEnd.bind(this)) - } -}) - -//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)) - } - - scrollLeft() { - this.carousel.scrollBy({ - top: 0, - left: -this.scrollDistance, - behavior: 'smooth' - }) - } - - scrollRight() { - this.carousel.scrollBy({ - top: 0, - left: this.scrollDistance, - behavior: 'smooth' - }) - } - - connectedCallback() { - this.carousel = this.shadowRoot.querySelector('.carousel') - this.carouselContainer = this.shadowRoot.querySelector('.carousel-container') - this.carouselSlot = this.shadowRoot.querySelector('slot') - this.nextArrow = this.shadowRoot.querySelector('.next-item') - this.previousArrow = this.shadowRoot.querySelector('.previous-item') - this.nextGradient = this.shadowRoot.querySelector('.right') - this.previousGradient = this.shadowRoot.querySelector('.left') - this.carouselItems - this.scrollDistance = this.carouselContainer.getBoundingClientRect().width / 3 - const firstElementObserver = new IntersectionObserver(entries => { - if (entries[0].isIntersecting) { - this.previousArrow.classList.remove('expand') - this.previousGradient.classList.add('hide') - } - else { - this.previousArrow.classList.add('expand') - this.previousGradient.classList.remove('hide') - } - }, { - root: this.carouselContainer, - threshold: 0.9 - }) - const lastElementObserver = new IntersectionObserver(entries => { - if (entries[0].isIntersecting) { - this.nextArrow.classList.remove('expand') - this.nextGradient.classList.add('hide') - } - else { - this.nextArrow.classList.add('expand') - this.nextGradient.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() - firstElementObserver.observe(this.carouselItems[0]) - lastElementObserver.observe(this.carouselItems[this.carouselItems.length - 1]) - }) - - this.addEventListener('keyup', e => { - if (e.code === 'ArrowLeft') - this.scrollRight() - else - this.scrollRight() - }) - - this.nextArrow.addEventListener('click', this.scrollRight.bind(this)) - this.previousArrow.addEventListener('click', this.scrollLeft.bind(this)) - } - - disconnectedCallback() { - this.nextArrow.removeEventListener('click', this.scrollRight.bind(this)) - this.previousArrow.removeEventListener('click', this.scrollLeft.bind(this)) - } -}) - -//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.bind(this)) - notification.addEventListener('touchmove', this.handleTouchMove.bind(this)) - notification.addEventListener('touchend', this.handleTouchEnd.bind(this)) - } - - 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() - } - } - } - - 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]) - }, 4000); - 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) { - /*if (this.containerDimensions.left > this.containerDimensions.width) { - this.optionList.setAttribute('style', 'right: 0') - } - else { - this.optionList.setAttribute('style', 'left: 0') - }*/ - this.optionList.classList.remove('hide') - this.optionList.classList.add('no-transformations') - this.open = true - this.icon.classList.add('focused') - } - } - collapse() { - if (this.open) { - this.open = false - this.icon.classList.remove('focused') - this.optionList.classList.add('hide') - this.optionList.classList.remove('no-transformations') - } - } - 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() - this.menuDimensions = menu.getBoundingClientRect() - /*if (this.containerDimensions.left > this.containerDimensions.width) { - this.optionList.style.right = 0 - } - else { - this.optionList.style.right = 'auto' - }*/ - }); - window.addEventListener('mousedown', e => { - if (!this.contains(e.target) && e.button !== 2) { - this.collapse() - } - }) - if (this.hasAttribute('set-context') && this.getAttribute('set-context') === 'true') { - this.parentNode.setAttribute('oncontextmenu', 'return false') - this.parentNode.addEventListener('mouseup', e => { - if (e.button === 2) { - this.expand() - } - }) - } - /* const intersectionObserver = new IntersectionObserver(entries => { - entries.forEach(entry => { - if (this.open && !entry.isIntersecting) { - if (window.innerHeight - entry.intersectionRect.top < this.containerDimensions.height) - this.optionList.classList.add('moveUp') - else - this.optionList.classList.remove('moveUp') - console.log(entry.intersectionRect.left > this.containerDimensions.width) - if (entry.intersectionRect.left > this.containerDimensions.width) { - this.optionList.setAttribute('style', 'right: 0') - } - else { - this.optionList.setAttribute('style', 'left: 0') - } - } - }) - }, { - threshold: 1 - }) - intersectionObserver.observe(this.optionList)*/ - } -}) - -// 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() - } - }) - this.setAttribute('tabindex', '0') - } -}) - -// 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]; - }) - } -}) - - -const slidingSection = document.createElement('template') -slidingSection.innerHTML = ` - -
- -
-` - -customElements.define('sm-sliding-section', class extends HTMLElement { - constructor() { - super() - this.attachShadow({ mode: 'open' }).append(slidingSection.content.cloneNode(true)) - } - connectedCallback() { - - } -}) - -const section = document.createElement('template') -section.innerHTML = ` - -
- -
-` - -customElements.define('sm-section', class extends HTMLElement { - constructor() { - super() - this.attachShadow({ mode: 'open' }).append(section.content.cloneNode(true)) - } -}) \ No newline at end of file diff --git a/assets/message-background.svg b/assets/message-background.svg index 929cb2c..fa4c32f 100644 --- a/assets/message-background.svg +++ b/assets/message-background.svg @@ -1 +1 @@ -Hi \ No newline at end of file +Hi \ No newline at end of file diff --git a/css/bg.svg b/css/bg.svg deleted file mode 100644 index 4992268..0000000 --- a/css/bg.svg +++ /dev/null @@ -1 +0,0 @@ -bg \ No newline at end of file diff --git a/css/emojipanel.css b/css/emojipanel.css deleted file mode 100644 index 2fdbe24..0000000 --- a/css/emojipanel.css +++ /dev/null @@ -1 +0,0 @@ -.EmojiPanel__header,.EmojiPanel__footer{padding:10px;background:#FCFCFC}.EmojiPanel__header{border-bottom:1px solid #F9F9F9;border-radius:3px 3px 0 0}.EmojiPanel__header input{width:100%;padding:5px 14px;border:1px solid #EEE;border-radius:30px;outline:none;font-size:14px;font-weight:inherit}.EmojiPanel__header input:focus{border-color:#d5d5d5}.EmojiPanel__categories{display:flex;flex-wrap:wrap;margin:0 0 10px}.EmojiPanel__categories button{flex:1;min-width:30px;max-width:30px}@media (min-width: 290px){.EmojiPanel__categories button{min-width:30px;max-width:inherit}}.EmojiPanel__footer{display:flex;align-items:center;justify-content:space-between;border-top:1px solid #F9F9F9;border-radius:0 0 3px 3px}.EmojiPanel__brand{margin:0;font-size:14px;text-decoration:none;color:#9d9d9d;transition:color 0.2s}.EmojiPanel__brand:hover,.EmojiPanel__brand:focus{color:#777}.EmojiPanel__btnModifierToggle{font-size:24px}.EmojiPanel__btnModifierToggle.active{display:none}.EmojiPanel__modifierDropdown{display:none;height:30px}.EmojiPanel__modifierDropdown.active{display:block}.EmojiPanel__results{overflow-y:auto;height:300px;padding:0 10px 10px}.EmojiPanel__results .emoji{background:#FFF}.EmojiPanel__noResults{display:none;width:100%;padding:100px 0;text-align:center;color:#777}.EmojiPanel__category{margin:15px 0 5px;padding:0 0 5px;border-bottom:1px solid #EEE;color:#777}.EmojiPanel__tooltip{display:none}.EmojiPanel{width:100%;border-radius:3px;background:#fff;text-align:left}@media (min-width: 290px){.EmojiPanel{width:290px}}.EmojiPanel--trigger{visibility:hidden;pointer-events:none}.EmojiPanel--open{visibility:visible;pointer-events:inherit}.EmojiPanel button{padding:0;border:none;outline:none;background:none;cursor:pointer}.EmojiPanel .emoji{width:30px;height:30px;border:5px solid transparent;border-radius:3px;font-size:20px;line-height:1.1;cursor:pointer;transition:all 0.2s}.EmojiPanel .emoji:hover,.EmojiPanel .emoji:focus{background:#F1F1F1;border-color:#F1F1F1}.EmojiPanel .temp{flex:initial;width:20px;min-width:initial;height:20px;margin:5px;border-radius:3px;background:#EEE} diff --git a/css/main.css b/css/main.css index 43d19ed..14a97ba 100644 --- a/css/main.css +++ b/css/main.css @@ -9,7 +9,7 @@ :root { scroll-behavior: smooth; - font-size: clamp(16px, 1.2vmax, 36px); + font-size: clamp(16px, 1vmax, 18px); } html, body { @@ -338,9 +338,8 @@ sm-button[variant=primary] .icon { display: flex; } #sign_in .title-font { - font-kerning: normal; - line-height: 1.2; text-transform: capitalize; + line-height: 1.2; font-weight: 700; font-size: 2.5rem; } @@ -833,6 +832,7 @@ sm-button[variant=primary] .icon { #chat footer sm-textarea::part(textarea) { background: rgba(var(--text-color), 0.1); padding-right: 3rem; + border-radius: 2rem; } #chat #send_message_button { position: absolute; @@ -1098,7 +1098,7 @@ sm-tab-header { .logo-section { padding: 2rem 3rem; - margin: 0; + margin: 0.5rem 0 1rem 0; } #sign_in { diff --git a/css/main.min.css b/css/main.min.css index 72e0f4e..0e1ddd3 100644 --- a/css/main.min.css +++ b/css/main.min.css @@ -1 +1 @@ -#sign_in_page,body{background:rgba(var(--foreground-color),1)}.contact .address,.mail-card .sender,.text-overflow{text-overflow:ellipsis;white-space:nowrap}*,::after,::before{padding:0;margin:0;box-sizing:border-box;font-family:Roboto,sans-serif}#confirmation_popup .flex,#mail .flex,#prompt .flex,sm-popup sm-input+sm-input{margin-top:1rem}.contact .address,.contact .name,h1,h2,h3,h4,h5{font-family:Poppins,sans-serif}:root{scroll-behavior:smooth;font-size:clamp(16px,1.2vmax,36px)}body,html{height:100%}body{--accent-color:#3042e7;--secondary-color:#ffac2e;--text-color:17,17,17;--text-color-light:100,100,100;--foreground-color:255,255,255;--background-color:#efefef;--error-color:red;color:rgba(var(--text-color),1)}body[data-theme=dark]{--accent-color:#5365ff;--secondary-color:#FDB956;--text-color:218,218,218;--text-color-light:170,170,170;--foreground-color:20,20,20}body[data-theme=dark] #contacts,body[data-theme=dark] #mails{background:rgba(var(--foreground-color),.5)}body[data-theme=dark] .initial{background:rgba(var(--text-color),.1)!important;color:rgba(var(--text-color),1)!important;box-shadow:0 .1rem .1rem #00016,0 .1rem .3rem #00040}body[data-theme=dark] .message,h1,h2,h3,h4,h5,textarea{color:rgba(var(--text-color),1)}p{line-height:1.6}h1{font-size:3rem}h2{font-size:2rem}h3{font-size:1.5rem}h4{font-size:1.1rem}h5{font-size:.8rem}h1,h2,h3,h4,h5{font-weight:600}textarea{background:rgba(var(--text-color),.06);border:none;border-radius:.3rem;width:100%;padding:1rem;font-size:1rem;resize:none}textarea:focus{outline:0;box-shadow:0 0 0 .1rem var(--accent-color)}.flex{display:flex}.grid{display:grid}.grid-2{grid-template-columns:auto auto;gap:1em}.align-center{align-items:center}.justify-right{margin-left:auto}.direction-column{flex-direction:column}.rest{flex:1}.hide{opacity:0;pointer-events:none}.hide-completely{display:none!important}.no-transformations{transform:none!important}.breakable{overflow-wrap:break-word}.text-overflow{overflow:hidden}.sticky{position:sticky;top:1rem}.light-text{color:rgba(var(--text-color-light),1)}.accent-color{color:var(--accent-color)}.secondary-color{color:var(--secondary-color)}.fab{box-shadow:0 1rem 1rem #00020;margin-right:1rem;position:fixed;bottom:3.5rem;right:0;z-index:2}.fab .icon{margin-left:0!important;margin-right:.5rem;height:.9rem!important;stroke-width:8!important}a:any-link{text-decoration:none;color:var(--accent-color);text-transform:capitalize;font-weight:500}.solid-background{background:var(--background-color)!important}.normal-weight{font-weight:400}.icon{fill:none;stroke-width:6;stroke:rgba(var(--text-color),1);height:1.2rem;width:1.2rem;overflow:visible;stroke-linecap:round;stroke-linejoin:round}span.ripple{position:absolute;border-radius:50%;transform:scale(0);background:rgba(var(--text-color),.2);pointer-events:none}.interact{overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:transparent}.popup-header{padding:.5rem 1.5rem 0;display:flex;align-items:center;width:100%}.popup-header .icon{padding:.7rem;height:2.4rem;width:2.4rem;stroke-width:8;transform:translateX(-.5rem);cursor:pointer;-webkit-tap-highlight-color:transparent}.popup-header .back{transform:none}.popup-header button,.popup-header sm-button{width:auto;margin-left:auto}#confirmation_popup,#prompt{flex-direction:column}#confirmation_popup h4,#prompt h4{font-weight:500;margin-bottom:1.5rem}#confirmation_popup .flex sm-button:first-of-type,#prompt .flex sm-button:first-of-type{margin-right:.6rem;margin-left:auto}.page{align-items:flex-start;width:100%;height:100%}.card{display:flex;flex-direction:column;margin:1rem 0}sm-button{--font-family:"Poppins",sans-serif;margin:1rem 0}sm-button .icon{margin-right:.4rem}sm-button[variant=primary] .icon{align-self:center;height:1rem;width:1rem;margin-left:.8rem;stroke-width:6;stroke:rgba(var(--foreground-color),1)}.back-button{height:2.4rem;width:2.4rem;padding:.7rem;transform:translateX(-.6rem)}.logo-section{position:relative;align-items:center;height:max-content;margin:.5rem 0}#sign_in .left h3,#sign_in_popup p{margin-bottom:1rem}.logo-section h4{font-weight:500;line-height:1;font-size:1rem}.logo-section h5{color:rgba(var(--text-color),.7)}.logo-section .main-logo{height:1.4rem;margin-right:.4rem;fill:rgba(var(--text-color),1);stroke:none}.select-file input[type=file]{display:none}#sign_in{display:grid;border-radius:.6rem;width:100%;padding:0 1.5rem;height:100%;align-items:flex-end}#sign_in .logo-section{padding:1.5rem;display:flex}#sign_in .title-font{font-kerning:normal;line-height:1.2;text-transform:capitalize;font-weight:700;font-size:2.5rem}#sign_in .left{display:grid;flex-direction:column;padding-bottom:1.5rem;z-index:1}#sign_in .left h4{color:rgba(var(--foreground-color),1)}#sign_in .left sm-button{margin-top:3rem;width:auto}#sign_in .left sm-button:last-of-type{margin-left:auto}#sign_in .left sm-button:first-of-type:hover .icon{transform:translateX(.4rem)}#sign_in .left h3,#sign_in .left p{font-weight:500}#sign_in_page{height:100vh;width:100vw;overflow:hidden}.logo-section{padding:1.5rem}#sign_in_illustration,#sign_in_popup{position:relative;width:100%}#lock{height:12rem;position:absolute;top:-5rem;left:0}#sign_in_popup sm-button,#sign_in_popup sm-input{display:flex;min-width:100%}#sign_in_popup h4{margin-top:6rem;line-height:.6;font-weight:500}#sign_in_popup h2{margin-bottom:2rem}#loading_page{height:100vh;display:grid;place-content:center;justify-items:center}#loading_page svg{z-index:1;transform-origin:bottom;height:6rem;width:6rem;animation:bounce .5s infinite alternate ease-in}#loading_page .shadow{margin-top:-1rem;width:5rem;height:2rem;background:rgba(var(--text-color),.1);border-radius:50%;animation:scale .5s infinite alternate ease-in;margin-left:1rem}#loading_page h4{margin-top:2rem}@keyframes bounce{0%{transform:scaleY(1) translateY(-4rem)}90%{transform:scaleY(1) translateY(0)}100%{transform:scaleY(.8)}}@keyframes scale{0%{transform:scale(.5)}90%{transform:scale(1.05)}100%{transform:scale(1)}}.initial{justify-content:center;font-size:1.2rem;width:2.4rem;height:2.4rem;background:rgba(var(--foreground-color),1);box-shadow:0 .1rem .1rem #0001a,0 .1rem .3rem #00016;border-radius:2rem;text-transform:uppercase}.contact{position:relative;display:grid;gap:0 1rem;grid-template-columns:auto 1fr auto;grid-template-areas:"dp . menu" "dp . menu";padding:.8rem 1rem;align-items:center}.contact:focus{background:rgba(var(--text-color),.06);outline:0}.contact .initial{grid-area:dp}.contact .name{font-size:1rem;font-weight:500;text-transform:capitalize}.contact .address{overflow:hidden;font-weight:400;color:rgba(var(--text-color),.8)}.contact sm-menu{grid-area:menu}#warn_no_encryption,.date-card{padding:.4rem .8rem;background:rgba(var(--text-color),.1);font-weight:500;border-radius:.5rem;color:rgba(var(--text-color),.8);margin:1rem 0;justify-self:center;align-self:flex-start}#chat_container,#compose_mail_popup sm-input,#no_mails .new-conversation,.mail header{margin-bottom:1rem}.date-card{align-self:center}.contact.unread::before,.mail-card.unread::before{content:"";position:absolute;width:.2rem;height:100%;top:0;left:0;background:#00C853}.mail,.mail-card{position:relative}.contact.unread,.mail-card.unread{overflow:hidden;font-weight:600}.contact.unread h4,.mail-card.unread h4{font-weight:700}.mail-card{display:flex;flex-direction:column;padding:1rem 1.5rem}.mail-card .sender{color:rgba(var(--text-color),.7);overflow:hidden;margin-right:1rem}.mail-card .date{margin-left:auto;white-space:nowrap}.mail-card .subject{font-size:1em;margin-top:.3rem;font-weight:500}.mail-card .description{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:.9em;color:rgba(var(--text-color),.8)}#chat .message .message-body,.mail .mail-content,.mail .mail-subject{overflow-wrap:break-word;word-wrap:break-word}@keyframes slide{from{opacity:0;transform:translateX(-1rem)}to{opacity:1;transform:none}}#mail_container{width:100%}.mail:not(:first-of-type){margin-top:2rem;padding-inline-start:1rem}.mail:not(:first-of-type)::before{content:"";position:absolute;left:0;top:0;width:.2rem;height:100%;background:rgba(var(--text-color),.2)}.mail header{align-self:start;padding-bottom:.5rem;border-bottom:solid 1px rgba(var(--text-color),.2)}.mail header h4{font-weight:500}.mail header .flo-id{font-weight:400;max-width:90%}.mail .mail-subject{margin-bottom:.4em}.mail .mail-content{height:max-content;max-width:60ch;white-space:pre-wrap}.logo-section{display:grid;grid-template-columns:auto 1fr;grid-template-areas:"logo ." "logo ."}.logo-section svg{grid-area:logo}#main_navbar{position:fixed;bottom:0;padding:0;flex-wrap:wrap;width:100%;background:rgba(var(--foreground-color),.9);box-shadow:0 -.2rem 1rem #00016;height:3.5rem;align-items:center;z-index:4}#main_navbar .logo-section{padding:0}#main_navbar .navbar-item{position:relative;height:100%;flex:1;justify-content:center;flex-direction:column;opacity:.8}#main_navbar .navbar-item .icon{height:1.2rem;width:1.2rem}#main_navbar .navbar-item.badge::after{right:0;top:0;position:absolute;content:attr(data-notifications);display:flex;justify-content:center;align-items:center;padding:.4rem;line-height:0;height:calc(1em + .4rem);background:#00C853;color:rgba(var(--foreground-color),1);border-radius:2rem;transition:transform .3s}#auto_complete_contact,#chat .message,#contacts,#contacts header,#mails{position:relative}#main_navbar .navbar-item.badge.active::after,#main_navbar .navbar-item.badge[data-notifications=""]::after,#main_navbar .navbar-item.badge[data-notifications="0"]::after{transform:scale(0)}#main_navbar .active{opacity:1}#main_navbar .active h5{color:var(--accent-color)}#main_navbar .active .icon{stroke:var(--accent-color)}#auto_complete_contact{justify-content:flex-start;padding-bottom:0}#mail_contact_list{max-height:40vh;overflow-y:auto;position:absolute;top:100%;background:rgba(var(--foreground-color),1);z-index:1;border-radius:.4rem;box-shadow:0 .1rem .1rem #00010,0 .2rem .5rem #00020;width:100%}#mail_contact_list .contact{grid-template-columns:auto 1fr;grid-template-areas:"dp ." "dp ."}#mail_contact_list sm-menu{display:none}#contacts header{gap:.5rem}#contacts header sm-input{margin:0;width:100%}#contacts header sm-input .icon{stroke:rgba(var(--text-color),.5);height:.9rem;width:.9rem}#contacts header sm-input::part(input){padding:.4rem 1rem}#contacts #all_contacts{position:absolute;top:0;bottom:0;left:0;right:0;height:100%;width:100%;z-index:1;background-color:rgba(var(--foreground-color),1);transition:transform .3s;transform:translateX(-100%)}#contacts #all_contacts .back{padding:.7rem;height:2.4rem;width:2.4rem;margin-left:-.6rem;cursor:pointer}#contacts,#mails{grid-template-rows:max-content 1fr;height:calc(100vh - 3.5rem);backdrop-filter:blur(.4rem)}#contacts header,#mails header{padding:1rem 1.5rem}#contacts header h4,#mails header h4{text-transform:uppercase;font-size:.8rem;letter-spacing:.06em}#contacts header .grid,#mails header .grid{grid-template-columns:1fr auto auto auto;gap:.5rem}#contacts header .grid .icon,#mails header .grid .icon{height:2.2rem;width:2.2rem;padding:.4rem;cursor:pointer}#contacts header sm-button,#mails header sm-button{margin:0 0 0 auto}#contacts header sm-button .icon,#mails header sm-button .icon{height:.9rem;width:.9rem;align-self:center;stroke-width:8;margin-left:0;margin-right:.5rem}#chat_page{overflow-y:hidden}#chat{height:100vh;grid-template-rows:max-content 1fr max-content}#chat header{padding:.5rem 1rem;box-shadow:0 .2rem .4rem #00016}#chat header .back-button{margin-right:.2rem}#chat header .initial{margin-right:1rem}#chat header h4{font-weight:500;opacity:.8}#chat header h5{opacity:.7;font-weight:400}#chat header sm-menu{margin-left:1rem}#chat footer .flex{align-items:flex-end;padding:.5rem 1rem}#chat footer sm-textarea::part(textarea){background:rgba(var(--text-color),.1);padding-right:3rem}#chat #send_message_button{position:absolute;right:1.5rem;transform:scale(0);z-index:1;align-self:center;height:2.4rem;width:2.4rem;padding:.5rem;cursor:pointer;stroke:none;fill:rgba(var(--text-color),.4);margin-left:1rem;transition:.3s}#chat #send_message_button.active{fill:var(--accent-color);transform:none}#chat #type_message{margin:0}#chat .message{display:grid;grid-auto-flow:column;align-items:center;gap:.5rem;width:100%;font-size:.9rem;max-width:max-content;margin-bottom:.2rem;margin-top:.8rem}#chat .message .message-body{white-space:pre-wrap;box-shadow:0 1px .1rem #00020;padding:.6em 1em}#chat .message .time{font-size:.8em;opacity:.8;margin-top:.3rem}#chat .sent{margin-left:auto}#chat .sent::after{content:"";position:absolute;left:100%;top:0;width:0;height:0;border-style:solid;border-width:.5em .3em 0 0;border-color:var(--accent-color) transparent transparent}#chat .sent .message-body{background:var(--accent-color);color:#f0f0f0;border-radius:.4em 0 .4em .4em}#chat .sent .time{grid-column:1}#chat .received::after{content:"";position:absolute;left:-.5em;top:0;width:0;height:0;border-style:solid;border-width:0 .5em .5em 0;border-color:transparent rgba(var(--text-color),.1) transparent transparent}#chat .received .message-body{background:rgba(var(--text-color),.1);border-radius:0 .4em .4em}#chat .received+.received,#chat .sent+.sent{margin-top:0}#chat .received+.received::after,#chat .sent+.sent::after{display:none}#chat .received+.received .message-body,#chat .sent+.sent .message-body{border-radius:.4em}#chat .unconfirmed{opacity:.7}#chat_container{padding:0 1rem}#new_conversation,#no_mails{height:100%;justify-content:center;text-align:center;padding:1.5rem}#new_conversation p,#no_mails p{margin-top:.8rem}#no_mails .new-conversation{height:7rem}.new-conversation{height:8rem;width:8rem;align-self:center;stroke-width:16;stroke:rgba(var(--text-color),.4)}#chat_container,#contacts_container,#inbox_mail_container,#mail,#sent_mail_container{width:100%;flex-direction:column;height:100%;overflow-y:auto}#contacts_container:empty{display:none}#contacts_container:not(:empty)~.empty-state{display:none}sm-tab-panels{overflow:hidden auto}sm-tab-header{--accent-color:rgba(var(--text-color), 0.7)}#inbox_mail_container,#sent_mail_container{padding-bottom:6rem}#chat,#mail{background:rgba(var(--foreground-color),1)}#mail{height:100vh;padding:1.5rem;align-items:flex-start}#mail .flex sm-button:first-of-type{margin-right:.5rem}#settings_page{height:calc(100vh - 3.5rem);overflow-y:auto;padding:1.5rem}#settings_page h4{margin-bottom:.3rem;text-transform:capitalize}#settings_page h4:not(:first-of-type){margin-top:1.5rem}#settings_page p{max-width:60ch}#settings_page header{margin-bottom:1.5rem}#settings_page .flex sm-button{margin:0;margin-left:1rem}#settings_page sm-switch{padding-left:1rem}#settings_page sm-button{width:100%}@media screen and (max-width:640px){.hide-on-mobile{position:fixed;max-height:0;opacity:0;pointer-events:none}#sign_in{grid-template-areas:"illustration" ".";height:100%}#sign_in_illustration{grid-area:illustration}#chat header h5{width:calc(100vw - 12rem)}#chat .message{width:fit-content;max-width:90%}#settings_page{padding-bottom:3.5rem}}@media only screen and (min-width:640px){::-webkit-scrollbar{width:.5rem}::-webkit-scrollbar-thumb{background:rgba(var(--text-color),.2)}::-webkit-scrollbar-thumb:hover{background:rgba(var(--text-color),.5)}.hide-on-desktop{display:none!important}.page{padding-bottom:0}.fab{position:absolute;bottom:0}.logo-section{padding:2rem 3rem;margin:0}#sign_in{align-items:center;gap:4vw;grid-template-columns:1.2fr 1fr;padding:0 4vw}#sign_in .left sm-button:last-of-type{margin-left:.5rem}#sign_in .left h4{color:var(--accent-color)}#main_navbar,#main_navbar .logo-section .label,#main_navbar .navbar-item,#main_navbar .navbar-item .label{color:#f0f0f0}#sign_in_popup .icon{width:1.2rem;height:1.2rem;cursor:pointer}#main_navbar{flex-direction:column;position:relative;padding:.5rem;box-shadow:none;height:auto;background:#111}#main_navbar .navbar-item{height:auto;justify-content:flex-start;flex-direction:row;flex:none;padding:1rem .5rem;border-radius:.4rem}#main_navbar .navbar-item .icon{height:1.2rem;width:2.4rem;stroke:#f0f0f0}#contacts,#mails,#main,#settings_page{height:100vh}#main_navbar .logo-section{padding:0 1rem}#main_navbar .logo-section .main-logo{fill:#f0f0f0}#main_navbar .active{background:var(--accent-color);border-radius:.4rem}#main_navbar .label{display:none}#add_contact_popup::part(popup){min-width:24rem}#compose_mail_popup::part(popup),#reply_mail_popup::part(popup){min-width:36rem}#main{width:100vw;grid-template-columns:auto 1fr}#chat .message .message-body{max-width:50ch}.contact,.mail-card{margin:.25rem .5rem;border-radius:.5rem}#chat_page,#mail_page{grid-template-columns:20rem 1fr}#contacts,#mails{border-right:1px solid rgba(var(--text-color),.2)}#settings_page section{display:grid;grid-template-columns:1fr 1fr;gap:3rem;grid-auto-flow:column}#settings_page sm-button{width:max-content}.contact.active,.mail-card.active{background:rgba(var(--text-color),.06)}.card{display:inline-flex;width:auto}}@media only screen and (min-width:1280px){#sign_in{gap:4vw;padding:0 12vw}#sign_in .title-font{font-size:3rem}#main_navbar{align-items:flex-start}#main_navbar .navbar-item{padding:1rem .8rem;width:100%}#main_navbar .navbar-item .icon{width:2rem;margin-right:.8rem}#main_navbar .label{display:block}#chat_page,#mail_page{grid-template-columns:22rem 1fr}#chat header{padding:.5rem 1.5rem}#chat #chat_container{padding:1rem 1.5rem}}@media (hover:hover){.contact:hover,.mail-card:hover,.navbar-item:hover{background:rgba(var(--text-color),.06);cursor:pointer}.contact sm-menu{opacity:0;transition:opacity .3s}.contact:hover sm-menu,sm-menu:focus-within{opacity:1}} \ No newline at end of file +#sign_in_page,body{background:rgba(var(--foreground-color),1)}.contact .address,.mail-card .sender,.text-overflow{text-overflow:ellipsis;white-space:nowrap}*,::after,::before{padding:0;margin:0;box-sizing:border-box;font-family:Roboto,sans-serif}#confirmation_popup .flex,#mail .flex,#prompt .flex,sm-popup sm-input+sm-input{margin-top:1rem}.contact .address,.contact .name,h1,h2,h3,h4,h5{font-family:Poppins,sans-serif}:root{scroll-behavior:smooth;font-size:clamp(16px,1vmax,18px)}body,html{height:100%}body{--accent-color:#3042e7;--secondary-color:#ffac2e;--text-color:17,17,17;--text-color-light:100,100,100;--foreground-color:255,255,255;--background-color:#efefef;--error-color:red;color:rgba(var(--text-color),1)}body[data-theme=dark]{--accent-color:#5365ff;--secondary-color:#FDB956;--text-color:218,218,218;--text-color-light:170,170,170;--foreground-color:20,20,20}body[data-theme=dark] #contacts,body[data-theme=dark] #mails{background:rgba(var(--foreground-color),.5)}body[data-theme=dark] .initial{background:rgba(var(--text-color),.1)!important;color:rgba(var(--text-color),1)!important;box-shadow:0 .1rem .1rem #00016,0 .1rem .3rem #00040}body[data-theme=dark] .message,h1,h2,h3,h4,h5,textarea{color:rgba(var(--text-color),1)}p{line-height:1.6}h1{font-size:3rem}h2{font-size:2rem}h3{font-size:1.5rem}h4{font-size:1.1rem}h5{font-size:.8rem}h1,h2,h3,h4,h5{font-weight:600}#confirmation_popup h4,#prompt h4,#sign_in .left h3,#sign_in .left p,#sign_in_popup h4,.contact .name,.logo-section h4,a:any-link{font-weight:500}textarea{background:rgba(var(--text-color),.06);border:none;border-radius:.3rem;width:100%;padding:1rem;font-size:1rem;resize:none}textarea:focus{outline:0;box-shadow:0 0 0 .1rem var(--accent-color)}.flex{display:flex}.grid{display:grid}.grid-2{grid-template-columns:auto auto;gap:1em}.align-center{align-items:center}.justify-right{margin-left:auto}.direction-column{flex-direction:column}.rest{flex:1}.hide{opacity:0;pointer-events:none}.hide-completely{display:none!important}.no-transformations{transform:none!important}.breakable{overflow-wrap:break-word}.text-overflow{overflow:hidden}.sticky{position:sticky;top:1rem}.light-text{color:rgba(var(--text-color-light),1)}.accent-color{color:var(--accent-color)}.secondary-color{color:var(--secondary-color)}.fab{box-shadow:0 1rem 1rem #00020;margin-right:1rem;position:fixed;bottom:3.5rem;right:0;z-index:2}.fab .icon{margin-left:0!important;margin-right:.5rem;height:.9rem!important;stroke-width:8!important}a:any-link{text-decoration:none;color:var(--accent-color);text-transform:capitalize}.solid-background{background:var(--background-color)!important}.normal-weight{font-weight:400}.icon{fill:none;stroke-width:6;stroke:rgba(var(--text-color),1);height:1.2rem;width:1.2rem;overflow:visible;stroke-linecap:round;stroke-linejoin:round}span.ripple{position:absolute;border-radius:50%;transform:scale(0);background:rgba(var(--text-color),.2);pointer-events:none}.interact{overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:transparent}.popup-header{padding:.5rem 1.5rem 0;display:flex;align-items:center;width:100%}.popup-header .icon{padding:.7rem;height:2.4rem;width:2.4rem;stroke-width:8;transform:translateX(-.5rem);cursor:pointer;-webkit-tap-highlight-color:transparent}.popup-header .back{transform:none}.popup-header button,.popup-header sm-button{width:auto;margin-left:auto}#confirmation_popup,#prompt{flex-direction:column}#confirmation_popup h4,#prompt h4{margin-bottom:1.5rem}#confirmation_popup .flex sm-button:first-of-type,#prompt .flex sm-button:first-of-type{margin-right:.6rem;margin-left:auto}.page{align-items:flex-start;width:100%;height:100%}.card{display:flex;flex-direction:column;margin:1rem 0}sm-button{--font-family:"Poppins",sans-serif;margin:1rem 0}sm-button .icon{margin-right:.4rem}sm-button[variant=primary] .icon{align-self:center;height:1rem;width:1rem;margin-left:.8rem;stroke-width:6;stroke:rgba(var(--foreground-color),1)}.back-button{height:2.4rem;width:2.4rem;padding:.7rem;transform:translateX(-.6rem)}.logo-section{position:relative;align-items:center;height:max-content;margin:.5rem 0}#sign_in .left h3,#sign_in_popup p{margin-bottom:1rem}.logo-section h4{line-height:1;font-size:1rem}.logo-section h5{color:rgba(var(--text-color),.7)}.logo-section .main-logo{height:1.4rem;margin-right:.4rem;fill:rgba(var(--text-color),1);stroke:none}.select-file input[type=file]{display:none}#sign_in{display:grid;border-radius:.6rem;width:100%;padding:0 1.5rem;height:100%;align-items:flex-end}#sign_in .logo-section{padding:1.5rem;display:flex}#sign_in .title-font{text-transform:capitalize;line-height:1.2;font-weight:700;font-size:2.5rem}#sign_in .left{display:grid;flex-direction:column;padding-bottom:1.5rem;z-index:1}#sign_in .left h4{color:rgba(var(--foreground-color),1)}#sign_in .left sm-button{margin-top:3rem;width:auto}#sign_in .left sm-button:last-of-type{margin-left:auto}#sign_in .left sm-button:first-of-type:hover .icon{transform:translateX(.4rem)}#sign_in_page{height:100vh;width:100vw;overflow:hidden}.logo-section{padding:1.5rem}#sign_in_illustration,#sign_in_popup{position:relative;width:100%}#lock{height:12rem;position:absolute;top:-5rem;left:0}#sign_in_popup sm-button,#sign_in_popup sm-input{display:flex;min-width:100%}#sign_in_popup h4{margin-top:6rem;line-height:.6}#sign_in_popup h2{margin-bottom:2rem}#loading_page{height:100vh;display:grid;place-content:center;justify-items:center}#loading_page svg{z-index:1;transform-origin:bottom;height:6rem;width:6rem;animation:bounce .5s infinite alternate ease-in}#loading_page .shadow{margin-top:-1rem;width:5rem;height:2rem;background:rgba(var(--text-color),.1);border-radius:50%;animation:scale .5s infinite alternate ease-in;margin-left:1rem}#loading_page h4{margin-top:2rem}@keyframes bounce{0%{transform:scaleY(1) translateY(-4rem)}90%{transform:scaleY(1) translateY(0)}100%{transform:scaleY(.8)}}@keyframes scale{0%{transform:scale(.5)}90%{transform:scale(1.05)}100%{transform:scale(1)}}.initial{justify-content:center;font-size:1.2rem;width:2.4rem;height:2.4rem;background:rgba(var(--foreground-color),1);box-shadow:0 .1rem .1rem #0001a,0 .1rem .3rem #00016;border-radius:2rem;text-transform:uppercase}.contact{position:relative;display:grid;gap:0 1rem;grid-template-columns:auto 1fr auto;grid-template-areas:"dp . menu" "dp . menu";padding:.8rem 1rem;align-items:center}.contact:focus{background:rgba(var(--text-color),.06);outline:0}.contact .initial{grid-area:dp}.contact .name{font-size:1rem;text-transform:capitalize}.contact .address{overflow:hidden;font-weight:400;color:rgba(var(--text-color),.8)}.contact sm-menu{grid-area:menu}#warn_no_encryption,.date-card{padding:.4rem .8rem;background:rgba(var(--text-color),.1);font-weight:500;border-radius:.5rem;color:rgba(var(--text-color),.8);margin:1rem 0;justify-self:center;align-self:flex-start}#chat_container,#compose_mail_popup sm-input,#no_mails .new-conversation,.mail header{margin-bottom:1rem}.date-card{align-self:center}.contact.unread::before,.mail-card.unread::before{content:"";position:absolute;width:.2rem;height:100%;top:0;left:0;background:#00C853}.mail,.mail-card{position:relative}.contact.unread,.mail-card.unread{overflow:hidden;font-weight:600}.contact.unread h4,.mail-card.unread h4{font-weight:700}.mail-card{display:flex;flex-direction:column;padding:1rem 1.5rem}.mail-card .sender{color:rgba(var(--text-color),.7);overflow:hidden;margin-right:1rem}.mail-card .date{margin-left:auto;white-space:nowrap}.mail-card .subject{font-size:1em;margin-top:.3rem;font-weight:500}.mail-card .description{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:.9em;color:rgba(var(--text-color),.8)}@keyframes slide{from{opacity:0;transform:translateX(-1rem)}to{opacity:1;transform:none}}#mail_container{width:100%}.mail:not(:first-of-type){margin-top:2rem;padding-inline-start:1rem}.mail:not(:first-of-type)::before{content:"";position:absolute;left:0;top:0;width:.2rem;height:100%;background:rgba(var(--text-color),.2)}.mail header{align-self:start;padding-bottom:.5rem;border-bottom:solid 1px rgba(var(--text-color),.2)}.mail header h4{font-weight:500}.mail header .flo-id{font-weight:400;max-width:90%}.mail .mail-content,.mail .mail-subject{overflow-wrap:break-word;word-wrap:break-word}.mail .mail-subject{margin-bottom:.4em}.mail .mail-content{height:max-content;max-width:60ch;white-space:pre-wrap}.logo-section{display:grid;grid-template-columns:auto 1fr;grid-template-areas:"logo ." "logo ."}.logo-section svg{grid-area:logo}#main_navbar{position:fixed;bottom:0;padding:0;flex-wrap:wrap;width:100%;background:rgba(var(--foreground-color),.9);box-shadow:0 -.2rem 1rem #00016;height:3.5rem;align-items:center;z-index:4}#main_navbar .logo-section{padding:0}#main_navbar .navbar-item{position:relative;height:100%;flex:1;justify-content:center;flex-direction:column;opacity:.8}#main_navbar .navbar-item .icon{height:1.2rem;width:1.2rem}#main_navbar .navbar-item.badge::after{right:0;top:0;position:absolute;content:attr(data-notifications);display:flex;justify-content:center;align-items:center;padding:.4rem;line-height:0;height:calc(1em + .4rem);background:#00C853;color:rgba(var(--foreground-color),1);border-radius:2rem;transition:transform .3s}#auto_complete_contact,#chat .message,#contacts,#contacts header,#mails{position:relative}#main_navbar .navbar-item.badge.active::after,#main_navbar .navbar-item.badge[data-notifications=""]::after,#main_navbar .navbar-item.badge[data-notifications="0"]::after{transform:scale(0)}#main_navbar .active{opacity:1}#main_navbar .active h5{color:var(--accent-color)}#main_navbar .active .icon{stroke:var(--accent-color)}#auto_complete_contact{justify-content:flex-start;padding-bottom:0}#mail_contact_list{max-height:40vh;overflow-y:auto;position:absolute;top:100%;background:rgba(var(--foreground-color),1);z-index:1;border-radius:.4rem;box-shadow:0 .1rem .1rem #00010,0 .2rem .5rem #00020;width:100%}#mail_contact_list .contact{grid-template-columns:auto 1fr;grid-template-areas:"dp ." "dp ."}#mail_contact_list sm-menu{display:none}#contacts header{gap:.5rem}#contacts header sm-input{margin:0;width:100%}#contacts header sm-input .icon{stroke:rgba(var(--text-color),.5);height:.9rem;width:.9rem}#contacts header sm-input::part(input){padding:.4rem 1rem}#contacts #all_contacts{position:absolute;top:0;bottom:0;left:0;right:0;height:100%;width:100%;z-index:1;background-color:rgba(var(--foreground-color),1);transition:transform .3s;transform:translateX(-100%)}#contacts #all_contacts .back{padding:.7rem;height:2.4rem;width:2.4rem;margin-left:-.6rem;cursor:pointer}#contacts,#mails{grid-template-rows:max-content 1fr;height:calc(100vh - 3.5rem);backdrop-filter:blur(.4rem)}#contacts header,#mails header{padding:1rem 1.5rem}#contacts header h4,#mails header h4{text-transform:uppercase;font-size:.8rem;letter-spacing:.06em}#contacts header .grid,#mails header .grid{grid-template-columns:1fr auto auto auto;gap:.5rem}#contacts header .grid .icon,#mails header .grid .icon{height:2.2rem;width:2.2rem;padding:.4rem;cursor:pointer}#contacts header sm-button,#mails header sm-button{margin:0 0 0 auto}#contacts header sm-button .icon,#mails header sm-button .icon{height:.9rem;width:.9rem;align-self:center;stroke-width:8;margin-left:0;margin-right:.5rem}#chat_page{overflow-y:hidden}#chat{height:100vh;grid-template-rows:max-content 1fr max-content}#chat header{padding:.5rem 1rem;box-shadow:0 .2rem .4rem #00016}#chat header .back-button{margin-right:.2rem}#chat header .initial{margin-right:1rem}#chat header h4{font-weight:500;opacity:.8}#chat header h5{opacity:.7;font-weight:400}#chat header sm-menu{margin-left:1rem}#chat footer .flex{align-items:flex-end;padding:.5rem 1rem}#chat footer sm-textarea::part(textarea){background:rgba(var(--text-color),.1);padding-right:3rem;border-radius:2rem}#chat #send_message_button{position:absolute;right:1.5rem;transform:scale(0);z-index:1;align-self:center;height:2.4rem;width:2.4rem;padding:.5rem;cursor:pointer;stroke:none;fill:rgba(var(--text-color),.4);margin-left:1rem;transition:.3s}#chat #send_message_button.active{fill:var(--accent-color);transform:none}#chat #type_message{margin:0}#chat .message{display:grid;grid-auto-flow:column;align-items:center;gap:.5rem;width:100%;font-size:.9rem;max-width:max-content;margin-bottom:.2rem;margin-top:.8rem}#chat .message .message-body{overflow-wrap:break-word;word-wrap:break-word;white-space:pre-wrap;box-shadow:0 1px .1rem #00020;padding:.6em 1em}#chat .message .time{font-size:.8em;opacity:.8;margin-top:.3rem}#chat .sent{margin-left:auto}#chat .sent::after{content:"";position:absolute;left:100%;top:0;width:0;height:0;border-style:solid;border-width:.5em .3em 0 0;border-color:var(--accent-color) transparent transparent}#chat .sent .message-body{background:var(--accent-color);color:#f0f0f0;border-radius:.4em 0 .4em .4em}#chat .sent .time{grid-column:1}#chat .received::after{content:"";position:absolute;left:-.5em;top:0;width:0;height:0;border-style:solid;border-width:0 .5em .5em 0;border-color:transparent rgba(var(--text-color),.1) transparent transparent}#chat .received .message-body{background:rgba(var(--text-color),.1);border-radius:0 .4em .4em}#chat .received+.received,#chat .sent+.sent{margin-top:0}#chat .received+.received::after,#chat .sent+.sent::after{display:none}#chat .received+.received .message-body,#chat .sent+.sent .message-body{border-radius:.4em}#chat .unconfirmed{opacity:.7}#chat_container{padding:0 1rem}#new_conversation,#no_mails{height:100%;justify-content:center;text-align:center;padding:1.5rem}#new_conversation p,#no_mails p{margin-top:.8rem}#no_mails .new-conversation{height:7rem}.new-conversation{height:8rem;width:8rem;align-self:center;stroke-width:16;stroke:rgba(var(--text-color),.4)}#chat_container,#contacts_container,#inbox_mail_container,#mail,#sent_mail_container{width:100%;flex-direction:column;height:100%;overflow-y:auto}#contacts_container:empty{display:none}#contacts_container:not(:empty)~.empty-state{display:none}sm-tab-panels{overflow:hidden auto}sm-tab-header{--accent-color:rgba(var(--text-color), 0.7)}#inbox_mail_container,#sent_mail_container{padding-bottom:6rem}#chat,#mail{background:rgba(var(--foreground-color),1)}#mail{height:100vh;padding:1.5rem;align-items:flex-start}#mail .flex sm-button:first-of-type{margin-right:.5rem}#settings_page{height:calc(100vh - 3.5rem);overflow-y:auto;padding:1.5rem}#settings_page h4{margin-bottom:.3rem;text-transform:capitalize}#settings_page h4:not(:first-of-type){margin-top:1.5rem}#settings_page p{max-width:60ch}#settings_page header{margin-bottom:1.5rem}#settings_page .flex sm-button{margin:0;margin-left:1rem}#settings_page sm-switch{padding-left:1rem}#settings_page sm-button{width:100%}@media screen and (max-width:640px){.hide-on-mobile{position:fixed;max-height:0;opacity:0;pointer-events:none}#sign_in{grid-template-areas:"illustration" ".";height:100%}#sign_in_illustration{grid-area:illustration}#chat header h5{width:calc(100vw - 12rem)}#chat .message{width:fit-content;max-width:90%}#settings_page{padding-bottom:3.5rem}}@media only screen and (min-width:640px){::-webkit-scrollbar{width:.5rem}::-webkit-scrollbar-thumb{background:rgba(var(--text-color),.2)}::-webkit-scrollbar-thumb:hover{background:rgba(var(--text-color),.5)}.hide-on-desktop{display:none!important}.page{padding-bottom:0}.fab{position:absolute;bottom:0}.logo-section{padding:2rem 3rem;margin:.5rem 0 1rem}#sign_in{align-items:center;gap:4vw;grid-template-columns:1.2fr 1fr;padding:0 4vw}#sign_in .left sm-button:last-of-type{margin-left:.5rem}#sign_in .left h4{color:var(--accent-color)}#main_navbar,#main_navbar .logo-section .label,#main_navbar .navbar-item,#main_navbar .navbar-item .label{color:#f0f0f0}#sign_in_popup .icon{width:1.2rem;height:1.2rem;cursor:pointer}#main_navbar{flex-direction:column;position:relative;padding:.5rem;box-shadow:none;height:auto;background:#111}#main_navbar .navbar-item{height:auto;justify-content:flex-start;flex-direction:row;flex:none;padding:1rem .5rem;border-radius:.4rem}#main_navbar .navbar-item .icon{height:1.2rem;width:2.4rem;stroke:#f0f0f0}#contacts,#mails,#main,#settings_page{height:100vh}#main_navbar .logo-section{padding:0 1rem}#main_navbar .logo-section .main-logo{fill:#f0f0f0}#main_navbar .active{background:var(--accent-color);border-radius:.4rem}#main_navbar .label{display:none}#add_contact_popup::part(popup){min-width:24rem}#compose_mail_popup::part(popup),#reply_mail_popup::part(popup){min-width:36rem}#main{width:100vw;grid-template-columns:auto 1fr}#chat .message .message-body{max-width:50ch}.contact,.mail-card{margin:.25rem .5rem;border-radius:.5rem}#chat_page,#mail_page{grid-template-columns:20rem 1fr}#contacts,#mails{border-right:1px solid rgba(var(--text-color),.2)}#settings_page section{display:grid;grid-template-columns:1fr 1fr;gap:3rem;grid-auto-flow:column}#settings_page sm-button{width:max-content}.contact.active,.mail-card.active{background:rgba(var(--text-color),.06)}.card{display:inline-flex;width:auto}}@media only screen and (min-width:1280px){#sign_in{gap:4vw;padding:0 12vw}#sign_in .title-font{font-size:3rem}#main_navbar{align-items:flex-start}#main_navbar .navbar-item{padding:1rem .8rem;width:100%}#main_navbar .navbar-item .icon{width:2rem;margin-right:.8rem}#main_navbar .label{display:block}#chat_page,#mail_page{grid-template-columns:22rem 1fr}#chat header{padding:.5rem 1.5rem}#chat #chat_container{padding:1rem 1.5rem}}@media (hover:hover){.contact:hover,.mail-card:hover,.navbar-item:hover{background:rgba(var(--text-color),.06);cursor:pointer}.contact sm-menu{opacity:0;transition:opacity .3s}.contact:hover sm-menu,sm-menu:focus-within{opacity:1}} \ No newline at end of file diff --git a/css/main.scss b/css/main.scss index 84ec99f..8d60eb0 100644 --- a/css/main.scss +++ b/css/main.scss @@ -8,7 +8,7 @@ } :root{ scroll-behavior: smooth; - font-size: clamp(16px, 1.2vmax, 36px); + font-size: clamp(16px, 1vmax, 18px); } html, body{ height: 100%; @@ -296,9 +296,8 @@ sm-button[variant="primary"]{ display: flex; } .title-font{ - font-kerning: normal; - line-height: 1.2; text-transform: capitalize; + line-height: 1.2; font-weight: 700; font-size: 2.5rem; } @@ -774,6 +773,7 @@ sm-button[variant="primary"]{ sm-textarea::part(textarea){ background: rgba(var(--text-color), 0.1); padding-right: 3rem; + border-radius: 2rem; } } #send_message_button{ @@ -1029,7 +1029,7 @@ sm-tab-header{ } .logo-section{ padding: 2rem 3rem; - margin: 0; + margin: .5rem 0 1rem 0; } #sign_in{ align-items: center; diff --git a/index.html b/index.html index d32bb44..58c2140 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,7 @@ FLO Messenger + @@ -888,125 +889,125 @@ } } - - + + + }).catch(error => notify(error, "error")) + } +