Skip to content

Commit

Permalink
Fixed mobile end style error && Improved style in iPhone 5 / SE
Browse files Browse the repository at this point in the history
  • Loading branch information
hifocus committed Dec 21, 2018
1 parent 6dbffa1 commit aa1d2b1
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 54 deletions.
29 changes: 14 additions & 15 deletions elements/function.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,13 @@ if (navigator.userAgent.match(/Alipay/i)) {
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)
Expand Down Expand Up @@ -81,6 +66,20 @@ if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
}
// UserAgent Verify Part Ends

// Removal of useless elements when in wechat and mobile qq
if (/(MicroMessenger|QQ|Alipay)/i.test(navigator.userAgent)) {
var title = "";
var subtitle = "";
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
console.log("REMOVAL DONE");
}

// Verify if `paypal` is defined
if (typeof paypal !== "string") {
document
Expand Down
5 changes: 3 additions & 2 deletions elements/function.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 11 additions & 8 deletions elements/function.original.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
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");
Expand All @@ -28,20 +28,13 @@
// 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;
Expand All @@ -63,6 +56,16 @@
}
// UserAgent Verify Part Ends

// Removal of useless elements when in wechat and mobile qq
if (/(MicroMessenger|QQ|Alipay)/i.test(navigator.userAgent)) {
var title = "";
var subtitle = "";
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
console.log("REMOVAL DONE");
}


// Verify if `paypal` is defined
if (typeof paypal !== "string") {
Expand Down
3 changes: 3 additions & 0 deletions elements/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ p {
.desktop {
display: none;
}
.h5 {
font-size: 18px;
}
}

@media all and (min-width: 800px){
Expand Down
30 changes: 1 addition & 29 deletions elements/style.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions merger.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<link rel="shortcut icon" type="image/x-icon" href="https://ws1.sinaimg.cn/thumbnail/0072Lfvtly1fyegd14voyj30dw0dwt9x.jpg">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/picturepan2/spectre@0.5.3/dist/spectre.min.css" integrity="sha256-eBag0DNksOEjebVrDSBxOYWaIsRA5RBzz/PWQtkgmvM=" crossorigin="anonymous">
<link rel="stylesheet" href="elements/style.min.css">
<!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/combine/gh/picturepan2/spectre@0.5.7/dist/spectre.min.css,gh/hifocus/merger@0.10/elements/style.min.css"> -->
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net">
<link rel="dns-prefetch" href="https://www.zhihu.com">
</head>
Expand Down Expand Up @@ -97,6 +98,7 @@ <h2 id="name"></h2>
<!-- Footer Scripts --> <!-- Please do not swap orders -->
<script src="https://cdn.jsdelivr.net/combine/npm/jquery@3.3.1,gh/lrsjng/jquery-qrcode@0.14.0/dist/jquery-qrcode.min.js"></script>
<script src="elements/function.min.js"></script>
<!-- <script src="https://cdn.jsdelivr.net/gh/hifocus/merger@0.10/elements/function.min.js" integrity="sha256-KxLsYuSdnxgVpWvfJkbtsayJuI/9CvowjtYCEfjcaQk=" crossorigin="anonymous"></script> -->
<script src="https://at.alicdn.com/t/font_974919_xgtacm93vxp.js"></script>

</body>
Expand Down

0 comments on commit aa1d2b1

Please sign in to comment.