Browse Source

Added styles and yotsuba.css

pull/40/head
Savetheinternet 14 years ago
parent
commit
915dcc55eb
  1. 41
      main.js
  2. 10
      style.css
  3. 40
      yotsuba.css

41
main.js

@ -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))

10
style.css

@ -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

@ -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;
}
Loading…
Cancel
Save