Posts

Showing posts from September, 2019

box-shadow

box-shadow: [inset] x-offset y-offset [ blur-radius  [ spread-radius ]] [ color ] ; With all zeros, the shadow is exactly under the box. So it's hidden. The x and y offsets are like relative positioning. Take the shadow defined by any other parameters, and just move it. Blur comes first, but I'm going to talk about spread first. Spread-radius extends the shadow outward in all directions by some distance. With blur radius still set to zero, a sharp edged shadow extends outward from the box for the given distance. (It looks like a border.) For blur-radius, take a shadow with an hard edge defined according to your spread-radius. And then "fuzz" outward, putting down some color where there had been none. And fuzz inward, lightening the shadow at its old edge, and letting it darken toward it's actual color setting as you move in from . its old edge. Finally "inset" puts the shadow inside the box, instead of outside. Commas!!! Don't put co

Callback, Promise, Observable, and Doughnuts

This is the story of Jerry JavaSript's Automated Slow Doughnut Shop. One day, I wanted a doughnut. So I rode my bike to the automated slow doughnut shop, where they have a slow doughnut machine. You put in a dollar. And then the machine mixes batter, heats the fat, drops the batter into the fat, lifts it out on a linked metal conveyor belt, dusts it with sugar, and drops it into your waiting hands. Once I get my doughnut, I can eat it in the usual manner. But from the time I put in my dollar until the time I receive my doughnut, I am blocked. Fortunately, the slow doughnut machine has a slot labeled, "Insert callback  here". This is great. I code up a function eatDoughnut(doughnut) . I can reference my teeth,  esophagus, stomach, and so on, because they are mine and I know all about them. And then I slip my   eatDoughnut(doughnut)  function  into the slot and get on my bike and ride  to the office while the slow doughnut machine is still mixing batter. When the