2021年3月14日のブックマーク (2件)

  • JSのレスポンシブ対応をresizeからmatchMediaに移行した

    JS でブレークポイント毎に処理を分ける場合の方法を resize から matchMedia に移行したので、その際のメモ書きです。 昔ながらの方法 恥ずかしながら、最近まで JS でブレークポイント毎に JS 処理を切り替える場合、 以下のように昔ながらの resize イベントの監視を使っていました... /** * イベントリスナー */ const listener = () => { // リサイズ時に行う処理 if (window.innerWidth >= 768) { // 768px以上 console.log('PC用ブレークポイント用処理'); } else { // 768px未満 console.log('SP用ブレークポイント用処理'); } }; // リスナー登録 window.addEventListener('resize', listener); /

    JSのレスポンシブ対応をresizeからmatchMediaに移行した
    bouzuya
    bouzuya 2021/03/14
  • RegEx Crossword

    It's a crossword puzzle where you need to fill in the hexes with character sequences, so that they match the regular expressions listed around the edges. The individual clues will turn bold purplebold green when satisfied, orangered when not, and underlined when active. Note that the regex must be a full match, and empty cells are treated as spaces. Double click a rule to edit it. When finished, p

    bouzuya
    bouzuya 2021/03/14
    解けた