This file contains hidden or 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 { useCallback, useEffect, useRef } from 'react'; | |
| type ScrollIntoViewOptions = { | |
| behavior?: ScrollBehavior; | |
| block?: ScrollLogicalPosition; | |
| inline?: ScrollLogicalPosition; | |
| }; | |
| type UseFocusOnHashOptions = { | |
| onFocus?: () => void; |
This file contains hidden or 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
| { | |
| "@context": "https://schema.org", | |
| "@type": "Person", | |
| "name": "名前", | |
| "description": "詳細な説明", | |
| "image": ["https://example.com/image01.jpg"], | |
| "sameAs": ["副次的なURL1"], | |
| "hasOccupation": [ | |
| { | |
| "@type": "Occupation", |
This file contains hidden or 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
| @use '@root/common/styles/index.scss' as *; | |
| .tooltip_content { | |
| z-index: 1; | |
| width: 510px; | |
| max-width: 100%; | |
| padding: 8px; | |
| border-radius: 8px; | |
| animation-duration: 0.2s; | |
| animation-timing-function: ease-in-out; |
This file contains hidden or 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
| .bordering { | |
| position: relative; | |
| color: #fff; | |
| -webkit-text-stroke: 4px #000; // デザインデータ上の縁取り×2 | |
| &::before { | |
| content: attr(data-text); | |
| position: absolute; | |
| -webkit-text-stroke: 0; | |
| } |
This file contains hidden or 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 SweetScroll from 'sweet-scroll' | |
| /** | |
| * スムーススクロールの共通処理です。 | |
| * https://github.com/tsuyoshiwada/sweet-scroll | |
| * @example | |
| * import { scroller } from '@utility/scroller' | |
| * const element = document.getElementById('element') | |
| * scroller.toElement(element) | |
| * element.setAttribute('tabindex', '-1') |
This file contains hidden or 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
| /** | |
| * 配列を比較して、1つでも重複があれば`true`を返す | |
| * @param {Array} arr1 | |
| * @param {Array} arr2 | |
| * @returns {Boolean} | |
| */ | |
| const isDuplicateArray = (arr1, arr2) => { | |
| return ( | |
| [...arr1, ...arr2].filter(item => arr1.includes(item) && arr2.includes(item)).length > 0 | |
| ) |
This file contains hidden or 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
| /** | |
| * @classdesc 対象要素内の見出しを検索して目次を生成します。 | |
| * @author Manabu Yasuda <[email protected]> | |
| * @example | |
| * import Toc from '@lib/Toc' | |
| * const toc = new Toc({ | |
| * tocSelector: '.toc', | |
| * contentSelector: '.content', | |
| * headingSelector: 'h2', | |
| * listClass: 'list', |
This file contains hidden or 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 { debounce } from '@utility/debounce' | |
| import { throttle } from '@utility/throttle' | |
| /** | |
| * @classdesc 指定した要素までスクロールしたかを検知してコールバック関数で処理を実行します。 | |
| * @author Manabu Yasuda <[email protected]> | |
| * @example | |
| * import ScrollFixed from '@lib/ScrollFixed' | |
| * | |
| * const fixed = new ScrollFixed({ |
This file contains hidden or 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 {Object} params | |
| //- @param {String} params.width [null] セルの横幅 | |
| //- @param {String} params.parentWidth [null] テーブル全体の横幅 | |
| //- | |
| //- @examples Input | |
| //- colgroup | |
| //- +Col({ width: 300, parentWidth: 900 }) | |
| //- +Col({ width: "300", parentWidth: "900" }) | |
| //- +Col({ width: "300px", parentWidth: "900px" }) | |
| //- |
This file contains hidden or 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
| // `npm i -D glob js-beautify` | |
| const fs = require('fs') | |
| const glob = require('glob') | |
| const beautify = require('js-beautify') | |
| const beautifyOptions = { | |
| indent_size: 2, | |
| end_with_newline: true, | |
| preserve_newlines: false, | |
| max_preserve_newlines: 0, | |
| wrap_line_length: 0, |