forked from iammapping/wedding
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b0786a0
Showing
124 changed files
with
8,907 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
################################################ | ||
############### .gitignore ################## | ||
################################################ | ||
# | ||
# This file is only relevant if you are using git. | ||
# | ||
# Files which match the splat patterns below will | ||
# be ignored by git. This keeps random crap and | ||
# and sensitive credentials from being uploaded to | ||
# your repository. It allows you to configure your | ||
# app for your machine without accidentally | ||
# committing settings which will smash the local | ||
# settings of other developers on your team. | ||
# | ||
# Some reasonable defaults are included below, | ||
# but, of course, you should modify/extend/prune | ||
# to fit your needs! | ||
################################################ | ||
|
||
|
||
|
||
|
||
################################################ | ||
# Local Configuration | ||
# | ||
# Explicitly ignore files which contain: | ||
# | ||
# 1. Sensitive information you'd rather not push to | ||
# your git repository. | ||
# e.g., your personal API keys or passwords. | ||
# | ||
# 2. Environment-specific configuration | ||
# Basically, anything that would be annoying | ||
# to have to change every time you do a | ||
# `git pull` | ||
# e.g., your local development database, or | ||
# the S3 bucket you're using for file uploads | ||
# development. | ||
# | ||
################################################ | ||
|
||
config/local.js | ||
|
||
|
||
|
||
|
||
|
||
################################################ | ||
# Dependencies | ||
# | ||
# When releasing a production app, you may | ||
# consider including your node_modules and | ||
# bower_components directory in your git repo, | ||
# but during development, its best to exclude it, | ||
# since different developers may be working on | ||
# different kernels, where dependencies would | ||
# need to be recompiled anyway. | ||
# | ||
# More on that here about node_modules dir: | ||
# http://www.futurealoof.com/posts/nodemodules-in-git.html | ||
# (credit Mikeal Rogers, @mikeal) | ||
# | ||
# About bower_components dir, you can see this: | ||
# http://addyosmani.com/blog/checking-in-front-end-dependencies/ | ||
# (credit Addy Osmani, @addyosmani) | ||
# | ||
################################################ | ||
|
||
node_modules | ||
bower_components | ||
|
||
|
||
|
||
|
||
################################################ | ||
# Sails.js / Waterline / Grunt | ||
# | ||
# Files generated by Sails and Grunt, or related | ||
# tasks and adapters. | ||
################################################ | ||
.tmp | ||
dump.rdb | ||
|
||
|
||
|
||
|
||
|
||
################################################ | ||
# Node.js / NPM | ||
# | ||
# Common files generated by Node, NPM, and the | ||
# related ecosystem. | ||
################################################ | ||
lib-cov | ||
*.seed | ||
*.log | ||
*.out | ||
*.pid | ||
npm-debug.log | ||
|
||
|
||
|
||
|
||
|
||
################################################ | ||
# Miscellaneous | ||
# | ||
# Common files generated by text editors, | ||
# operating systems, file systems, etc. | ||
################################################ | ||
|
||
*~ | ||
*# | ||
.DS_STORE | ||
.netbeans | ||
nbproject | ||
.idea | ||
.node_history |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"generators": { | ||
"modules": {} | ||
}, | ||
"hooks": { | ||
"orm": false, | ||
"pubsub": false | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/** | ||
* Gruntfile | ||
* | ||
* This Node script is executed when you run `grunt` or `sails lift`. | ||
* It's purpose is to load the Grunt tasks in your project's `tasks` | ||
* folder, and allow you to add and remove tasks as you see fit. | ||
* For more information on how this works, check out the `README.md` | ||
* file that was generated in your `tasks` folder. | ||
* | ||
* WARNING: | ||
* Unless you know what you're doing, you shouldn't change this file. | ||
* Check out the `tasks` directory instead. | ||
*/ | ||
|
||
module.exports = function(grunt) { | ||
|
||
|
||
// Load the include-all library in order to require all of our grunt | ||
// configurations and task registrations dynamically. | ||
var includeAll; | ||
try { | ||
includeAll = require('include-all'); | ||
} catch (e0) { | ||
try { | ||
includeAll = require('sails/node_modules/include-all'); | ||
} | ||
catch(e1) { | ||
console.error('Could not find `include-all` module.'); | ||
console.error('Skipping grunt tasks...'); | ||
console.error('To fix this, please run:'); | ||
console.error('npm install include-all --save`'); | ||
console.error(); | ||
|
||
grunt.registerTask('default', []); | ||
return; | ||
} | ||
} | ||
|
||
|
||
/** | ||
* Loads Grunt configuration modules from the specified | ||
* relative path. These modules should export a function | ||
* that, when run, should either load/configure or register | ||
* a Grunt task. | ||
*/ | ||
function loadTasks(relPath) { | ||
return includeAll({ | ||
dirname: require('path').resolve(__dirname, relPath), | ||
filter: /(.+)\.js$/ | ||
}) || {}; | ||
} | ||
|
||
/** | ||
* Invokes the function from a Grunt configuration module with | ||
* a single argument - the `grunt` object. | ||
*/ | ||
function invokeConfigFn(tasks) { | ||
for (var taskName in tasks) { | ||
if (tasks.hasOwnProperty(taskName)) { | ||
tasks[taskName](grunt); | ||
} | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
// Load task functions | ||
var taskConfigurations = loadTasks('./tasks/config'), | ||
registerDefinitions = loadTasks('./tasks/register'); | ||
|
||
// (ensure that a default task exists) | ||
if (!registerDefinitions.default) { | ||
registerDefinitions.default = function (grunt) { grunt.registerTask('default', []); }; | ||
} | ||
|
||
// Run task functions to configure Grunt. | ||
invokeConfigFn(taskConfigurations); | ||
invokeConfigFn(registerDefinitions); | ||
|
||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Copyright 2017 iammapping | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
# 婚礼互动,让你们的婚礼飞起来 | ||
|
||
## 缘起 | ||
|
||
这个项目就是在我婚礼前一个月左右,心血来潮,想在婚礼上搞点事情,给大家留个深刻的印象。最终婚礼上的反响还不错,近期想着与其让这个项目尘封,倒不如开源出来,祝愿所有的 forker 有情人终成眷属。 | ||
|
||
## 介绍 | ||
|
||
项目分为微信端和大屏端。微信端可以作为电子请柬提前分享给大家,部署的服务器域名最好有备案,不然容易被屏蔽。大屏端是放在婚礼现场的大屏幕上,现场的宾客可以刷弹幕上墙,并且有照片播放页,迎宾页,抽奖页面。另外微信端也作为现场互动的入口,扫码签到可参与抽奖,发弹幕送祝福上大屏幕。 | ||
|
||
## 安装 | ||
|
||
下载本项目 | ||
|
||
``` | ||
> git clone https://github.com/iammapping/wedding | ||
``` | ||
|
||
到项目根目录初始化:`npm install` | ||
|
||
安装 sails | ||
|
||
``` | ||
> npm install sails -g | ||
``` | ||
|
||
启动:`sails lift`,生产环境加上 `--prod` 参数。 | ||
|
||
## 配置 | ||
|
||
**配置微信公众号** | ||
|
||
```json | ||
> vi config/weixin.js | ||
module.exports.weixin = { | ||
// 微信公众号相关设置 | ||
appid: 'xxx', | ||
secret: 'xxx', | ||
redirectUri: 'http://xxx' | ||
}; | ||
``` | ||
|
||
**配置数据库** | ||
|
||
导入表结构 | ||
|
||
``` | ||
mysql> create database wedding; | ||
mysql> source wedding.sql; | ||
``` | ||
|
||
修改连接参数(使用 Sequelize 替代了 Sails 框架中默认的 Waterline) | ||
|
||
```json | ||
> vi config/connections.js | ||
sequelizeServer: { | ||
user: 'xxx', | ||
password: 'xxx', | ||
database: 'wedding', | ||
options: { | ||
dialect: 'mysql', | ||
dialectOptions: { | ||
charset: 'utf8mb4' | ||
}, | ||
host: '127.0.0.1', | ||
port: 3306, | ||
logging: true, | ||
timezone: "+08:00", | ||
} | ||
} | ||
``` | ||
|
||
|
||
**修改图片素材** | ||
|
||
微信端在 `views/homepage.ejs` 中修改,公告也在此文件修改 | ||
```html | ||
<img class="disable-tilt" src="/images/1-740.jpg" data-width="1500" data-height="1000" data-center-offset="740" /> | ||
``` | ||
|
||
* data-width:图片宽度 | ||
* data-height:图片高度 | ||
* data-center-offset:图片主题中线x轴位置 | ||
|
||
|
||
|
||
|
||
大屏端在 `assets/styles/wall.css` 中修改 | ||
```css | ||
#slide1 { | ||
background-image: url(/images/1-740.jpg); | ||
} | ||
``` | ||
|
||
**修改背景音乐** | ||
|
||
在 `assets/js/home.js` 中修改 | ||
```javascript | ||
PM.bgm = new PM.BGM($('#bgm-audio'), { | ||
src: '/audios/pm_bgm2.mp3', | ||
autoplay: false | ||
}); | ||
``` | ||
|
||
|
||
**修改地图位置** | ||
|
||
在 `assets/js/pm.js` 中修改 | ||
```javascript | ||
var map = new AMap.Map('pnl-map',{ | ||
zoom: 17, | ||
center: [115.977634, 29.709759] | ||
}); | ||
var marker = new AMap.Marker({ | ||
position: map.getCenter() | ||
}); | ||
marker.setMap(map); | ||
|
||
// 设置label标签 | ||
marker.setLabel({ | ||
offset: new AMap.Pixel(-75, -30), | ||
content: "PM Infinity婚礼于10月5日晚" | ||
}); | ||
``` | ||
|
||
`center` 修改中心坐标,`content` 修改坐标说明的文字 | ||
|
||
|
||
## 致谢 | ||
|
||
感谢媳妇的支持,感谢大家的祝福。 | ||
|
||
感谢项目中使用的所有开源项目和服务: | ||
|
||
* Mysql、Nodejs、Sails、Sequelize、Bluebird | ||
* WeUI、jQuery、jquery.fullPage、slick、CommentCoreLibrary(CCL弹幕)、高德地图、iconfront | ||
|
||
|
||
## License | ||
|
||
Copyright 2017 iammapping | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
|
Empty file.
Oops, something went wrong.