Skip to content

Instantly share code, notes, and snippets.

View bugoaneo's full-sized avatar
🎯
Focusing

Polina Emellyanova bugoaneo

🎯
Focusing
View GitHub Profile
@bugoaneo
bugoaneo / Сookies
Last active August 8, 2025 06:16
Сookies Куки Принять-Отказаться
document.addEventListener('DOMContentLoaded', function() {
const cookieBar = document.querySelector('.cookies');
if (!cookieBar) return;
// Получаем текущий путь сайта (например, "/xi/" или "/")
const sitePath = window.location.pathname.split('/')[1] || '/';
const cookiePath = sitePath === '/' ? '/' : `/${sitePath}/`;
// Проверяем, не был ли уже принят cookies (постоянно) или отклонён (на сессию)
@bugoaneo
bugoaneo / style.css
Created April 14, 2023 06:46 — forked from Manyaka/style.css
How to break an image out of its parent container with CSS
.full-width {
left: 50%;
margin-left: -50vw;
margin-right: -50vw;
max-width: 100vw;
position: relative;
right: 50%;
width: 100vw;
}
@bugoaneo
bugoaneo / svg_sprites.md
Created January 26, 2023 14:38 — forked from darsain/svg_sprites.md
How to use SVG sprites in img[src] and css backgrounds

To make this work in CSS:

background: url('images.svg#chart');

or img:

<img src="images.svg#chart">
@bugoaneo
bugoaneo / input.scss
Created October 12, 2022 15:10
Generated by SassMeister.com.
$grid-gup: 30px;
$grid-col: 12;
.col-p {
width: calc(#{percentage(5/12)} - #{$grid-gup});
}
@for $i from 1 through $grid-col {
.col-#{$i} {
width: calc(#{percentage($i/$grid-col) - #{$grid-gup}});
function pageWidget(pages) {
var widgetWrap = $('<div class="widget_wrap"><ul class="widget_list"></ul></div>');
widgetWrap.prependTo("body");
for (var i = 0; i < pages.length; i++) {
$('<li class="widget_item"><a class="widget_link" href="' + pages[i] + '.html' + '">' + pages[i] + '</a></li>').appendTo('.widget_list');
}
var widgetStilization = $('<style>body {position:relative} .widget_wrap{position:absolute;top:0;left:0;z-index:9999;padding:10px 20px;background:#222;border-bottom-right-radius:10px;-webkit-transition:all .3s ease;transition:all .3s ease;-webkit-transform:translate(-100%,0);-ms-transform:translate(-100%,0);transform:translate(-100%,0)}.widget_wrap:after{content:" ";position:absolute;top:0;left:100%;width:24px;height:24px;background:#222 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAABGdBTUEAALGPC/xhBQAAAAxQTFRF////////AAAA////BQBkwgAAAAN0Uk5TxMMAjAd+zwAAACNJREFUCNdjqP///y/DfyBg+LVq1Xoo8W8/CkFYAmwA0Kg/AFcANT5fe7l4AAAAAElFTkSuQmCC) no-repeat 50% 50%;cursor:poi
@bugoaneo
bugoaneo / Cuontdown && packs
Created September 9, 2019 14:37
Cuontdown && packs
if (document.getElementById('countdownTimer')) {
var min = document.getElementById('countdownTimer').getAttribute('data-minutes');
var sec = document.getElementById('countdownTimer').getAttribute('data-seconds');
function countDown() {
sec--;
if (sec == -01) {
sec = 59;
min = min - 1;
} else {
@bugoaneo
bugoaneo / responsive picture
Created August 15, 2018 12:01
responsive picture
<picture>
<source media="(max-width: 799px)" srcset="elva-480w.jpg">
<source media="(min-width: 800px)" srcset="elva-800w.jpg">
<img src="elva-800w.jpg">
</picture>
@bugoaneo
bugoaneo / swiper-magnific-popup.js
Created September 14, 2017 10:25 — forked from thiagoeliasr/swiper-magnific-popup.js
Adding swipe support to Magnific Popup galleries. (touchSwipe is required: http://labs.rampinteractive.co.uk/touchSwipe/demos/)
(function() {
/* Define a variável que dá swipe no lightbox */
var magnificPopup = $.magnificPopup.instance;
/* Carrega a função quando clica no lightbox (senão não pega a classe utilizada) */
$("a.image-lightbox").click(function(e) {
/* Espera carregar o lightbox */
setTimeout(function() {
/* Swipe para a esquerda - Próximo */
@bugoaneo
bugoaneo / Family.scss
Created June 21, 2017 05:43
Family.scss
/// Select all children from the first to `$num`.
/// @group with-arguments
/// @content [Write the style you want to apply to the children, and it will be added within the @content directive]
/// @param {number} $num - id of the child
@mixin first($num) {
@if $num == 1 {
&:first-child {
@content;
}
} @else {
@media screen and (-webkit-min-device-pixel-ratio: 1.5),
screen and (min-resolution: 144dpi) {
.about__pic {
background: url('/img/content/[email protected]') center center no-repeat;
background-size: 100%;
}
}