diff --git a/demo/README.md b/demo/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1e48bbec8a6d52bf3ac8b23ff5c08e70b724ac2d --- /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 0000000000000000000000000000000000000000..bc30b7914893b1f1b8a6cfb970aa0e524ef26af7 --- /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 0000000000000000000000000000000000000000..f5b9960ee96f97befe8bbcf86cce40bafbe82a23 --- /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 0000000000000000000000000000000000000000..f7694a7e33304df647dc463d39bdcd5e91bce108 --- /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 0000000000000000000000000000000000000000..f4878a7f629ec6399e9ab32d7a8f99141a59f271 --- /dev/null +++ b/demo/public/demo.html @@ -0,0 +1,49 @@ + + +
+ + +