<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Seagull Code Nodes &#187; math</title>
	<atom:link href="http://blog.joshuasiegal.com/tag/math/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.joshuasiegal.com</link>
	<description></description>
	<lastBuildDate>Tue, 05 Oct 2010 06:25:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Math and jsFloater &#8211; dynamic drop shadow</title>
		<link>https://blog.joshuasiegal.com/2009/math-and-jsfloater-dynamic-drop-shadow/</link>
		<comments>https://blog.joshuasiegal.com/2009/math-and-jsfloater-dynamic-drop-shadow/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 11:20:12 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[jsFloater]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[liquid]]></category>
		<category><![CDATA[math]]></category>

		<guid isPermaLink="false">http://blog.joshuasiegal.com/?p=128</guid>
		<description><![CDATA[So, in other posts, we&#8217;ve talked about jsFloater being able to take your computed integer values and use them to create some dynamic effects based on the browser resizing. Here is a really simple example: it&#8217;s a drop shadow that changes its distance based on the size of the window, and as you resize the [...]]]></description>
			<content:encoded><![CDATA[<p>So, in other posts, we&#8217;ve talked about jsFloater being able to take your computed integer values and use them to create some dynamic effects based on the browser resizing.</p>
<p>Here is a really simple example: it&#8217;s a <a title="jsFloater - dynamic dropshadow example" href="http://joshuasiegal.com/jsFloater/dropshadow/" target="_blank">drop shadow that changes its distance based on the size of the window</a>, and as you resize the window the distance changes as well.  Of course, it&#8217;s up to your imagination to come up with other uses, but this is a simple example that gets to the point.</p>
<p><span id="more-128"></span></p>
<p>To accomplish this, I only needed to add a couple of lines of code to our existing resize event handler from the <a title="How To Use jsFloater" href="http://blog.joshuasiegal.com/2009/how-to-use-jsfloater/" target="_self">How To Use jsFloater</a> documentation:</p>
<blockquote><p>function floatStuff(re:Event):void<br />
{<br />
var sW:Number = stage.stageWidth;<br />
var sH:Number = stage.stageHeight;<br />
var shadW:int = Math.floor(sW/120);<br />
var shadH:int = Math.floor(sH/60);<br />
floater.floatHorVer(rembrandt,&#8221;center&#8221;,0,0,sW,sH);<br />
floater.floatHorVer(shadow,&#8221;center&#8221;,shadW,shadH,sW,sH);<br />
}</p>
<p><em>Note: if you are copying the code above, you will have to re-do the double quotes so that Flash recognizes them.</em></p></blockquote>
<p>As you can see, I&#8217;ve got two objects that I&#8217;m floating, with instance names of &#8220;rembrandt&#8221; and &#8220;shadow&#8221; &#8211; pretty obvious what&#8217;s going on there.  But if you look above, you&#8217;ll also see that I&#8217;ve added two variables of type integer, which take the stage width and height, divide each by some values that I think work well, and floor each result into an integer.</p>
<p>Both floats are using the floatHorVer method with an alignment mode of &#8220;center&#8221;, and the only difference between the picture of rembrant and its shadow is that the picture is always floating exactly center, while the shadow is being padded &#8211; dynamically &#8211; based upon a fraction of what the current browser size is.</p>
<p>The result: a dynamic drop shadow that seems alter its light source <a title="wikipedia: Throw(projector)" href="http://en.wikipedia.org/wiki/Throw_%28projector%29" target="_blank">throw</a> depending on the size of the window.  One possible use for this is making sure that the drop shadow doesn&#8217;t get cut off if the user resizes the browser window really small.</p>
<p>Of course, this is a simple example, but you can get as crazy with it as you like.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.joshuasiegal.com/2009/math-and-jsfloater-dynamic-drop-shadow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Call for CSS Math</title>
		<link>https://blog.joshuasiegal.com/2009/a-call-for-css-math/</link>
		<comments>https://blog.joshuasiegal.com/2009/a-call-for-css-math/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 17:59:58 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[semantic]]></category>

		<guid isPermaLink="false">http://blog.joshuasiegal.com/?p=81</guid>
		<description><![CDATA[Not talking about MathML here, but the addition of simple addition, subtraction, multiplication and division in CSS values. By this time, I&#8217;ve worked my head around the idea that, to many developers (and clients) out there, CSS is the one true way and tables are only good for displaying data &#8211; that is, data that [...]]]></description>
			<content:encoded><![CDATA[<p>Not talking about <a title="MathML" href="http://www.w3.org/Math/" target="_blank">MathML</a> here, but the addition of simple addition, subtraction, multiplication and division in CSS values.</p>
<p>By this time, I&#8217;ve worked my head around the idea that, to many developers (and clients) out there, CSS is the one true way and tables are only good for displaying data &#8211; that is, data that they consider data and not data that someone else might consider data.  See my <a title="Semantic HTML Literacy" href="http://blog.joshuasiegal.com/2009/semantic-html-literacy/">previous post on semantic html</a> for more carping on this topic.  But enough negativity &#8211; I would hereby like to add my voice to the growing number of developers calling for a new future in CSS: [paraphrase] &#8220;If CSS is the golden chalice of front-end web development, how come it can interpret between pixels, point sizes, and em sizes, but it can&#8217;t add 1 + 1?&#8221;</p>
<p>Now, I know, purists will say that Javascript is for math, and CSS is for styling.  Just simply get a good Javascript library and do your math there.  The problem is that other purists will say that using Javascript to generate your CSS positions is pure hackery.  And yet other purists will say &#8220;everyone come to my website to check out my awesome CSS hacks!&#8221;</p>
<p><span id="more-81"></span></p>
<p>Let&#8217;s face up to it: there are some things that CSS is just not that good at.  The idea that you are ruining your SEO by adding three lines of table code to get your column heights equalized seems dubious.  But, I&#8217;m willing to go with that and check out some truly <a title="Matthew James Taylor's Holy Grail 3-Column Layout" href="http://matthewjamestaylor.com/blog/perfect-3-column.htm" target="_blank">weird and wonderful</a> tricks to arrive at the same solution that would take literally half a dozen lines of code using old clunky tables.  But yeah, I&#8217;m sure google&#8217;s robots are completely fooled by a table and a couple of &lt;tr&gt; tags&#8230; [sarcsasm alert].</p>
<p>Anyway, if CSS is going to be responsible for our layout and can have access to and control some of the DOM, why can&#8217;t we just do:</p>
<blockquote><p>#layerid {<br />
width:20%;<br />
margin:10px auto;<br />
height:width * 0.5;<br />
}</p></blockquote>
<p>That would really open things up and allow for some more creative, interactive layouts.  Hopefully, CSS 4 will allow for some of this.  It should be, in my opinion, a no-brainer.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.joshuasiegal.com/2009/a-call-for-css-math/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
