-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphantom.php
88 lines (81 loc) · 2.66 KB
/
phantom.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<html>
<?php
readfile('static/header.html');
?>
<h2>转移动端URL</h2>
<p>将为您转换成移动端URL</p>
<hr>
<p>需要转换的URL:</p>
<textarea id="url" rows="20" cols="30"> </textarea>
<div>
<button id="b01">开始转换</button>
<button id="b02">强制停止</button>
<button class="btn" data-clipboard-target="#unicom">复制URL到剪贴板</button>
</div>
<div id='spin'></div>
<pre id="unicom"></pre>
<script>
// clipboard.js
new Clipboard('.btn');
$(document).ready(function(){
var opts = {
lines: 13 // The number of lines to draw
, length: 28 // The length of each line
, width: 14 // The line thickness
, radius: 42 // The radius of the inner circle
, scale: 1 // Scales overall size of the spinner
, corners: 1 // Corner roundness (0..1)
, color: '#66CCFF' // #rgb or #rrggbb or array of colors
, opacity: 0.25 // Opacity of the lines
, rotate: 0 // The rotation offset
, direction: 1 // 1: clockwise, -1: counterclockwise
, speed: 1.4 // Rounds per second
, trail: 60 // Afterglow percentage
, fps: 20 // Frames per second when using setTimeout() as a fallback for CSS
, zIndex: 2e9 // The z-index (defaults to 2000000000)
, className: 'spinner' // The CSS class to assign to the spinner
, top: '50%' // Top position relative to parent
, left: '50%' // Left position relative to parent
, shadow: false // Whether to render a shadow
, hwaccel: false // Whether to use hardware acceleration
, position: 'absolute' // Element positioning
};
var target = document.getElementById('spin')
var spinner = new Spinner(opts);
$("#b01").click(function(){
$("#b01").attr('disabled', true).text('正在转换,请耐心等待');
spinner.spin(target);
$.ajax({
method: 'POST',
data: $.param({
pc_url: $("#url").val()
}),
url:"/ajax_php/run_phantom.php",
async: true,
success: function(data) {
spinner.spin();
$("#unicom").html(data);
$("#b01").attr('disabled', false).text('开始转换');
}
});
});
$("#b02").click(function(){
$("#b02").attr('disabled', true).text('正在停止');
spinner.spin(target);
$.ajax({
method: 'POST',
data: $.param({
pc_url: $("#url").val()
}),
url:"/ajax_php/stop_phantom.php",
async: true,
success: function(data) {
spinner.spin();
$("#b02").attr('disabled', false).text('强制停止');
}
});
});
});
</script>
</body>
</html>