Skip to content

Instantly share code, notes, and snippets.

{% extends "base.html" %}
{% endblock %} открыть блок с html
---------------------------------------------------------------------------------------------------------------------------
{% block title %}Личный кабинет{% endblock %} вставить титл в html
---------------------------------------------------------------------------------------------------------------------------
{% if current_user.is_authenticated %}
показать блок если авторизован
{% else %}
показать блок если не авторизован
@stanruss
stanruss / accordion с картинками
Created June 10, 2025 10:57
Плавное переключение картинок при клике на другую картинку
const initOptions = () => {
const optionsContainer = document.querySelector('.options')
const options = document.querySelectorAll('.option')
optionsContainer.style.setProperty('--total-options', options.length)
optionsContainer.addEventListener('click', (event) => {
const clickedOption = event.target.closest('.option')
if (!clickedOption || clickedOption.classList.contains('active')) return
@stanruss
stanruss / hover btn html css
Last active June 11, 2025 09:56
hover btn html css
<div class="wrapper">
<a href="#!" class="hover1">hover me
<svg>
<rect></rect>
</svg>
</a>
</div>
*
@stanruss
stanruss / Скрыть мобильное меню при нажатии на ссылку
Last active June 11, 2025 09:59
Скрыть мобильное меню при нажатии на ссылку
$('.linkcollapse').on('click', function(){
$('.navbar-collapse').collapse('hide');
}); /* работает только с Jquery */
@stanruss
stanruss / stop play on youtube
Created March 5, 2018 09:32
stop play on youtube
<a href="http://www.youtube.com/embed/JMJXvsCLu6s" target="_blank" onclick="window.open(this.href, '', 'width='+screen.availWidth/2+',height='+screen.availHeight/2+',top='+screen.availHeight/4+',left='+screen.availWidth/4); return false;"> <i class="far fa-file-video white-text"></i> </a>
OR
<div id="play"></div>
<div id="playYoutube1">воспроизведение</div>
<div id="pauseYoutube1">пауза</div>
<script src="//www.youtube.com/player_api"></script>
<script>
@stanruss
stanruss / Чередование цветов элемента
Created October 19, 2017 05:19
Чередование цветов элемента
$colors: $font-color, $active-link
@for $i from 1 through length($colors)
section:nth-child(#{length($colors)}n+#{$i})
background-color: nth($colors, $i)
animation: animation-name animation-duration animation-timing-function animation-delay animation-iteration-count animation-direction;
animation-name: name
animation-duration: 2s/2ms
animation-timing-function: ease, linear, ease-in, ease-out, ease-in-out, cubic-bezier(x1, y1, x2, y2), step-start, step-end,
steps(количество шагов,start|end)
animation-delay: 2s/2ms
animation-iteration-count: infinite, число раз повтор
animation-direction: alternate(↨), alternate-reverse(↨↨), normal(↑), reverse(↓)
animation-play-state: paused, running
@stanruss
stanruss / migx вкладки
Created July 5, 2017 12:29
migx вкладки
Вкладки формы:
[
{"caption":"Tab Title", "fields": [
{"field":"1sectH3","caption":"1sectH3"},
{"field":"1sectP","caption":"1sectP"},
{"field":"image","caption":"Image","inputTVtype":"image"}
]}
]
Разметка колонок:
@stanruss
stanruss / Плавное подчеркивание ссылок
Last active June 11, 2025 10:09
Плавное подчеркивание ссылок
.object
position: relative
text-decoration: none
.object:after
display: block
position: absolute
left: 0
bottom: -5px
width: 0
height: 2px
@stanruss
stanruss / git установка
Last active April 20, 2024 12:32
Все команды GIT
echo "# название" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/stanruss/название.git
git push -u origin master
git log --oneline - посмотреть все коммиты.
git checkout . - восстановить все.
git checkout "код коммита" - вернуть до состояния этого коммита.