Skip to content

Instantly share code, notes, and snippets.

View baslie's full-sized avatar

Roman Purtov baslie

View GitHub Profile
@baslie
baslie / index.html
Last active July 3, 2024 05:11
SmoothScroll для Тильды с помощью библиотеки Lenis
<!-- *********************************************** -->
<!-- SmoothScroll с помощью библиотеки Lenis -->
<!-- *********************************************** -->
<!-- Более плавный скролл, нежели чем «классический» -->
<!-- *********************************************** -->
<script src="https://unpkg.com/@studio-freight/lenis@1.0.42/dist/lenis.min.js"></script>
<script>
// Классы, в которых скрипт «отваливается» — их нужно исключать принудительно :)
const classesToExclude = [
't706',
@baslie
baslie / index.html
Created July 3, 2024 03:59
Скрытие символа BOM на карточках Тильды
<!-- Скрытие символа BOM -->
<script>
(function() {
// Список классов для проверки
var classesToCheck = [
't-card__uptitle',
't-card__title',
't-card__descr'
];
@baslie
baslie / index.html
Created July 2, 2024 09:11
Плавный скролл по странице
<!-- Плавный скролл по странице -->
<script src="https://unpkg.com/@studio-freight/lenis@1.0.42/dist/lenis.min.js"></script>
<script>
const lenis = new Lenis({
lerp: 0.1,
easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)),
orientation: 'vertical',
gestureOrientation: 'vertical',
smoothWheel: true,
wheelMultiplier: 0.95,
@baslie
baslie / index.html
Last active July 2, 2024 18:33
Скрываем или удаляем пустые карточки на Тильде (блок ST315N)
<!-- ******************************************************* -->
<!-- Скрываем или удаляем пустые карточки -->
<!-- ******************************************************* -->
<!-- Видео с пояснением: https://youtu.be/VLor5zp0W4s -->
<!-- ******************************************************* -->
<script>
(function() {
// Настройки
const productCardClasses = ['js-product', 't-item'];
const productNameClasses = ['js-store-prod-name', 'js-product-name', 't786__title'];
@baslie
baslie / example.html
Created March 26, 2024 13:23
Меняем кнопки и цвета у блока BF905A в Тильде
<script>
const ucNewIcons = {
"t898__icon-telegram_wrapper": {
"iconPath": "none", // Нет новой иконки
"tooltipText": null // Нет нового названия для тултипа
},
"t898__icon-whatsapp_wrapper": {
"iconPath": "none",
"tooltipText": null
},
@baslie
baslie / example.html
Last active October 31, 2023 13:01
Работа с данными в динамическом каталоге Тильды
<script>
const MAX_ATTEMPTS = 10;
let attempts = 0;
function checkForJsStore() {
if (attempts >= MAX_ATTEMPTS) {
console.warn("Достигнуто максимальное количество попыток. Подождите или обновите страницу.");
return;
}
@baslie
baslie / custom.css
Last active October 25, 2023 10:02
TILDA: Замена категорий в магазине со слова «Все» на своё название
/* ВАЖНО! Замена категорий в магазине: «Все» → «Все блюда» */
div[data-storepart-uid="361763895611"] {
visibility: hidden;
position: relative;
}
div[data-storepart-uid="361763895611"]:after {
visibility: visible;
position: absolute;
top: 0;
left: 0;
@baslie
baslie / index.html
Created June 28, 2022 17:29
Фоновое видео с Google Drive для «Тильды»
<video style="object-fit: cover; background-size: cover; width: 100%; height: 900px" video="" preload="auto" muted="" playsinline="" autoplay="autoplay" loop="loop">
<!-- Вместо "id=1xAOh9c9ghq5j4rN38cAEwLYyKkLM6Sx4" вписать ID своего видео -->
<source src="https://drive.google.com/uc?export=download&amp;confirm=no_antivirus&amp;id=1xAOh9c9ghq5j4rN38cAEwLYyKkLM6Sx4" type="video/mp4">
</video>
@baslie
baslie / style.css
Created June 8, 2022 07:03
TILDA: Меняем «Phone» на «Телефон» в блоке BF905A
/* «Телефон» в виджете обратной связи */
a.t825__phone ~ div.t825__messenger-descr {
color: transparent;
}
a.t825__phone ~ div.t825__messenger-descr:after {
content: "Телефон";
color: #17181e; /* set color to original text color */
margin-left: -30px; /* margin-left equals length of text we're replacing */
}
@baslie
baslie / index.html
Last active October 17, 2023 12:47
Year in footer (Tilda)
<!-- Меняем год в копирайте -->
<!-- с помощью тега <strong> -->
<script>
window.onload = function() {
let startYear = '2014';
let className = 'uc-copyright';
let currentYear = new Date().getFullYear(); // Получаем текущий год
// Находим элемент <strong> внутри заданного класса
let copyrightElement = document.querySelector('.' + className + ' strong');