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
/** | |
* 画像の回転を取得する | |
* @returns {number} 回転を表す数字。正しく表示するために数字に応じて以下の処理をする: | |
* 1: 何もしない | |
* 2: 左右反転 | |
* 3: 180度回転 | |
* 4: 180度回転し、左右反転 | |
* 5: 時計回りに90度回転し、左右反転 | |
* 6: 時計回りに90度回転 | |
* 7: 時計回りに270度回転し、左右反転 |
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 {Element} baseElement | |
* @return {[Element]} 対象となるHTML要素 | |
*/ | |
export function collectAllSiblings(baseElement) { | |
const targets = [] | |
let current = baseElement | |
while (current && current !== document.body) { | |
const siblings = Array.from(current.parentNode.children) |
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
@charset "UTF-8"; | |
.Textarea { | |
@at-root { | |
& { | |
position: relative; | |
color: inherit; | |
font-size: rem(16px); | |
line-height: 1.8; | |
} |
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
@charset "UTF-8"; | |
.TextInput { | |
@at-root { | |
& { | |
width: 100%; | |
height: rem(40px); | |
padding: 0 rem(14px); | |
border: 0; | |
color: inherit; |
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
@charset "UTF-8"; | |
.Radio { | |
@at-root { | |
& { | |
position: relative; | |
z-index: 0; | |
display: inline-flex; | |
justify-content: flex-start; | |
align-items: baseline; |
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
@charset "UTF-8"; | |
.Checkbox { | |
@at-root { | |
@function checked-icon($color: #fff) { | |
$color: '' + $color; | |
$color: '%23' + str-slice($color, 2); | |
@return 'data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M9%2016.17L4.83%2012l-1.42%201.41L9%2019%2021%207l-1.41-1.41z%22%20fill%3D%22#{$color}%22%2F%3E%3C%2Fsvg%3E'; | |
} |
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
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no" id="meta-viewport"> | |
<script> | |
!function() { | |
var viewport = document.getElementById('meta-viewport'); | |
function onResize () { | |
var value = window.outerWidth < 375 ? "width=375" : "width=device-width,initial-scale=1,shrink-to-fit=no"; | |
if (viewport.getAttribute('content') !== value) { | |
viewport.setAttribute('content', 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
.smooth-scroll { | |
transition: transform 0.5s ease-out !important; | |
} | |
.smooth-scroll-fixed { | |
display: none !important; | |
} |
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
.smooth-scroll { | |
transition: transform .5s ease-out; | |
} |
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
$.fn.responsiveTable = (function() { | |
var $window = $(window); | |
return function() { | |
var $el = this; | |
var $table = this.find('>table'); | |
var onResize = function() { | |
var width = $table.outerWidth(); | |
var height = $table.outerHeight(); | |
var $parent = $el.parent(); | |
var containerWidth = $parent.width(); |