update css

This commit is contained in:
wolegca 2019-09-20 22:34:39 +08:00
parent 71720a31a8
commit e3bc023d61
5 changed files with 106 additions and 56 deletions

View File

@ -1,61 +1,39 @@
.container{ div.sidebar div:nth-of-type(n+1) {
max-width: 1440px; margin-bottom: 10px
margin:0 auto;
position: relative
} }
.container:before{ div.sidebar div:nth-of-type(n+1) *{
content:'';
display: block; display: block;
position:fixed; font-size: 16px;
top:0px; padding: 2px 0px;
left:0px; margin: 3px 0px
height:150%;
width:100%;
background: black url(../images/bg.jpg) no-repeat top;
background-size: cover
} }
.clearfix:after{ div.sidebar div:nth-of-type(n+1) span{
content:''; font-weight: bold;
display: block; font-size: 18px
height:0px;
clear: both;
visibility: hidden
} }
.sidebar-border{ div.sidebar div:nth-of-type(n+1) a{
position: absolute; text-decoration: none;
left:0px; transition:all ease .2s;
top:0px; padding-left: 2px;
display: block; border-radius:5px;
width:250px; box-shadow: 1px 1px 2px #999;
background-color: transparent; min-height: 50px;
padding-top:50px; padding:15px 5px;
overflow-x:hidden;
padding-bottom: 10px;
padding-left: 10px
} }
.sidebar{ div.sidebar div:nth-of-type(n+1) a:visited{
position: relative; color:black
display: block;
width:100%;
background-color:rgba(255,255,255,.8);
border-radius: 15px;
padding:15px
} }
.sidebar div:first-child{ div.sidebar div:nth-of-type(n+1) a:hover{
font-size: 20px; color:green;
font-weight: bold box-shadow: 2px 2px 5px #999;
transform:scale(1.05)
} }
@media screen and (max-width:700px){ div.sidebar div:nth-of-type(n+1) a:active{
.sidebar-border{ color:red
position: relative;
width:100%;
height:auto;
padding:0px
}
} }

View File

@ -14,7 +14,8 @@ body {
width: 100%; width: 100%;
z-index: 0; z-index: 0;
position: relative; position: relative;
display: block display: block;
overflow-x: hidden
} }
#menu-control { #menu-control {
@ -309,6 +310,61 @@ body {
left: 0px 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 { @keyframes fadeIn {
from { from {
opacity: 0 opacity: 0
@ -380,6 +436,22 @@ body {
border-radius: 0px 0px 10px 13px; border-radius: 0px 0px 10px 13px;
color:white 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) { @media screen and (max-width:480px) {

View File

@ -10,15 +10,15 @@
// } // }
// }); // });
var index = getQueryString('i');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "content.json", url: "content.json?timestamp=" + (new Date()).valueOf(),
dataType: "json", dataType: "json",
success: function (response) { success: function (response) {
var lastIndex = response.length - 1; var lastIndex = response.length - 1;
listContent(response); listContent(response, lastIndex);
if (response[lastIndex]['hasCode']) if (response[lastIndex]['hasCode'])
loadScript('content/js/' + response[lastIndex]['date'] + '.js'); loadScript('content/js/' + response[lastIndex]['date'] + '.js');

View File

@ -121,7 +121,7 @@ function listContent(json, num) {
sidebar = $('.sidebar'); sidebar = $('.sidebar');
for (; i <= len; i++) { for (; i <= len; i++) {
index = len - i; index = len - i;
if (len - i !== num) { if (index != num) {
sidebar.append($('<div>').append($('<a>').attr('href', 'view.html?i=' + index).append(json[index]['title']))); sidebar.append($('<div>').append($('<a>').attr('href', 'view.html?i=' + index).append(json[index]['title'])));
} else { } else {
sidebar.append($('<div>').append($('<span>').append(' · ' + json[index]['title']))); sidebar.append($('<div>').append($('<span>').append(' · ' + json[index]['title'])));

View File

@ -2,7 +2,7 @@
var index = getQueryString('i'); var index = getQueryString('i');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "content.json", url: "content.json?timestamp=" + (new Date()).valueOf(),
dataType: "json", dataType: "json",
success: function (response) { success: function (response) {