Had a random idea to implement a <style> tag in Enyo for global runtime CSS manipulation. I’m thinking it might be handy to resize a bunch of elements as a result of window resize, for example. I wrote a quick example in enyo v1 and ported the couple differences for v2.
You can either set the entire CSS via its published css property or set individual blocks via the set(classSpec, styleObject) method.
Thoughts?
Edit: Make a quick update to enable removing CSS from a selector by passing a null. See the example below for removing the border from the children of .app.
Here it is live:
CSS transitions are a really easy way to add basic animation to an enyo app. It works on (seemingly) any CSS property and takes JavaScript out of the picture. With Pirate’s Dice (which is still not fully functional …), I’m using them to zoom the background when starting a new game. I’m also trying to support multiple resolutions (phones in portrait and landscape, tablets, and desktop) using media queries.
There are two ways to create a scrim in enyo: globally through enyo.scrim or through the enyo.Scrim kind. In either case, the scrim “fades” the entire view (usually in order to show a modal dialog or a spinner). Another use case I’m currently experimenting with in Pirate’s Dice is a local scrim — one that only fades a particular portion of the app.
Working on a new game for webOS (and possibly other platforms) called Pirate’s Dice. I’m hoping to support both the classic rules of Liar’s Dice as well a variation or two. I have a playable alpha build working and am working on polish. I’ll be looking for beta testers soon I hope so let me know in comments or via email [admin-at-tiqtech.com] if you’re interested.
Created a new Accordion control this evening in my enyo-extras repository. If you’re not familiar with this style control, jQuery has a similar example. Take a look and feel free to fork and make improvements!
Next iteration will support scrolling content and horizontal display.
While it’s probably not fair to call this “daily” any longer, I’m going to stick with it anyway.
You may have heard that enyo has found its way onto the legacy devices via a new Maps application in the App Catalog. To test things out, I tried to deploy Score Keeper onto my Pre2. It deploys successfully but there are definitely some bugs to sort out. One way I intend to clean up the UI is by including a phone-specific stylesheet through a dynamic depends.js file.
I wouldn’t have expected to write so much about events in enyo but there’s a lot of depth to cover. I previously posted about an Animated Grid Layout control I created which I later used in Score Keeper for the board selection. I have a similar requirement for the main panes of InContact but also need to reorder the items.
Score Keeper
Had to take some time away from my Enyo Daily series to actually finish up my first Touchpad app!! It’s called Score Keeper and, as the name implies, it helps you keep track of the score for a game or activity. I just submitted it to the catalog and should be available soon. You’ll find it here once it’s available.
A question came up on the forums regarding global custom events. The use case described was the need to pass an event up or down the object hierarchy just to react to it at the appropriate level. Enyo actually can support this with the current architecture using its event dispatcher and it only requires a couple lines of code to implement.
Today’s been an interesting day for webOS. If you’re a webOS developer (which is probably a safe assumption if you’re reading this), you’re probably already aware of HP’s decision to jettison its hardware division. As a result, there are in effect no webOS phones or tablets to be released unless they find a suitable hardware partner. According to the fine folks over at This Is My Next, HP isn’t walking away from webOS. For now, I’ll buy into that and continue to create things for a platform I believe deserves to thrive.
That said, I’ve taken time off from posting due to the birth of my daughter (our third child). As a result, I haven’t taken much time to plan out the next couple posts. But, I wanted to get something out today so I’ll cover how to get started with the HTML5 canvas tag in enyo.