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
<!-- | |
https://csswizardry.com/2020/05/the-fastest-google-fonts/ | |
- 1. Preemptively warm up the fonts’ origin. | |
- | |
- 2. Initiate a high-priority, asynchronous fetch for the CSS file. Works in | |
- most modern browsers. | |
- | |
- 3. Initiate a low-priority, asynchronous fetch that gets applied to the page | |
- only after it’s arrived. Works in all browsers with JavaScript enabled. | |
- |
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
$min-mobile-width = 320 | |
$max-desktop-width = 1200 | |
html | |
font-size: 10px | |
@media (max-width: $min-mobile-width) | |
font-size calc((100vw / $min-mobile-width) * 10) | |
@media(orientation: landscape) | |
font-size calc(10px - (100vw - 100vh) / 100) |
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 Vue from 'vue' | |
export default (api) => ({ | |
namespaced: true, | |
state: { | |
list: [] | |
}, | |
getters: { | |
idxMap: state => state.list.reduce((map, { id }, i) => { | |
map[id] = i |
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 functional> | |
<div class="loader"> | |
<div></div> | |
<div></div> | |
<div></div> | |
</div> | |
</template> | |
<style> | |
@keyframes loader { |
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
^[a-zA-Z0-9!#$%&'*+\\\-/=?^_`{|}~.]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$ |
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
const FOCUSABLE = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex="-1"]), [contenteditable]' | |
export default class Modal { | |
constructor (options) { | |
const focusableChildren = options.el.querySelectorAll(FOCUSABLE) | |
this.el = options.el | |
this.activeClass = options.activeClass | |
this.firstFocusableChild = focusableChildren[0] | |
this.lastFocusableChild = focusableChildren[focusableChildren.length - 1] | |
this.elBeforeOpen = null |
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
var names = ['John Doe']; | |
for (var i = 0; i < names.length; i++) { | |
app.activeDocument.activeLayer.textItem.contents = names[i]; | |
app.activeDocument.saveAs( | |
new File('~/Desktop/' + names[i] + '.tif'), 10), | |
new TiffSaveOptions(), | |
true | |
); | |
} |
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
/* | |
Авторизация с токенами access и refresh для Vue.js | |
Пример использования: | |
Vue.use(Auth, { | |
http, // экземпляр Axios | |
router, // экземпляр VueRouter, | |
routes: { | |
login: '/login', | |
register: '/login?register', |
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
// Promise: https://github.com/taylorhakes/promise-polyfill | |
// fetch: https://github.com/developit/unfetch | |
// ScrollIntoView: https://github.com/KoryNunn/scroll-into-view | |
if (Array.prototype.find === undefined) { | |
Array.prototype.find = function (fn) { | |
for (var i = 0, l = this.length; i < l; i++) { | |
if (fn(this[i], i, this)) { | |
return this[i]; | |
} |
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
{ | |
"name": "App Name", | |
"short_name": "App Name", | |
"icons": [ | |
{ | |
"src": "/192x192.png", | |
"sizes": "192x192", | |
"type": "image/png" | |
}, | |
{ |
NewerOlder