Atomのウィンドウが勝手にぴょんぴょんなって癒されるやつができたぞ!!!
# init.coffee do -> process = null updateTime = 16 gravity = 20 time = 0 x_speed = 10 atom.commands.add 'atom-workspace', 'pyonpyon:start', -> win = atom.getWindowDimensions() y_max = screen.availHeight - win.height x_max = screen.availLeft + screen.availWidth - win.width process = setInterval -> win.y = Math.floor(Math.sqrt(2.00 * gravity * y_max) * time - 0.5 * gravity * time * time) win.x += x_speed if win.y > y_max win.y = y_max else if win.y < 0 win.y = 0 time = 0 if win.x > x_max win.x = x_max x_speed = - x_speed else if win.x < screen.availLeft win.x = screen.availLeft x_speed = - x_speed atom.setPosition(win.x, screen.availHeight - win.y - win.height) time += updateTime / 50 , updateTime atom.commands.add 'atom-workspace', 'pyonpyon:stop', -> clearInterval(process) time = 0
コマンドパレットからpyonpyon:start
を実行するとぴょんぴょんなって癒やされる。
止めるにはpyonpyon:stop
を実行する。
- 参考資料1: Vimのウィンドウが勝手にびよんびよんなってたのしいやつ
- 参考資料2: Emacsのウィンドウが勝手にびよんびよんなってたのしいやつ
- 参考資料3: あぁ^~Vimがぴょんぴょんするんじゃぁ^~
心ぴょんぴょんしたい時に便利です。
疲れた!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
— 素材感じる (@nekokawaee) September 6, 2015