Skip to content

Commit

Permalink
Added AzuText (4/4)
Browse files Browse the repository at this point in the history
i made a mistake previous commit, should be fixed
  • Loading branch information
MTSyntho authored Dec 11, 2024
1 parent 12cbf04 commit 94baeef
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions pkgs/apps/desktop/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,48 @@ function addDesktopApp(name, icon, src) {
desktopIcons.appendChild(link);
};

function addDesktopFiles(name, icon) {
// Create <a> for icon interaction
const link = document.createElement('a');
link.onclick = () => loadLibrary('system:extensionlink.js', `~/Desktop/${name}`)

// Create deskIcon div for the... app icon
const desktopIcon = document.createElement('div');
desktopIcon.className = 'deskIcon';

// Create the app icon
const img = document.createElement('img');
img.width = 40;
img.src = icon;

// Create icon name
const text = document.createElement('p');
text.textContent = name;

// Add app icon and title to the desktop icon
desktopIcon.appendChild(img);
desktopIcon.appendChild(text);

// Add desktop icon to the main container
link.appendChild(desktopIcon);
desktopIcons.appendChild(link);
};


addDesktopApp('SDK Test', 'assets/icons/exclamation.svg', 'apps:dynamic-test.js');
addDesktopApp('About', 'assets/icons/questionmark.svg', 'apps:sysver.js');
addDesktopApp('About', 'assets/icons/computer.svg', 'apps:sysver.js');
addDesktopApp('VirtualPC', 'assets/icons/questionmark.svg', 'apps:virtualpc.js');
addDesktopApp('AzuText', 'assets/icons/questionmark.svg', 'apps:azutext.js');

// addDesktopApp('Settings', 'assets/icons/settings.svg', 'settings/index.html');
// console.log(fetch_directory('~/Desktop'));
fetch_directory('~/Desktop').then(([files, folders]) => {
// Process files
files.forEach(file => {
addDesktopApp(file, 'assets/icons/questionmark.svg', 'settings/index.html');
addDesktopFiles(file, 'assets/icons/questionmark.svg');
});

// Optionally, process folders if needed
folders.forEach(folder => {
addDesktopApp(folder, 'assets/icons/folderopen.svg', 'settings/index.html'); // Adjust as necessary
addDesktopFiles(folder, 'assets/icons/folderopen.svg');
});
});

0 comments on commit 94baeef

Please sign in to comment.