Skip to content

Instantly share code, notes, and snippets.

View piayo's full-sized avatar
🏠
Working from home

piayo.wau piayo

🏠
Working from home
View GitHub Profile
@piayo
piayo / easings.css
Created December 1, 2020 23:56 — forked from argyleink/easings.css
Handy CSS properties for easing functions
:root {
--ease-in-quad: cubic-bezier(0.55, 0.085, 0.68, 0.53);
--ease-in-cubic: cubic-bezier(0.55, 0.055, 0.675, 0.19);
--ease-in-quart: cubic-bezier(0.895, 0.03, 0.685, 0.22);
--ease-in-quint: cubic-bezier(0.755, 0.05, 0.855, 0.06);
--ease-in-expo: cubic-bezier(0.95, 0.05, 0.795, 0.035);
--ease-in-circ: cubic-bezier(0.6, 0.04, 0.98, 0.335);
--ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
--ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
--ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1);
@piayo
piayo / lit-haunted-element.js
Created November 18, 2020 22:57 — forked from matthewp/lit-haunted-element.js
Haunted State Integration
import { LitElement } from 'lit-element';
import { State } from 'haunted';
export default class LitHauntedElement extends LitElement {
constructor() {
super();
this.hauntedState = new State(() => this.requestUpdate(), this);
}
@piayo
piayo / dnd-hooks-draggable.jsx
Created October 26, 2020 23:46 — forked from crazypixel/dnd-hooks-draggable.jsx
Drag and drop with hooks - Draggable component
import React, {useState, useCallback, useMemo, useEffect} from 'react';
const POSITION = {x: 0, y: 0};
const Draggable = ({children, id, onDrag, onDragEnd}) => {
const [state, setState] = useState({
isDragging: false,
origin: POSITION,
translation: POSITION
});
@piayo
piayo / jsdoit-backup-html.js
Created October 30, 2019 04:05
jsdoit から HTMLソースをバックアップ
// --------------------------
// jsdoit-backup-html.js
// jsdoit から HTMLソースをバックアップ
//
// usage:
// $ node jsdoit-backup-html.js
// --------------------------
var mkdirp = require('mkdirp');
var fs = require('fs');
@piayo
piayo / PIXI.MovieClip.prototype.setTickFrame
Last active December 15, 2015 06:59
PIXI.MovieClip.prototype.setTickFrame / PIXI.MovieClip.prototype.removeTickFrame
PIXI.MovieClip = function(a) {
PIXI.Sprite.call(this, a[0]);
this.textures = a;
this.currentFrame = 0;
this.animationSpeed = 1;
//added:start--------------------
this._now = null;
this._interval = 0;
this._lastTime = 0;
this._tick = null;
@piayo
piayo / PIXI.DisplayObjectContainer.prototype.find
Last active December 15, 2015 04:39
PIXI.DisplayObjectContainer.prototype.find
PIXI.DisplayObjectContainer.prototype.find = function(reg, limit){
var reg = new RegExp(reg);
var arr = [];
for(var i=0;i<this.children.length;i++){
if(this.children[i].name){
var n = this.children[i].name.toString();
if(reg.test(n) == true){
arr.push(this.children[i]);
if(limit && arr.length >= limit){
return arr;
@piayo
piayo / background.js
Created December 13, 2012 06:09
toggle popup for Chrome Extension like Official Google+ notifications extensions.
var _timer = null;
var _flg_opened = false;
var _func_toggle = function(flg){
_flg_opened = flg;
clearTimeout(_timer);
_timer = setTimeout(function(){
console.log(">>_flg_opened: "+ _flg_opened);
if(_flg_opened){
chrome.browserAction.setPopup({"popup": ""});
chrome.browserAction.setBadgeText({text:"OFF"});