折腾了一套半成品Hacker风格主题

最近抽时间把博客主题做了一下。本人对设计了解不多,参考了一些别人的皮肤,来回换了几个风格,都不太满意,暂时先定了这套:hacker风。

主要素材都是网上找的,颜色风格看了几套hacker网站后慢慢堆积而成。

效果:

主要参考教程是嘻哈烧饼,以及博客园官方教程。当然,主要还是F12来回调试,这是肯定的。

把代码上一下,因为是半成品,会有不少问题,包括自适应等都还没调,仅供参考,我会出时间完善。喜欢的可以先拿去做二次开发,折腾下挺有意思。

1.首先,下载主题CSS样式,将内容粘贴到后台设置里的【页面定制CSS代码】框里:

body {
    background-image: url(//static.uv-w.com/cnblogs/bg04.png);
    background-color: #000100;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    text-shadow: 1px 1px 1px #040404;
}

.test {
}

a {
    color: #1e989d;
    text-decoration: none;
}

a[name='top'] {
    /* height: 80px;*/
    position: fixed;
    width: 50px;
    z-index: 3;
    /* border: 1px solid #1e8081;*/
    bottom: 25px;
    right: 60px;
}

#backTop {
    background-image: url(http://www.sucaijiayuan.com/uploads/allimg/120923/2-120923001401.png);
    width: 34px;
    background-repeat: no-repeat;
    border-radius: 6px;
    height: 34px;
    display: inline-block;
    opacity: 0.5;
    cursor: pointer;
}

#backTop:hover {
    background-position: 0 -34px;
}

#home {
    padding: 0;
    box-shadow: 1px 0px 7px #18ecf5;
    background: rgba(29, 68, 70, 0.35);
    font-family: Georgia, serif;
    letter-spacing: -0.01em;
    word-spacing: 0.2em;
    line-height: 1.8em;
    width: 90%;
    max-width: 1000px;
    min-width: 600px;
    margin: 30px auto;
}

.menu {
    border: 1px solid #2a842a;
    padding: 0;
    border-radius: 3px;
    box-shadow: 1px 1px 1px;
    width: 49px;
    text-shadow: 1px 1px 1px #103233;
    display: inline-block;
    text-align: center;
    background-color: #102129;
}

#header {
    height: 100px;
    position: relative;
    width: 100%;
    /* border-bottom: 1px solid #147114;*/
}

#blogTitle {
    background: #0d0d0d;
    width: 150px;
    height: 150px;
    font-size: 12px;
    position: absolute;
    left: 50%;
    margin-left: -75px;
    text-align: center;
    border-radius: 50%;
    overflow: hidden;
    margin-top: -24px;
    z-index: 3;
    border: 2px solid #147114;
    box-shadow: 0px 5px 0px #2196F3;
    /* opacity: 0.5;*/
    background-image: url(http://static.uv-w.com/cnblogs/spy01.png);
    background-repeat: no-repeat;
    background-size: 150px;
}

#navigator {
    background: #abb9a6;
    margin: auto;
    position: relative;
    top: 60px;
    z-index: 2;
}

#blogTitle h1 {
    margin-top: 98px;
}

#blogTitle h1 a {
    text-decoration: none;
    color: #6b5529;
    text-shadow: 2px 2px 2px #2196f3;
}

.c_b_p_desc_readmore {
    display: block;
    color: #488448;
    text-decoration: none;
    border: 1px solid #319f31;
    font-size: 13px;
    margin-top: 7px;
    box-shadow: 1px 1px 1px #0bbac3;
    text-align: center;
    width: 60px;
}

#navList {
    width: 630px;
    background: aliceblue;
    margin: auto;
}

#navList li {
    display: table-cell;
    width: 75px;
}

#navList li a {
    text-decoration: none;
    color: #24b924;
    font-weight: 600;
}

#navList li:nth-of-type(1) {
    float: left;
}

#navList li:nth-of-type(2) {
    float: left;
}

#navList li:nth-of-type(3) {
    float: left;
}

#navList li:nth-of-type(4) {
    float: right;
}

#navList li:nth-of-type(5) {
    float: right;
}

#navList li:nth-of-type(6) {
    float: right;
}

.blogStats {
    display: none;
}

#main {
    /* background: rgba(18, 232, 59, 0.1);*/
}

#mainContent {
    display: table-cell;
    padding: 20px 8px;
    /* background: #9E9E9E;*/
}

.day {
    margin-top: 30px;
    padding: 10px 18px;
    position: relative;
    box-shadow: 1px 1px 1px rgb(46, 155, 160);
    border-radius: 18px;
    border: 1px solid #1c615a;
    background-color: rgba(44, 76, 46, 0.32);
}

