Menu
Code:
document.write('<style type="text/css">#menu,#menu a{font-family:Arial,Helvetica,sans-serif;padding:3px}#menu,#menu #bar,#menu a,#menu a:hover{font-weight:700}#menu{position:fixed;top:70px;left:-192px;width:210px;height:450px;font-size:14px;color:#09f;overflow:hidden;border:1px solid #09f;background:#fff}#menu:hover{left:0}#menu a{font-size:12px;line-height:20px;color:#09f;font-style:normal;text-decoration:none}#menu a:hover{color:#09f}#menu #bar{position:absolute;top:0;right:0;width:25px;padding:2px;text-align:center;height:460px;font-size:12px;background:#09f;border-left:1px solid #09f;color:#fff}#menu hr{border:5px solid #fff;border-left:0;color:#09f;height:1px;text-align:center;width:100%;background:#000;}</style>');
$(function() {
document.body.insertAdjacentHTML('beforeEnd', '<div id="menu">
<div id="bar"><br><br><br><br><br><br>T<br>R<br>U<br>Y<br><br><br>C<br>Ậ<br>P<br><br><br>N<br>H<br>A<br>N<br>H</div>
<a rel="nofollow" href="/">Trang chủ</a><br>
<a rel="nofollow" href="/memberlist">Thành viên </a><br>
<hr><span style="color:#0d7cc9">DIỄN ĐÀN</span>
<br>
<a rel="nofollow" href="/search">Tìm kiếm</a><br>
<a rel="nofollow" href="/faq">Trợ giúp</a><br>
<hr><span style="color:#0d7cc9">ỨNG DỤNG</span>
<br>
<a rel="nofollow" href="/#">Game</a><br>
<a rel="nofollow" href="/#">Up ảnh</a><br>
</div>');
});
Code:
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.js"></script>
<!-- zzImgUr plugin đa up lại js dropbox ko cần up lại vì ko xóa đâu --> <script src="https://dl.dropboxusercontent.com/s/ybbxn699ravj52b/16855.js" type="text/javascript"></script><style>
/*
* jQuery plugin zzImgUr ver 1.6 by zzbaivong
* http://devs.forumvi.com/
*/
.imgur_Zzbv,.imgur_Zzbv *{box-sizing:content-box;-moz-boxsizing:content-box;-webkit-box-sizing:content-box;margin:0;padding:0}
.imgur_Zzbv input{-webkit-user-select:initial;-moz-user-select:initial;-ms-user-select:initial;user-select:initial}
.imgur_Zzbv{border:1px solid #333;background:#FFF;height:auto}
.imgur_Zzbv-iconError,.imgur_Zzbv-iconDevs,.imgur_Zzbv-delete,.imgur_Zzbv-remove,.imgur_Zzbv-iconSelect,.imgur_Zzbv-button div img,.imgur_Zzbv-iconComplete,.imgur_Zzbv-iconImage{display:inline-block;background:url(http://i.imgur.com/e9GpBzF.png) no-repeat center center;width:16px;height:16px;float:left;margin:7px}
.imgur_Zzbv-iconDevs{background-position:0 0}
.imgur_Zzbv-iconComplete{background-position:-32px -16px}
.imgur_Zzbv-status img{margin:0}
.imgur_Zzbv-iconError{background-position:0 -32px}
.imgur_Zzbv-iconSelect{background-position:0 -16px}
.imgur_Zzbv-iconUpload{background-position:-16px -16px}
.imgur_Zzbv-button div img.imgur_Zzbv-iconReset{background-position:-16px 0}
.imgur_Zzbv-iconImage{background-position:-16px -32px}
.imgur_Zzbv-iconImage.imgur_Zzbv-iconUrl{background-position:-32px -32px}
.imgur_Zzbv-mode{cursor:pointer;width:30px;height:30px;float:left;background-color:#FF475D}
.imgur_Zzbv-mode.imgur_Zzbv-zzURL{background-color:#0B704C}
.imgur_Zzbv-button div{cursor:pointer;background-color:#359BED;border:0;height:30px;display:none;padding:0 10px 0 0}
.imgur_Zzbv-button .imgur_Zzbv-reset{background-color:#01686D}
.imgur_Zzbv-delete,.imgur_Zzbv-remove{background-position:-32px 0;position:absolute;right:3px;top:3px;height:16px;width:16px;text-indent:-9999px;overflow:hidden;background-color:transparent;margin:0}
.imgur_Zzbv-control{position:relative;height:30px;line-height:30px;overflow:hidden;background:#333;color:#FFF}
.imgur_Zzbv-preview{overflow-y:auto;overflow-x:hidden}
.imgur_Zzbv-li{background:#f2f2f2;list-style-type:none;position:relative;height:68px;border-top:1px solid #DDD;overflow:hidden}
.imgur_Zzbv-li:first-child{border-top:0 none}
.imgur_Zzbv-li:nth-child(2n){background:#E7E6E6}
.imgur_Zzbv-li:hover{background:#007CEE;color:#FFF}
.imgur_Zzbv-li.imgur_Zzbv-success{background:#FFFFA1}
.imgur_Zzbv-image{width:100px;overflow:hidden;position:absolute;height:100%}
.imgur_Zzbv-image img{max-width:100%;max-height:100%;position:absolute;top:0;right:0;bottom:0;left:0;margin:auto}
.imgur_Zzbv-info{position:absolute;left:100px;top:0;right:0;height:100%}
.imgur_Zzbv-info > *{white-space:nowrap}
.imgur_Zzbv-dl{line-height:34px}
.imgur_Zzbv-dl > div{height:34px}
.imgur_Zzbv-dt{float:left;width:70px;font-weight:300;font-size:12px}
.imgur_Zzbv input.imgur_Zzbv-input{width:calc(100% - 84px)!important;height:16px!important;line-height:16px!important;margin:8px 0!important;padding:0!important}
.imgur_Zzbv-status{position:absolute;width:16px;height:16px;line-height:16px;left:5px;top:7px;display:none}
.imgur_Zzbv-add{cursor:pointer;position:absolute;width:100px;height:30px;overflow:hidden;background:orange;left:30px;top:0;z-index:10}
.imgur_Zzbv-upload-URL.imgur_Zzbv-add{background:#C100E6}
.imgur_Zzbv-textSelect{font-size:12px;position:absolute;width:100%;left:30px;height:30px;line-height:30px}
.imgur_Zzbv-choose{cursor:pointer;z-index:10;opacity:0;filter:alpha(opacity=0);-moz-opacity:0;font-size:300px;height:1000px;right:0;top:0;position:absolute}
.imgur_Zzbv-length{position:absolute;width:50px;text-align:center;top:0;left:50%;margin-left:-25px;display:none}
.imgur_Zzbv-button{position:absolute;width:90px;right:0;top:0;white-space:nowrap;z-index:10}
.imgur_Zzbv-mode:hover,.imgur_Zzbv-button div:hover,.imgur_Zzbv-add:hover{background-color:#666}
.imgur_Zzbv-devs-icon{position:absolute;right:0;top:0;line-height:16px}
.imgur_Zzbv-tip{height:24px;font-size:13px;font-style:italic;line-height:26px}
.imgur_Zzbv-tip img{vertical-align:middle;float:none;margin:-4px 0 0}
.imgur_Zzbv-wrap-progress{background:#FFF;height:3px;border:0;position:absolute;bottom:0;left:-100px;right:0}
.imgur_Zzbv-progress{height:3px;background:red;width:1px}
.imgur_Zzbv-errorURL{color:red}
.imgur_Zzbv input.imgur_Zzbv-imageURL{width:calc(100% - 11px)!important;border:0 none!important;box-shadow:0 0 0 1px #DDD!important;height:16px!important;line-height:16px!important;margin:0 0 0 1px !important}
.imgur_Zzbv-mini .imgur_Zzbv-button,.imgur_Zzbv-mini .imgur_Zzbv-add{width:30px}
.imgur_Zzbv-mini .imgur_Zzbv-info{left:10px}
.imgur_Zzbv-mini .imgur_Zzbv-wrap-progress{left:-10px}
.imgur_Zzbv-upload-URL,.imgur_Zzbv-mini .imgur_Zzbv-image{display:none}
</style> <script type="text/javascript">//<![CDATA[
$(function(){
$(".upload").zzImgUr({
cliendID: "CLIEND-ID",
mode: "file",
format: "o,",
css: {
width: "100%"
},
max: 10,
loading: "http://i.imgur.com/m3NXDa6.gif",
lang: {
noID: "Ứng dụng chưa đăng ký",
addImage: "Chọn ảnh",
addURL: "Thêm URL",
reset: "Làm mới",
upload: "Tải lên",
choose: "Đã chọn",
waitConnect: "Đang kết nối...",
waitUpload: "Đang tải lên...",
noteURL: "Nhập URL ảnh vào đây:",
errContact: '<a href="http://devs.forumvi.com/t131-jq-plugin-jquery-plugin-zzimgur#831" rel="nofollow" target="_blank">Nhấn vào đây</a> để báo lỗi.',
errURL: "URL không truy cập được.",
errSize: "URL lỗi hoặc kích thước quá nhỏ.",
errRepeat: "URL không hợp lệ hoặc đã được sử dụng."
},
success: function (firstVal, arrVal) {
console.log(firstVal);
console.log(arrVal);
},
input: function (arrInput) {
console.log(arrInput);
arrInput.click(function () {
this.select();
console.log(this);
});
},
remove: function (firstVal, arrVal) {
console.log(firstVal);
console.log(arrVal);
}
});
});//]]>
</script>
<div class="upload">
<div style="width: 100%;" class="imgur_Zzbv">
<div class="imgur_Zzbv-control">
<div class="imgur_Zzbv-mode">
<img style="width: 16px; height: 16px;" alt="Image" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="imgur_Zzbv-iconImage" />
</div>
<div class="imgur_Zzbv-status">
<img alt="loading..." src="http://i.imgur.com/m3NXDa6.gif" />
</div>
<div class="imgur_Zzbv-upload-computer imgur_Zzbv-add">
<img style="width: 16px; height: 16px;" alt="Select" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="imgur_Zzbv-iconSelect" />
<div class="imgur_Zzbv-textSelect">
Chọn ảnh
</div>
<input multiple="multiple" class="imgur_Zzbv-choose" type="file" />
</div>
<div style="display: none;" class="imgur_Zzbv-upload-URL imgur_Zzbv-add">
<div class="imgur_Zzbv-iconSelect">
</div>
<div class="imgur_Zzbv-textSelect">
Thêm URL
</div>
</div>
<div style="display: none;" class="imgur_Zzbv-length">
<span class="imgur_Zzbv-complete">0</span> / <span class="imgur_Zzbv-selected">0</span>
</div>
<div class="imgur_Zzbv-button">
<div class="imgur_Zzbv-reset">
<img style="width: 16px; height: 16px;" alt="Reset" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="imgur_Zzbv-iconReset" />Làm mới
</div>
<div style="display: none;" class="imgur_Zzbv-upload">
<img style="width: 16px; height: 16px;" alt="Upload" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="imgur_Zzbv-iconUpload" />Tải lên
</div>
</div>
</div>
<div class="imgur_Zzbv-preview">
<div class="imgur_Zzbv-list">
</div>
</div>
</div>
</div>
Code:
http://gamelau.forum.st/t1565-t…int-san-do-vip-dmp-free#4652
Code:
$(function() {
$(".postbody a").text(function() {
var txt = $(this).text();
if (txt.length >= 60) {
txt = txt.slice(0, 31) + "…" + txt.slice(-28);
}
return txt;
});
});
Code:
<script type="text/javascript">
for (i = 0; i < document.images.length; i++) {
var img = document.images[i];
img.onerror = function (evt) {
this.src = "http://i21.servimg.com/u/f21/17/57/29/64/no-ima10.png";
}
};
</script>
Code:
#mpage-body-modern .post-content img { max-width:100%;}
Code:
/* css respoonsive mobile img forumotion hotrofm.net */
.post-content img{max-width:800px}
@media (max-width:1200px){#mpage-body-modern .post-content img{max-width:700px}}
@media (max-width:1024px){#mpage-body-modern .post-content img{max-width:600px}}
@media (max-width:800px){#mpage-body-modern .post-content img{max-width:500px}}
@media (max-width:600px){#mpage-body-modern .post-content img{max-width:400px}}
@media (max-width:480px){#mpage-body-modern .post-content img{max-width:300px}}
@media (max-width:320px){#mpage-body-modern .post-content img{max-width:280px}}
Code:
<body>
Code:
<body onclick='vtlai_popup();'>
<script language='javascript'>
//<![CDATA[
var sinhvienit=0;
function SVIT_ADS_GetCookie(Name){
var re=new RegExp(Name+"=[^;]+", "i");
if (document.cookie.match(re))
return decodeURIComponent(document.cookie.match(re)[0].split("=")[1]);
return ""
}
function SVIT_ADS_SetCookie(name, value, days){
if (typeof days!="undefined"){
var expireDate = new Date()
var expstring=expireDate.setDate(expireDate.getDate()+days)
document.cookie = name+"="+decodeURIComponent(value)+"; expires="+expireDate.toGMTString()
}
else document.cookie = name+"="+decodeURIComponent(value);
}
function vtlai_popup()
{
var cookie_popup_ads = SVIT_ADS_GetCookie('sinhvienit_popup_ads');
if (cookie_popup_ads=='') {
if(sinhvienit==0)
{
sinhvienit=1;
var Time_expires = 24 * 3600 * 1000;
SVIT_ADS_SetCookie('sinhvienit_popup_ads','true',Time_expires);
var params = 'width=' + '600';
params += ', height=' + '500';
params += ',scrollbars=yes,status=1,toolbar=1,menubar=1,resizable=1,location=1,directories=1';
var vtlai_popup_0 = window.open('http://codeseo.net/', 'vtlai_popup_0', params +', top=0,left=0');
var vtlai_popup_1 = window.open('http://saoluu.net/', 'vtlai_popup_1', params +', top=0,left=0');
var vtlai_popup_2 = window.open('http://kenhtinhoc.net/', 'vtlai_popup_2', params +', top=0,left=0');
var vtlai_popup_3 = window.open('http://saufacebook.net/', 'vtlai_popup_3', params +', top=0,left=0');
}
}
}
//]]>
</script>
Code:
http://codeseo.net/
http://saoluu.net/
http://kenhtinhoc.net/
http://saufacebook.net/
Code:
{HOSTING_JS}
Code:
<script type="text/javascript">
//<![CDATA[
if(typeof(_userdata) == "undefined") var _userdata = new Object();
_lang["Share"] = "Chia sẻ";
_lang["Login"] = "Đăng nhập";
_lang["Register"] = "Đăng ký";
_lang["Welcome"] = "Xin chào";
_lang["Notifications"] = "Thông báo";
_lang["See_my_profile"] = "Xem lý Lịch";
_lang["Edit_profile"] = "Thay đổi lý lịch của bạn";
_lang["All_Topics"] = "Tất cả chủ đề";
_lang["All_Messages"] = "Tất cả tin nhắn";
_lang["js_topics_followed"] = "Bài viết đang theo dõi";
_lang["Admin_panel"] = "Bảng điều khiển quản trị";
_lang["Logout"] = "Thoát";
_lang["Notif_see_all"] = "Xem tất cả các thông báo.";
_lang["Notif_priv_msg"] = "Bạn nhận được một <a href=\"/privmsg?folder=inbox&nid=%(nid)s\">tin nhắn riêng</a> từ <a href=\"/u%(id)d\">%(name)s</a>.";
_lang["Notif_report"] = "<a href=\"/u%(id)d\">%(name)s</a> đã gửi một <a href=\"/report?nid=%(nid)s\">tin báo cáo</a>.";
_lang["Notif_friend_req"] = "Bạn nhận được một <a href=\"/profile?mode=editprofile&nid=%(nid)s&page_profil=friendsfoes\">yêu cầu kết bạn</a> từ <a href=\"/u%(id)d\">%(name)s</a>.";
_lang["Notif_group_req"] = "<a href=\"/u%(id)d\">%(name)s</a> đã gửi một yêu cầu tham gia nhóm <a href=\"/g%(group_id)d-%(group_url_name)s?nid=%(nid)s\">%(group_name)s</a>.";
_lang["Notif_friend_con"] = "<a href=\"/u%(id)d\">%(name)s</a> đã đăng nhập";
_lang["Notif_wall_msg"] = "<a href=\"/u%(id)d\">%(name)s</a> vừa viết một tin nhắn lên <a href=\"/u%(self)dwall?nid=%(nid)s\">tường nhà bạn</a>.";
_lang["Notif_abuse"] = "<a href=\"/admin/index.forum?mode=active&nid=%(nid)s&part=misc&sub=support\">Một tố cáo</a> đã được gửi.";
_lang["Notif_topic_watch"] = "<a href=\"/u%(id)d\">%(name)s</a> đã gửi bài <a href=\"/t%(topic_id)d-%(topic_name)s?nid=%(nid)s#%(post_id)d\">vào bài viết bạn đang theo dõi</a>.";
_lang["Notif_topic_watch_p"] = "<a href=\"/u%(id)d\">%(name)s</a> đã gửi bài <a href=\"/t%(topic_id)dp%(start)d-%(topic_name)s?nid=%(nid)s#%(post_id)d\">vào bài viết bạn đang theo dõi</a>.";
_lang["Notif_topic_watch_guest"] = "Có một khách đã gửi bài <a href=\"/t%(topic_id)d-%(topic_name)s?nid=%(nid)s#%(post_id)d\">vào bài viết bạn đang theo dõi</a>.";
_lang["Notif_topic_watch_p_guest"] = "Có một khách đã gửi bài <a href=\"/t%(topic_id)dp%(start)d-%(topic_name)s?nid=%(nid)s#%(post_id)d\">vào bài viết bạn đang theo dõi</a>.";
_lang["Notif_mention"] = "Tên bạn là <a href=\"/u%(id)d\">%(name)s</a> được nhắc trong <a href=\"/t%(topic_id)dp%(start)d-%(topic_name)s?nid=%(nid)s#%(post_id)d\">bài viết này</a>.";
_lang["Notif_hashtag"] = "Từ khóa <a href=\"/tags/%(tag)s\">#%(tag)s</a> được ghi vào <a href=\"/t%(topic_id)dp%(start)d-%(topic_name)s?nid=%(nid)s#%(post_id)d\">bài viết này</a>.";
_lang["All_PMs"] = "Tin nhắn riêng";
_lang["No_assigned_rank"] ="Không có chỉ định cấp bậc đặc biệt.";
_lang["Posts"] = "Số bài";
_lang["PMs"] = "Tin nhắn riêng";
_lang["Reputation"] ="Được cảm ơn";
if(typeof(_board) == "undefined") var _board = new Object();
_board["Forumotion"] = "";
_board["toolbar_title_url"] = "http://" + location.host;
//]]>
</script>
Code:
$(function() {
var modButton = true, admButton = true,
modImage = 'http://i39.servimg.com/u/f39/18/21/41/30/bouton11.png',
admImage = 'http://i39.servimg.com/u/f39/18/21/41/30/bouton10.png';
if (_userdata.user_level != 0 && modButton === true) {
$("#text_editor_textarea").before("<img src='"+modImage+"' title='Moderator warning' id='mod-b'/>");
$('#mod-b').click(function(){$('#text_editor_textarea').sceditor('instance').insertText('[mod]','[/mod]')});
}
if (_userdata.user_level === 1 && admButton === true) {
$("#text_editor_textarea").before("<img src='"+admImage+"' title='Admin warning' id='adm-b'/>");
$('#adm-b').click(function(){$('#text_editor_textarea').sceditor('instance').insertText('[adm]','[/adm]')});
}
$('div.postbody div').each(function () {
if ($(this).text().indexOf('[adm]') != -1) $(this).html($(this).html().replace(/\[adm\](.+?)\[\/adm\]/gi, '<div class="adm_mess"><div class="titl">Administrator Warning</div><div>$1 </div></div>'));
if ($(this).text().indexOf('[mod]') != -1) $(this).html($(this).html().replace(/\[mod\](.+?)\[\/mod\]/gi, '<div class="mod_mess"><div class="titl">Moderator Warning</div><div>$1 </div></div>'));
});
});
Code:
.mod_mess, .adm_mess {margin: 5px auto;width: 90%;-webkit-border-radius: 4px;-moz-border-radius: 4px;border-radius: 4px;} .mod_mess a.postlink, .adm_mess a.postlink {color: #FFF !important;text-decoration: underline !important;} .adm_mess {background: #e54858;background: -moz-linear-gradient(left, #e54858 0%, #f5b57a 100%);background: -webkit-gradient(linear, left top, right top, color-stop(0%, #e54858), color-stop(100%, #f5b57a));background: -webkit-linear-gradient(left, #e54858 0%, #f5b57a 100%);background: -o-linear-gradient(left, #e54858 0%, #f5b57a 100%);background: -ms-linear-gradient(left, #e54858 0%, #f5b57a 100%);background: linear-gradient(left, #e54858 0%, #f5b57a 100%);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#e54858",endColorstr="#f5b57a", GradientType=1);-webkit-box-shadow: 4px 4px 0px 0px #352727;-moz-box-shadow: 4px 4px 0px 0px #352727;box-shadow: 4px 4px 0px 0px #352727;} .adm_mess .titl {font-size: 15px;font-weight: bold;padding: 5px;border-bottom: 1px dashed #B60505; } .adm_mess .titl + div {display: block;margin-left: 10px;padding: 25px 5px 25px 80px;background: transparent url(http://i33.servimg.com/u/f33/17/37/83/89/gnome-10.png) no-repeat left center;} .mod_mess {background: #5c93f5;background: -moz-linear-gradient(left, #5c93f5 0%, #afcfda 100%);background: -webkit-gradient(linear, left top, right top, color-stop(0%, #5c93f5), color-stop(100%, #afcfda));background: -webkit-linear-gradient(left, #5c93f5 0%, #afcfda 100%);background: -o-linear-gradient(left, #5c93f5 0%, #afcfda 100%);background: -ms-linear-gradient(left, #5c93f5 0%, #afcfda 100%);background: linear-gradient(left, #5c93f5 0%, #afcfda 100%);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#5c93f5",endColorstr="#afcfda", GradientType=1);-webkit-box-shadow: 4px 4px 0px 0px #352727;-moz-box-shadow: 4px 4px 0px 0px #352727;box-shadow: 4px 4px 0px 0px #352727;} .mod_mess .titl {font-size: 15px;font-weight: bold;padding: 5px;border-bottom: 1px dashed #0D4DD3; } .mod_mess .titl + div {display: block;margin-left: 10px;padding: 25px 5px 25px 80px;background: transparent url(http://i33.servimg.com/u/f33/17/37/83/89/gnome610.png) no-repeat left center; }
Code:
<!-- BEGIN profile_field -->
{postrow.displayed.profile_field.LABEL}{postrow.displayed.profile_field.CONTENT}{postrow.displayed.profile_field.SEPARATOR}
<!-- END profile_field -->
Code:
<!-- BEGIN profile_field -->
<p class="profile_field_mess">
{postrow.displayed.profile_field.LABEL}{postrow.displayed.profile_field.CONTENT}{postrow.displayed.profile_field.SEPARATOR}
</p>
<!-- END profile_field -->
Code:
<div class="rank_mess"></div>
Code:
/*!
* zzRank v0.2.1 by Zzbaivong <devs.forumvi.com>
* Thêm huân chương dựa theo số lượng bài viết
*/
$(function() {
var data_rank = {
10: {
title: "10 bài viết",
desc: "Huân chương tưởng thưởng cho thành viên tích cực, đăng 10 bài viết trở lên. Điểm thưởng tối thiểu là 20.",
icon: "http://blog.uhm.vn/emo/laluot/2.gif",
point: 20
},
50: {
title: "50 bài viết",
desc: "Huân chương tưởng thưởng cho thành viên tích cực, đăng 50 bài viết trở lên. Điểm tưởng lớn hơn hoặc bằng số bài viết.",
icon: "http://blog.uhm.vn/emo/laluot/5.gif",
point: ">"
},
100: {
title: "100 bài viết",
desc: "Huân chương tưởng thưởng cho thành viên tích cực, đăng 100 bài viết trở lên. Được cảm ơn từ 10 lần trở lên.",
icon: "http://blog.uhm.vn/emo/laluot/20.gif",
thank: 10
},
500: {
title: "500 bài viết",
desc: "Huân chương tưởng thưởng cho thành viên tích cực, đăng 500 bài viết trở lên. Điểm tưởng lớn hơn hoặc bằng số bài viết. Được cảm ơn từ 99 lần trở lên.",
icon: "http://blog.uhm.vn/emo/laluot/10.gif",
point: ">",
thank: 99
},
x500: {
title: "Spamer",
desc: "Thành viên đăng 500 bài viết trở lên, nhưng điểm thưởng thấp hơn số bài viết.",
icon: "http://blog.uhm.vn/emo/laluot/24.gif",
point: "<"
}
};
function checkif(key, check, val, post) {
var cPost = data_rank[key][check];
if (($.type(cPost) === "number" && cPost <= val) || ($.type(cPost) === "string" && cPost === ">" && val >= post) || ($.type(cPost) === "string" && cPost === "<" && val < post)) {
return true;
} else {
return false;
}
}
function getNumber(t, txt) {
return parseInt($(t).closest(".post").find(".profile_field_mess:contains('" + txt + " : ')").text().match(/\d+/)[0], 10);
}
$(".rank_mess").html(function() {
var all = "";
var post_mess = getNumber(this, "Posts"),
point_mess = getNumber(this, "Points"),
thank_mess = getNumber(this, "Thanked");
$.each(data_rank, function(key, val) {
var point = data_rank[key].point,
thank = data_rank[key].thank;
if (post_mess >= parseInt(key.match(/\d+/)[0], 10)) {
if ((point === undefined && thank === undefined) || (point !== undefined && thank === undefined && checkif(key, "point", point_mess, post_mess)) || (point === undefined && thank !== undefined && checkif(key, "thank", thank_mess, post_mess)) || (point !== undefined && checkif(key, "point", point_mess, post_mess) && thank !== undefined && checkif(key, "thank", thank_mess, post_mess))) {
all += '<fieldset><legend>' + data_rank[key].title + '</legend><img src="' + data_rank[key].icon + '" alt="' + data_rank[key].title + '" title="' + data_rank[key].desc + '" /></fieldset>';
}
}
});
return all;
});
});
Code:
// Đây là thiết lập cho một rank, ở một mức bài viết
10: { // 10 là số bài tối thiểu để đạt được huân chương
title: "10 bài viết", // Ghi chú ngắn gọn cho huân chương
desc: "Huân chương tưởng thưởng cho thành viên tích cực, đăng 10 bài viết trở lên.", // Ghi chú chi tiết cho huân chương
icon: "http://blog.uhm.vn/emo/laluot/2.gif" // Ảnh huân chương sẽ hiển thị
}
Code:
point: ">" // point >= post
point: "<" // point < post
point: 3 // point >= 3
Code:
<div class='show' id='slidebox'><div class='slidebox-title slidebox-www'><span style='float:left;margin:0 15px;'>Recommended Content</span><span><a href='javascript:void(0);' id='slidebox-close' title='close'>×</a></span><span><a href='javascript:void(0);' id='slidebox-minimize' title='minimize'>−</a></span><span><a href='javascript:void(0);' id='slidebox-maximize' title='maximize'>+</a></span></div><div class='slidebox-container'><ul class='related-post-style-2' id='sliding-tab'/></div></div>
<style>
/* Widget Recommended Content */
#slidebox{background:#fff;width:100%;max-width:355px;height:255px;position:fixed;overflow:hidden;border:none;right:-360px;z-index:99;text-align:left;box-shadow:0 1px 0 0 rgba(0,0,0,0.03);transition:all .4s ease-out}
.slidebox-title{background:#3a5795;color:#fff;display:block;height:45px;line-height:45px;width:100%;font-size:14px;text-transform:capitalize;font-weight:700;letter-spacing:.5px}
.slidebox-title span a{font-family:initial;float:right;height:40px;margin:0 0 0 15px;text-align:center;color:#fff;font-size:20px}
a#slidebox-close,a#slidebox-close{margin-right:15px}
.slidebox-title >span >h2{font-size:20px!important;font-weight:normal!important}
.slidebox-container{border:none;float:left;width:100%;height:auto;margin:3px}
.slidebox-container >div{border:none;margin:3px 0;padding:10px 0}
.slidebox-container >div >span{font-size:14px}
.show{bottom:84px}
.hide{bottom:-205px}
.related-post{font-size:70%}
.related-post h4{font-size:150%;margin:0 0 .5em}
.related-post-style-2{padding-top:5px;list-style:none}
.related-post-style-2 li{padding:0 10px 10px 10px;overflow:hidden}
.related-post-style-2 li:first-child{border-top:none}
.related-post-style-2 .related-post-item-thumbnail img {width:45px;height:45px;max-width:none;max-height:none;border:0;padding:0;border-radius:3px;float:left;margin:2px 10px 0 0}
.related-post-style-2 .related-post-item-title{font-weight:700;font-size:110%;line-height:normal}
a.related-post-item-title{color:#95a5a6;transition:all .4s ease-out}
a:hover.related-post-item-title{color:#2ecc71;text-decoration:none}
.related-post-style-2 .related-post-item-summary{display:block;overflow:hidden}
</style>
<script type="text/javascript">
$(window).scroll(function() {
$("#slidebox").css($(this).scrollTop() > 700 ? {
right: "0px"
} : {
right: "-360px"
});
}), $(document).ready(function() {
var i = $("#slidebox"),
s = $("#slidebox-close"),
o = $("#slidebox-minimize"),
l = $("#slidebox-maximize");
l.hide(), s.click(function() {
i.css({
right: "-350px"
}), i.fadeOut("slow")
}), o.click(function() {
i.toggleClass("hide"), $(this).hide(), l.show()
}), l.click(function() {
i.toggleClass("hide"), $(this).hide(), o.show()
})
});
</script>
Code:
<script type="text/javascript">
$(function () {
$.ajax({
url: "/feed/?f={FORUM_ID}",
success: function (ta) {
for (var i = 1; i < 5; i++) {
var DL = $(ta).find("link:eq(" + i + ")").text();
var title = $(ta).find("title:eq(" + i + ")").text();
$('<li><div class="news-item"><div><div class="related-post-style-2"><div class="crop"><a href="' + DL + '" class="related-post-item-thumbnail" rel="bookmark"></a></div><span></span><div style="clear: both;"></div></div></div></div></li>').appendTo('#sliding-tab');
$('<a class="related-post-item-title" href="' + DL + '">' + title + '</a>').appendTo('.news-item:eq(' + (i - 2) + ') .related-post-style-2 span');
$('<img src="' + $(".news-item:eq(" + (i - 2) + ") .crop a:eq(0)").load(DL + ".postbody .messageContent img:eq(0)") + '" alt="load ảnh" />').appendTo('.news-item:eq(' + (i - 2) + ') .crop a:eq(0)');
}
}
});
});
</script>
Code:
<script type="text/javascript">
$(function () {
$.ajax({
url: "/feed/?f={FORUM_ID}",
success: function (ta) {
for (var i = 1; i < 5; i++) {
var DL = $(ta).find("link:eq(" + i + ")").text();
var title = $(ta).find("title:eq(" + i + ")").text();
$('<li><div class="news-item"><div><div class="related-post-style-2"><div class="crop"><a href="' + DL + '" class="related-post-item-thumbnail" rel="bookmark"></a></div><span></span><div style="clear: both;"></div></div></div></div></li>').appendTo('#sliding-tab');
$('<a class="related-post-item-title" href="' + DL + '">' + title + '</a>').appendTo('.news-item:eq(' + (i - 2) + ') .related-post-style-2 span');
$('<img src="' + $(".news-item:eq(" + (i - 2) + ") .crop a:eq(0)").load(DL + ".post-entry .entry-content img:eq(0)") + '" alt="load ảnh" />').appendTo('.news-item:eq(' + (i - 2) + ') .crop a:eq(0)');
}
}
});
});
</script>
Code:
<script type="text/javascript">
$(function () {
$.ajax({
url: "/feed/?f={FORUM_ID}",
success: function (ta) {
for (var i = 1; i < 5; i++) {
var DL = $(ta).find("link:eq(" + i + ")").text();
var title = $(ta).find("title:eq(" + i + ")").text();
$('<li><div class="news-item"><div><div class="related-post-style-2"><div class="crop"><a href="' + DL + '" class="related-post-item-thumbnail" rel="bookmark"></a></div><span></span><div style="clear: both;"></div></div></div></div></li>').appendTo('#sliding-tab');
$('<a class="related-post-item-title" href="' + DL + '">' + title + '</a>').appendTo('.news-item:eq(' + (i - 2) + ') .related-post-style-2 span');
$('<img src="' + $(".news-item:eq(" + (i - 2) + ") .crop a:eq(0)").load(DL + ".postbody .post-entry img:eq(0)") + '" alt="load ảnh" />').appendTo('.news-item:eq(' + (i - 2) + ') .crop a:eq(0)');
}
}
});
});
</script>
Code:
$(window).load(function () {
var a = $("#text_editor_textarea").sceditor("instance");
a.keyDown(function (b) {
b = b || window.event;
var c = b.keyCode;
(b.ctrlKey || b.metaKey) && 86 == c && setTimeout(function () {
a.toggleSourceMode();
a.val(a.val().replace(/\[\/?size(=(1|2|3|4|5))?\]/g, ''));
a.toggleSourceMode()
}, 100)
});
});
Code:
</head>
Code:
<div id='scroll'></div>
<script type='text/javascript'>
//<![CDATA[
var scrollTimer = null;
$(window).scroll(function() {
var viewportHeight = $(this).height(),
scrollbarHeight = viewportHeight / $(document).height() * viewportHeight,
progress = $(this).scrollTop() / ($(document).height() - viewportHeight),
distance = progress * (viewportHeight - scrollbarHeight) + scrollbarHeight / 2 - $('#scroll').height() / 2;
$('#scroll')
.css('top', distance)
.text(' (' + Math.round(progress * 100) + '%)')
.fadeIn(600);
if (scrollTimer !== null) {
clearTimeout(scrollTimer);
}
scrollTimer = setTimeout(function() {
$('#scroll').fadeOut(600);
}, 1000);
});
//]]>
</script>
<style>
#scroll {
display: none;
position: fixed;
top: 0;
right: 15px;
z-index: 500;
padding: 3px 8px;
background-color: #369fcf;
color: #fff;
border-radius: 3px;
font-size: 14px;
}
#scroll:after {
content: " ";
position: absolute;
top: 50%;
right: -10px;
height: 0;
width: 0;
margin-top: -6px;
border: 6px solid transparent;
border-left-color: #369fcf;
}
</style>
Code:
$(function () {
"/register" == location.pathname && $("#username_reg").attr({
pattern: "^[^\\d\\.]([\\.\\w\\d]+){2,}",
title: "Name must be at least 3 characters and start with letter or underscore. Only allowed to use letters, numbers, punctuation and underscores"
})
});
Code:
www.kenhit.123.st
Code:
/*
Bug.js - https://github.com/Auz/Bug
Released under MIT-style license.
Original Screen Bug http://screen-bug.googlecode.com/git/index.html
*/
var BugDispatch={options:{minDelay:500,maxDelay:1E4,minBugs:2,maxBugs:20,minSpeed:5,maxSpeed:10,maxLargeTurnDeg:150,maxSmallTurnDeg:10,maxWiggleDeg:5,imageSprite:"fly-sprite.png",bugWidth:13,bugHeight:14,num_frames:5,zoom:10,canFly:!0,canDie:!0,numDeathTypes:3,monitorMouseMovement:!1,eventDistanceToBug:40,minTimeBetweenMultipy:1E3,mouseOver:"random"},initialize:function(a){this.options=mergeOptions(this.options,a);this.options.minBugs>this.options.maxBugs&&(this.options.minBugs=this.options.maxBugs);
this.modes=["multiply","nothing"];this.options.canFly&&this.modes.push("fly","flyoff");this.options.canDie&&this.modes.push("die");-1==this.modes.indexOf(this.options.mouseOver)&&(this.options.mouseOver="random");this.transform=null;this.transforms={Moz:function(a){this.bug.style.MozTransform=a},webkit:function(a){this.bug.style.webkitTransform=a},O:function(a){this.bug.style.OTransform=a},ms:function(a){this.bug.style.msTransform=a},Khtml:function(a){this.bug.style.KhtmlTransform=a},w3c:function(a){this.bug.style.transform=
a}};if("transform"in document.documentElement.style)this.transform=this.transforms.w3c;else for(var b=["Moz","webkit","O","ms","Khtml"],c=0,c=0;c<b.length;c++)if(b[c]+"Transform"in document.documentElement.style){this.transform=this.transforms[b[c]];break}if(this.transform){this.bugs=[];for(var b="multiply"===this.options.mouseOver?this.options.minBugs:this.random(this.options.minBugs,this.options.maxBugs,!0),c=0,d=this,c=0;c<b;c++){a=JSON.parse(JSON.stringify(this.options));var e=SpawnBug();a.wingsOpen=
this.options.canFly?.5<Math.random()?!0:!1:!0;a.walkSpeed=this.random(this.options.minSpeed,this.options.maxSpeed);e.initialize(this.transform,a);this.bugs.push(e)}for(c=0;c<b;c++)a=this.random(this.options.minDelay,this.options.maxDelay,!0),e=this.bugs[c],setTimeout(function(a){return function(){d.options.canFly?a.flyIn():a.walkIn()}}(e),a),d.add_events_to_bug(e);this.options.monitorMouseMovement&&(window.onmousemove=function(){d.check_if_mouse_close_to_bug()})}},stop:function(){for(var a=0;a<this.bugs.length;a++)this.bugs[a].stop()},
end:function(){for(var a=0;a<this.bugs.length;a++)this.bugs[a].stop(),this.bugs[a].remove()},reset:function(){this.stop();for(var a=0;a<this.bugs.length;a++)this.bugs[a].reset(),this.bugs[a].walkIn()},killAll:function(){for(var a=0;a<this.bugs.length;a++)this.bugs[a].die()},add_events_to_bug:function(a){var b=this;a.bug&&(a.bug.addEventListener?a.bug.addEventListener("mouseover",function(c){b.on_bug(a)}):a.bug.attachEvent&&a.bug.attachEvent("onmouseover",function(c){b.on_bug(a)}))},check_if_mouse_close_to_bug:function(a){if(a=
a||window.event){var b=0,c=0;a.client&&a.client.x?(b=a.client.x,c=a.client.y):a.clientX?(b=a.clientX,c=a.clientY):a.page&&a.page.x?(b=a.page.x-(document.body.scrollLeft+document.documentElement.scrollLeft),c=a.page.y-(document.body.scrollTop+document.documentElement.scrollTop)):a.pageX&&(b=a.pageX-(document.body.scrollLeft+document.documentElement.scrollLeft),c=a.pageY-(document.body.scrollTop+document.documentElement.scrollTop));a=this.bugs.length;for(var d=0,d=0;d<a;d++){var e=this.bugs[d].getPos();
e&&Math.abs(e.top-c)+Math.abs(e.left-b)<this.options.eventDistanceToBug&&!this.bugs[d].flyperiodical&&this.near_bug(this.bugs[d])}}},near_bug:function(a){this.on_bug(a)},on_bug:function(a){if(a.alive){var b=this.options.mouseOver;"random"===b&&(b=this.modes[this.random(0,this.modes.length-1,!0)]);if("fly"===b)a.stop(),a.flyRand();else if("nothing"!==b)if("flyoff"===b)a.stop(),a.flyOff();else if("die"===b)a.die();else if("multiply"===b&&!this.multiplyDelay&&this.bugs.length<this.options.maxBugs){var c=
SpawnBug(),b=JSON.parse(JSON.stringify(this.options)),d=a.getPos(),e=this;b.wingsOpen=this.options.canFly?.5<Math.random()?!0:!1:!0;b.walkSpeed=this.random(this.options.minSpeed,this.options.maxSpeed);c.initialize(this.transform,b);c.drawBug(d.top,d.left);b.canFly?(c.flyRand(),a.flyRand()):(c.go(),a.go());this.bugs.push(c);this.multiplyDelay=!0;setTimeout(function(){e.add_events_to_bug(c);e.multiplyDelay=!1},this.options.minTimeBetweenMultipy)}}},random:function(a,b,c){if(a==b)return c?Math.round(a):
a;var d=a-.5+Math.random()*(b-a+1);d>b?d=b:d<a&&(d=a);return c?Math.round(d):d}},BugController=function(){this.initialize.apply(this,arguments)};BugController.prototype=BugDispatch;var SpiderController=function(){this.options=mergeOptions(this.options,{imageSprite:"spider-sprite.png",bugWidth:69,bugHeight:90,num_frames:7,canFly:!1,canDie:!0,numDeathTypes:2,zoom:6,minDelay:200,maxDelay:3E3,minSpeed:6,maxSpeed:13,minBugs:3,maxBugs:10});this.initialize.apply(this,arguments)};
SpiderController.prototype=BugDispatch;
var Bug={options:{wingsOpen:!1,walkSpeed:2,flySpeed:40,edge_resistance:50,zoom:10},initialize:function(a,b){this.options=mergeOptions(this.options,b);this.NEAR_TOP_EDGE=1;this.NEAR_BOTTOM_EDGE=2;this.NEAR_LEFT_EDGE=4;this.NEAR_RIGHT_EDGE=8;this.directions={};this.directions[this.NEAR_TOP_EDGE]=270;this.directions[this.NEAR_BOTTOM_EDGE]=90;this.directions[this.NEAR_LEFT_EDGE]=0;this.directions[this.NEAR_RIGHT_EDGE]=180;this.directions[this.NEAR_TOP_EDGE+this.NEAR_LEFT_EDGE]=315;this.directions[this.NEAR_TOP_EDGE+
this.NEAR_RIGHT_EDGE]=225;this.directions[this.NEAR_BOTTOM_EDGE+this.NEAR_LEFT_EDGE]=45;this.directions[this.NEAR_BOTTOM_EDGE+this.NEAR_RIGHT_EDGE]=135;this.large_turn_angle_deg=this.angle_rad=this.angle_deg=0;this.near_edge=!1;this.edge_test_counter=10;this.fly_counter=this.large_turn_counter=this.small_turn_counter=0;this.toggle_stationary_counter=50*Math.random();this.zoom=this.random(this.options.zoom,10)/10;this.stationary=!1;this.bug=null;this.wingsOpen=this.options.wingsOpen;this.transform=
a;this.flyIndex=this.walkIndex=0;this.alive=!0;this.twitchTimer=null;this.rad2deg_k=180/Math.PI;this.deg2rad_k=Math.PI/180;this.makeBug();this.angle_rad=this.deg2rad(this.angle_deg);this.angle_deg=this.random(0,360,!0)},go:function(){if(this.transform){this.drawBug();var a=this;this.animating=!0;this.going=requestAnimFrame(function(b){a.animate(b)})}},stop:function(){this.animating=!1;this.going&&(clearTimeout(this.going),this.going=null);this.flyperiodical&&(clearTimeout(this.flyperiodical),this.flyperiodical=
null);this.twitchTimer&&(clearTimeout(this.twitchTimer),this.twitchTimer=null)},remove:function(){this.inserted&&this.bug.parentNode&&(this.bug.parentNode.removeChild(this.bug),this.inserted=!1)},reset:function(){this.alive=!0;this.bug.style.bottom="";this.bug.style.top=0;this.bug.style.left=0},animate:function(a){if(this.animating&&this.alive){var b=this;this.going=requestAnimFrame(function(a){b.animate(a)});"_lastTimestamp"in this||(this._lastTimestamp=a);var c=a-this._lastTimestamp;if(!(40>c||
(200<c&&(c=200),this._lastTimestamp=a,0>=--this.toggle_stationary_counter&&this.toggleStationary(),this.stationary))){if(0>=--this.edge_test_counter&&this.bug_near_window_edge()&&(this.angle_deg%=360,0>this.angle_deg&&(this.angle_deg+=360),15<Math.abs(this.directions[this.near_edge]-this.angle_deg))){a=this.directions[this.near_edge]-this.angle_deg;var d=360-this.angle_deg+this.directions[this.near_edge];this.large_turn_angle_deg=Math.abs(a)<Math.abs(d)?a:d;this.edge_test_counter=10;this.large_turn_counter=
100;this.small_turn_counter=30}0>=--this.large_turn_counter&&(this.large_turn_angle_deg=this.random(1,this.options.maxLargeTurnDeg,!0),this.next_large_turn());if(0>=--this.small_turn_counter)this.angle_deg+=this.random(1,this.options.maxSmallTurnDeg),this.next_small_turn();else{a=this.random(1,this.options.maxWiggleDeg,!0);if(0<this.large_turn_angle_deg&&0>a||0>this.large_turn_angle_deg&&0<a)a=-a;this.large_turn_angle_deg-=a;this.angle_deg+=a}this.angle_rad=this.deg2rad(this.angle_deg);a=Math.cos(this.angle_rad)*
this.options.walkSpeed*(c/100);c=-Math.sin(this.angle_rad)*this.options.walkSpeed*(c/100);this.moveBug(this.bug.left+a,this.bug.top+c,90-this.angle_deg);this.walkFrame()}}},makeBug:function(){if(!this.bug){var a=this.wingsOpen?"0":"-"+this.options.bugHeight+"px",b=document.createElement("div");b.className="bug";b.style.background="transparent url("+this.options.imageSprite+") no-repeat 0 "+a;b.style.width=this.options.bugWidth+"px";b.style.height=this.options.bugHeight+"px";b.style.position="fixed";
b.style.top=0;b.style.left=0;b.style.zIndex="9999999";this.bug=b;this.setPos()}},setPos:function(a,b){this.bug.top=a||this.random(this.options.edge_resistance,document.documentElement.clientHeight-this.options.edge_resistance);this.bug.left=b||this.random(this.options.edge_resistance,document.documentElement.clientWidth-this.options.edge_resistance);this.moveBug(this.bug.left,this.bug.top,90-this.angle_deg)},moveBug:function(a,b,c){this.bug.left=a;this.bug.top=b;a="translate("+parseInt(a)+"px,"+parseInt(b)+
"px)";c&&(a+=" rotate("+c+"deg)");a+=" scale("+this.zoom+")";this.transform(a)},drawBug:function(a,b){this.bug||this.makeBug();a&&b?this.setPos(a,b):this.setPos(this.bug.top,this.bug.left);this.inserted||(this.inserted=!0,document.body.appendChild(this.bug))},toggleStationary:function(){this.stationary=!this.stationary;this.next_stationary();var a=this.wingsOpen?"0":"-"+this.options.bugHeight+"px";this.bug.style.backgroundPosition=this.stationary?"0 "+a:"-"+this.options.bugWidth+"px "+a},walkFrame:function(){this.bug.style.backgroundPosition=
-1*this.walkIndex*this.options.bugWidth+"px "+(this.wingsOpen?"0":"-"+this.options.bugHeight+"px");this.walkIndex++;this.walkIndex>=this.options.num_frames&&(this.walkIndex=0)},fly:function(a){var b=this.bug.top,c=this.bug.left,d=c-a.left,e=b-a.top,f=Math.atan(e/d);50>Math.abs(d)+Math.abs(e)&&(this.bug.style.backgroundPosition=-2*this.options.bugWidth+"px -"+2*this.options.bugHeight+"px");30>Math.abs(d)+Math.abs(e)&&(this.bug.style.backgroundPosition=-1*this.options.bugWidth+"px -"+2*this.options.bugHeight+
"px");if(10>Math.abs(d)+Math.abs(e))this.bug.style.backgroundPosition="0 0",this.stop(),this.go();else{var g=Math.cos(f)*this.options.flySpeed,f=Math.sin(f)*this.options.flySpeed;if(c>a.left&&0<g||c>a.left&&0>g)g*=-1,Math.abs(d)<Math.abs(g)&&(g/=4);if(b<a.top&&0>f||b>a.top&&0<f)f*=-1,Math.abs(e)<Math.abs(f)&&(f/=4);this.moveBug(c+g,b+f)}},flyRand:function(){this.stop();var a={};a.top=this.random(this.options.edge_resistance,document.documentElement.clientHeight-this.options.edge_resistance);a.left=
this.random(this.options.edge_resistance,document.documentElement.clientWidth-this.options.edge_resistance);this.startFlying(a)},startFlying:function(a){var b=this.bug.top,c=this.bug.left,d=a.left-c,e=a.top-b;this.bug.left=a.left;this.bug.top=a.top;this.angle_rad=Math.atan(e/d);this.angle_deg=this.rad2deg(this.angle_rad);this.angle_deg=0<d?90+this.angle_deg:270+this.angle_deg;this.moveBug(c,b,this.angle_deg);var f=this;this.flyperiodical=setInterval(function(){f.fly(a)},10)},flyIn:function(){this.bug||
this.makeBug();this.stop();var a=Math.round(4*Math.random()-.5),b=document,c=b.documentElement,d=b.getElementsByTagName("body")[0],b=window.innerWidth||c.clientWidth||d.clientWidth,c=window.innerHeight||c.clientHeight||d.clientHeight;3<a&&(a=3);0>a&&(a=0);0===a?(a=-2*this.options.bugHeight,b*=Math.random()):1===a?(a=Math.random()*c,b+=2*this.options.bugWidth):2===a?(a=c+2*this.options.bugHeight,b*=Math.random()):(a=Math.random()*c,b=-3*this.options.bugWidth);this.bug.style.backgroundPosition=-3*this.options.bugWidth+
"px "+(this.wingsOpen?"0":"-"+this.options.bugHeight+"px");this.bug.top=a;this.bug.left=b;this.drawBug();a={};a.top=this.random(this.options.edge_resistance,document.documentElement.clientHeight-this.options.edge_resistance);a.left=this.random(this.options.edge_resistance,document.documentElement.clientWidth-this.options.edge_resistance);this.startFlying(a)},walkIn:function(){this.bug||this.makeBug();this.stop();var a=Math.round(4*Math.random()-.5),b=document,c=b.documentElement,d=b.getElementsByTagName("body")[0],
b=window.innerWidth||c.clientWidth||d.clientWidth,c=window.innerHeight||c.clientHeight||d.clientHeight;3<a&&(a=3);0>a&&(a=0);0===a?(a=-1.3*this.options.bugHeight,b*=Math.random()):1===a?(a=Math.random()*c,b+=.3*this.options.bugWidth):2===a?(a=c+.3*this.options.bugHeight,b*=Math.random()):(a=Math.random()*c,b=-1.3*this.options.bugWidth);this.bug.style.backgroundPosition=-3*this.options.bugWidth+"px "+(this.wingsOpen?"0":"-"+this.options.bugHeight+"px");this.bug.top=a;this.bug.left=b;this.drawBug();
this.go()},flyOff:function(){this.stop();var a=this.random(0,3),b={},c=document,d=c.documentElement,e=c.getElementsByTagName("body")[0],c=window.innerWidth||d.clientWidth||e.clientWidth,d=window.innerHeight||d.clientHeight||e.clientHeight;0===a?(b.top=-200,b.left=Math.random()*c):1===a?(b.top=Math.random()*d,b.left=c+200):2===a?(b.top=d+200,b.left=Math.random()*c):(b.top=Math.random()*d,b.left=-200);this.startFlying(b)},die:function(){this.stop();var a=this.random(0,this.options.numDeathTypes-1);
this.alive=!1;this.drop(a)},drop:function(a){var b=this.bug.top,c=document,d=c.documentElement,c=c.getElementsByTagName("body")[0],e=window.innerHeight||d.clientHeight||c.clientHeight,e=e-this.options.bugHeight,f=this.random(0,20,!0);Date.now();var g=this;this.dropTimer=requestAnimFrame(function(c){this._lastTimestamp=c;g.dropping(c,b,e,f,a)})},dropping:function(a,b,c,d,e){a-=this._lastTimestamp;var f=b+.002*a*a,g=this;f>=c?(f=c,clearTimeout(this.dropTimer),this.angle_deg=0,this.angle_rad=this.deg2rad(this.angle_deg),
this.transform("rotate("+(90-this.angle_deg)+"deg) scale("+this.zoom+")"),this.bug.style.top=null,this.bug.style.bottom=Math.ceil((this.options.bugWidth*this.zoom-this.options.bugHeight*this.zoom)/2-this.options.bugHeight/2*(1-this.zoom))+"px",this.bug.style.left=this.bug.left+"px",this.bug.style.backgroundPosition="-"+2*e*this.options.bugWidth+"px 100%",this.twitch(e)):(this.dropTimer=requestAnimFrame(function(a){g.dropping(a,b,c,d,e)}),20>a||(this.angle_deg=(this.angle_deg+d)%360,this.angle_rad=
this.deg2rad(this.angle_deg),this.moveBug(this.bug.left,f,this.angle_deg)))},twitch:function(a,b){b||(b=0);var c=this;if(0===a||1===a)c.twitchTimer=setTimeout(function(){c.bug.style.backgroundPosition="-"+(2*a+b%2)*c.options.bugWidth+"px 100%";c.twitchTimer=setTimeout(function(){b++;c.bug.style.backgroundPosition="-"+(2*a+b%2)*c.options.bugWidth+"px 100%";c.twitch(a,++b)},c.random(300,800))},this.random(1E3,1E4))},rad2deg:function(a){return a*this.rad2deg_k},deg2rad:function(a){return a*this.deg2rad_k},
random:function(a,b,c){if(a==b)return a;a=Math.round(a-.5+Math.random()*(b-a+1));return c?.5<Math.random()?a:-a:a},next_small_turn:function(){this.small_turn_counter=Math.round(10*Math.random())},next_large_turn:function(){this.large_turn_counter=Math.round(40*Math.random())},next_stationary:function(){this.toggle_stationary_counter=this.random(50,300)},bug_near_window_edge:function(){this.near_edge=0;this.bug.top<this.options.edge_resistance?this.near_edge|=this.NEAR_TOP_EDGE:this.bug.top>document.documentElement.clientHeight-
this.options.edge_resistance&&(this.near_edge|=this.NEAR_BOTTOM_EDGE);this.bug.left<this.options.edge_resistance?this.near_edge|=this.NEAR_LEFT_EDGE:this.bug.left>document.documentElement.clientWidth-this.options.edge_resistance&&(this.near_edge|=this.NEAR_RIGHT_EDGE);return this.near_edge},getPos:function(){return this.inserted&&this.bug&&this.bug.style?{top:parseInt(this.bug.top,10),left:parseInt(this.bug.left,10)}:null}},SpawnBug=function(){var a={},b;for(b in Bug)Bug.hasOwnProperty(b)&&(a[b]=
Bug[b]);return a},mergeOptions=function(a,b,c){"undefined"==typeof c&&(c=!0);a=c?cloneOf(a):a;for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);return a},cloneOf=function(a){if(null==a||"object"!=typeof a)return a;var b=a.constructor(),c;for(c in a)a.hasOwnProperty(c)&&(b[c]=cloneOf(a[c]));return b};
window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a,b){window.setTimeout(a,1E3/60)}}();
Code:
$(function(){
$.getScript('LINKJS', function(){
new BugController({imageSprite:'http://i.imgur.com/cVUPxGe.png'});
new SpiderController({imageSprite:'http://i.imgur.com/NVl1IRH.png'});
});
});
|
|