You are browsing as a guest. Sign up (or log in) to start making projects!

7h 10m 44s logged

A Big Jump [Dev Post 3]

Here is an update of what I’ve been working on over the weekend. And there is a lot!

Window Movement

I followed the guide to make windows movable. However, there was a challenge.

Challenge

If I want to make modOS modular, how could I identify user-made windows? The guide showed a hard-coded movement system, but that would mean other people couldn’t make their own apps!

Solution

I used .querySelector to give every window of the same class movement functionality while keeping each instance separate. This means no matter how many windows of the same app you make, they’ll all be movable! So yes, you could have 30 copies of the same ping pong app (not on modOS… yet) and every window would work normally.

Account Feature (Still in Progress)

This is mainly what took most of the 7 hours I logged today.

What was used?

I used Firebase to establish a backend where user info would be stored. The info consists of a username, password, and user data. The first two are self-explanatory, but the data will store user changes to their OS so they can jump back in where they left off.

Challenges

The account creation script should theoretically work. However, I didn’t build the project around a package manager. Firebase works much better with one, meaning the project would need to be migrated to a framework like Vite.

Solution

There is a solution: create a new repository with Vite installed, then move everything over. I really didn’t want to deal with that right now, so the account feature will be implemented once the base build of modOS is complete.

App Launching

You can now use a terminal interface to launch apps!

Challenges

To keep apps modular while still being… apps, I couldn’t just say “open this app.” I needed users to be able to define a preferred name, icon, and content. The first two were easy, but I also needed a list of apps and their content. This way, future modOS developers can publish their applications to the modOS environment.

Solution

There is now an apps.json file with a full list of apps (1 app right now). Whenever you launch an app via exec(name, icon) from the Dev Console, it checks whether the app exists in the JSON file and, if it does, fetches its corresponding content.

A Step Towards Modular…

modOS is officially MODULAR!

What is modular as of now?

Many things!

  • I scratched the modular clock idea from the previous Dev Post… AND REPLACED IT WITH A COMPLETELY MODULAR BAR!!! So now the entire bar is modular. :)
  • Apps are now modular too! You can launch any app via exec(name, icon) in the Dev Console (often opened with F12) to render a new window with your preferred name and icon.
  • The clock idea was scratched… BUT THE CLOCK ITSELF IS STILL MODULAR!

Challenges

Making things modular takes a lot of time. You don’t just write your program in HTML anymore—you have to generate it through JavaScript. To make it modular, individual variables need to go through their own processes before everything connects together. And of course… that usually comes with a bug or two.

Solution

Uh… yeah, that was the challenge. Doesn’t really need a solution.

Releases

From now on, every new release will be named after a song from a 2000s Turkish Alternative Rock band.

The next major release will be called:

modOS v0.x.x-alpha [Mor Ve Ötesi - Cambaz]

Make sure you give it a listen. It’s a banger!

Final Thoughts

I think the project is going very well. It’s taking a lot of time, but it’s worthwhile since I’m learning new things about a programming language I’ve been using for five years now.

I’m hoping to add more features, finish the base build, and finally move on to the backend side of things.

0
24

Comments 0

No comments yet. Be the first!