-
-
Save HAYASAKA-Ryosuke/f5ce6d9f743067e64c59 to your computer and use it in GitHub Desktop.
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
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>ラーメンタイマ</title> | |
<style> | |
body { | |
-webkit-app-region: drag; | |
-webkit-user-select: none; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="notification"></div> | |
<div id="complete"></div> | |
<h1><div id="output"></div></h1> | |
</body> | |
<script src="ramen.js"></script> | |
</html> |
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
'use strict'; | |
var app = require('app'); | |
var BrowserWindow = require('browser-window'); | |
require('crash-reporter').start(); | |
var mainWindow = null; | |
app.on('window-all-closed', function(){ | |
if(process.platform != 'darwin'){ | |
app.quit(); | |
} | |
}); | |
app.on('ready', function(){ | |
mainWindow = new BrowserWindow({width: 120, height: 80, transparent: true, frame: false}); | |
mainWindow.loadUrl('file://' + __dirname + '/index.html'); | |
mainWindow.on('closed', function(){ | |
mainWindow = null; | |
}); | |
}); |
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
{ | |
"name": "ramentimer", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC" | |
} |
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
"use strict"; | |
function complete_notification() { | |
var n = new Notification('Electron!!', { | |
body: '3分経ちました!' | |
}); | |
} | |
var i = 180; //3分固定 | |
function count(){ | |
if(i <= 0){ | |
document.getElementById("output").innerHTML = "完成!"; | |
document.getElementById("complete").innerHTML = "<audio src='./media/complete.mp3' autoplay loop></audio>" | |
complete_notification(); | |
}else{ | |
document.getElementById("output").innerHTML = i + "s"; | |
} | |
i -= 1; | |
} | |
window.onload = function(){ | |
setInterval("count()", 1000); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment