12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta name="screen-orientation" content="portrait">
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0"/>
- <title>获奖名单</title>
- <link rel="icon" type="image/x-icon" href="img/favicon.ico" />
- <link rel="stylesheet" type="text/css" href="css/reset.css">
- <link rel="stylesheet" type="text/css" href="css/wall.css">
- <style type="text/css">
- .wall {
- overflow: scroll;
- background-repeat: repeat;
- }
- ::-webkit-scrollbar {
- display: none;
- }
- body, html {
- width: 100%;
- height: 100%;
- }
- .mask {
- -webkit-filter:blur(5px);
- filter:blur(5px);
- }
- #main {
- -webkit-transition: all 1s;
- transition: all 1s;
- }
- .result-list {
- text-align: center;
- color: #4de7c8;
- font-size: 30px;
- line-height: 50px;
- margin-top: 50px;
- margin-bottom: 50px;
- font-family: '幼圆';
- }
- .result-title {
- text-align: center;
- color: #4de7c8;
- font-size: 40px;
- margin-top: 100px;
- font-family: '幼圆';
- }
- </style>
- </head>
- <body>
- <div id="main" class="wall">
- <div class="result-title">获奖名单</div>
- <div class="result-list" v-for="result in results">
- <div v-for="item in result">
- {{item}}
- </div>
- </div>
- </div>
- <script type="text/javascript" src="js/vue.js"></script>
- <script type="text/javascript">
- new Vue({
- el: '#main',
- data: {
- results: []
- },
- mounted () {
- let vm = this
- let locals = window.localStorage
- let str_results = []
- // 遍历(排除choosed)
- for(let i = 0; i<localStorage.length; i++){
- if (localStorage.key(i) !== 'choosed') {
- str_results.push(localStorage.getItem(localStorage.key(i)))
- }
- }
- // 分割每个string, 并将</br>换成空格
- let results = []
- for(let nameList of str_results) {
- let temp = JSON.parse(nameList)
- temp = temp.map(item => {return item.replace('<br/>', ' ')})
- results.push(temp)
- }
-
- // 根据长度进行排序,名单短的放在前面
- results = results.sort((x, y) => { return x.length - y.length;})
- this.results = results
- },
- })
- </script>
- </body>
- </html>
|