-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathpreview.html
49 lines (49 loc) · 1.65 KB
/
preview.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Weex Preview</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="format-detection" content="telephone=no, email=no">
<link rel="stylesheet" href="./assets/preview.css">
<script src="./assets/qrcode.js"></script>
</head>
<body>
<!-- <header class="header center">
<h1 class="page-title">Weex Preview</h1>
</header> -->
<div class="content center">
<main class="main">
<div class="mock-phone">
<div class="camera"></div>
<div class="earpiece"></div>
<div class="inner">
<iframe id="preview" src="http://localhost:8080/" frameborder="0"></iframe>
</div>
<div class="home-btn"></div>
</div>
<div class="qrcode-box">
<div class="qrcode" id="qrcode"></div>
<p class="qrcode-tips">Use <a target="_blank" href="https://weex-project.io/playground.html">Weex playground app</a> to scan it.</p>
</div>
</main>
</div>
<script>
(function(){
function createQRCode (url) {
var $QR = document.getElementById('qrcode')
var QR = qrcode(0, 'L')
QR.addData(url + '?_wx_tpl=' + url)
QR.make()
$QR.innerHTML = QR.createImgTag(6, 12)
}
// TODO: get origin
var origin = location.origin || 'http://127.0.0.1:8080'
createQRCode(origin + '/dist/landing.weex.js')
})();
</script>
</body>
</html>