I have expanded support from Wikipedia to more sources like Wired, BBC, The Verge, etc… It took a while because I had to learn how to use npm and the rss-parser library.
response.status.
I added two new apps: a timer app and a simple browser.
The timer app currently only supports 5 minutes. It has a start, pause, and reset button.
The browser was somewhat easier to implement. I set up a input box and a button, and programmed the button to open the link or search query that was inputted into the search box. I’m planning on adding an iframe to showcase the website directly on the OS instead of opening a new tab!
I added an open article button which opens the random article on click. I learned how to implement this through Javascript by using article.content_urls.desktop.page; to get the article url and then open the article on click using window.open(url, "_blank");, and an event listener on the open article button.
I also added the current date at the top of the title using date.toLocaleDateString.
I styled the buttons to slightly glow on hover and sink into the screen (inset box-shadow) on click.
I started with Astro but after learning astro for about 1 hour, I realized that it was overkill for what I was trying to do. So instead I swapped to HTML, CSS, and JS (although, I’ll probably try programming it in Astro when I get the html/css/js version to work).
I spent around 15 minutes looking for colors, fonts, and a custom cursor icon for the site. I settled with the cute coffee bean icon which you can see in the image!
The rest of the time was spent adding the styles to styles.css, setting up the HTML to work with the Javascript code, and implementing API fetch functions. The Javascript kinda works, but I haven’t linked it with the button yet, so it only loads the article on page refresh. Also, the JS only works with Wikipedia API for now, but more sites are going to be added very soon.
Bug where selecting 3 app mean one will inevitably be opened and cant be unselected. Fix by allowing to only select one app at a time. So when an app is selected and another app is clicked on, the currently selected app would be deselected and the new app icon would be selected.
Fixed a bug where it said the title was undefined since when the loop finished, i = 2 which is more than the object index which had only 0 and 1 (before I added more to the object). To fix this, I changed “var” to “let” and it worked again. I learned that let allows i to have it own value every iteration. So I basically implemented the for loop wrong in Javascript (I thought that var and let would do the same thing, turns out it has its differences!).
PoseiOS V1 is finally complete!!!
It’s been a while since my last devlog. Most of the time was spent trying to fix a bunch of bugs in the javascript code.
clampWindowPos() that would determine the max x and y offset that the windows could have in order to stay in the viewport. The function calculates this by calculating half of the width and height of the window (since the window has transform: translate(-50%, -50%); which causes the center to be at half the width/height). Then, it calculates the minimum left value and the maximum left value that the window could move to and did the same for the top value. Finally the function return those values.Added poseidon.md, my first app!
element.classList.add("...");
width: fit-content so that I don’t have to guess the width of my div.Aesthetic tweak: Changed cursor grab to only show when hovering over handle instead of showing over the whole window).
Reduced repetition and improved scalability by turning open/close window into a generalized function that works for all windows, so I can call the function for future apps.
A lot of bugs and back-and-forth and commenting out code to add open-close function for the apps. I found out that I needed 2 parameters for the functions closeWindowOnClick and openWindowOnClick. First parameter is used for checking if the open button (app icon) or close button was selected/tapped, and second parameter is used for targeting the specific window that should be opened/closed. The parameters made me very confused because I would sometimes misinterpret the element as the button when the element parameter being passed was linked to the window.
Added an icon and CSS styling for my first app: poseidon.md
Added attributions to my README, for the bg image and the icons.
Called addWindowTapHandler() on line 19 instead of calling addWindowTapHandler() for each window directly to reduce redundancy.
Chose mousedown instead of click for event listener so that the window auto-focus when it is tapped immediately (if click is used then the window will only focus after mouse is up).
Add open and close window functions. You can open by clicking “PoseiOS” in the topbar, and close by clicking the “x” button.
Add left & right padding on top bar.
Fix text being highlighted when dragging windows by using user-select: none; cursor: grab;
I encountered a bug where u can drag window by selecting any part of it. I fixed this by changing the id to include “-handle” so that the javascript could recognize it (before the javascript was looking for “handle” instead of “-handle” which created the bug).
I made a website to showcase a font I drew using Calligraphr and ibis Paint.
Unfortunately I didn’t use Lapse to record my font drawing process 😭 so I am unable to publish the font itself as a project.
I learned how to add a editable text block using contenteditable="true" within the div. I also learned how to add a coding snippet using <pre><code>...</code></pre>.
Since the marquee tag was deprecated, I built a marquee of text using an animation keyframe that I defined in CSS. I used white-space: no-wrap in order to stop the text in the marquee from wrapping and instead flow on one horizontal line. overflow-x: auto was used to fix a bug where the text would overflow to the right side of the screen.
I ran into an issue where the vines background image in hero section was distracting and made the font unreadable. I fixed this by adding the linear gradient property to background in CSS.
I initially deployed the website using Github pages, but I ran into a https issue that I wasn’t sure how to fix, so I decided to switch to Vercel deployment instead which was a lot more convenient and straightforward.
I made the website transition from green (at the hero section) to brown (at the footer) to resemble the green grass and brown soil.
I plan to make more fonts in the future!
backdrop-blur andbackground-color: rgba(255, 255, 255, 0.1);
transform: translate(-50%, -50%);
I started off with some boilerplate code, creating and linking the HTML, CSS, and JS files.
I added some content on the webpage.
I added a background wallpaper for the WebOS.
I styled the site using CSS, but I haven’t added any Javascript yet.
I imported the Inter Font from Google fonts.
A new tag that I learned was using background-position in order to crop/position the background image so that it fit my preferences.
I am working on the schematic for my first PCB! I am learning the basics of how to make a PCB board for a USB 2.0 hub by referencing the USB hub tutorial on Hack Club Jam. I started off by importing some symbols for a chip and USB ports using the EasyEDA library. I also started wiring some of the components and learned how to use nets.