import Swiper from "swiper"
import { Pagination } from "swiper/modules"
// import "swiper/css" // не нужен потому что сам настроил в scss
import "swiper/css/pagination" // тоже при желании можно убрать и самому стили прописать в scss
try {
This file contains 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
<h1 id="как-сделать-разные-склонения-окончаний-слов-в-зависимости-от-числа-на-javascript">Как сделать разные склонения окончаний слов в зависимости от числа на JavaScript</h1> | |
<h2 id="1-когда-это-надо">1. Когда это надо</h2> | |
<p>Например надо вывести в разных местах разные окончания слов в зависимости от заданного числа.</p> | |
<ul> | |
<li>1 минута</li> | |
<li>2 минуты </li> | |
<li>5 минут</li> | |
</ul> | |
<h2 id="2-подключение-скрипта-склонения-окончаний-слов-к-странице-сайта">2. Подключение скрипта склонения окончаний слов к странице сайта</h2> | |
<p><strong>Скачать скрипт можно <a href="https://gist.githubusercontent.com/artemsites/b691ba8ec063f32c27900e198981bd39/raw/getDeclOfNum.js">из GitHub</a></strong> </p> |
This file contains 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
/** | |
* @version 17.09.2024 | |
* @author info@artemsites.ru | |
* import { DateFormatterClass } from "/src/utils/DateFormatterClass.js" | |
* | |
* const dateFormatter = new DateFormatterClass('2024-03-28') // создаст экземпляр на указанную дату | |
* const dateFormatter = new DateFormatterClass() // создаст экземпляр на текущую дату | |
*/ | |
export class DateFormatterClass { | |
constructor(dateString = new Date()) { |
This file contains 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
/** | |
* @version 16.09.2024 | |
* import { getClearPhone } from "/src/utils/regexp.js" | |
*/ | |
export function getClearPhone(str) { | |
return str.replace(/[^+0-9]/g, "") | |
} |
This file contains 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 { copyToClipboard } from "/src/utils/copyToClipboard.js" | |
* | |
* copyToClipboard("Этот текст будет скопирован в буфер обмена") | |
*/ | |
export function copyToClipboard(text, callback) { | |
const textarea = document.createElement('textarea') | |
textarea.value = text | |
document.body.appendChild(textarea) |
This file contains 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> | |
<Teleport to="body"> | |
<Transition> | |
<div v-if="isOpen" class="popup-overlay" @click="closePopup"> | |
<div class="popup-content" @click.stop> | |
<button class="popup-close" @click="closePopup"> | |
× | |
</button> | |
<slot></slot> |
<svg width="0" height="0" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<symbol id="faq-v3-ico-3" viewBox="0 0 31 30">
<circle fill="var(--color)" cx="15.4" cy="15" r="15" />
<path fill="var(--color-inverse)" d="M6.4 12c0-.1.04-.18.1-.26a.35.35 0 0 1 .26-.1h4.9c.1 0 .19-.04.26-.12a.35.35 0 0 0 .11-.25v-4.9c0-.1.04-.19.11-.26A.35.35 0 0 1 12.4 6h6c.1 0 .18.04.25.11.08.07.11.16.11.26v4.9c0 .1.04.18.11.25.08.08.16.11.26.11h4.9c.1 0 .19.04.26.11.07.08.1.16.1.26v6c0 .1-.03.18-.1.26a.35.35 0 0 1-.26.1h-4.9c-.1 0-.18.04-.26.12a.35.35 0 0 0-.1.25v4.9c0 .1-.04.19-.12.26a.35.35 0 0 1-.25.11h-6a.35.35 0 0 1-.26-.11.35.35 0 0 1-.1-.26v-4.9c0-.1-.04-.18-.12-.25a.35.35 0 0 0-.25-.11h-4.9a.35.35 0 0 1-.26-.11.35.35 0 0 1-.11-.26v-6Z" />
</symbol>
</svg>
This file contains 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
_ |
NewerOlder