Skip to content
This repository has been archived by the owner on Jul 17, 2021. It is now read-only.

Commit

Permalink
情人节表白程序 v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
maicong committed Aug 7, 2015
1 parent b403b8a commit 514aaa3
Show file tree
Hide file tree
Showing 84 changed files with 3,567 additions and 2 deletions.
54 changes: 52 additions & 2 deletions README.md
@@ -1,2 +1,52 @@
# qiugouda
分享一款带自动生成的表白程序源代码
# 情人节表白程序 - Qiugouda_Love

麦葱已将源码已发布到 Github,喜欢的可以 `Star``Fork` 本源码。

原文地址:[《分享一款带自动生成的表白程序源代码》](http://www.yuxiaoxi.com/2014-02-17-to-love-source-code.html)

在线演示:[http://www.qiugouda.com/love/](http://www.qiugouda.com/love/)

##模版文件列表

```
/2014
/css
/css/all.min.css
/fonts
/fonts/RuiHeiXiTi.otf
/img
/img/***.jpg
/img/***.gif
/js
/js/all.min.js
/js/audio.min.js
/js/brav1toolbox.js
/js/flowtime.js
/js/love.min.js
/js/love.src.js
/music
/music/saveme.mp3
/music/lovebgm.mp3
index.php
love.php
loveNote.txt
loveTpl.html
```

`/2014` 用于存放生成的静态页面,若更改,请同时修改 `love.php` 里的路径
`/js/love.min.js` 字段获取js压缩文件, `/js/love.src.js` 是未压缩的
`love.php` 核心处理文件,`love.min.js` 传参给此文件处理并生成相应静态页面
`loveNote.txt` 数据记录
`loveTpl.html` 页面模版文件,`love.php` 生成的页面以此文件为模版

##程序运行原理

给页面文字添加span标签,设置 `id="text-xx"` 唯一属性,使用 `contenteditable="true"`,开启该元素的编辑模式,用jQuery属性 `.click()` 判断点击,用 `.text()` 返回此元素的文本内容,并用正则进行判断内容是否合法,然后通过AJAX POST给php处理,php对传入的参数进行过滤,然后读取模版文件,替换模版文件对应内容,保存为新文件并记录操作,最后返回数据给前端,前端处理数据并更新页面。

##使用说明

[点击下载稳定版本](https://github.com/maicong/music/releases) 并解压到网站目录,通过 `http://你的域名/指定目录` 进行访问,如果放在根目录,直接访问绑定域名就行。

```
注:这是一个自动生成表白页面的程序,模版由 `jianghongfei.com.cn` 原创,`麦葱(www.yuxiaoxi.com)` 做二次开发,仅限娱乐,不得用于商业用途!
```
5 changes: 5 additions & 0 deletions css/all.min.css

Large diffs are not rendered by default.

Binary file added fonts/RuiHeiXiTi.otf
Binary file not shown.
Binary file added img/14915.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/319280.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/319280_bg.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali0.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali10.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali11.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali12.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali14.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali16.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali18.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali19.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali2.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali20.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali21.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali22.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali22_bg.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali24.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali25.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali29.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali2_bg.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali3.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali30_1.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali30_2.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali31.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali32.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/iali35.jpg
Binary file added img/iali37.jpg
Binary file added img/iali4.jpg
Binary file added img/iali40.jpg
Binary file added img/iali40_bg.jpg
Binary file added img/iali42.jpg
Binary file added img/iali44.jpg
Binary file added img/iali45.jpg
Binary file added img/iali45_bg.jpg
Binary file added img/iali46.jpg
Binary file added img/iali49.jpg
Binary file added img/iali5.jpg
Binary file added img/iali50_1.jpg
Binary file added img/iali50_2.jpg
Binary file added img/iali51.jpg
Binary file added img/iali52.jpg
Binary file added img/iali53.jpg
Binary file added img/iali57.gif
Binary file added img/iali57.jpg
Binary file added img/iali58.jpg
Binary file added img/iali59.png
Binary file added img/iali59_bg.jpg
Binary file added img/iali6.jpg
Binary file added img/iali60.jpg
Binary file added img/iali62.jpg
Binary file added img/iali63.jpg
Binary file added img/iali64.jpg
Binary file added img/iali65.jpg
Binary file added img/iali66.jpg
Binary file added img/iali67.jpg
Binary file added img/iali68.jpg
Binary file added img/iali69.jpg
Binary file added img/iali71.jpg
Binary file added img/iali75.jpg
Binary file added img/iali75_bg.jpg
Binary file added img/iali76.gif
Binary file added img/iali76_bg.png
Binary file added img/iali77.jpg
Binary file added img/iali8.gif
Binary file added img/iali8_bg.png
Binary file added img/iali9.jpg
318 changes: 318 additions & 0 deletions img/index.php

Large diffs are not rendered by default.

Binary file added img/loading.gif
318 changes: 318 additions & 0 deletions index.php

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions js/all.min.js

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions js/audio.min.js

Large diffs are not rendered by default.

201 changes: 201 additions & 0 deletions js/brav1toolbox.js
@@ -0,0 +1,201 @@
/*!
* Brav1Toolbox.js - common utility scripts and polyfills
* http://marcolago.com/
* MIT licensed
*
* Copyright (C) 2012-2013 Marco Lago, http://marcolago.com
*/
var Brav1Toolbox = (function()
{
var cssPrefixes = ["", "-webkit-", "-moz-", "-ms-", "-o-"];
var styleObject;

/**
* cache a Style Collection Object for future use
*/
if (window.getComputedStyle)
{
styleObject = window.getComputedStyle(document.body);
}
else
{
styleObject = document.documentElement.style;
}

/**
* shortcut to add a listener for modern browsers and IE8-
*/
function _addListener(element, type, handler, useCapture)
{
if (element.addEventListener)
{
element.addEventListener(type, handler, useCapture);
}
else if (element.attachEvent)
{
element.attachEvent(type, handler);
}
}

/**
* checks if a CSS property is supported
* including the prefixed ones
*/
function _testCSS(prop)
{
return _getPrefixed(prop) != "";
}

/**
* returns the standard or the prefixed CSS property
* use: element[Brav1Toolbox.getPrefixed(CSSProperty)];
*/
function _getPrefixed(prop)
{
for (var i = 0; i < cssPrefixes.length; i++)
{
var pre = cssPrefixes[i].replace(/-/g, "");
var p = prop;
if (pre.length > 0)
{
p = p.charAt(0).toUpperCase() + p.substr(1);
}
p = pre + p;
if (p in styleObject == true)
{
return p;
}
}
return "";
}

/**
* returns the type of the object passed
*/
function _typeOf(obj)
{
return !!obj && Object.prototype.toString.call(obj).match(/(\w+)\]/)[1];
}

/**
* classList API polyfill
*/

/**
* adds the specified class to the specified element
*/
function _addClass(el, c)
{
if (el.classList)
{
el.classList.add(c);
}
else
{
if (_hasClass(el, c) == false)
{
var cl = el.className;
if (cl.length > 0)
{
cl += " ";
}
el.className = cl + c;
}
}
}

/**
* removes the specified class from the specified element
*/
function _removeClass(el, c)
{
if (el.classList)
{
el.classList.remove(c);
}
else
{
var cl = el.className;
if (cl.indexOf(c) != -1)
{
if (cl.indexOf(" " + c) != -1)
{
cl = cl.replace(" " + c, "");
}
else if (cl.indexOf(c + " ") != -1)
{
cl = cl.replace(c + " ", "");
}
else
{
cl = cl.replace(c, "");
}
}
el.className = cl;
}
}

/**
* checks if the specified class is assigned to the specified element
*/
function _hasClass(el, c)
{
if (el)
{
if (el.classList)
{
return el.classList.contains(c);
}
else if (el.className)
{
return el.className.indexOf(c) != -1;
}
}
return false;
}

/**
* creates and dispatch a custom event
*/
function _dispatchEvent(t, ps)
{
if (document.createEvent)
{
var e = document.createEvent( "HTMLEvents");
e.initEvent(t, true, true);
for (var p in ps)
{
e[p] = ps[p];
}
document.dispatchEvent(e);
}
}

/**
* returns the absolute distance from two points
*/
function _distance(pA, pB)
{
var cX;
var cY;
cX = pB.x - pA.x;
cX *= cX;
cY = pB.y - pA.y;
cY *= cY;

return Math.abs(Math.sqrt( cX + cY ));
}

return {
addListener: _addListener,
dispatchEvent: _dispatchEvent,
testCSS: _testCSS,
getPrefixed: _getPrefixed,
typeOf: _typeOf,
addClass: _addClass,
removeClass: _removeClass,
hasClass: _hasClass,
distance: _distance
}
})();

0 comments on commit 514aaa3

Please sign in to comment.