Commit b1af4f40 authored by amonsiri unkham's avatar amonsiri unkham

week05

parent 9bbce2b9
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<style>
body {
background-color: #9999ff;
}
</style>
</style>
<style media="screen">
ol{
color:red;
}
</style>
<style type="text/css">
h1{
text-align: center;
margin: auto;
font-size: 48px;
width: 400px;
}
.img {
margin-top: 40px;
text-align: center;
}
.img img {
margin: auto;
width: 300px;
height: 300px;
background: #333;
border-radius: 50%;
}
.text {
background: #fff;
-webkit-box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.75);
box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.75);
width: 300px;
margin: auto;
text-align: center;
margin-top: 50px;
}
</style>
</head>
<body>
<h1 style="color:blue;">สวัสดี ชาวโลก!</h1>
<div class="img">
<img src="1.png" alt="" width="400" height="400">
</div>
<div class="text">
<h2 style="background-color:DodgerBlue;"> เราใช้ </h2>
<ol>
<li>node เวอร์ชั่น <script>document.write(process.versions.node)</script></li>
<li>Chrome เวอร์ชัน <script>document.write(process.versions.chrome)</script></li>
<li>และ Electron เวอร์ชัน <script>document.write(process.versions.electron)</script></li>
</ol>
</body>
</html>
const {app, BrowserWindow} = require('electron')
const path = require('path')
const url = require('url')
let win
//เรียกอ๊อฟเจ็ควินโดร
function createWindow () {
win = new BrowserWindow({width: 800, height: 600})
win.loadURL(url.format({
pathname: path.join(__dirname, 'index.html'),
protocol: 'file:',
slashes: true
}))
win.webContents.openDevTools()
//ให้อีเว้นอะไร
win.on('closed', () => {
win = null
})
}
app.on('ready', createWindow)
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
if (win === null) {
createWindow()
}
})
This diff is collapsed.
{
"name": "windowapp",
"version": "1.0.0",
"description": "ขอคะแนน",
"main": "main.js",
"scripts": {
"app": "./node_modules/electron/dist/electron ." ,
"อัตราย": "rm -rf *",
"echo": "echo สวัสดี",
"touch": "touch สวัสดี",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "amonsiri",
"license": "ISC",
"devDependencies": {
"electron": "^1.8.2"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment