Browse Source

first commit

gesofts 3 years ago
commit
842e9655fe
6 changed files with 277 additions and 0 deletions
  1. 0 0
      README.md
  2. 17 0
      index.html
  3. 63 0
      js/index.js
  4. 21 0
      js/jquery-1.8.3-min.js
  5. BIN
      styles/images/car.png
  6. 176 0
      styles/index.css

+ 0 - 0
README.md


+ 17 - 0
index.html

@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>Title</title>
+    <link type="text/css" rel="stylesheet" href="./styles/index.css" />
+    <script type="application/x-javascript" src="./js/jquery-1.8.3-min.js"></script>
+    <script type="application/x-javascript" src="./js/index.js"></script>
+</head>
+<body style="padding-top: 20px;">
+    <div class="bus-lzlist" >
+
+        <ol id="lzlist">
+        </ol>
+    </div>
+</body>
+</html>

+ 63 - 0
js/index.js

@@ -0,0 +1,63 @@
+PageIndex = function () {
+    return{
+
+        defaultOption: {
+            basePath:"",
+            // 站点数据
+            stationFlys : [
+                //站点名称,站点编号
+                {name:"南京站", no:"1"},
+                {name:"新模范马路", no:"2"},
+                {name:"玄武门", no:"3"},
+                {name:"鼓楼", no:"4"},
+                {name:"珠江路", no:"5"},
+                {name:"新街口", no:"6"},
+                {name:"张府园", no:"7"},
+                {name:"三山街", no:"8"},
+                {name:"中华门", no:"9"},
+                {name:"安德门", no:"10"},
+                {name:"天隆寺", no:"11"},
+                {name:"软件大道", no:"12"},
+                {name:"花神庙", no:"13"},
+                {name:"南京南站", no:"14"},
+                {name:"双龙大道", no:"15"}
+            ],
+            // 进出站数据,1进站,2出站
+            inOutStationFlys:[
+                // 车牌号码,站点编号,进出站类型
+                {carNo:"苏AKE223", no:"4", type:1},
+                {carNo:"苏A4SK92", no:"10", type:2}
+            ]
+        },
+        init :function (){
+            this.funLoadLineInfo();
+
+            this.funLoadInOutStationInfo();
+        },
+        funLoadLineInfo : function () {
+            var html = "";
+            for (let nItem = 0; nItem < PageIndex.defaultOption.stationFlys.length; nItem++){
+                html += "<li id='s_"+PageIndex.defaultOption.stationFlys[nItem].no+"'><a>"+PageIndex.defaultOption.stationFlys[nItem].name+"</a></li>";
+            }
+            $("#lzlist").html(html);
+        },
+        funLoadInOutStationInfo : function () {
+            for (let nItem = 0; nItem < PageIndex.defaultOption.inOutStationFlys.length; nItem ++){
+                let liId = "#s_" + PageIndex.defaultOption.inOutStationFlys[nItem].no;
+                if (PageIndex.defaultOption.inOutStationFlys[nItem].type == 1){
+                    $(liId).append("<div class='inStation'><img src='./styles/images/car.png'></div>");
+                }
+                else{
+                    $(liId).append("<div class='outStation'><img src='./styles/images/car.png'></div>");
+                }
+            }
+        }
+
+
+    }
+}();
+
+
+$(function () {
+    PageIndex.init();
+})

File diff suppressed because it is too large
+ 21 - 0
js/jquery-1.8.3-min.js


BIN
styles/images/car.png


+ 176 - 0
styles/index.css

