Skip to content

Instantly share code, notes, and snippets.

@nuadaria
nuadaria / gist:e53f06968e1b82e995b2
Last active August 29, 2015 14:24
It's a Trap - Triggered Traps
/**
* A script that checks the interpolation of a token's movement to detect
* whether they have passed through a square containing a trap.
*
* A trap can be any token on the GM layer for which the cobweb status is
* active. Flying tokens (ones with the fluffy-wing status or angel-outfit
* status active) will not set off traps unless the traps are also flying.
*
* This script works best for square traps equal or less than 2x2 squares or
* circular traps of any size.
@nuadaria
nuadaria / phsyChar.js
Created March 31, 2022 23:47
Physical Characteristics
if(!document.getElementById("templateButtonDescription") && window.location.href.includes("/characters/new")){
var link = document.createElement("a");
link.id = "templateButtonDescription";
link.setAttribute("href", "#");
link.classList.add("button");
link.onclick = function(e){
e.preventDefault();
document.getElementById("game_character_description").innerHTML = "Physical Characteristics:\n"
+"Color of Eyes\n"
@nuadaria
nuadaria / charBio.js
Created March 31, 2022 23:51
Character BIo
if(!document.getElementById("templateButtonBio") && window.location.href.includes("/characters/new")){
var link = document.createElement("a");
link.id = "templateButtonBio";
link.setAttribute("href", "#");
link.classList.add("button");
link.onclick = function(e){
e.preventDefault();
document.getElementById("game_character_bio").innerHTML = "General Information:\n"
+"Full name\n"
@nuadaria
nuadaria / editPageButton.js
Created March 31, 2022 23:52
Edit This Page Button
if(document.getElementsByClassName('wiki-edit').length < 1){
var siblingDiv = document.getElementsByClassName('wiki-page-container');
var div = document.createElement('div');
div.innerHTML = '<div class="wiki-edit"><a class="button" href="'+window.location.href+'/edit">Edit This Page</a></div>';
siblingDiv[0].parentNode.insertBefore(div, siblingDiv.nextSibling);
}
window.addEventListener("load", loaderFunction);
function loaderFunction() {
if(!document.getElementById("calendariFrame") && document.getElementById("iFrameContainer")){
var iframe = document.createElement("iframe");
iframe.src = "<PUT_YOUR_PUBLISHED_LINK_HERE>";
iframe.setAttribute("id", "calendariFrame");
iframe.setAttribute("scrolling", "no");
iframe.setAttribute("frameborder", "0");
{
"name": "English (built-in)",
"lang": "en",
"api": {
"wikipedia": "en"
},
"messages": {
"loading": "Loading",
"wikipedia": "From Wikipedia, the free encyclopedia",
"error": "Error",
@nuadaria
nuadaria / timelineImp.js
Last active March 21, 2023 18:04
This gist is to support an implementation of timeline.js on an Obsidian Portal site.
//We neeed to load the timeline js and css in our local js since there isn't support on OP for 3rd party libraries
//these two methods shamelessly taken from stack
function addCss(fileName) {
var head = document.head;
var link = document.createElement("link");
link.type = "text/css";
link.rel = "stylesheet";
link.href = fileName;
@nuadaria
nuadaria / nestedAccordion.js
Created May 12, 2023 01:43
For implementation of nest-able accordions on Obsidian Portal
$(".accordion").accordion({
header: "> h3:not(.item)",
heightStyle: "content",
active: false,
collapsible: true
});
@nuadaria
nuadaria / nestedAccordion.html
Last active May 12, 2023 01:48
For implementation of nest-able accordions on Obsidian Portal
<div class="accordion">
<h3>Simple Accordion</h3>
<div class="content">
Stuff just in the outer accordion
<div class="accordion">
<h3>Nested Accordion 1.1</h3>
<div class="content">
Inner content goes here
<div class="accordion">
@nuadaria
nuadaria / Candela_Obscura.css
Created July 5, 2023 22:54
Candela Obscura character sheet css
.sheet-title {
padding-top: 15px;
padding-right: 10px;
}
.sheet-col-right {
float: right;
padding-right: 10px;
}