New: Ability, Adventuring Company, Alchemy, Archetype, Career, Character Creation, Equipment, Markup, Mechanika, Monsternomicon, Organization, Race, Skill, Spell, Steamjack, Thrall

This commit is contained in:
phil 2013-06-12 08:38:42 +02:00
commit 04d184a4db
38 changed files with 7579 additions and 0 deletions

View file

@ -0,0 +1,58 @@
(function() {
function addListener(elem, event, f) {
if (elem.addEventListener) elem.addEventListener(event, f, false);
else elem.attachEvent("on"+event, f);
}
function expand() {
var jsOnloads = document.querySelectorAll("a.js-expandable");
for(var index = 0; index < jsOnloads.length; index++) {
var jsOnload = jsOnloads.item(index)
, body = document.querySelector("body")
, availableWidth = parseFloat(window.getComputedStyle(body)["width"], 10)
, article = body.querySelector("article")
, style = window.getComputedStyle(article)
, iniWidth = parseFloat(style["width"], 10)
, paddingLeft = parseFloat(style["paddingLeft"], 10)
, maxWidth = availableWidth - 2 * paddingLeft;
function resize(event) {
event.preventDefault();
var width = parseFloat(style["width"], 10)
, newWidth = (width >= maxWidth-30) ? iniWidth : maxWidth
, text = (width >= maxWidth-30) ? "&#xE012;" : "&#xE014;";
article.style["width"] = newWidth.toString()+"px";
jsOnload.innerHTML = text;
}
function over(event) {
event.preventDefault();
var width = parseFloat(style["width"], 10);
if (width == iniWidth)
article.style["width"] = (iniWidth+30).toString()+"px";
else if (width == maxWidth)
article.style["width"] = (maxWidth-30).toString()+"px";
}
function out(event) {
event.preventDefault();
var width = parseFloat(style["width"], 10);
if (width == iniWidth+30)
article.style["width"] = iniWidth.toString()+"px";
else if (width == maxWidth-30)
article.style["width"] = maxWidth.toString()+"px";
}
addListener(jsOnload, "mouseover", over);
addListener(jsOnload, "mouseout", out);
addListener(jsOnload, "click", resize);
}
}
if (window.addEventListener) window.addEventListener("DOMContentLoaded", expand, false);
else window.attachEvent("onload", expand);
}());

View file

@ -0,0 +1,70 @@
(function() {
function addListener(elem, event, f) {
if (elem.addEventListener) elem.addEventListener(event, f, false);
else elem.attachEvent("on"+event, f);
}
function opaque() {
var jsOnloads = document.querySelectorAll("a.js-opaquable");
for(var index = 0; index < jsOnloads.length; index++) {
var jsOnload = jsOnloads.item(index)
, body = document.querySelector("body")
, article = body.querySelector("article")
, content = article.querySelector("section.content")
, style = window.getComputedStyle(article)
, iniColor = style["color"]
, minColor = "#2C2C2C"
, iniBackgroundColor = style["backgroundColor"]
, minBackgroundColor = "rgba(252, 253, 246, 0.50)";
function recolor(event) {
event.preventDefault();
var backgroundColor = style["backgroundColor"]
, alpha = parseFloat(backgroundColor.replace(/^.*,(.+)\)/,'$1'), 10)
, newBackgroundColor = (alpha > 0.7) ? minBackgroundColor : iniBackgroundColor
, newColor = (alpha > 0.7) ? minColor : iniColor
, text = (alpha > 0.7) ? "&#xE05C;" : "&#xE05D;";
article.style["backgroundColor"] = newBackgroundColor;
body.style["color"] = newColor;
jsOnload.innerHTML = text;
}
function over(event) {
event.preventDefault();
var backgroundColor = style["backgroundColor"];
var minus = "rgba(252, 253, 246, 0.75)";
var plus = "rgba(252, 253, 246, 0.60)";
var alpha = parseFloat(backgroundColor.replace(/^.*,(.+)\)/,'$1'), 10);
if (alpha > 0.8)
article.style["backgroundColor"] = minus;
else if (alpha < 0.7)
article.style["backgroundColor"] = plus;
}
function out(event) {
event.preventDefault();
var backgroundColor = style["backgroundColor"];
var minus = "rgba(252, 253, 246, 0.75)";
var plus = "rgba(252, 253, 246, 0.60)";
var alpha = parseFloat(backgroundColor.replace(/^.*,(.+)\)/,'$1'), 10);
if (alpha > 0.7)
article.style["backgroundColor"] = iniBackgroundColor;
else if (alpha > 0.55)
article.style["backgroundColor"] = minBackgroundColor;
}
addListener(jsOnload, "mouseover", over);
addListener(jsOnload, "mouseout", out);
addListener(jsOnload, "click", recolor);
}
}
if (window.addEventListener) window.addEventListener("DOMContentLoaded", opaque, false);
else window.attachEvent("onload", expand);
}());

View file

@ -0,0 +1,59 @@
(function() {
function addListener(elem, event, f) {
if (elem.addEventListener) elem.addEventListener(event, f, false);
else elem.attachEvent("on"+event, f);
}
function resizing() {
var jsOnloads = document.querySelectorAll("a.js-resizable");
for(var index = 0; index < jsOnloads.length; index++) {
var jsOnload = jsOnloads.item(index)
, article = document.querySelector("body > article")
, style = window.getComputedStyle(article)
, fontSize0 = parseFloat(style["fontSize"], 10)
, fontSize1 = fontSize0 * 1.1
, fontSize15 = fontSize0 * 1.15
, fontSize2 = fontSize0 * 1.2
, fontSize25 = fontSize0 * 1.25
, fontSize3 = fontSize0 * 1.3;
function resize(event) {
event.preventDefault();
var fontSize = parseFloat(style["fontSize"], 10)
, newFontSize = (fontSize < fontSize15) ? fontSize3 : fontSize0
, text = (fontSize < fontSize15) ? "&#xE0EB;" : "&#xE0EA;";
article.style["fontSize"] = newFontSize+"px";
jsOnload.innerHTML = text;
}
function over(event) {
event.preventDefault();
var fontSize = parseFloat(style["fontSize"], 10);
if (fontSize < fontSize15)
article.style["fontSize"] = fontSize1+"px";
else if (fontSize > fontSize25)
article.style["fontSize"] = fontSize2+"px";
}
function out(event) {
event.preventDefault();
var fontSize = parseFloat(style["fontSize"], 10);
if (fontSize < fontSize25)
article.style["fontSize"] = fontSize0+"px";
else if (fontSize > fontSize15)
article.style["fontSize"] = fontSize3+"px";
}
addListener(jsOnload, "mouseover", over);
addListener(jsOnload, "mouseout", out);
addListener(jsOnload, "click", resize);
}
}
if (window.addEventListener) window.addEventListener("DOMContentLoaded", resizing, false);
else window.attachEvent("onload", expand);
}());