Skip to content

Commit

Permalink
merge cost-tour branch. didnt really do a cost tour, but did some oth…
Browse files Browse the repository at this point in the history
…er cool stuff.
  • Loading branch information
orthecreedence committed Mar 28, 2024
2 parents b05e44f + 72b2497 commit c441d64
Show file tree
Hide file tree
Showing 21 changed files with 19,114 additions and 164 deletions.
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Metalsmith(__dirname)
base: '',
title: 'Basis',
description: 'Documentation and information about the Basis project',
asset_version: 8,
asset_version: 10,
},
})
.source(`${SRC}/`)
Expand Down
2 changes: 1 addition & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
'linkvisited': '#8a1717',
},
fontFamily: {
accent: ['Titillium Web', 'sans-serif'],
accent: ['Lato', 'sans-serif'],
logo: ['Bolshevik'],
},
},
Expand Down
Binary file modified www/assets/fonts/icons.woff2
Binary file not shown.
Binary file removed www/assets/fonts/teko-ext.woff2
Binary file not shown.
Binary file removed www/assets/fonts/teko.woff2
Binary file not shown.
Binary file removed www/assets/fonts/titillium-ext.woff2
Binary file not shown.
Binary file removed www/assets/fonts/titillium.woff2
Binary file not shown.
56 changes: 56 additions & 0 deletions www/assets/js/bus.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
const EventBus = function EventBus() {
const event_store = {};

function eachev(events, looper) {
(Array.isArray(events) ? events : [events]).forEach(looper);
}

const on = (events, fn) => {
eachev(events, (ev) => {
event_store[ev] || (event_store[ev] = []);
event_store[ev].push(fn);
});
};

const once = (events, fn) => {
eachev(events, (ev) => {
const newfn = (...args) => {
fn(...args);
off(ev, newfn);
};
on(ev, newfn);
});
};

const off = (events, fn) => {
eachev(events, (ev) => {
if(!event_store[ev]) return;
if(!fn) {
delete event_store[ev];
return;
}
event_store[ev] = event_store[ev]
.filter((fn_comp) => fn !== fn_comp);
});
};

const emit = (event, ...args) => {
const fnlist = event_store[event] || [];
fnlist.forEach((fn) => {
fn(...args);
});
};

const destroy = () => {
Object.keys(event_store).forEach((k) => delete event_store[k]);
};

return {
on,
once,
off,
emit,
destroy,
}
};

Loading

0 comments on commit c441d64

Please sign in to comment.