From 7648789019fee8f433a3cec0bdfc3a4506108f12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B2=9D=E6=96=AF=E9=84=A7=E4=B8=8D=E5=88=A9=E5=A4=9A?= Date: Mon, 24 Feb 2020 15:38:28 +0800 Subject: [PATCH] =?UTF-8?q?HRB-3334=20=E5=8A=A0=E4=B8=8A=E7=AF=84=E4=BE=8B?= =?UTF-8?q?=E9=A0=81=E9=9D=A2(Web&Mobile)=E5=85=B1=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/README.md | 9 ++++ demo/app.js | 14 ++++++ demo/package.json | 27 +++++++++++ demo/public/css/demo.css | 35 ++++++++++++++ demo/{ => public/css}/index.css | 0 demo/public/demo.html | 49 ++++++++++++++++++++ {doc => demo/public}/images/button.png | Bin {doc => demo/public}/images/color.png | Bin {doc => demo/public}/images/data.png | Bin {doc => demo/public}/images/image.png | Bin {doc => demo/public}/images/prize.png | Bin {doc => demo/public}/images/theme-dark.png | Bin {doc => demo/public}/images/theme-light.png | Bin {doc => demo/public}/images/turntable.png | Bin demo/{ => public}/index.html | 4 +- package.json | 3 +- 16 files changed, 137 insertions(+), 4 deletions(-) create mode 100644 demo/README.md create mode 100644 demo/app.js create mode 100644 demo/package.json create mode 100644 demo/public/css/demo.css rename demo/{ => public/css}/index.css (100%) create mode 100644 demo/public/demo.html rename {doc => demo/public}/images/button.png (100%) rename {doc => demo/public}/images/color.png (100%) rename {doc => demo/public}/images/data.png (100%) rename {doc => demo/public}/images/image.png (100%) rename {doc => demo/public}/images/prize.png (100%) rename {doc => demo/public}/images/theme-dark.png (100%) rename {doc => demo/public}/images/theme-light.png (100%) rename {doc => demo/public}/images/turntable.png (100%) rename demo/{ => public}/index.html (98%) diff --git a/demo/README.md b/demo/README.md new file mode 100644 index 0000000..1e48bbe --- /dev/null +++ b/demo/README.md @@ -0,0 +1,9 @@ +# 根目錄 yarn install && npm run build 產生 dist/lottery-wheel.min.js + +# 到 demo yarn install && npm run start + +# demo 頁面為 localhost:3000/demo.html (RWD) + +# 其他使用範例為 localhost:3000/index.html + +# 更多詳細使用方式請參考 [https://github.com/fralonra/lottery-wheel] \ No newline at end of file diff --git a/demo/app.js b/demo/app.js new file mode 100644 index 0000000..bc30b79 --- /dev/null +++ b/demo/app.js @@ -0,0 +1,14 @@ +'use strict' +const express = require('express') +// create Express app +const app = express() + +app.use(express.static(__dirname + '/public')); + +app.get('/test', (req, res) => res.end('I\'m listening. Please access with static.')) + +// listen on port +const port = process.env.PORT || 3000 +app.listen(port, () => { + console.log(`listening on ${port}`) +}) diff --git a/demo/package.json b/demo/package.json new file mode 100644 index 0000000..f5b9960 --- /dev/null +++ b/demo/package.json @@ -0,0 +1,27 @@ +{ + "name": "h2u-lottery", + "version": "0.0.0", + "description": "H2U HRB Lottery", + "engines": { + "node": "10.x" + }, + "main": "app.js", + "scripts": { + "start": "cp ../dist/lottery-wheel.min.js public/js && node app.js", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "dependencies": { + "@line/bot-sdk": "^6.8.4", + "express": "^4.17.1", + "node-fetch": "^2.6.0" + }, + "devDependencies": { + "eslint": "^6.8.0", + "eslint-config-standard": "^14.1.0", + "eslint-plugin-import": "^2.19.1", + "eslint-plugin-node": "^11.0.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1" + } + } + \ No newline at end of file diff --git a/demo/public/css/demo.css b/demo/public/css/demo.css new file mode 100644 index 0000000..f7694a7 --- /dev/null +++ b/demo/public/css/demo.css @@ -0,0 +1,35 @@ +* { + box-sizing: border-box; + outline: 0; + text-decoration: none; + word-wrap: break-word; +} +html { + font-size: 100%; + line-height: 1.5; +} +body { + margin: 0; + padding: 0; + overflow-x: hidden; +} +section { + color: #FFF; + text-align: center; + background-color: #358CA7; + width: 100%; + margin-bottom: 0.5rem; +} +.main { + display: flex; + flex-flow: column; + align-items: center; + width: 100%; + padding: 1rem; + background: #f5f5f5; +} +.showcase { + flex: 1 1 auto; + justify-content: center; + padding: 0.75rem; +} diff --git a/demo/index.css b/demo/public/css/index.css similarity index 100% rename from demo/index.css rename to demo/public/css/index.css diff --git a/demo/public/demo.html b/demo/public/demo.html new file mode 100644 index 0000000..f4878a7 --- /dev/null +++ b/demo/public/demo.html @@ -0,0 +1,49 @@ + + + + + + Lottery Wheel + + + + +
+
+

H2U轉轉樂

+
+
+ +
+
+ + + diff --git a/doc/images/button.png b/demo/public/images/button.png similarity index 100% rename from doc/images/button.png rename to demo/public/images/button.png diff --git a/doc/images/color.png b/demo/public/images/color.png similarity index 100% rename from doc/images/color.png rename to demo/public/images/color.png diff --git a/doc/images/data.png b/demo/public/images/data.png similarity index 100% rename from doc/images/data.png rename to demo/public/images/data.png diff --git a/doc/images/image.png b/demo/public/images/image.png similarity index 100% rename from doc/images/image.png rename to demo/public/images/image.png diff --git a/doc/images/prize.png b/demo/public/images/prize.png similarity index 100% rename from doc/images/prize.png rename to demo/public/images/prize.png diff --git a/doc/images/theme-dark.png b/demo/public/images/theme-dark.png similarity index 100% rename from doc/images/theme-dark.png rename to demo/public/images/theme-dark.png diff --git a/doc/images/theme-light.png b/demo/public/images/theme-light.png similarity index 100% rename from doc/images/theme-light.png rename to demo/public/images/theme-light.png diff --git a/doc/images/turntable.png b/demo/public/images/turntable.png similarity index 100% rename from doc/images/turntable.png rename to demo/public/images/turntable.png diff --git a/demo/index.html b/demo/public/index.html similarity index 98% rename from demo/index.html rename to demo/public/index.html index ec414a9..3a352b3 100644 --- a/demo/index.html +++ b/demo/public/index.html @@ -4,11 +4,11 @@ Lottery Wheel - + - +
diff --git a/package.json b/package.json index b4cd9c2..9616360 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,7 @@ "build": "rollup -c rollup.config.js", "lint": "standard --fix src/*.js", "prepare": "npm run build", - "test": "npm run lint", - "start": "node src/index.js" + "test": "npm run lint" }, "repository": { "type": "git", -- 2.26.2