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
| /* | |
| * refs: | |
| * https://ru.wikipedia.org/wiki/Задача_о_100_узниках_и_100_ящиках | |
| * https://habr.com/ru/post/250817/ | |
| */ | |
| function randomIntFromInterval(min, max) { | |
| return Math.floor(Math.random() * (max - min + 1) + min) | |
| } |
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
| // css | |
| :root { | |
| --circle-size: clamp(1.3rem, 5vw, 3rem); | |
| --spacing: clamp(0.25rem, 2vw, 0.5rem); | |
| } | |
| .c-stepper { | |
| display: flex; | |
| } | |
| .c-stepper__item { |
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="inline flex flex-row w-full rounded overflow-hidden border p-0" | |
| :class="wrapperClass + (focused ? ' ' + wrapperFocusedClass : '')"> | |
| <div class="text-black p-2 m-0 flex justify-center items-center" | |
| :class="prefixClass"> | |
| <span :class="prefixSpanClass">+7</span> | |
| </div> | |
| <input class="pl-3 w-full m-0" | |
| type="tel" |
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
| Object.compare = (obj1, obj2) => { | |
| for (let p in obj1) { | |
| if (obj1.hasOwnProperty(p) !== obj2.hasOwnProperty(p)) return false; | |
| if(obj1[p]===null && obj2[p]!==null) return false; | |
| if(obj2[p]===null && obj1[p]!==null) return false; | |
| switch (typeof (obj1[p])) { | |
| case 'object': | |
| if (!Object.compare(obj1[p], obj2[p])) return false; | |
| break; | |
| case 'function': |