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 React, { useEffect, useContext } from 'react'; | |
import Router from 'next/router'; | |
export const ScrollPositionContext = React.createContext({ | |
triggerScroll: () => null, | |
}); | |
export const useScrollPosition = () => useContext(ScrollPositionContext); | |
let routerBound = false; |
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
function getBeautyWeight(height, sex = 'men') { | |
const standardHeight = { | |
men: 175, | |
female: 163, | |
}; | |
const standardRatio = { | |
men: 62.7 / standardHeight.men, | |
female: 49.2 / standardHeight.female, | |
}; | |
const standardWeight = { |
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
{ | |
"tagname-lowercase": true, | |
"attr-lowercase": true, | |
"attr-value-double-quotes": true, | |
"attr-value-not-empty": false, | |
"attr-no-duplication": true, | |
"doctype-first": true, | |
"tag-pair": true, | |
"tag-self-close": false, | |
"spec-char-escape": false, |
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 React from 'react' | |
import { func, node, number, object, shape, string } from 'prop-types' | |
import { withRouter } from 'react-router-dom' | |
const debounce = (fn, time) => { | |
let timeout; | |
return function() { | |
const functionCall = () => fn.apply(this, arguments) | |
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
// scroll check | |
(function() { | |
var $window = $(window); | |
var $target = $('.scroll-check'); | |
function scrollHandle() { | |
var winHeight = $window.height(); | |
var scrollTop = $window.scrollTop(); | |
$target.each(function() { |
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
/* jQuery ui-datepicker extension */ | |
/** | |
* | |
* https://gist.github.com/Artemeey/8bacd37964a8069a2eeee8c9b0bd2e44/ | |
* | |
* Version: 1.0 (15.06.2016) | |
* Requires: jQuery v1.8+ | |
* Requires: jQuery-UI v1.10+ | |
* |
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 gulp = require('gulp'), | |
path = require('path'), | |
merge = require('merge-stream'), | |
listFilepaths = require('list-filepaths'), | |
spritesmith = require('gulp.spritesmith-multi'); | |
// 자동 스프라이트 | |
gulp.task('auto-sprite', function() { | |
var stream = merge(); |
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
{ | |
"rules": { | |
"color-no-invalid-hex": true, | |
"declaration-block-no-duplicate-properties": [ | |
true, | |
{ | |
"ignore": [ | |
"consecutive-duplicates-with-different-values" | |
] | |
} |
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
function memorySizeOf(obj) { | |
var bytes = 0; | |
function sizeOf(obj) { | |
if(obj !== null && obj !== undefined) { | |
switch(typeof obj) { | |
case 'number': | |
bytes += 8; | |
break; | |
case 'string': |
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
function getSafeArea() { | |
var result, computed, div = document.createElement('div'); | |
div.style.padding = 'env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)'; | |
document.body.appendChild(div); | |
computed = getComputedStyle(div); | |
result = { | |
top: parseInt(computed.paddingTop) || 0, | |
right: parseInt(computed.paddingRight) || 0, | |
bottom: parseInt(computed.paddingBottom) || 0, |
NewerOlder