.day .dayTitle {
    width: 61px;
    height: 50px;
    line-height: 24px;
    position: absolute;
    left: -84px;
    top: 2px;
    background-size: 58px;
    text-align: center;
    background-position: 2px;
    background-repeat: no-repeat;
    opacity: 0.6;
    border-radius: 6px;
    box-shadow: 1px 1px 1px #00f3ff;
    border: 1px solid #1c615a;
    background-color: rgba(44, 76, 46, 0.87);
}

.dayTitle a {
    text-decoration: none;
    color: #37b537;
}

.postTitle a {
    text-decoration: none;
    color: #37b537;
    font-weight: 700;
    font-size: 20px;
    /* text-shadow: 1px 1px 1px rgb(27, 181, 60);*/
}

.postCon {
    color: rgb(113, 152, 113);
    margin-top: 2px;
}

.postDesc {
    color: #476d4c;
}

.postDesc a {
    color: #376937;
    border: 1px solid #2a842a;
    padding: 1px 4px;
    text-decoration: none;
    border-radius: 2px;
    font-size: 13px;
    box-shadow: 1px 1px 1px #0f6e71;
}

#sideBar {
    display: table-cell;
    padding: 20px;
    /* border-left: 1px solid #147114;*/
    width: 25%;
}

.sidebar-block, .newsItem {
    border: 1px solid #1c615a;
    margin-top: 20px;
    background: rgba(36, 93, 41, 0.2);
    padding: 4px 10px;
    border-radius: 10px;
    box-shadow: 1px 1px 1px #009688;
    color: #009688;
}

#RecentCommentsBlock ul, #TopViewPostsBlock ul, #TopFeedbackPostsBlock ul {
    list-style: none;
}

#cnblogs_post_body {
    color: #37b537;
    text-shadow: 1px 1px 1px #0a1312;
}

.recent_comment_title, #TopViewPostsBlock ul li, #TopFeedbackPostsBlock ul li {
    margin-left: -40px;
    font-size: 11px;
    text-decoration: underline;
}

.recent_comment_body {
    margin-left: -40px;
    font-size: 14px;
    color: #17ef83
}

.recent_comment_author {
    color: #1fab9d;
}

#sidebar_postarchive ul li {
    margin-left: -23px;
}

.cnblogs_code {
    border: 1px solid #217c80;
    background-color: rgba(78, 156, 145, 0.62) !important;
    border-radius: 9px;
    text-shadow: 0px 0px 1px #e8dddd !important;
}

.code_img_closed {
    opacity: 0.5;
}

.cnblogs_code_collapse {
    background: #274b32;
    color: #4e8e50;
    border: 1px solid #17babf;
    border-radius: 2px;
}

.cnblogs_code_hide {
    text-shadow: 0px 0px 1px #e8dddd !important;
    background: rgba(22, 27, 13, 0.19) !important;
   /* font-size: 18px; */
}

.cnblogs_code_toolbar {
    background-color: rgba(48, 34, 34, 0) !important;
}

.cnblogs_code_toolbar .cnblogs_code_copy {
    background: inherit;
}

.cnblogs_code_toolbar .cnblogs_code_copy>a {
    background-color: inherit !important;
}

.cnblogs_code_copy>a>img {
    opacity: 0.2;
    border-radius: 3px;
}

#footer {
    /* display: none;*/
    color: #147114;
    margin-left: 12px;
    text-shadow: 1px 1px 1px #162b3c;
}

#under_post_news, #under_post_kb {
    display: none;
}

#tbCommentAuthor {
    background: #aecace;
    border-radius: 3px;
    border: 1px solid #1f7a7e;
}

#tbCommentBody {
    background: #aecace;
    border-radius: 3px;
    border: 1px solid #1f7a7e;
    max-height: 200px;
    height: 100px;
}

#btn_comment_submit, .input_my_zzk {
    background: #2a4432;
    border: 1px solid #199398;
    color: #449e44;
    border-radius: 3px;
}
同时必须选中【禁用模板默认CSS】。

2.在【页脚Html代码】里放入如下代码:

1 <script>
2 //返回顶部按钮
3 $('a[name="top"]').html( '<span id="backTop"></span>');
4 $("#backTop").on('click', function(){
5     $('body,html').animate({scrollTop:0},300);
6 });
7 </script>
戳我查看

然后保存就可以看效果la。

附:

博客园的开放性真的挺好,给我们很多空间去折腾,这不正是我们的程序猿的意义所在吗?

posted @ 2016-11-09 10:36  uv-w  阅读(749)  评论(2)    收藏  举报