Login light

study/goLearning/bili/bili.html.md

!!!
<style>
#iframe{
    width: 100%;
    min-height: 380px;
    height: auto;
}
#post-content{
background-color: #ddd;
}
.wrapper-lg {
    padding: 0px;
}
#bili{
min-height: 4500px;
overflow:hidden;
}
#bili .bili_div{
    position: relative;
    width: 395px;
    height: 170px;
    float: left;
    margin: 20px 0px 0px 5px;
}
#bili .bili_col{
    padding: 5px;
    margin-left: 15px;
    width: 365px;
    height: 100%;
    border-radius: 45px 10px 10px 10px;
    background-color: ghostwhite;
    box-shadow: -12px 12px 8px #919191;
}
#bili .bili_head{
margin:0px;
background-size: 100% 100%;
position: absolute;
left: 0px;
top: 0px;
width: 50px;
height: 50px;
border-radius: 50%;
border: 1px solid #eee;
}
#bili .bili_main{
font-size: 12px;
    padding-left: 30px;
}
#bili .bili_name{
height:20px;
padding: 0px 0px 0px 0px;
}
#bili .bili_name a{
font-weight: bold;
color: #000;
}
#bili .bili_time{
line-height:20px;
float: right;
}
#bili .bili_title{
height: 24px;
overflow: hidden;
color: #f35;
}
#bili .bili_title a{
text-decoration: none;
color: #f35;
}
#bili .bili_desc{
    margin-left: 6px;
    line-height: 20px;
    width: 159px;
    height: 95px;
    overflow: hidden;
    float: left;
    font-size: 10px;
}
#bili .bili_img{
margin:0px;
background-repeat: no-repeat;
    float: left;
    height: 100px;
    width: 160px;
    border-radius: 6px;
}
#bili .bili_bot{
margin-top: 3px;
}
</style>
<script>
//配置存储图片的路径,需要与php文件中的路径同步修改
$.ajax({
    dataType: "json",
    url: '/code/bilibili.json',
    beforeSend:function(request) {
        request.setRequestHeader("Cache-control", "max-age: 1000");
    }
})
//获取json
.success(function(bili_obj){
//document.getElementById('iframe').src='//player.bilibili.com/player.html?page=1&aid='+bili_obj.list[0].aid;
    bilibili_html(bili_obj);
});
function bilibili_html(obj){
$('#bili').html('');
$.each(obj.list,function(k,i){
    var creat_time = new Date(i.created * 1000);//toLocaleString()
    creat_time = creat_time.toLocaleDateString().replace(/\//g, "-") + " " + creat_time.toTimeString().substr(0, 8)
    $('#bili').append(
    '<div class="bili_div"><a class="no-external-link" title="'+i.title+'" target="_blank" href="http://www.bilibili.com/video/av'+i.aid+'"><div class="bili_col">'
    +'<img class="bili_head" referrerPolicy="no-referrer" rel="no-referrer" src="'+obj.up_img[i.mid]+'@64w_64h.webp">'
    +'<div class="bili_main"><div class="bili_name">' + i.author
    +'<span class="bili_time">' + creat_time + '</span></div>'
    +'<div class="bili_title">'
    + i.title +'</div>'
    +'<div class="bili_bot">'
    +'<img class="bili_img" referrerPolicy="no-referrer" rel="no-referrer" src="'+i.pic+'@320w_200h_100Q_1c.webp"/>'
    +'<div class="bili_desc">' + i.description + '</div></div></div></div></a></div>'
    );
});
}
//@182w_112h.webp
</script>
<!-- <iframe id="iframe" src="" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe> -->
<div id="bili"></div>
!!!