Last active 1 month ago

onionring-adaptation-for-petrapixel-sites.js Raw
1const webringContainer = '#webrings'; // edit this to be the selector of some container you want to put your webrings in
2const webrings = { // follow the structure here to add more items if you have more
3 tyvnjam: {
4 vars: 'https://kazehai.com/else/tyvnjam/variables.js',
5 widget: 'https://kazehai.com/else/tyvnjam/widget.js'
6 },
7};
8
9Object.keys(webrings).forEach((ring) => {
10 const ringCont = document.createElement('div');
11 ringCont.id = ring;
12
13 const vars = document.createElement('script');
14 vars.src = webrings[ring].vars;
15
16 const widget = document.createElement('script');
17 widget.src = webrings[ring].widget;
18
19 ringCont.appendChild(vars);
20 ringCont.appendChild(widget);
21 document.querySelector(webringContainer).appendChild(ringCont);
22});