@@ -0,0 +1,176 @@
+li{
+    list-style: none;
+}
+.bus-lzlist {
+    counter-reset: sectioncounter
+}
+
+.bus-lzlist:hover ol:after {
+    opacity: 0
+}
+
+.bus-lzlist ol {
+    display: inline-block;
+    position: relative
+}
+
+.bus-lzlist ol:before {
+    position: absolute;
+    top: 10px;
+    right: 5px;
+    left: 5px;
+    height: 2px;
+    background: #317cf7;
+    content: ""
+}
+
+.bus-lzlist ol:after {
+    position: absolute;
+    right: 0;
+    bottom: 0;
+    left: 0;
+    height: 50px;
+    background-image: -webkit-gradient(linear,left top,left bottom,from(hsla(0,0%,100%,0)),color-stop(96%,#fff));
+    background-image: linear-gradient(180deg,hsla(0,0%,100%,0),#fff 96%);
+    opacity: 1;
+    -webkit-transition: all .2s;
+    transition: all .2s;
+    content: "";
+    pointer-events: none
+}
+
+.bus-lzlist ol+ol {
+    margin-top: 5px
+}
+
+.bus-lzlist li {
+    float: left;
+    position: relative;
+    width: 23px;
+    text-align: center
+}
+
+.bus-lzlist li:before {
+    display: block;
+    margin: 0 auto 5px;
+    -webkit-box-sizing: border-box;
+    box-sizing: border-box;
+    border: 2px solid #317cf7;
+    border-radius: 50%;
+    width: 23px;
+    height: 23px;
+    font-size: 12px;
+    font-weight: 600;
+    line-height: 20px;
+    background: #fff;
+    content: counter(sectioncounter);
+    counter-increment: sectioncounter
+}
+
+/*.bus-lzlist li:after {*/
+/*    display: block;*/
+/*    position: absolute;*/
+/*    top: 10px;*/
+/*    right: 5px;*/
+/*    left: 5px;*/
+/*    height: 2px;*/
+/*    background: #317cf7;*/
+/*    content: ""*/
+/*}*/
+
+.bus-lzlist li:hover a {
+    max-height: auto;
+    color: #629dff
+}
+
+.bus-lzlist li:active a {
+    color: #115fe0
+}
+
+.bus-lzlist li.active:after {
+    position: absolute;
+    top: 26px;
+    left: 50%;
+    margin-left: -4px;
+    width: 8px;
+    height: 8px;
+    background: #317cf7;
+    -webkit-transform: rotate(45deg);
+    transform: rotate(45deg);
+    content: ""
+}
+
+.bus-lzlist li.active a {
+    position: relative;
+    z-index: 1;
+    border-radius: 4px;
+    color: #fff!important;
+    background-color: #317cf7
+}
+
+.bus-lzlist li+li {
+    margin-left: 30px
+}
+
+.bus-lzlist a {
+    display: block;
+    overflow: hidden;
+    table-layout: fixed;
+    margin: 0 auto;
+    padding: 4px 3px 4px 4px;
+    width: 14px;
+    max-height: 170px;
+    font-size: 14px;
+    text-align: left;
+    letter-spacing: 3px;
+    word-wrap: break-word;
+    -webkit-transition: color .2s;
+    transition: color .2s;
+    -webkit-writing-mode: vertical-rl;
+    writing-mode: vertical-rl;
+    -webkit-writing-mode: tb-rl;
+    -ms-writing-mode: tb-rl;
+    writing-mode: tb-rl;
+    cursor: pointer;
+}
+
+.bus-lzlist.rendermac li:before,.bus-lzlist a {
+    line-height: 17px
+}
+
+.bus-lzlist.rendermac a {
+    margin-left: 4px
+}
+
+.bus-lzlist.renderpc a {
+    margin-left: 2px
+}
+
+.bus-lzlist.renderm li:before {
+    line-height: 15px
+}
+
+.inStation{
+    top: -16px;
+    left: -10px;
+    position: absolute;
+    width: 48px;
+    height: 44px;
+}
+.outStation{
+    top: -6px;
+    left: 15px;
+    position: absolute;
+    width: 42px;
+    height: 24px;
+}
+
+.outStation img, .inStation img{
+    width: 24px;
+    height: 24px;
+}
+
+.outStation div, .inStation div{
+    font-size: 1px;
+    height: 20px;
+}