CSS :out-of-range / / No Comments One aspect of web development I’ve always loathed was working with forms. Form elements have been traditionally difficult to style due to OS and browser differences, and validation can be a nightmare. Luckily the native HTML APIs added methods for improving the form validation situation. With input[type=number] elements, you can add min and max attributes. Those attributes are great but the browser doesn’t display distinct error styles if those numbers are out of range. Luckily we have :out-of-range: /* matches when number is not within min and max */ input[type=number]:out-of-range { border-color: red; } Thanks to CSS :out-of-range, developers can style input elements based... more → Posted in: JavaScript Tagged with: outofrange
New Maps of Westeros & Middle-earth / / No Comments Fans of fantasy fiction must believe that they have sailed across the Great Sea and arrived in the blessed lands of Valinor. With both House of the Dragon and The Lord of the Rings: The Rings of Power currently airing on subscription tv we really are living in the Blessed Realms. One of the many highlights from the first two episodes of The Rings of Power have been the sumptuous and sweeping Maps Mania… more → Posted in: Interactive Maps Tagged with: maps, Middleearth, Westeros
Monitor Events and Function Calls via Console / / No Comments Despite having worked on the very complex Firefox for a number of years, I’ll always love plain old console.log debugging. Logging can provide an audit trail as events happen and text you can share with others. Did you know that chrome provides monitorEvents and monitor so that you can get a log each time an event occurs or function is called? Monitor Events Pass an element and a series of events to monitorEvents to get a console log when the event happens: // Monitor any clicks within the window monitorEvents(window, 'click') // Monitor for keyup and keydown events on the body monitorEvents(document.body, ['keyup', 'keydown']) You can pass an array of events to listen for multiple... more → Posted in: JavaScript Tagged with: Calls, Console, events, Function, Monitor
Investigating IndexedDB Wrapper Libraries – Part Three / / No Comments Welcome to the third and final (for now) entry into my series looking at wrapper libraries for working with IndexedDB. I began this series earlier this month demonstrating a simple Contacts database implemented with IndexedDB. In the second entry, I demonstrated how the Dexie library made working with IndexedDB much simpler. Today I’m going to look at my last "planned" entry (I may revisit this again if I find more) in this series – using DPP, or Deep Persistent Proxy Objects for JavaScript. Raymond Camden… more → Posted in: JavaScript Tagged with: IndexedDB, investigating, libraries, part, three, Wrapper
Where Should You Live? / / No Comments MoveMap is an interactive map which can help you decide the best place to live based on your own preferences and tastes. Tell Movemap what kind of weather you prefer, what kind of environment you would prefer to live in and the amount you wish to spend on a property and Movemap will show you the best places to live in the United States which match your preferences. MoveMap uses property price Maps Mania… more → Posted in: Interactive Maps Tagged with: live, should
Adding Social Share Links in Eleventy / / No Comments One common feature of content sites (including this one), is links/buttons/etc to share a piece of content on social media. Typically this is Twitter, but many sites will include ways to share links on Facebook, LinkedIn, and more. A reader asked me a few days ago about how this could be done in Eleventy and I thought I’d share a quick example. Raymond Camden… more → Posted in: JavaScript Tagged with: Adding, Eleventy, links, share, Social
Mapping the Extreme Heat Belt / / No Comments Last Monday the First Street Foundation released data from its analysis of how current and future extreme heat events will impact American neighborhoods. Enter your zip-code into the First Street Foundation website and you can view the risk that your home faces over the next thirty years from extreme heat (and also the risk to your home from wildfire and flooding). The First Street Foundation Maps Mania… more → Posted in: Interactive Maps Tagged with: Belt, Extreme, Heat, Mapping
git Force Push / / No Comments Rebasing is a frequent task for anyone using git. We sometimes use rebasing to branch our code from the last changes or even just to drop commits from a branch. Oftentimes when trying to push after a rebase, you’ll see something like the following: hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. Commonly developers will use the --force or -f flags during a push to force pushing code changes: git push origin my-branch --force # or git push origin my-branch -f I was recently... more → Posted in: JavaScript Tagged with: Force, Push