Wednesday, January 14, 2015

"the problem with angular"

A friend tweeted me The Problem with Angular. The tl;dr is that A. the syntax is very server-coder minded (I've noticed the resemblance to JSTL etc before) and that it's not super-performant. Personally, I also note that it's not particularly easy to model what's going on in your head.

One disagreement I have is with this bit:
Although there are front-enders that are enthusiastic about Angular, I have the feeling that their number is surprisingly low for a major framework.
Personally, I've seen the opposite, I'm kind of impressed by the number of supporters vs how many places I see using it.

As has been said before:

Working on getting to one of the peeks. I think; I wonder if Angular 2.0 combined with WebComponents will make it less relevant rather than more, as time goes on...

Wednesday, January 7, 2015

note to self: reset intellij font size

It's a little annoying that intelliJ has multiple ways of changing the font size (including pinch gestures and crap like that) but, unlike browsers, cmd-0 doesn't get things back to normal. (Thus failing the "a UI should do what surprises the user the least" mantra hard - and adding to my general distrust of gestures.)

The most expedient way to get back to normal seems to be hit cmd-shift-a, then type "reset font size". (I dig when UIs seem to blend Photoshop-esque short cuts with Infocom-like text parsers!)

Monday, January 5, 2015

text overlay effect with css masking

A long while ago I made a Java-based tool called k/stencil, though (unusually for me) I somehow removed it from its place on my website, and can't find the old code.

In short I could use it to make stuff like this:
Basically I was trying to automate making stuff like this, that I made in the ancient version of Paint Shop Pro that was my go to for too many years:

Anyway. These days, CSS can totally do the same effect. To whit:

.overlay {
    font-family:impact;
    font-size:80px;
    background-image: url(http://kirk.is/features/wallpaper/full/umbrella.jpg);
    background-size: 400px 300px;
    background-position:-20px -20px;
    line-height:60px;
    letter-spacing:-4px;
    padding:10px;
    -webkit-background-clip: text;  
    background-clip: text;  
    color: rgba(0,0,0,0);  
}

plus

<div class="overlay">KIRK.is<br>k/stencil</div>

can make something like

So, to honor, or replace, my old tool, I thought I'd build a tool. But then I realized that was kind of overkill... I mean the tool I was envisioning would be a highly configurable expert-ish tool,  basically saying "ok, here's the basic CSS, you edit it and I'll show you the changes updating on a sample!". Which is exactly what jsFiddle is. Duh.

So I made one of those!

UPDATE: I changed my mind, because why the jsFiddle is ok, it doesn't let you quickly play with sliding the image or changing it's zoom, so I reinstated http://kirk.is/features/kstencil/. I used basic jQuery mouse events for sliding the background and used noUiSlider as a lightweight library for the zoom widget.  Anyway, check it out, it's rough but effective.






Saturday, January 3, 2015

tags n stuff

One thing I enjoy on my personal website is the restrospect page, where I show entries for this month and day for each year going all the way back to the blog's start in late-2000. Another thing I like on the site is a best of page, away of collating times I was actually creative on the day, but I haven't updated that listing for many years. I decided to try to bridge the gap with a personal "tag" based system; since I hit the retrospect page most days, I might as well use that daily review to gather the more interesting content I've made.

So I made a customized version of the retrospect page that I'll use for tagging over the course of 2015. The code I made is terribly hacky (as befits most of the rest of the backend of the site) but two bits of jQuery came in handy: the Tag-It library, which made the tag w/ autocomplete widget very easy, and then I had a chance for me to review using jQuery promises via the when() function, since I needed two separate Ajax queries (one that returned all unique tags, used to populate the Tag-It's autocomplete, and another for any previous tags I had entered) but wanted both to complete before I went ahead and initialized the tag widgets.

Both of those page have concise documentation pages, and I didn't run into any "gotchas", so I'm not going to go into more details here.

Friday, January 2, 2015

semi-meta: blogspot tags and chronological order

I decided to use a tag for my recent run of "advent director's commentary", so I could make a permanent link to the assembled posts. Problem was that the posts are then in reverse chronological order, and would make for backwards reading.

Yet Another Bloggers Tips Blog to the rescue! That link has a script I was able to copy and paste into my template here, and then I could construct the following link:

http://kirkdev.blogspot.com/search/label/advent2014#order=ASC

Cool! I should go back and figure if I have any other series to permalink using it.

animal advent ala ed emberley: director's commentary 21-25

Day 21: Gorilla

The copy of Emberley's book I grew up with had a square on the back cover and the caption "What can you make from this shape? An Ape!"

I made this one fairly early on in the sequence, after the whale, and when i started thinking that every puppet should have some kind of interaction. Its zoom effect is testament to how I made every puppet scalable - most of the puppets don't leverage that much, but I tried to reduce the amount of magic numbers and hardcoding.

Day 22: Giraffe

Actually, this is one of the few others that does use the scaling as well! These entries from the last few pages of the book really have a lot of nice detail and elegance.
Day 23: Alligator

On the home stretch. The disorder of the boxes really adds to the personality of this one, and I worked to make the jaw snap.
Day 24: Dragon

What a beauty this one is! Very tricky making all those funky S-shapes. The fire and smoke was my own creation. I was pleased with the way I got the legs moving.
Day 25: Santa!

The only one that is my own design - and that has its own color palette, distinct from the animal puppets. (It's funny comparing his design to my old Advent santaskate - that the two are so similar reinforces the idea that Emberley was a lasting influence that I reinvoked when I started making processing applets without importing graphics.)

This Santa is actually an homage to a cardboard advent calendar I grew up with, and still makes a seasonal appearance at my mom's house... I made an animated GIF of it a while back, but the short of it is for my folks the pullstring was a slightly naughty joke.

I think I recycled some code from the whale for the presents, but added rotation. (Come to think of it, it's just my old Advent giftplosion.)


Thursday, January 1, 2015

animal advent ala ed emberley: director's commentary 16-20

Day 16: Deer

One I created later, when I was kind of scrounging to find enough good candidates to finish the set. The interaction (bowing down as if to eat) is particularly dull, but overall the creature is pretty.
Day 17: Fish

Visually, this is one of my favorites. This plethora of fish really showed off Emberley's design style. And gave me a chance to use some Java subclassing! (Plus, I've been making little fishtanks like this, with the similar sense of kick and water drag since... yeesh, like 1994, in Windows C Programming, or maybe Visual Basic.)

I thought somewhere I heard an admonition not to make "dead fish" in gaming, not to just move a static fish sprite around and call it a day, so each fish here pushes with its fin and tail a bit.

Day 18: Octopus

This one I'm really proud of. I was tempted to just make each an arm an S, and have them rotate around the fish or something, and call it a day, but I realized I could do more. For a long while I've been inspired by the Processing.org "Reach 2" Example - I'm still not sure I quite wrap my head around how it works, and in fact it turned out to be too fiddly for me to use directly, so I had to reinvent the technique from scratch. Each arm is a series of joints, and each joint "wants" to turn to towards the mouse, but each is constrained to a certain amount of angle, and also can only adjust its angle at a specific rate. (Plus, each has a "default" angle it returns to to create the "S" shape in the deconstructed form)

Day 19: Whale

Another early one, and one of the first to really add a cool interaction. Emberley's book has an alternate whale blowing stylized dots, and by using simple x/y speed I was able to make a nice display.

The flexing of the whale was fun, but I had to "cheat" it somehow, because the squares and triangles that make up the whale at rest don't touch when it it is flexing. At first I had these cheat-y circles to fill the joint space that would hide in deconstructed form. Later I figured out to redo the math and have an extra triangle implicitly get draw on the side of "proper" structures. The end result wasn't perfect, but better than the circles.

Day 20: Monkey

Another one that didn't quite live up to my hopes. I couldn't quite get the flip to have a sense of weight and physics behind it, and again I was nearing the end of my time and gumption, so I just let it be. It's a pretty cute monkey though!