wip: 建设pwa

This commit is contained in:
any86 2020-04-03 09:03:20 +08:00
parent f3e782d4ae
commit 6674643359
6 changed files with 43 additions and 16 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -6,6 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" /> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link rel="manifest" href="<%= BASE_URL %>manifest.json">
<title>正则大全</title> <title>正则大全</title>
<!-- 百度统计 --> <!-- 百度统计 -->
<script> <script>
@ -20,9 +21,10 @@
<!-- <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.8/styles/github.min.css"> <!-- <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.8/styles/github.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.8/highlight.min.js"></script> --> <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.8/highlight.min.js"></script> -->
<style> <style>
:root{ :root {
--primary: #42b983; --primary: #42b983;
} }
* { * {
padding: 0; padding: 0;
margin: 0; margin: 0;
@ -47,26 +49,30 @@
list-style-type: none; list-style-type: none;
} }
@keyframes rotate{ @keyframes rotate {
from{ from {
transform: rotate(0); transform: rotate(0);
} }
to{ to {
transform: rotate(360deg); transform: rotate(360deg);
} }
} }
.loading{
.loading {
animation: rotate 1s infinite linear; animation: rotate 1s infinite linear;
margin:0; margin: 0;
padding:0; padding: 0;
position: fixed; position: fixed;
top:0;left:0;right: 0;bottom:0; top: 0;
margin:auto; left: 0;
right: 0;
bottom: 0;
margin: auto;
display: block; display: block;
width:100px; width: 100px;
height:100px; height: 100px;
border:0 solid #42b983; border: 0 solid #42b983;
border-right-width: 4px; border-right-width: 4px;
border-radius: 50%; border-radius: 50%;
} }

View File

@ -0,0 +1,15 @@
{
"short_name": "any-rule",
"name": "正则大全",
"icons": [
{
"src": "/any-rule/icon.png",
"type": "image/png",
"sizes": "192x192"
}
],
"background_color": "#2196F3",
"theme_color": "#2196F3",
"display": "standalone",
"start_url": "/any-rule"
}

View File

View File

@ -3,6 +3,12 @@ import App from './App.vue'
Vue.config.productionTip = false Vue.config.productionTip = false
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('./sw.js');
});
}
new Vue({ new Vue({
render: h => h(App), render: h => h(App),
}).$mount('#app') }).$mount('#app')