This repository has been archived by the owner on Jul 17, 2021. It is now read-only.
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
Showing
84 changed files
with
3,567 additions
and
2 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 |
---|---|---|
@@ -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)` 做二次开发,仅限娱乐,不得用于商业用途! | ||
``` |
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,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 | ||
} | ||
})(); | ||
|
Oops, something went wrong.