Created
May 19, 2020 14:28
-
-
Save Kaz-su/26b3a053d71a0681583b92c150737cdb to your computer and use it in GitHub Desktop.
健食の糞LPの糞コード
This file contains hidden or 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
var second=0;var customerCount=(Math.random()*50);customerCount=Math.floor(customerCount);var productCount=4;var productCount2=6;$(document).ready(function(){$('#footer-slider').fadeIn();second=getCookie();console.log(document.cookie);if(isNaN(second)){second=7200;};CustomerIncrement();ProductDecrement();CountDown();setInterval("CustomerIncrement()",3000);setInterval("CountDown()",1000);});function Rand_View_Num(){randNum=(Math.random()*8)-3;randNum=Math.floor(randNum);customerCount=customerCount+randNum;if(customerCount>999){customerCount=999;}if(customerCount<3){customerCount=3;}}function CustomerIncrement(){Rand_View_Num();var nowdate=new Date();var hour=nowdate.getHours();var min=nowdate.getMinutes();jQuery('#slider1 p').html(hour+"時"+min+"分現在あなたの他に<span class='blink' style='color:#ffff00;font-weight:bold;'>"+customerCount+"</span>人が見ています");jQuery('#slider3 p').html(hour+"時"+min+"分現在あなたの他に<span class='blink' style='color:#ffff00;font-weight:bold;'>"+customerCount+"</span>人が見ています");}function ProductDecrement(){if(productCount>1){productCount--;productCount2--;}Rand_View_Num();var nowdate=new Date();var hour=nowdate.getHours();var min=nowdate.getMinutes();jQuery('#slider3 p').html(hour+"時"+min+"分現在あなたの他に<span class='blink' style='color:#ffff00;font-weight:bold;'>"+customerCount+"</span>人が見ています");}function CountDown(){if(second>0){second--;jQuery('#slider2 p').html("キャンペーン終了まで"+"<span class='blink' style='color:#ff0000;font-weight:bold;'>"+toHms(second)+"</span>");jQuery('#slider4 p').html("キャンペーン終了まで"+"<span class='blink' style='color:#ff0000;font-weight:bold;'>"+toHms(second)+"</span>");}else{jQuery('#slider2 p').html("キャンペーン終了まで残りわずか");jQuery('#slider4 p').html("キャンペーン終了まで残りわずか");}document.cookie="sec="+second+" ;max-age=7200";}function toHms(t){var hms="";var h=t/3600|0;var m=t%3600/60|0;var s=t%60;if(h!=0){hms=h+"時間"+padZero(m)+"分"+padZero(s)+"秒";}else if(m!=0){hms=m+"分"+padZero(s)+"秒";}else{hms=s+"秒";}return hms;function padZero(v){if(v<10){return"0"+v;}else{return v;}}}function getCookie(){if(document.cookie!=''){var tmp=document.cookie.split('; ');for(var i=0;i<tmp.length;i++){var data=tmp[i].split('=');if(data[0]=='sec'){return Number(data[1]);}}}} |
This file contains hidden or 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
var second = 0; | |
var customerCount = Math.random() * 50; | |
customerCount = Math.floor(customerCount); | |
var productCount = 4; | |
var productCount2 = 6; | |
$(document).ready(function () { | |
$("#footer-slider").fadeIn(); | |
second = getCookie(); | |
console.log(document.cookie); | |
if (isNaN(second)) { | |
second = 7200; | |
} | |
CustomerIncrement(); | |
ProductDecrement(); | |
CountDown(); | |
setInterval("CustomerIncrement()", 3000); | |
setInterval("CountDown()", 1000); | |
}); | |
function Rand_View_Num() { | |
randNum = Math.random() * 8 - 3; | |
randNum = Math.floor(randNum); | |
customerCount = customerCount + randNum; | |
if (customerCount > 999) { | |
customerCount = 999; | |
} | |
if (customerCount < 3) { | |
customerCount = 3; | |
} | |
} | |
function CustomerIncrement() { | |
Rand_View_Num(); | |
var nowdate = new Date(); | |
var hour = nowdate.getHours(); | |
var min = nowdate.getMinutes(); | |
jQuery("#slider1 p").html(hour + "時" + min + "分現在あなたの他に<span class='blink' style='color:#ffff00;font-weight:bold;'>" + customerCount + "</span>人が見ています"); | |
jQuery("#slider3 p").html(hour + "時" + min + "分現在あなたの他に<span class='blink' style='color:#ffff00;font-weight:bold;'>" + customerCount + "</span>人が見ています"); | |
} | |
function ProductDecrement() { | |
if (productCount > 1) { | |
productCount--; | |
productCount2--; | |
} | |
Rand_View_Num(); | |
var nowdate = new Date(); | |
var hour = nowdate.getHours(); | |
var min = nowdate.getMinutes(); | |
jQuery("#slider3 p").html(hour + "時" + min + "分現在あなたの他に<span class='blink' style='color:#ffff00;font-weight:bold;'>" + customerCount + "</span>人が見ています"); | |
} | |
function CountDown() { | |
if (second > 0) { | |
second--; | |
jQuery("#slider2 p").html("キャンペーン終了まで" + "<span class='blink' style='color:#ff0000;font-weight:bold;'>" + toHms(second) + "</span>"); | |
jQuery("#slider4 p").html("キャンペーン終了まで" + "<span class='blink' style='color:#ff0000;font-weight:bold;'>" + toHms(second) + "</span>"); | |
} else { | |
jQuery("#slider2 p").html("キャンペーン終了まで残りわずか"); | |
jQuery("#slider4 p").html("キャンペーン終了まで残りわずか"); | |
} | |
document.cookie = "sec=" + second + " ;max-age=7200"; | |
} | |
function toHms(t) { | |
var hms = ""; | |
var h = (t / 3600) | 0; | |
var m = ((t % 3600) / 60) | 0; | |
var s = t % 60; | |
if (h != 0) { | |
hms = h + "時間" + padZero(m) + "分" + padZero(s) + "秒"; | |
} else if (m != 0) { | |
hms = m + "分" + padZero(s) + "秒"; | |
} else { | |
hms = s + "秒"; | |
} | |
return hms; | |
function padZero(v) { | |
if (v < 10) { | |
return "0" + v; | |
} else { | |
return v; | |
} | |
} | |
} | |
function getCookie() { | |
if (document.cookie != "") { | |
var tmp = document.cookie.split("; "); | |
for (var i = 0; i < tmp.length; i++) { | |
var data = tmp[i].split("="); | |
if (data[0] == "sec") { | |
return Number(data[1]); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment