Coder Social home page Coder Social logo

lottery-2016's Introduction

芒果TV 2016 年会抽奖


声明: 该代码使用nodejs, coffee, sqlite3 运行于linux, mac. 该代码没有经过window测试. 不对任何windows平台bug进行修复.

该代码实际跑12米 * 5 米在屏幕上,分辨率为1080P(1920 * 1080)

该程序已完工.完工日期大概为2016.2.1 [补充实际完成于2.2]

GO! GO! Go!

Prepare

  1. 安装coffee和node-dev
npm install -g coffee-script
  1. 准备员工照片. 尺寸为300 * 300, 文件名格式为 "工号_姓名.png" 如 "001_张三.jpg"(jpg或png都可以).这个用来初始话员工数据库.放在同一个文件夹下.

Download & Run

  1. clone 本仓库或者下载源码解压得到文件夹 lottery-2016

  2. 找到文件 config.coffee

修改配置

config =
  ...
  ...
  img_source: '/home/ec/document/2016'
  ...

img_source 使用绝对路径指向员工照片的文件.

  1. 找到文件init-data.coffee

取消最后三行注释后运行:(注意:以下命令均在项目文件夹下进行)

coffee init-data.coffee

进行数据初始化.初始化完成后将会在项目目录下出现db.sqlite这个就是数据库了.需要重复测试抽奖可以备份该文件,进行覆盖即可.

  1. 运行
npm start

打开浏览器

http://localhost:3000

然后进行抽奖设置,和奖品设置即可.

如果抽奖需要混合奖品(非单一)可以根据数据库将奖品命名为:

 mix_(奖品数据库id-名称-数量)_(奖品数据库id-名称-数量)_...

例如:

mix_(28-温情家庭礼包-10)_(29-富士拍立得-10)_(30-芒果小觅-10)

Thanks

DONATE

支付宝 [email protected]

LICENSE

MIT

lottery-2016's People

Contributors

huyinghuan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.