KITASENJU DESIGN BLOG

memo, html, javascript, unity

Entries from 2025-04-01 to 1 month

Paperjsのsvgを(イラレに)コピぺする

window.addEventListener('keydown', () => { const svg = paper.project.exportSVG({ asString: true }); // @ts-ignore navigator.clipboard.writeText(svg); }

bpmに従って何かする時

音の時間/60*bpmにして、整数し、1フレーム前の整数と比較。 整数が変わっていたらビート public static update(){ let bpm = 128/2; let time = this.getTime()/60*bpm; let currentTime = Math.floor(time); let pastTime = this.time; if(currentTime!=pa…

jsで、webcamを選択

js

余計なコードが入ってます。 import { Params } from "../data/Params"; export class MyVideo { public video:HTMLVideoElement; public deviceId:string = ""; constructor(){ this.video = document.getElementById('video') as HTMLVideoElement; //this…

MacBooks's Voice Memos transcription function does not work

My Voice Memos app on MacBook transcription function does not work. However, it works when the sound file is re-saved. It works well after I edited the file a little bit. Macにもボイスメモというアプリがあり、録音すると書き起こしをしてくれ…

canvasにvideoをコピーする時、左右反転させる

this.ctx.save(); // 現在の状態を保存 // 左右反転(X軸を-1倍)、原点を右端に移動 this.ctx.scale(-1, 1); this.ctx.drawImage( video, -this.canvas.width, // 反転時は負の位置に描画する必要あり 0, this.canvas.width, this.canvas.height ); this.ct…

cacheがどうしても消えない

ウェブアプリ開発しててキャッシュが消えなかった。 PWAを使ったことがあったのが多分原因 該当するタグなどを消してもダメで困ってた。 以下をやったら消えた。 -- PWAや一部のサイトでは、Service Worker がキャッシュしてる場合がある → chrome://service…

typescript+webpackからp5.svg.jsを使う

p5 editorでは使えた。 しかしtypescript+webpackとp5.svg.jsが使えなかった。 スコープの違い CDN/タグ読み込み グローバルスコープ グローバルに関数を直接呼び出せる npm/webpack ローカルスコープ インポートしたオブジェクト経由で関数を呼び出す 基本…

"FOOTER"