Last active
December 22, 2015 02:29
-
-
Save c0untd0wn/6403669 to your computer and use it in GitHub Desktop.
Change SNULife to its old design
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name snulife-oldtheme | |
// @version 0.8 | |
// @description Change SNULife to its old design | |
// @include http://*.snulife.com/* | |
// @include http://snulife.com/* | |
// @updateURL https://raw.github.com/gist/6403669/snulife-oldtheme.user.js | |
// @copyright 2013+, c0untd0wn | |
// ==/UserScript== | |
var $=jQuery; | |
// 게시글 목록에서 댓글의 수 스타일 변경 | |
$('#bd .replyNum').css('color', '#c66'); | |
$('#bd .replyNum').each(function(){ | |
$(this).text('('+$(this).text()+')'); | |
}); | |
// 게시글 목록에서 New, 이미지, 첨부파일 아이콘 제거 | |
$('.extraimages').remove(); | |
// 추천받은 댓글 배경 색상 변경 | |
$('.fdb_lst_ul li').filter(function(){ | |
var color = $(this).css('background-color'); | |
return color === 'rgb(228, 242, 247)' || color === '#e4f2f7'; | |
}).css('background-color', '#FFF2E5'); | |
// 댓글 추천(하트 모양) 색상 변경 | |
$('.bd em').css('color', '#ff9966'); | |
// 글 제목 스타일 변경 | |
$('.rd_hd .board h1').css({ | |
'font-size': '18px', | |
'padding-top': '5px', | |
'padding-bottom': '5px' | |
}); | |
// 닉네임 스타일 변경 | |
$('.rd_hd .board .nick').css({ | |
'font-size': '13px', | |
'color': '#3399ff' | |
}); | |
// 조회수, 추천수, 비추천수, 댓글수 스타일 변경 | |
$('.rd_hd .btm_area span').css('font-size', '13px'); | |
$('.rd_hd .board b').css('color', '#ff3300'); | |
// 추천,비추천 버튼 스타일 변경 | |
$('.rd_vote a.btn_img').css({ | |
'height': '40px', | |
'width': '40px', | |
'margin': '0' | |
}); | |
$('.rd_vote a.btn_img img').css('margin-top', '13px'); | |
$('.rd_vote a.btn_img span').remove(); | |
// 덧글 배경 색상 변경 | |
var additional = $('#comment').prev().prev().prev().children().last(); | |
if(!additional.hasClass('xe_content')){ | |
if(additional.hasClass('rd_tag')) | |
additional = additional.prev(); | |
additional.css('background', '#ffebd6'); | |
} | |
// 댓글 경계 색상 변경 | |
$('li.fdb_itm').css('border-top-color', '#adadad'); | |
// 댓글 신고 버튼 transition 제거 (이것 때문에 댓글이 흔들림) | |
$('.ico_16px').css('transition', 'none'); | |
function addCss(styleText){ | |
var style = document.createElement('style'); | |
style.type = 'text/css'; | |
if(style.styleSheet){ | |
style.styleSheet.cssText = styleText; | |
} | |
else{ | |
style.innerHTML = styleText; | |
} | |
document.getElementsByTagName('head')[0].appendChild(style); | |
} | |
// 커뮤니티의 각 서브메뉴에 따라 기존 스타일 색상 적용 | |
function applyTheme(maincolor, subcolor){ | |
$('#headerMenu .main_menu').css('background-color', maincolor); | |
$('#lnb li.on').css('background-color', subcolor); | |
$('#gnb li').hover(function(){ $(this).css('color', maincolor) }, function(){ $(this).css('color', '#737373') }); | |
addCss("#headerMenu #gnb li.on { background: " + subcolor + "}"); | |
$('#lnb_title').css('background-color', maincolor); | |
$('#gnb').css('background', maincolor); | |
$('.gnbsub li.on a').css('color', maincolor); | |
$('.header_title').css('border-left', '2px solid '+maincolor); | |
} | |
if(!(location.href.indexOf('main') > 0)){ | |
if(location.href.indexOf('love') > 0){ | |
applyTheme('#F05A86', '#F37B9E'); | |
} | |
if(location.href.indexOf('gongsage') > 0){ | |
//applyTheme('#FECD38', '#FED760'); | |
applyTheme('#FFCC00', '#FFD633'); | |
//applyTheme('#E5B832', '#FECD38'); | |
} | |
if(location.href.indexOf('snuplaza') > 0){ | |
applyTheme('#0033CC', '#335CD6'); | |
} | |
if(location.href.indexOf('snukin') > 0){ | |
applyTheme('#63BD5A', '#82CA7B'); | |
} | |
} | |
// 추천, 비추천 등에 의한 새로고침 비활성화 | |
var script = document.createElement('script'); | |
script.type = 'text/javascript'; | |
script.innerHTML = 'function completeCallModuleAction(a){"success"!=a.message&&alert(a.message);}' | |
document.getElementsByTagName('head')[0].appendChild(script); | |
// 글꼴 나눔고딕으로 변경 | |
addCss('@import url(http://fonts.googleapis.com/earlyaccess/nanumgothic.css); *{ font-family: "Nanum Gothic"; }'); | |
// 동물사진 border 색상 변경 | |
addCss('#temporary_animal { border-color: #ff9966 !important }'); | |
setTimeout("(function(){ var $=jQuery; $('.animal_pic').each(function(){ $(this).children().first().css('border-color', '#ff9966') });})();", 1500); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment