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
@mixin simple-before { | |
&::before { | |
content: ''; | |
@content; | |
} | |
} | |
@mixin simple-after { | |
&::after { | |
content: ''; |
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($top: auto, $right: auto, $bottom: auto, $left: auto) { | |
position: absolute; | |
margin: auto; | |
top: $top; | |
right: $right; | |
bottom: $bottom; | |
left: $left; | |
} |
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
$img_dir: '/img/'; | |
@function image-url ($url) { | |
@return url("#{$img_dir}#{$url}"); | |
} |
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
// image-urlを使う想定 | |
@mixin bg-contain($path) { | |
background-image: image-url($path); | |
background-repeat: no-repeat; | |
background-size: contain; | |
} |
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
// size | |
$pc-min-width: 1440px; | |
$tablet_max_width: 769px; | |
$sp_max_width: 375px; | |
@function pSize($value) { | |
@return $value / $pc_min_width * 100 + vw; | |
} | |
@function tSize($value) { |
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
/** | |
* 画像サイズを返してくれる。 | |
* @param {String} パス | |
*/ | |
img-size($path) | |
image-size($img_dir + $path) | |
/** | |
* 画像アスペクト比を返してくれる。 | |
* @param {String} パス |
NewerOlder