From e3bc023d61b71773ca3a4cf32a87996976d0d8ba Mon Sep 17 00:00:00 2001 From: wolegca <2738076308@qq.com> Date: Fri, 20 Sep 2019 22:34:39 +0800 Subject: [PATCH] update css --- css/index.css | 72 ++++++++++++++++------------------------------ css/myui.css | 74 +++++++++++++++++++++++++++++++++++++++++++++++- js/index.js | 8 +++--- js/initialize.js | 2 +- js/view.js | 6 ++-- 5 files changed, 106 insertions(+), 56 deletions(-) diff --git a/css/index.css b/css/index.css index 7aa9287..765ccfa 100644 --- a/css/index.css +++ b/css/index.css @@ -1,61 +1,39 @@ -.container{ - max-width: 1440px; - margin:0 auto; - position: relative +div.sidebar div:nth-of-type(n+1) { + margin-bottom: 10px } -.container:before{ - content:''; +div.sidebar div:nth-of-type(n+1) *{ display: block; - position:fixed; - top:0px; - left:0px; - height:150%; - width:100%; - background: black url(../images/bg.jpg) no-repeat top; - background-size: cover + font-size: 16px; + padding: 2px 0px; + margin: 3px 0px } -.clearfix:after{ - content:''; - display: block; - height:0px; - clear: both; - visibility: hidden +div.sidebar div:nth-of-type(n+1) span{ + font-weight: bold; + font-size: 18px } -.sidebar-border{ - position: absolute; - left:0px; - top:0px; - display: block; - width:250px; - background-color: transparent; - padding-top:50px; - overflow-x:hidden; - padding-bottom: 10px; - padding-left: 10px +div.sidebar div:nth-of-type(n+1) a{ + text-decoration: none; + transition:all ease .2s; + padding-left: 2px; + border-radius:5px; + box-shadow: 1px 1px 2px #999; + min-height: 50px; + padding:15px 5px; } -.sidebar{ - position: relative; - display: block; - width:100%; - background-color:rgba(255,255,255,.8); - border-radius: 15px; - padding:15px +div.sidebar div:nth-of-type(n+1) a:visited{ + color:black } -.sidebar div:first-child{ - font-size: 20px; - font-weight: bold +div.sidebar div:nth-of-type(n+1) a:hover{ + color:green; + box-shadow: 2px 2px 5px #999; + transform:scale(1.05) } -@media screen and (max-width:700px){ - .sidebar-border{ - position: relative; - width:100%; - height:auto; - padding:0px - } +div.sidebar div:nth-of-type(n+1) a:active{ + color:red } \ No newline at end of file diff --git a/css/myui.css b/css/myui.css index 8a4201a..6b59342 100644 --- a/css/myui.css +++ b/css/myui.css @@ -14,7 +14,8 @@ body { width: 100%; z-index: 0; position: relative; - display: block + display: block; + overflow-x: hidden } #menu-control { @@ -309,6 +310,61 @@ body { left: 0px } +.container{ + max-width: 1440px; + margin:0 auto; + position: relative +} + +.container:before{ + content:''; + display: block; + position:fixed; + top:0px; + left:0px; + height:150%; + width:100%; + background: black url(../images/bg.jpg) no-repeat top; + background-size: cover +} + +.clearfix:after{ + content:''; + display: block; + height:0px; + clear: both; + visibility: hidden +} + +.sidebar-border{ + position: absolute; + left:0px; + top:0px; + display: block; + width:250px; + background-color: transparent; + padding-top:50px; + overflow-x:hidden; + padding-bottom: 10px; + padding-left: 10px +} + +.sidebar{ + position: relative; + display: block; + width:100%; + background-color:rgba(255,255,255,.8); + border-radius: 15px; + padding:15px; + cursor:default +} + +.sidebar div:first-child{ + font-size: 20px; + font-weight: bold; + margin-bottom: 10px +} + @keyframes fadeIn { from { opacity: 0 @@ -380,6 +436,22 @@ body { border-radius: 0px 0px 10px 13px; color:white } + + .sidebar-border{ + position: relative; + width:100%; + height:auto; + padding:0px + } + + .sidebar div:nth-of-type(n+1) *{ + text-align: center + } + + .sidebar div:nth-of-type(n+1) a{ + border:1px solid black; + border-radius:5px + } } @media screen and (max-width:480px) { diff --git a/js/index.js b/js/index.js index dde115d..33d243d 100644 --- a/js/index.js +++ b/js/index.js @@ -10,15 +10,15 @@ // } // }); - +var index = getQueryString('i'); $.ajax({ type: "GET", - url: "content.json", + url: "content.json?timestamp=" + (new Date()).valueOf(), dataType: "json", success: function (response) { var lastIndex = response.length - 1; - - listContent(response); + + listContent(response, lastIndex); if (response[lastIndex]['hasCode']) loadScript('content/js/' + response[lastIndex]['date'] + '.js'); diff --git a/js/initialize.js b/js/initialize.js index 6cc80e9..843a2b8 100644 --- a/js/initialize.js +++ b/js/initialize.js @@ -121,7 +121,7 @@ function listContent(json, num) { sidebar = $('.sidebar'); for (; i <= len; i++) { index = len - i; - if (len - i !== num) { + if (index != num) { sidebar.append($('
').append($('').attr('href', 'view.html?i=' + index).append(json[index]['title']))); } else { sidebar.append($('
').append($('').append(' ยท ' + json[index]['title']))); diff --git a/js/view.js b/js/view.js index 8fe88a1..874e701 100644 --- a/js/view.js +++ b/js/view.js @@ -2,11 +2,11 @@ var index = getQueryString('i'); $.ajax({ type: "GET", - url: "content.json", + url: "content.json?timestamp=" + (new Date()).valueOf(), dataType: "json", success: function (response) { - - listContent(response,index); + + listContent(response, index); if (response[index]['hasCode']) loadScript('content/js/' + response[index]['date'] + '.js');