Added styles and yotsuba.css

This commit is contained in:
Savetheinternet 2011-01-20 19:35:41 +11:00
parent 0190dcfa52
commit 915dcc55eb
3 changed files with 91 additions and 0 deletions

41
main.js
View File

@ -24,8 +24,49 @@ function citeReply(id) {
document.getElementById('body').value += '>>' + id + '\n';
}
var selectedstyle = 'Yotsuba B';
var styles = [
['Yotsuba B', '/default.css'],
['Yotsuba', '/yotsuba.css']
];
function changeStyle(x) {
localStorage.stylesheet = styles[x][1];
document.getElementById('stylesheet').href = styles[x][1];
selectedstyle = styles[x][0];
}
newLink = document.createElement('link');
newLink.rel = 'stylesheet';
newLink.type = 'text/css';
newLink.id = 'stylesheet';
document.getElementsByTagName('head')[0].insertBefore(newLink, document.getElementsByTagName('link')[0].lastChild)
if(localStorage.stylesheet) {
for(x=0;x<styles.length;x++) {
if(styles[x][1] == localStorage.stylesheet) {
changeStyle(x);
break;
}
}
}
function init()
{
newElement = document.createElement('div');
newElement.className = 'styles';
for(x=0;x<styles.length;x++) {
style = document.createElement('a');
style.innerHTML = '[' + styles[x][0] + ']';
style.href = 'javascript:changeStyle(' + x + ');';
if(selectedstyle == styles[x][0])
style.className = 'selected';
newElement.appendChild(style);
}
document.getElementsByTagName('body')[0].insertBefore(newElement, document.getElementsByTagName('body')[0].lastChild)
if (window.location.hash.indexOf('q') == 1)
citeReply(window.location.hash.substring(2));
else if (window.location.hash.substring(1))

View File

@ -233,4 +233,14 @@ span.spoiler {
}
span.spoiler:hover {
color: white;
}
div.styles {
float: right;
padding-bottom: 20px;
}
div.styles a {
margin: 0 10px;
}
div.styles a.selected {
text-decoration: none;
}

40
yotsuba.css Normal file
View File

@ -0,0 +1,40 @@
body {
background: #ffe url('img/fade-yotsuba.png') repeat-x 50% 0%;
color: #800000;
}
a:link, a:visited, p.intro a.email span.name {
color: #0000ff;
}
a:link:hover {
color: #d00;
}
a.post_no {
color: #800000;
}
div.post.reply {
background: #f0e0d6;
border-color: #d9bfb7;
}
div.post.reply.highlighted {
background: #f0c0b0;
border-color: #d9bfb7;
}
div.post.reply p.body a {
color: navy;
}
p.intro span.subject {
color: #d00;
}
form table tr th {
background: #EA8;
}
div.ban h2 {
background: #FCA;
color: inherit;
}
div.ban {
border-color: #800;
}
div.ban p {
color: black;
}