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
varying vec2 vTextureCoord; | |
uniform vec4 filterArea; | |
uniform sampler2D uSampler; | |
uniform float colorShiftR; | |
uniform float colorShiftG; | |
uniform float colorShiftB; | |
void main() { | |
vec2 rOffset = vec2(colorShiftR) / filterArea.xy; |
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 hexToRgb(color) { | |
// remove # if exist | |
const replacedColor = color.replace(/#/g, ""); | |
return [ | |
parseInt(replacedColor.substr(0, 2), 16), | |
parseInt(replacedColor.substr(2, 2), 16), | |
parseInt(replacedColor.substr(4, 2), 16) | |
]; | |
} |
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
// textures should be object | |
export function threeTextureLoad(textures) { | |
const texturePromises = []; | |
const loadedTextures = {}; | |
const loader = new THREE.TextureLoader(); | |
Object.keys(textures).forEach(key => { | |
texturePromises.push( | |
new Promise((resolve, reject) => { | |
const entry = textures[key]; |
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 getDate(d) { | |
const date = new Date(d) | |
return ( | |
date.getFullYear() + | |
'.' + | |
(date.getMonth() + 1) + | |
'.' + | |
date.getDate() + | |
' ' + | |
this.days[date.getDay()] |
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
class CanvasUtil { | |
constructor(canvas){ | |
this.canvas = canvas; | |
this.ctx = this.canvas.getContext('2d'); | |
} | |
clear(){ | |
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); | |
} | |
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
@mixin abs-center { | |
position: absolute; | |
top: 0; | |
left: 0; | |
right: 0; | |
bottom: 0; | |
margin: auto; | |
} |
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
@mixin flex-center { | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
} |
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
@mixin position-ab-center1 { | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
transform: translate(-50%, -50%); | |
} |
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
// pattern | |
$ease : cubic-bezier(0.25, 0.1, 0.25, 1); | |
$linear : cubic-bezier(0, 0, 1, 1); | |
$easeIn : cubic-bezier(0.42, 0, 1, 1); | |
$easeOut : cubic-bezier(0, 0, 0.58, 1); | |
$easeInOut : cubic-bezier(0.42, 0, 0.58, 1); | |
$easeInSine : cubic-bezier(0.47, 0, 0.745, 0.715); | |
$easeOutSine : cubic-bezier(0.39, 0.575, 0.565, 1); | |
$easeInOutSine : cubic-bezier(0.445, 0.05, 0.55, 0.95); |
NewerOlder