This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default function getValidRange(current, max, min) { | |
| return Math.min(Math.max(current, min), max); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div | |
| class="w-screen h-screen overflow-hidden" | |
| data-vue-component-name="AppCover" | |
| > | |
| <transition-group | |
| :style="{ | |
| backgroundColor: color, | |
| width: `${(skippedBackgroundsCount + 1) * 100}vw`, | |
| }" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Type writing effect | |
| * @param message | |
| * @param typingCallback | |
| * @param doneCallback | |
| */ | |
| export default function typingEffect( | |
| message, | |
| typingCallback = () => {}, | |
| doneCallback = () => {}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div | |
| data-vue-component-name="OnHover" | |
| @mouseenter="toggleHover(true)" | |
| @mouseleave="toggleHover(false)" | |
| > | |
| <slot :hover="hoverState" /> | |
| </div> | |
| </template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { reactive, computed } from 'vue'; | |
| export default function isScreenSize() { | |
| const screen = reactive({ | |
| xs2: { | |
| max: 539, | |
| enabled: false, | |
| }, | |
| xs: { | |
| max: 639, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default function excludeKeys(obj = {}, keys = []) { | |
| return Object | |
| .keys(obj) | |
| .reduce( | |
| (acc, key) => { | |
| if (!keys.includes(key)) { | |
| acc[key] = obj[key]; | |
| } | |
| return acc; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // подставляет в inline-styles значение высоты, | |
| // которое можно использовать для анимации высоты с динамическим контентом | |
| let isCollapsed = true; | |
| type Params = { | |
| from: string; | |
| to: string; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const throtthe = () => { | |
| let timeout = null; | |
| return (fn, TIME) => { | |
| if (!timeout) { | |
| fn(); | |
| timeout = setTimeout( | |
| () => { | |
| clearTimeout(timeout); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // запуск функции с задержкой | |
| async delayExecute(fn, duration = 0) { | |
| return new Promise( | |
| resolve => setTimeout( | |
| () => resolve(fn()), | |
| duration, | |
| ), | |
| ); | |
| } |