Skip to content

Commit

Permalink
uwu
Browse files Browse the repository at this point in the history
  • Loading branch information
novafurry committed Aug 9, 2024
1 parent 62a653c commit 9bddc9e
Show file tree
Hide file tree
Showing 11 changed files with 753 additions and 57 deletions.
Binary file added assets/audio/mission.mp3
Binary file not shown.
Binary file added assets/audio/notif.mp3
Binary file not shown.
15 changes: 8 additions & 7 deletions assets/code/apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,17 +244,18 @@ var app = {
wd.win();
}
},
docaiModel: {
sysqna: {
runs: false,
name: 'DocAI ML Models',
name: 'System QNA ML Models',
onstartup: async function() {
try {
const model = await qna.load();
console.log("Model loaded");
window.docAImodel = model;
return "Sysqna model loaded";
} catch (error) {
console.error("Failed to load model", error);
return error;
return "Failed to load model";
}
},
},
Expand Down Expand Up @@ -421,12 +422,12 @@ var app = {
} else {
document.querySelector("#docai").remove();
document.querySelector("#docaitbn").remove();
const load = tk.mbw('DocAI Model Loader', '500px', 'auto', true, undefined, undefined, undefined, "docaiml");
wm.wal("You skipped loading the DocAI model on boot. Please wait.")
const load = tk.mbw('DocAi Model Loader', '500px', 'auto', true, undefined, undefined, undefined, "docaiml");
wm.wal("The sysqna model failed to load on boot. Please wait.")
var div = tk.c('p', load.main);
div.innerHTML = `DocAI is loading the models...<br><progress></progress>`;
div.innerHTML = `DocAI is reloading the model...<br><progress></progress>`;
try {
await app.docaiModel.onstartup();
await app.sysqna.onstartup();
} catch (error) {
document.querySelector("#docaiml").remove()
document.querySelector("#docaimltbn").remove()
Expand Down
15 changes: 4 additions & 11 deletions assets/code/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ var fs = {
};
setTimeout(function () {
fs.ls("/user/info/name").then(async (namefile) => {
console.log(namefile);
if (namefile.items.length == 0) {
document.querySelector(".splashscreen").remove();
}
else {
// get count of items in app json object
var apps = 0
for (var key in app) {if (app[key].hasOwnProperty("onstartup")) {apps++}}
Expand All @@ -67,13 +62,11 @@ setTimeout(function () {
var counter = 0;
for (var key in app) {
if (app[key].hasOwnProperty("onstartup")) {
document.querySelector("#currentComponentText").innerText = `Current App/Component: ${app[key].name}`;
await app[key].onstartup(); // this is where each compontent is called
wm.notifSys("Services", `Loading ${app[key].name || key}`, 5000);
var appResponse = await app[key].onstartup(); // this is where each compontent is called
wm.notifSys("Services", `${app[key].name || key} says:<br>"${appResponse}"`, 5000);
counter++;
// document.querySelector("#currentComponent").value = counter;
}
}
document.querySelector(".splashscreen").remove();
}
});
});
}, 1000)
6 changes: 3 additions & 3 deletions assets/code/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var ui = {
},
play: function (filename) {
const audio = new Audio(filename);
audio.volume = nvol;
audio.volume = 1;
audio.play();
},
show: function (dr1, anim) {
Expand Down Expand Up @@ -72,9 +72,9 @@ var ui = {
dest: function (dr1, anim) {
if (dr1) {
if (anim) {
$(dr1).fadeOut(anim, function () { dr1.remove(); });
$(dr1).fadeOut(anim, function () { $(dr1).remove(); });
} else {
$(dr1).fadeOut(170, function () { dr1.remove(); });
$(dr1).fadeOut(170, function () { $(dr1).remove(); });
}
}
},
Expand Down
61 changes: 40 additions & 21 deletions assets/code/wm.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,43 @@ var wm = {
element.style.top = `${topPosition}px`;
},

notif: function (message, name, onclick) {
const note = document.createElement('div');
note.classList = "notif";
note.innerHTML = `${name} - ${message}`;
const id = gen(7);
note.id = id;
notif: function (name, cont, mode) {
const div = tk.c('div', document.getElementById('notif'), 'notif');
tk.p(name, 'bold', div);
tk.p(cont, undefined, div);
$(div).fadeIn(80);
div.addEventListener('click', function () { div.remove() });
const note2 = document.createElement('div');
note2.classList = "notif";
const id2 = gen(7);
note2.id = id2;
note2.innerHTML = `<b>${name}</b>
<br>
${cont}`;
if(localStorage.getItem("doNotDisturb") !== "true") {
ui.play('./assets/audio/notif.mp3');
document.getElementById('desktopNotificationsArea').appendChild(note2);
}
note2.addEventListener('click', function () { ui.dest(note2, 140); });
setTimeout(() => {
ui.dest("#"+note2.id, 140);
}, 5000);
},

notifSys: function (name, cont, mode) {
const note2 = document.createElement('div');
note2.classList = "notif2";
note2.classList = "notif";
const id2 = gen(7);
note2.id = id2;
note2.innerText = `${name} - ${message}`;
document.getElementById('notif').appendChild(note);
document.getElementById('notifold').appendChild(note2);
ui.play('./assets/other/webdrop.ogg');
note.addEventListener('click', function () { ui.dest(note, 140); });
note2.innerHTML = `<b>${name}</b>
<br>
${cont}`;
if(localStorage.getItem("doNotDisturb") !== "true") {ui.play('./assets/audio/notif.mp3')};
document.getElementById('desktopNotificationsArea').appendChild(note2);
note2.addEventListener('click', function () { ui.dest(note2, 140); });
setTimeout(function () { ui.dest(id, 200); }, 20000);
dest('defnotif');
setTimeout(() => {
ui.dest("#"+note2.id, 140);
}, 5000);
},
cm: function () {
const div = document.createElement('div');
Expand Down Expand Up @@ -95,11 +114,11 @@ var wm = {
showf(window, 0);
},

notif: function (name, cont, mode) {
const div = tk.c('div', document.getElementById('notif'), 'notif');
tk.p(name, 'bold', div);
tk.p(cont, undefined, div);
$(div).fadeIn(80);
div.addEventListener('click', function () { div.remove() });
}
// notif: function (name, cont, mode) {
// const div = tk.c('div', document.getElementById('notif'), 'notif');
// tk.p(name, 'bold', div);
// tk.p(cont, undefined, div);
// $(div).fadeIn(80);
// div.addEventListener('click', function () { div.remove() });
// }
}
18 changes: 18 additions & 0 deletions assets/lib/tf.js

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions assets/lib/use.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9bddc9e

Please sign in to comment.