diff --git a/elements/function.js b/elements/function.js new file mode 100644 index 0000000..00561c8 --- /dev/null +++ b/elements/function.js @@ -0,0 +1,155 @@ +// HTML Template Merger - Merge your qrcode quicker. +// Released under GNU General Public License v3.0. Opensourced. (https://github.com/hifocus/merger) +// Author @hifocus (https://github.com/hifocus), @LF112 (https://github.com/lf112) +// Copyright reservation is required. + +var client; +var selected; + +// Set profile photo +document.getElementById("i").style.background = + "url('" + profile + "') no-repeat center/cover"; + +// UserAgent Verify Part Starts +var scale = window.devicePixelRatio; // Change to 1 on retina screens to see blurry canvas. + +document.getElementById("titleinfo").innerHTML = "惶心最帅"; + +// General UserAgent verify rules +if (navigator.userAgent.match(/Alipay/i)) { + console.log("ALIPAY CLIENT"); + // Redirect directly + window.location.href = alipay; +} else if (navigator.userAgent.match(/MicroMessenger\//i)) { + if ( + location.href.substr(location.href.lastIndexOf("#") + 1) == "showqrcode" && + !selected + ) + document.getElementById("showqrcode").style.display = "none"; + console.log("WECHAT CLIENT"); + client = wechat; + // Click the button, import from js + document.getElementById("toclick").click(); + document.getElementById("titleinfo").innerHTML = + "长按识别二维码 向" + myname + "支付"; + // Melt the car door ((( + document.getElementById("h").removeChild(document.getElementById("i")); // remove profile photo + document + .getElementById("pending") + .removeChild(document.getElementById("depends")); // remove buttons + document + .getElementById("btncontainer") + .removeChild(document.getElementById("qrcodeclose")); //remove exit buttons +} else if (navigator.userAgent.match(/QQ\//i)) { + console.log("MOBILE QQ CLIENT"); + window.location.href = + window.location.href.match(/^[^\#\?]+/)[0] + "#showqrcode"; + document.getElementById("titleinfo").innerHTML = + "长按识别二维码 向" + myname + "支付"; + // Melt the car door ((( + document.getElementById("h").removeChild(document.getElementById("i")); // remove profile photo + document + .getElementById("pending") + .removeChild(document.getElementById("depends")); // remove buttons + document + .getElementById("btncontainer") + .removeChild(document.getElementById("qrcodeclose")); // remove exit buttons + document + .getElementById("qrcontainer") + .removeChild(document.getElementById("currentqrcode")); // remove default qrcode (mobile qq only) + // Import from api + document.getElementById("tenpayonly").src = qrcodeapi + tenpay; +} + +// Verify if mobile browser only +else { + if ( + location.href.substr(location.href.lastIndexOf("#") + 1) == "showqrcode" && + !selected + ) + document.getElementById("showqrcode").style.display = "none"; + document.getElementById("qrcodeclose").onclick = function() { + document.getElementById("currentqrcode").innerHTML = ""; + if (document.getElementById("showqrcode").style.display == "flex") + document.getElementById("showqrcode").style.display = ""; + }; +} +if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) { + console.log("MOBILE BROWSER CLIENT"); +} else { + console.log("DESKTOP BROWSER CLIENT"); +} +// UserAgent Verify Part Ends + +// Verify if `paypal` is defined +if (typeof paypal !== "string") { + document + .getElementById("depends") + .removeChild(document.getElementById("paypalbtn")); + console.log("PAYPAL BUTTON REMOVED"); +} else { + function openbox() { + selected = "yes"; + window.open( + paypal, + "_blank", + "toolbar=no,scrollbars=no,visible=none,width=360,height=640" + ); + } + console.log("PAYPAL BUTTON OPERATING"); +} + +// Onclick Function Part Starts +function openwechat() { + selected = "yes"; + document.getElementById("titleinfo").innerHTML = + "微信扫一扫 向" + myname + "支付"; + client = wechat; + showqrcode(); +} +function openalipay() { + selected = "yes"; + document.getElementById("titleinfo").innerHTML = + "支付宝扫一扫 向" + myname + "支付"; + client = alipay; + showqrcode(); +} +function opentenpay() { + selected = "yes"; + document.getElementById("titleinfo").innerHTML = + "手机QQ扫一扫 向" + myname + "支付"; + client = tenpay; + showqrcode(); +} +// Onclick Function Part Ends + +// Fill in tile and subtitle +document.getElementById("name").innerHTML = title; +document.getElementById("description").innerHTML = subtitle; + +// See if `debugmode` is defined +if (typeof debugmode !== "undefined" && debugmode !== null) { + console.log("DEBUG MODE ENABLED ↑"); + // Copyright console log from https://github.com/MoePlayer/APlayer/. Thank you. + console.log( + `${"\n"} %c merger.html %c https://github.com/hifocus/merger ${"\n"}`, + "color: #fadfa3; background: #030307; padding:5px 0;", + "background: #fadfa3; padding:5px 0;" + ); +} else { + console.clear(); + console.log("DEBUG MODE DISABLED ↑"); +} + +function showqrcode() { + if ( + location.href.substr(location.href.lastIndexOf("#") + 1) == "showqrcode" && + selected == "yes" + ) + document.getElementById("showqrcode").style.display = "flex"; + $("#currentqrcode").qrcode({ + render: "image", + size: 300 * scale, + text: client + }); +} diff --git a/elements/function.min.js b/elements/function.min.js new file mode 100644 index 0000000..84f4f90 --- /dev/null +++ b/elements/function.min.js @@ -0,0 +1,16 @@ +// HTML Template Merger - Merge your qrcode quicker. (https://github.com/hifocus/merger) +var client;var selected;document.getElementById("i").style.background="url('"+profile+"') no-repeat center/cover";var scale=window.devicePixelRatio;document.getElementById("titleinfo").innerHTML="惶心最帅";if(navigator.userAgent.match(/Alipay/i)){console.log("ALIPAY CLIENT");window.location.href=alipay;} +else if(navigator.userAgent.match(/MicroMessenger\//i)){if(location.href.substr(location.href.lastIndexOf('#')+1)=="showqrcode"&&!selected)document.getElementById('showqrcode').style.display="none";console.log("WECHAT CLIENT");client=wechat;document.getElementById("toclick").click();document.getElementById("titleinfo").innerHTML="长按识别二维码 向"+myname+"支付";document.getElementById("h").removeChild(document.getElementById("i"));document.getElementById("pending").removeChild(document.getElementById("depends"));document.getElementById("btncontainer").removeChild(document.getElementById("qrcodeclose"));} +else if(navigator.userAgent.match(/QQ\//i)){console.log("MOBILE QQ CLIENT");window.location.href=window.location.href.match(/^[^\#\?]+/)[0]+"#showqrcode";document.getElementById("titleinfo").innerHTML="长按识别二维码 向"+myname+"支付";document.getElementById("h").removeChild(document.getElementById("i"));document.getElementById("pending").removeChild(document.getElementById("depends"));document.getElementById("btncontainer").removeChild(document.getElementById("qrcodeclose"));document.getElementById("qrcontainer").removeChild(document.getElementById("currentqrcode"));document.getElementById("tenpayonly").src=qrcodeapi+tenpay;} +else{if(location.href.substr(location.href.lastIndexOf('#')+1)=="showqrcode"&&!selected)document.getElementById('showqrcode').style.display="none";document.getElementById('qrcodeclose').onclick=function(){document.getElementById('currentqrcode').innerHTML="";if(document.getElementById('showqrcode').style.display=="flex")document.getElementById('showqrcode').style.display="";}} +if(/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)){console.log("MOBILE BROWSER CLIENT");} +else{console.log("DESKTOP BROWSER CLIENT");} +if(typeof paypal!=="string"){document.getElementById("depends").removeChild(document.getElementById("paypalbtn"));console.log("PAYPAL BUTTON REMOVED");} +else{function openbox(){selected="yes";window.open(paypal,"_blank","toolbar=no,scrollbars=no,visible=none,width=360,height=640");} +console.log("PAYPAL BUTTON OPERATING")} +function openwechat(){selected="yes";document.getElementById("titleinfo").innerHTML="微信扫一扫 向"+myname+"支付";client=wechat;showqrcode();} +function openalipay(){selected="yes";document.getElementById("titleinfo").innerHTML="支付宝扫一扫 向"+myname+"支付";client=alipay;showqrcode();} +function opentenpay(){selected="yes";document.getElementById("titleinfo").innerHTML="手机QQ扫一扫 向"+myname+"支付";client=tenpay;showqrcode();} +document.getElementById("name").innerHTML=title;document.getElementById("description").innerHTML=subtitle;if(typeof debugmode!=="undefined"&&debugmode!==null){console.log("DEBUG MODE ENABLED ↑");console.log(`${'\n'} %c merger.html %c https://github.com/hifocus/merger ${'\n'}`,'color: #fadfa3; background: #030307; padding:5px 0;','background: #fadfa3; padding:5px 0;');} +else{console.clear();console.log("DEBUG MODE DISABLED ↑");} +function showqrcode(){if(location.href.substr(location.href.lastIndexOf('#')+1)=="showqrcode"&&selected=="yes")document.getElementById('showqrcode').style.display="flex";$("#currentqrcode").qrcode({render:"image",size:300*scale,text:client});} \ No newline at end of file diff --git a/elements/function.original.js b/elements/function.original.js new file mode 100644 index 0000000..0a5c59e --- /dev/null +++ b/elements/function.original.js @@ -0,0 +1,123 @@ + + // HTML Template Merger - Merge your qrcode quicker. + // Released under GNU General Public License v3.0. Opensourced. (https://github.com/hifocus/merger) + // Author @hifocus (https://github.com/hifocus), @LF112 (https://github.com/lf112) + // Copyright reservation is required. + + var client; + var selected; + + // Set profile photo + document.getElementById("i").style.background = "url('" + profile + "') no-repeat center/cover"; + + // UserAgent Verify Part Starts + var scale = window.devicePixelRatio; // Change to 1 on retina screens to see blurry canvas. + + document.getElementById("titleinfo").innerHTML = "惶心最帅"; + + // General UserAgent verify rules + if (navigator.userAgent.match(/Alipay/i)) { + console.log("ALIPAY CLIENT"); + // Redirect directly + window.location.href = alipay; + } + else if (navigator.userAgent.match(/MicroMessenger\//i)) { + if(location.href.substr(location.href.lastIndexOf('#')+1) == "showqrcode" && !selected) document.getElementById('showqrcode').style.display = "none"; + console.log("WECHAT CLIENT"); + client = wechat; + // Click the button, import from js + document.getElementById("toclick").click(); + document.getElementById("titleinfo").innerHTML = "长按识别二维码 向" + myname + "支付"; + // Melt the car door ((( + document.getElementById("h").removeChild(document.getElementById("i")); // remove profile photo + document.getElementById("pending").removeChild(document.getElementById("depends")); // remove buttons + document.getElementById("btncontainer").removeChild(document.getElementById("qrcodeclose")); //remove exit buttons + } + + else if (navigator.userAgent.match(/QQ\//i)) { + console.log("MOBILE QQ CLIENT"); + window.location.href = window.location.href.match(/^[^\#\?]+/)[0] + "#showqrcode"; + document.getElementById("titleinfo").innerHTML = "长按识别二维码 向" + myname + "支付"; + // Melt the car door ((( + document.getElementById("h").removeChild(document.getElementById("i")); // remove profile photo + document.getElementById("pending").removeChild(document.getElementById("depends")); // remove buttons + document.getElementById("btncontainer").removeChild(document.getElementById("qrcodeclose")); // remove exit buttons + document.getElementById("qrcontainer").removeChild(document.getElementById("currentqrcode")); // remove default qrcode (mobile qq only) + // Import from api + document.getElementById("tenpayonly").src = qrcodeapi + tenpay; + } + + // Verify if mobile browser only + else { + if(location.href.substr(location.href.lastIndexOf('#')+1) == "showqrcode" && !selected) document.getElementById('showqrcode').style.display = "none"; + document.getElementById('qrcodeclose').onclick = function (){ + document.getElementById('currentqrcode').innerHTML = ""; + if(document.getElementById('showqrcode').style.display == "flex") document.getElementById('showqrcode').style.display = ""; + } + } + if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) { + console.log("MOBILE BROWSER CLIENT"); + } + else { + console.log("DESKTOP BROWSER CLIENT"); + } + // UserAgent Verify Part Ends + + + // Verify if `paypal` is defined + if (typeof paypal !== "string") { + document.getElementById("depends").removeChild(document.getElementById("paypalbtn")); + console.log("PAYPAL BUTTON REMOVED"); + } + else { + function openbox() { + selected = "yes"; + window.open(paypal, "_blank", "toolbar=no,scrollbars=no,visible=none,width=360,height=640"); + } + console.log("PAYPAL BUTTON OPERATING") + } + + // Onclick Function Part Starts + function openwechat() { + selected = "yes"; + document.getElementById("titleinfo").innerHTML = "微信扫一扫 向" + myname + "支付"; + client = wechat; + showqrcode(); + } + function openalipay() { + selected = "yes"; + document.getElementById("titleinfo").innerHTML = "支付宝扫一扫 向" + myname + "支付"; + client = alipay; + showqrcode(); + } + function opentenpay() { + selected = "yes"; + document.getElementById("titleinfo").innerHTML = "手机QQ扫一扫 向" + myname + "支付"; + client = tenpay; + showqrcode(); + } + // Onclick Function Part Ends + + // Fill in tile and subtitle + document.getElementById("name").innerHTML = title; + document.getElementById("description").innerHTML = subtitle; + + // See if `debugmode` is defined + if (typeof debugmode !== "undefined" && debugmode !== null) { + console.log("DEBUG MODE ENABLED ↑"); + // Copyright console log from https://github.com/MoePlayer/APlayer/. Thank you. + console.log(`${'\n'} %c merger.html %c https://github.com/hifocus/merger ${'\n'}`, 'color: #fadfa3; background: #030307; padding:5px 0;', 'background: #fadfa3; padding:5px 0;'); + } + else { + console.clear(); + console.log("DEBUG MODE DISABLED ↑"); + } + + function showqrcode() { + if (location.href.substr(location.href.lastIndexOf('#') + 1) == "showqrcode" && selected == "yes") document.getElementById('showqrcode').style.display = "flex"; + $("#currentqrcode").qrcode({ + render: "image", + size: 300 * scale, + text: client + }); + } \ No newline at end of file diff --git a/elements/style.css b/elements/style.css index 0299349..ab057fa 100644 --- a/elements/style.css +++ b/elements/style.css @@ -1,3 +1,8 @@ +/* HTML Template Merger - Merge your qrcode quicker. +Released under GNU General Public License v3.0. Opensourced. (https://github.com/hifocus/merger) +Author @hifocus (https://github.com/hifocus), @LF112 (https://github.com/lf112) +Copyright reservation is required. */ + /* HTML Templete Grouper - The Best Way To Share Your Chatting Group To The Public. GitHub: [https:/github.com/hifocus/Grouper] , Released Under MIT Lisence diff --git a/elements/style.min.css b/elements/style.min.css index bb50ebb..fe989b2 100644 --- a/elements/style.min.css +++ b/elements/style.min.css @@ -1,8 +1,30 @@ -/* -HTML Templete Grouper - The Best Way To Share Your Chatting Group To The Public. -GitHub: [https:/github.com/hifocus/Grouper] , Released Under MIT Lisence -Original Version: [https://i.chainwon.com/946.html] -Modified By Huangxin [https://www.hxis.me] on Aug 29th 2018, great thanks to @Dreamer-Paul -Please DO NOT Remove Any Of The Copyright Information -*/ -body,html{margin:0;height:100%;background:linear-gradient(-45deg,#ee7752,#ce3e75,#23a6d5,#23d5ab);background-size:400% 400%;font-family:Noto Sans SC Sliced,sans-serif;-webkit-animation:Gradient 10s ease infinite;animation:Gradient 10s ease infinite;-o-user-select:none;-ms-user-select:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}@-webkit-keyframes Gradient{0%{background-position:0 50%}50%{background-position:100% 50%}}@keyframes Gradient{0%,to{background-position:0 50%}50%{background-position:100% 50%}to{background-position:0 50%}}.main{position:absolute;top:calc(50% - 207px);width:100%}.main i{display:block;margin:0 auto;width:200px;height:200px;border-radius:100%;text-align:center}body div h2,body div p{margin:0;margin-top:20px;color:#fff;text-align:center}.middlebtn{margin-right:auto;margin-left:auto;text-align:center;opacity:.85}.details{font-size:20px}.qrcode{width:50%;height:50%}.modal-body .content{text-align:center}@media all and (max-width:800px){.desktop{display:none}} \ No newline at end of file +/* HTML Template Merger - Merge your qrcode quicker. (https://github.com/hifocus/merger) */ +body,html{height:100%;margin:0;background:linear-gradient(-45deg,#ee7752,#ce3e75,#23a6d5,#23d5ab);background-size:400% 400%;-webkit-animation:Gradient 10s ease infinite;-moz-animation:Gradient 10s ease infinite;animation:Gradient 10s ease infinite;-o-user-select:none;-ms-user-select:none;-webkit-user-select:none;-moz-user-select:none;user-select:none} +@-webkit-keyframes Gradient{0%{background-position:0 50%} +50%{background-position:100% 50%} +100%{background-position:0 50%} +} +@-moz-keyframes Gradient{0%{background-position:0 50%} +50%{background-position:100% 50%} +100%{background-position:0 50%} +} +@keyframes Gradient{0%{background-position:0 50%} +50%{background-position:100% 50%} +100%{background-position:0 50%} +} +.main{position:absolute;top:calc(50% - 207px);width:100%} +.main i{width:200px;height:200px;border-radius:100%;display:block;margin:0 auto;text-align:center} +h2,p{font-weight:400;color:#fff;text-align:center;margin:0;margin-top:20px} +h2{font-size:30px} +p{font-size:16px} +.middlebtn{text-align:center;margin-left:auto;margin-right:auto;opacity:.85} +.details{font-size:20px} +.qrcode{width:50%;height:50%} +.modal-body .content{text-align:center} +@media all and (max-width:800px){.desktop{display:none} +} +@media all and (min-width:800px){.smaller{width:50%;height:auto;margin-left:auto;margin-right:auto} +} +.icon{width:1em;height:1em;vertical-align:-.15em;fill:currentColor;overflow:hidden;font-size:16} +.wechat .alipay .tenpay{display:none} +img{max-width:75%;height:auto;width:auto\9} diff --git a/merger.html b/merger.html index d5c68f5..67b344d 100644 --- a/merger.html +++ b/merger.html @@ -1,15 +1,14 @@ @@ -18,15 +17,17 @@