Skip to content

Instantly share code, notes, and snippets.

@motrdevua
motrdevua / arr.js
Last active March 15, 2023 19:39
European countries array
// prettier-ignore
const europeanCountries = [
['al', 'Albania'],
['ad', 'Andorra'],
['at', 'Austria'],
['by', 'Belarus'],
['be', 'Belgium'],
['ba', 'Bosnia and Herzegovina'],
['bg', 'Bulgaria'],
['hr', 'Croatia'],
@motrdevua
motrdevua / index.html
Last active October 7, 2021 05:41
countdown loop
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
Empty File<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
@motrdevua
motrdevua / script.js
Created February 14, 2021 14:16
Vanilla js fadein/out
/**
* Fade in/out
*/
function fade(type, ms, el) {
var isIn = type === "in",
opacity = isIn ? 0 : 1,
interval = 50,
duration = ms,
gap = interval / duration;
@motrdevua
motrdevua / mixin_icon-halo.scss
Last active February 12, 2021 19:29
mixin_icon-halo
@mixin icon-halo($radius, $color) {
position: relative;
border-radius: $radius;
transition: all .2s ease-in-out;
&::before {
position: absolute;
top: 0;
left: 0;
width: 100%;
@motrdevua
motrdevua / index.html
Last active January 23, 2021 21:52
youtube iframe video
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
/*! video */
@motrdevua
motrdevua / csv2json.js
Last active December 7, 2020 12:46
csv2json
function CSVToArray(strData, strDelimiter) {
// Check to see if the delimiter is defined. If not,
// then default to comma.
strDelimiter = strDelimiter || ',';
// Create a regular expression to parse the CSV values.
var objPattern = new RegExp(
// Delimiters.
'(\\' +
strDelimiter +
'|\\r?\\n|\\r|^)' +
@motrdevua
motrdevua / animate.html
Last active November 6, 2020 08:29
animate elements
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
/*! scrolling effects */
.action {
@motrdevua
motrdevua / inlineSvg.js
Created October 18, 2020 05:05
inline svg from img src
/**
* Inline svg
*/
const allImg = document.querySelectorAll('img');
for (let i = 0; i < allImg.length; i++) {
const imgSrc = allImg[i].getAttribute('src');
if (imgSrc.split('.')[1] === 'svg') {
let myRequest = new Request(imgSrc);
@motrdevua
motrdevua / loader.html
Last active October 21, 2020 18:46
gooey loader
<div class="loader-wrapper">
<div class="loader dot dot--big">
<div class="dot dot--small"></div>
</div>
<svg width="0px" height="0px">
<filter id="goo">
<feGaussianBlur in="SourceGraphic" stdDeviation="7" result="blur" />
<feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7" result="goo" />
<feBlend in="SourceGraphic" in2="goo" />
</filter>