summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2011-01-20 19:35:41 +1100
committerSavetheinternet <savetheinternet@n0v4.com>2011-01-20 19:35:41 +1100
commit915dcc55ebfcdb441f4b0efee90b12334718b9bd (patch)
tree4fe00d5af85db73a87256e7a9bfd6c2220aeb311
parent0190dcfa52aee3acd6871cd1885ed171ad30c69f (diff)
Added styles and yotsuba.css
-rw-r--r--main.js41
-rw-r--r--style.css10
-rw-r--r--yotsuba.css40
3 files changed, 91 insertions, 0 deletions
diff --git a/main.js b/main.js
index d0b0e0d6..dd46cd18 100644
--- a/main.js
+++ b/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))
diff --git a/style.css b/style.css
index 058de230..c02cae54 100644
--- a/style.css
+++ b/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;
} \ No newline at end of file
diff --git a/yotsuba.css b/yotsuba.css
new file mode 100644
index 00000000..65509290
--- /dev/null
+++ b/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;
+} \ No newline at end of file