<?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/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>SVG &#8211; WiredPrairie</title>
	<atom:link href="blog/archives/tag/svg/feed" rel="self" type="application/rss+xml" />
	<link>/blog</link>
	<description>Yet another tech blog.</description>
	<lastBuildDate>Wed, 22 Aug 2012 12:36:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.0</generator>
<site xmlns="com-wordpress:feed-additions:1">193486638</site>	<item>
		<title>How to mask an image in HTML/CSS</title>
		<link>/blog/index.php/archives/1713</link>
		
		<dc:creator><![CDATA[Aaron]]></dc:creator>
		<pubDate>Wed, 22 Aug 2012 12:03:00 +0000</pubDate>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Circle]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Ellipse]]></category>
		<category><![CDATA[Html]]></category>
		<category><![CDATA[Mask]]></category>
		<category><![CDATA[Round]]></category>
		<category><![CDATA[SVG]]></category>
		<guid isPermaLink="false">/blog/?p=1713</guid>

					<description><![CDATA[Until browsers all agree on a technique for masking an image in HTML (like –web-kit-mask-image), I’ve got another option: using SVG. I’m creating a single page application to help sell some electronics and other goodies I’ve collected over the years. Rather than the traditional rectangular display of photos, I wanted to try something different. I [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Until browsers all agree on a technique for masking an image in HTML (like –web-kit-mask-image), I’ve got another option: using SVG.</p>
<p><img loading="lazy" style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="blog/wpcontent/uploads/2012/08/image2.png" width="280" height="304" /></p>
<p>I’m creating a single page application to help sell some electronics and other goodies I’ve collected over the years. Rather than the traditional rectangular display of photos, I wanted to try something different. I wanted the photos to be round. However, I didn’t want to create a bunch of round images. </p>
<p>Enter SVG:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">&lt;svg width=<span style="color: #006080">&quot;220&quot;</span> height=<span style="color: #006080">&quot;220&quot;</span>&gt;<br />                    &lt;mask id=<span style="color: #006080">&quot;m1&quot;</span>&gt;&lt;ellipse cx=<span style="color: #006080">&quot;110&quot;</span> cy=<span style="color: #006080">&quot;110&quot;</span> rx=<span style="color: #006080">&quot;98&quot;</span> ry=<span style="color: #006080">&quot;98&quot;</span> style=<span style="color: #006080">&quot;fill:white;stroke-width:0;fill-opacity: 1.0&quot;</span>&gt;&lt;/ellipse&gt;&lt;/mask&gt;<br />                    &lt;g&gt;<br />                        &lt;ellipse cx=<span style="color: #006080">&quot;110&quot;</span> cy=<span style="color: #006080">&quot;110&quot;</span> rx=<span style="color: #006080">&quot;100&quot;</span> ry=<span style="color: #006080">&quot;100&quot;</span> style=<span style="color: #006080">&quot;stroke-width:10;stroke:#222&quot;</span>&gt;&lt;/ellipse&gt;<br />                        &lt;image href=<span style="color: #006080">&quot;img/sales/lenovo/IMG_0468.jpg&quot;</span> x=<span style="color: #006080">&quot;-25%&quot;</span> y=<span style="color: #006080">&quot;-25%&quot;</span> height=<span style="color: #006080">&quot;150%&quot;</span> width=<span style="color: #006080">&quot;150%&quot;</span> style=<span style="color: #006080">&quot;mask: url(#m1)&quot;</span>&gt;&lt;/image&gt;&lt;/g&gt;&lt;/svg&gt;</pre>
<p></div>
<p>The original images aren’t square, so I tweaked the size and position of each so that it would completely fill the ellipse (150% and -25% for size and location).&#160; As a fall back, I’m going to add the CSS property and value “display:none” to a standard HTML img element that will be optionally displayed if the browser can’t do SVG (like IE8 and lower for example). I don’t want to lose a potential sale to images not showing up! I’ll use <a href="http://modernizr.com/docs/" target="_blank">modernizr</a> for SVG detection.</p>
<p>And although the code above doesn’t demonstrate the technique, you can use CSS to decorate the SVG. Check <a href="http://jsfiddle.net/Uv2sZ/" target="_blank">this</a> demo out that I created:</p>
<p><img loading="lazy" style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="blog/wpcontent/uploads/2012/08/image3.png" width="216" height="214" /></p>
<p><img loading="lazy" style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="blog/wpcontent/uploads/2012/08/image4.png" width="607" height="211" /></p>
<p><img loading="lazy" style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="blog/wpcontent/uploads/2012/08/image5.png" width="206" height="76" /></p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1713</post-id>	</item>
		<item>
		<title>SVG Setting Text Content Dynamically</title>
		<link>/blog/index.php/archives/1643</link>
		
		<dc:creator><![CDATA[Aaron]]></dc:creator>
		<pubDate>Tue, 17 Apr 2012 12:53:00 +0000</pubDate>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Html]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SVG]]></category>
		<guid isPermaLink="false">/blog/?p=1643</guid>

					<description><![CDATA[Continuing on a theme of animating SVG, I’ve added a label in the center of the animation which contains the current angle of the ever-rotating marker (in fact in a centered horizontally and vertically SVG text node). (Click image below to try it.) At the bottom of the file from the previous post, I’ve added [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Continuing on a <a href="blog/archives/1638">theme</a> of animating SVG, I’ve added a label in the center of the animation which contains the current angle of the ever-rotating marker (in fact in a centered horizontally and vertically SVG text node). </p>
<p>(Click image below to try it.)</p>
<p><a href="http://www.wiredprairie.us/examples/svg/demo2.html" target="_blank"><img loading="lazy" style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="blog/wpcontent/uploads/2012/04/image26.png" width="316" height="313" /></a></p>
<p>At the bottom of the file from the <a href="blog/archives/1638">previous</a> post, I’ve added the following:</p>
<pre class="code">    <span style="color: blue">&lt;</span><span style="color: maroon">text </span><span style="color: red">id</span><span style="color: blue">=&quot;currentValueAsText&quot; </span><span style="color: red">x</span><span style="color: blue">=&quot;300&quot; </span><span style="color: red">y</span><span style="color: blue">=&quot;300&quot; 
        </span><span style="color: red">style</span><span style="color: blue">=&quot;</span><span style="color: red">text-anchor</span><span style="color: blue">: middle;</span><span style="color: red">alignment-baseline</span><span style="color: blue">:middle&quot; 
        </span><span style="color: red">fill</span><span style="color: blue">=&quot;#FFFFFF&quot; </span><span style="color: red">font-family</span><span style="color: blue">=&quot;'Arial'&quot; </span><span style="color: red">font-size</span><span style="color: blue">=&quot;96&quot; </span><span style="color: red">opacity</span><span style="color: blue">=&quot;.6&quot;&gt;</span>0<span style="color: blue">&lt;/</span><span style="color: maroon">text</span><span style="color: blue">&gt;

</span></pre>
<p>It’s a new text node. It’s set to centered both horizontally and vertically (using the text-anchor and alignment-baseline style properties respectively) at 300,300. </p>
<p>Setting the content is simple as well:</p>
<pre class="code">(<span style="color: blue">function </span>() {
    window.onload = loaded;
    <span style="color: blue">function </span>loaded() {
        <span style="color: blue">var </span>colorTemp = document.getElementById(<span style="color: maroon">&quot;color-temp&quot;</span>);
        <span style="color: blue">var </span>reading = document.getElementById(<span style="color: maroon">'current-reading'</span>);
<font style="background-color: #ffff00">        <span style="color: blue">var </span>currentVal = document.getElementById(<span style="color: maroon">&quot;currentValueAsText&quot;</span>);
</font>        <span style="color: blue">var </span>currentAngle = 0;
        <span style="color: blue">var </span>fill;

        <span style="color: blue">var </span>direction = 1;
        setInterval(<span style="color: blue">function </span>() {
            currentAngle += direction;
            <span style="color: blue">if </span>(currentAngle &gt;= 120 || currentAngle &lt;= -120) {
                direction *= -1;
            } <span style="color: blue">else if </span>(currentAngle === 0) {
                fill = direction === 1 ? <span style="color: maroon">&quot;#BE1E2D&quot; </span>: <span style="color: maroon">&quot;#10A2DC&quot;</span>;
                colorTemp.setAttribute(<span style="color: maroon">&quot;fill&quot;</span>, fill);
            }
            <span style="color: #006400">// adjust the opacity
            </span>colorTemp.setAttribute(<span style="color: maroon">&quot;opacity&quot;</span>, Math.abs(currentAngle) / 120.0);
            reading.setAttribute(<span style="color: maroon">&quot;transform&quot;</span>, <span style="color: maroon">&quot;rotate(&quot; </span>+ currentAngle + <span style="color: maroon">&quot;)&quot;</span>);
<font style="background-color: #ffff00">            currentValueAsText.textContent = currentAngle.toString();
</font>
        }, 25);
    }
})();</pre>
<p>Use the <strong>textContent</strong> property of the SVG text node to set the text. </p>
<p>Done. <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="blog/wpcontent/uploads/2012/04/wlEmoticon-smile2.png" /></p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1643</post-id>	</item>
		<item>
		<title>Spinning SVG Animation</title>
		<link>/blog/index.php/archives/1638</link>
					<comments>/blog/index.php/archives/1638#comments</comments>
		
		<dc:creator><![CDATA[Aaron]]></dc:creator>
		<pubDate>Tue, 17 Apr 2012 01:36:13 +0000</pubDate>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Html]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[Thermostat]]></category>
		<guid isPermaLink="false">/blog/?p=1638</guid>

					<description><![CDATA[Interested in learning a few capabilities of SVG animation this evening from JavaScript in a web page, I put together a simple demonstration. Click on the image to launch the demo. Animating SVG in a modern browser (including IE9) is generally easy enough. This example was slightly more interesting in that I wanted the thicker [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Interested in learning a few capabilities of SVG animation this evening from JavaScript in a web page, I put together a simple demonstration.</p>
<p>Click on the image to launch the demo.</p>
<p><a href="http://www.wiredprairie.us/examples/svg/demo1.html" target="_blank"><img loading="lazy" style="background-image: none; border-right-width: 0px; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="blog/wpcontent/uploads/2012/04/image23.png" width="308" height="307" /></a></p>
<p>Animating SVG in a modern browser (including IE9) is generally easy enough. This example was slightly more interesting in that I wanted the thicker line to rotate based on the center point of the image, rather than the location of the line itself.</p>
<p>Not what I wanted:</p>
<p><img loading="lazy" style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="blog/wpcontent/uploads/2012/04/image24.png" width="308" height="307" /></p>
<p>Desired rotation:</p>
<p><img loading="lazy" style="background-image: none; border-right-width: 0px; margin: 0px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="blog/wpcontent/uploads/2012/04/image25.png" width="308" height="307" /></p>
<p>The white bar would rotate around the center point (marked by the red arrow above).</p>
<p>I’ve included all of the code at the bottom of the post. (There’s quite a lot of path information).</p>
<p>The JavaScript just used an interval to move the line around the point:</p>
<p><pre class="code">(<span style="color: blue">function </span>() {
    window.onload = loaded;
    <span style="color: blue">function </span>loaded() {
        <span style="color: blue">var </span>colorTemp = document.getElementById(<span style="color: maroon">&quot;color-temp&quot;</span>);
        <span style="color: blue">var </span>reading = document.getElementById(<span style="color: maroon">'current-reading'</span>);
        <span style="color: blue">var </span>currentAngle = 0;
        <span style="color: blue">var </span>fill;

        <span style="color: blue">var </span>direction = 1;
        setInterval(<span style="color: blue">function </span>() {
            currentAngle += direction;
            <span style="color: blue">if </span>(currentAngle &gt;= 120 || currentAngle &lt;= -120) {
                direction *= -1;
            } <span style="color: blue">else if </span>(currentAngle === 0) {
                fill = direction === 1 ? <span style="color: maroon">&quot;#BE1E2D&quot; </span>: <span style="color: maroon">&quot;#10A2DC&quot;</span>;
                colorTemp.setAttribute(<span style="color: maroon">&quot;fill&quot;</span>, fill);
            }
            <span style="color: #006400">// adjust the opacity
            </span>colorTemp.setAttribute(<span style="color: maroon">&quot;opacity&quot;</span>, Math.abs(currentAngle) / 120.0);

            reading.setAttribute(<span style="color: maroon">&quot;transform&quot;</span>, <span style="color: maroon">&quot;rotate(&quot; </span>+ currentAngle + <span style="color: maroon">&quot;)&quot;</span>);

        }, 25);
    }
})();</pre>
<p>  The angle is fixed between 120 and –120 degrees. When the angle reaches zero, the fill color is toggled. </p>
<p>As the angle adjusts, the line is updated as well as the opacity of the fill.</p>
<p>The overall size of the SVG drawing is 600&#215;600. Knowing that (and wanting the exact center), I translated a group to an offset of 300x, 300y containing the line:</p>
<pre class="code"><span style="color: blue">&lt;</span><span style="color: maroon">g </span><span style="color: red">id</span><span style="color: blue">=&quot;temp-transform&quot; </span><span style="color: red">transform</span><span style="color: blue">=&quot;translate(300,300)&quot;&gt;
        &lt;</span><span style="color: maroon">line </span><span style="color: red">id</span><span style="color: blue">=&quot;current-reading&quot; </span><span style="color: red">fill</span><span style="color: blue">=&quot;none&quot; </span><span style="color: red">stroke</span><span style="color: blue">=&quot;#FFFFFF&quot;
              </span><span style="color: red">stroke-width</span><span style="color: blue">=&quot;5&quot; </span><span style="color: red">stroke-linecap</span><span style="color: blue">=&quot;round&quot;
              </span><span style="color: red">stroke-miterlimit</span><span style="color: blue">=&quot;10&quot; </span><span style="color: red">x1</span><span style="color: blue">=&quot;0&quot; </span><span style="color: red">y1</span><span style="color: blue">=&quot;-180&quot; </span><span style="color: red">x2</span><span style="color: blue">=&quot;0&quot; </span><span style="color: red">y2</span><span style="color: blue">=&quot;-120&quot;/&gt;
&lt;/</span><span style="color: maroon">g</span><span style="color: blue">&gt;
</span></pre>
<p>This effectively made the rotation now work from the center, once the line coordinates were adjusted to reflect the new translation. </p>
<p>This works because the contents of the outer group caused the new starting point (origin) to be 300x, 300y rather than the default 0x, 0y. You can see the line is from y –120 to y –180. That’s because I wanted the line to start in the top middle (as the x is set to 0 for the line).</p>
<p>I used Adobe Illustrator CS 5.5 to create the SVG image. Illustrator typically does not always handle fonts well when exporting as SVG. The final text node was this:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">&lt;text transform=<span style="color: #006080">&quot;matrix(1 0 0 1 254.1387 83.3198)&quot;</span> fill=<span style="color: #006080">&quot;#D1D3D4&quot;</span> font-family=<span style="color: #006080">&quot;'Arial'&quot;</span><br />      font-weight=<span style="color: #006080">&quot;bold&quot;</span> font-size=<span style="color: #006080">&quot;29.4616&quot;</span>&gt;thermo&lt;/text&gt;<br /></pre>
<p></div>
<p>To make it work across browsers, I needed to modify the text node below slightly. Note the font name and missing bold attribute. It’s not a hard switch, but it’s annoying if you need to make changes to your SVG multiple times.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">&lt;text transform=<span style="color: #006080">&quot;matrix(1 0 0 1 254.1387 83.3198)&quot;</span> fill=<span style="color: #006080">&quot;#D1D3D4&quot;</span> <br />font-family=<span style="color: #006080">&quot;'Arial-BoldMT'&quot;</span> font-size=<span style="color: #006080">&quot;29.4616&quot;</span>&gt;thermo&lt;/text&gt;</pre>
<p></div>
<p>If you have any questions, please leave a comment!</p>
<pre class="code"><span style="color: blue">&lt;!</span><span style="color: maroon">DOCTYPE </span><span style="color: red">HTML</span><span style="color: blue">&gt;
&lt;</span><span style="color: maroon">html</span><span style="color: blue">&gt;
&lt;</span><span style="color: maroon">head</span><span style="color: blue">&gt;
    &lt;</span><span style="color: maroon">title</span><span style="color: blue">&gt;</span>Svg Spinner Demo<span style="color: blue">&lt;/</span><span style="color: maroon">title</span><span style="color: blue">&gt;
    &lt;</span><span style="color: maroon">style</span><span style="color: blue">&gt;
        </span><span style="color: maroon">#demo1 svg </span>{
            <span style="color: red">width</span>: <span style="color: blue">300px</span>;
            <span style="color: red">height</span>: <span style="color: blue">300px</span>;
        }

    <span style="color: blue">&lt;/</span><span style="color: maroon">style</span><span style="color: blue">&gt;
&lt;/</span><span style="color: maroon">head</span><span style="color: blue">&gt;
&lt;</span><span style="color: maroon">body</span><span style="color: blue">&gt;

&lt;</span><span style="color: maroon">div </span><span style="color: red">id</span><span style="color: blue">=&quot;demo1&quot;&gt;
&lt;</span><span style="color: maroon">svg </span><span style="color: red">version</span><span style="color: blue">=&quot;1.0&quot; </span><span style="color: red">id</span><span style="color: blue">=&quot;Layer_1&quot; </span><span style="color: red">xmlns</span><span style="color: blue">=&quot;http://www.w3.org/2000/svg&quot; </span><span style="color: red">xmlns</span><span style="color: blue">:</span><span style="color: red">xlink</span><span style="color: blue">=&quot;http://www.w3.org/1999/xlink&quot; </span><span style="color: red">x</span><span style="color: blue">=&quot;0px&quot; </span><span style="color: red">y</span><span style="color: blue">=&quot;0px&quot;
     </span><span style="color: red">width</span><span style="color: blue">=&quot;600px&quot; </span><span style="color: red">height</span><span style="color: blue">=&quot;600px&quot; </span><span style="color: red">viewBox</span><span style="color: blue">=&quot;0 0 600 600&quot; </span><span style="color: red">enable-background</span><span style="color: blue">=&quot;new 0 0 600 600&quot; </span><span style="color: red">xml</span><span style="color: blue">:</span><span style="color: red">space</span><span style="color: blue">=&quot;preserve&quot;&gt;
&lt;</span><span style="color: maroon">g</span><span style="color: blue">&gt;
    &lt;</span><span style="color: maroon">radialGradient </span><span style="color: red">id</span><span style="color: blue">=&quot;SVGID_1_&quot; </span><span style="color: red">cx</span><span style="color: blue">=&quot;298.9106&quot; </span><span style="color: red">cy</span><span style="color: blue">=&quot;196.146&quot; </span><span style="color: red">r</span><span style="color: blue">=&quot;399.267&quot; </span><span style="color: red">gradientUnits</span><span style="color: blue">=&quot;userSpaceOnUse&quot;&gt;
        &lt;</span><span style="color: maroon">stop  </span><span style="color: red">offset</span><span style="color: blue">=&quot;0&quot; </span><span style="color: red">style</span><span style="color: blue">=&quot;</span><span style="color: red">stop-color</span><span style="color: blue">:#D9D9D9&quot;/&gt;
        &lt;</span><span style="color: maroon">stop  </span><span style="color: red">offset</span><span style="color: blue">=&quot;1&quot; </span><span style="color: red">style</span><span style="color: blue">=&quot;</span><span style="color: red">stop-color</span><span style="color: blue">:#C2C2C2&quot;/&gt;
    &lt;/</span><span style="color: maroon">radialGradient</span><span style="color: blue">&gt;
    &lt;</span><span style="color: maroon">path </span><span style="color: red">fill</span><span style="color: blue">=&quot;url(#SVGID_1_)&quot; </span><span style="color: red">d</span><span style="color: blue">=&quot;M300.646,595.41c-78.957,0-153.188-30.747-209.02-86.579C35.795,453,5.048,378.77,5.048,299.812
        c0-78.957,30.748-153.188,86.579-209.02S221.689,4.214,300.646,4.214c78.958,0,153.188,30.748,209.019,86.579
        c55.832,55.831,86.579,130.063,86.579,209.02c0,78.958-30.747,153.188-86.579,209.019
        C453.834,564.663,379.604,595.41,300.646,595.41z&quot;/&gt;
    &lt;</span><span style="color: maroon">path </span><span style="color: red">fill</span><span style="color: blue">=&quot;#808285&quot; </span><span style="color: red">d</span><span style="color: blue">=&quot;M300.646,6.214c39.637,0,78.086,7.762,114.281,23.071c34.961,14.787,66.359,35.957,93.324,62.922
        s48.135,58.364,62.923,93.325c15.309,36.193,23.07,74.643,23.07,114.28s-7.762,78.086-23.07,114.281
        c-14.788,34.961-35.958,66.359-62.923,93.324s-58.363,48.135-93.324,62.923c-36.194,15.309-74.644,23.07-114.281,23.07
        s-78.087-7.762-114.28-23.07c-34.961-14.788-66.36-35.958-93.325-62.923s-48.135-58.363-62.922-93.324
        C14.81,377.898,7.048,339.449,7.048,299.812s7.762-78.087,23.071-114.28c14.787-34.961,35.957-66.36,62.922-93.325
        s58.364-48.135,93.325-62.922C222.559,13.976,261.009,6.214,300.646,6.214 M300.646,2.214
        C136.287,2.214,3.048,135.453,3.048,299.812S136.287,597.41,300.646,597.41s297.598-133.239,297.598-297.598
        S465.005,2.214,300.646,2.214L300.646,2.214z&quot;/&gt;
&lt;/</span><span style="color: maroon">g</span><span style="color: blue">&gt;
&lt;</span><span style="color: maroon">g</span><span style="color: blue">&gt;
    &lt;</span><span style="color: maroon">radialGradient </span><span style="color: red">id</span><span style="color: blue">=&quot;SVGID_2_&quot; </span><span style="color: red">cx</span><span style="color: blue">=&quot;299.0464&quot; </span><span style="color: red">cy</span><span style="color: blue">=&quot;204.2632&quot; </span><span style="color: red">r</span><span style="color: blue">=&quot;368.0053&quot; </span><span style="color: red">gradientUnits</span><span style="color: blue">=&quot;userSpaceOnUse&quot;&gt;
        &lt;</span><span style="color: maroon">stop  </span><span style="color: red">offset</span><span style="color: blue">=&quot;0&quot; </span><span style="color: red">style</span><span style="color: blue">=&quot;</span><span style="color: red">stop-color</span><span style="color: blue">:#141414&quot;/&gt;
        &lt;</span><span style="color: maroon">stop  </span><span style="color: red">offset</span><span style="color: blue">=&quot;1&quot; </span><span style="color: red">style</span><span style="color: blue">=&quot;</span><span style="color: red">stop-color</span><span style="color: blue">:#080808&quot;/&gt;
    &lt;/</span><span style="color: maroon">radialGradient</span><span style="color: blue">&gt;
    &lt;</span><span style="color: maroon">path </span><span style="color: red">fill</span><span style="color: blue">=&quot;url(#SVGID_2_)&quot; </span><span style="color: red">d</span><span style="color: blue">=&quot;M300.646,572.266c-72.775,0-141.194-28.34-192.654-79.8c-51.459-51.46-79.8-119.879-79.8-192.654
        s28.34-141.194,79.8-192.654s119.879-79.8,192.654-79.8s141.194,28.34,192.654,79.8c51.46,51.46,79.8,119.879,79.8,192.654
        s-28.34,141.194-79.8,192.654S373.421,572.266,300.646,572.266z&quot;/&gt;
    &lt;</span><span style="color: maroon">path </span><span style="color: red">d</span><span style="color: blue">=&quot;M300.646,29.358c36.512,0,71.931,7.15,105.271,21.252c32.205,13.622,61.129,33.123,85.968,57.962
        c24.84,24.839,44.341,53.763,57.963,85.968c14.102,33.34,21.252,68.759,21.252,105.271c0,36.512-7.15,71.931-21.252,105.271
        c-13.622,32.205-33.123,61.129-57.963,85.968c-24.839,24.84-53.763,44.341-85.968,57.963
        c-33.34,14.102-68.759,21.252-105.271,21.252c-36.513,0-71.931-7.15-105.271-21.252c-32.205-13.622-61.129-33.123-85.968-57.963
        c-24.839-24.839-44.34-53.763-57.962-85.968c-14.102-33.34-21.252-68.759-21.252-105.271c0-36.513,7.15-71.931,21.252-105.271
        c13.622-32.205,33.123-61.129,57.962-85.968s53.763-44.34,85.968-57.962C228.715,36.509,264.133,29.358,300.646,29.358
         M300.646,25.358c-151.577,0-274.454,122.877-274.454,274.454c0,151.576,122.877,274.454,274.454,274.454
        c151.576,0,274.454-122.878,274.454-274.454C575.1,148.235,452.222,25.358,300.646,25.358L300.646,25.358z&quot;/&gt;
&lt;/</span><span style="color: maroon">g</span><span style="color: blue">&gt;
&lt;</span><span style="color: maroon">g</span><span style="color: blue">&gt;
    &lt;</span><span style="color: maroon">radialGradient </span><span style="color: red">id</span><span style="color: blue">=&quot;SVGID_3_&quot; </span><span style="color: red">cx</span><span style="color: blue">=&quot;299.5176&quot; </span><span style="color: red">cy</span><span style="color: blue">=&quot;232.4409&quot; </span><span style="color: red">r</span><span style="color: blue">=&quot;259.4771&quot; </span><span style="color: red">gradientUnits</span><span style="color: blue">=&quot;userSpaceOnUse&quot;&gt;
        &lt;</span><span style="color: maroon">stop  </span><span style="color: red">offset</span><span style="color: blue">=&quot;0&quot; </span><span style="color: red">style</span><span style="color: blue">=&quot;</span><span style="color: red">stop-color</span><span style="color: blue">:#212121&quot;/&gt;
        &lt;</span><span style="color: maroon">stop  </span><span style="color: red">offset</span><span style="color: blue">=&quot;1&quot; </span><span style="color: red">style</span><span style="color: blue">=&quot;</span><span style="color: red">stop-color</span><span style="color: blue">:#0D0D0D&quot;/&gt;
    &lt;/</span><span style="color: maroon">radialGradient</span><span style="color: blue">&gt;
    &lt;</span><span style="color: maroon">path </span><span style="color: red">fill</span><span style="color: blue">=&quot;url(#SVGID_3_)&quot; </span><span style="color: red">d</span><span style="color: blue">=&quot;M300.646,491.916c-105.927,0-192.104-86.178-192.104-192.104
        c0-105.927,86.178-192.104,192.104-192.104c105.926,0,192.104,86.178,192.104,192.104
        C492.75,405.738,406.572,491.916,300.646,491.916z&quot;/&gt;
    &lt;</span><span style="color: maroon">path </span><span style="color: red">d</span><span style="color: blue">=&quot;M300.646,109.708c25.666,0,50.561,5.026,73.996,14.938c22.638,9.575,42.968,23.283,60.429,40.743
        c17.46,17.46,31.167,37.791,40.742,60.428c9.912,23.435,14.938,48.331,14.938,73.996s-5.025,50.561-14.938,73.996
        c-9.575,22.638-23.282,42.968-40.742,60.429c-17.461,17.46-37.791,31.167-60.429,40.742c-23.435,9.912-48.33,14.938-73.996,14.938
        s-50.562-5.025-73.996-14.938c-22.637-9.575-42.968-23.282-60.428-40.742c-17.46-17.461-31.168-37.791-40.743-60.429
        c-9.912-23.435-14.938-48.33-14.938-73.996s5.026-50.562,14.938-73.996c9.575-22.637,23.283-42.968,40.743-60.428
        s37.791-31.168,60.428-40.743C250.084,114.733,274.98,109.708,300.646,109.708 M300.646,105.708
        c-107.201,0-194.104,86.903-194.104,194.104c0,107.201,86.903,194.104,194.104,194.104c107.201,0,194.104-86.903,194.104-194.104
        C494.75,192.611,407.847,105.708,300.646,105.708L300.646,105.708z&quot;/&gt;
&lt;/</span><span style="color: maroon">g</span><span style="color: blue">&gt;
&lt;</span><span style="color: maroon">g </span><span style="color: red">opacity</span><span style="color: blue">=&quot;0.8&quot;&gt;
    &lt;</span><span style="color: maroon">path </span><span style="color: red">id</span><span style="color: blue">=&quot;color-temp&quot; </span><span style="color: red">fill</span><span style="color: blue">=&quot;#BE1E2D&quot; </span><span style="color: red">opacity</span><span style="color: blue">=&quot;0&quot; </span><span style="color: red">d</span><span style="color: blue">=&quot;M300.646,489.309c-104.489,0-189.497-85.008-189.497-189.497c0-104.489,85.008-189.497,189.497-189.497
        c104.489,0,189.497,85.008,189.497,189.497C490.143,404.301,405.135,489.309,300.646,489.309z&quot;/&gt;
    &lt;</span><span style="color: maroon">path </span><span style="color: red">d</span><span style="color: blue">=&quot;M300.646,110.815c25.515,0,50.266,4.997,73.566,14.852c22.505,9.519,42.718,23.146,60.075,40.504
        s30.984,37.57,40.504,60.075c9.854,23.3,14.852,48.051,14.852,73.566s-4.997,50.266-14.852,73.566
        c-9.52,22.505-23.146,42.718-40.504,60.075s-37.57,30.984-60.075,40.504c-23.3,9.854-48.051,14.852-73.566,14.852
        s-50.266-4.997-73.566-14.852c-22.505-9.52-42.718-23.146-60.075-40.504s-30.985-37.57-40.504-60.075
        c-9.855-23.3-14.852-48.051-14.852-73.566s4.997-50.266,14.852-73.566c9.519-22.505,23.146-42.718,40.504-60.075
        s37.57-30.985,60.075-40.504C250.38,115.812,275.131,110.815,300.646,110.815 M300.646,109.815
        c-104.933,0-189.997,85.064-189.997,189.997c0,104.932,85.064,189.997,189.997,189.997c104.932,0,189.997-85.064,189.997-189.997
        C490.643,194.879,405.578,109.815,300.646,109.815L300.646,109.815z&quot;/&gt;
&lt;/</span><span style="color: maroon">g</span><span style="color: blue">&gt;
&lt;</span><span style="color: maroon">g </span><span style="color: red">id</span><span style="color: blue">=&quot;temperature-markings&quot;&gt;
        &lt;</span><span style="color: maroon">line </span><span style="color: red">fill</span><span style="color: blue">=&quot;none&quot; </span><span style="color: red">stroke</span><span style="color: blue">=&quot;#C7C8CA&quot; </span><span style="color: red">stroke-width</span><span style="color: blue">=&quot;5&quot; </span><span style="color: red">stroke-miterlimit</span><span style="color: blue">=&quot;10&quot;
              </span><span style="color: red">x1</span><span style="color: blue">=&quot;300.646&quot; </span><span style="color: red">y1</span><span style="color: blue">=&quot;123.751&quot; </span><span style="color: red">x2</span><span style="color: blue">=&quot;300.646&quot; </span><span style="color: red">y2</span><span style="color: blue">=&quot;161.603&quot;/&gt;
        &lt;</span><span style="color: maroon">line </span><span style="color: red">fill</span><span style="color: blue">=&quot;none&quot; </span><span style="color: red">stroke</span><span style="color: blue">=&quot;#C7C8CA&quot; </span><span style="color: red">stroke-width</span><span style="color: blue">=&quot;5&quot; </span><span style="color: red">stroke-miterlimit</span><span style="color: blue">=&quot;10&quot;
              </span><span style="color: red">x1</span><span style="color: blue">=&quot;422.102&quot; </span><span style="color: red">y1</span><span style="color: blue">=&quot;371.971&quot; </span><span style="color: red">x2</span><span style="color: blue">=&quot;454.881&quot; </span><span style="color: red">y2</span><span style="color: blue">=&quot;390.896&quot;/&gt;
        &lt;</span><span style="color: maroon">line </span><span style="color: red">fill</span><span style="color: blue">=&quot;none&quot; </span><span style="color: red">stroke</span><span style="color: blue">=&quot;#C7C8CA&quot; </span><span style="color: red">stroke-width</span><span style="color: blue">=&quot;5&quot; </span><span style="color: red">stroke-miterlimit</span><span style="color: blue">=&quot;10&quot;
              </span><span style="color: red">x1</span><span style="color: blue">=&quot;146.41&quot; </span><span style="color: red">y1</span><span style="color: blue">=&quot;390.896&quot; </span><span style="color: red">x2</span><span style="color: blue">=&quot;179.191&quot; </span><span style="color: red">y2</span><span style="color: blue">=&quot;371.97&quot;/&gt;
&lt;/</span><span style="color: maroon">g</span><span style="color: blue">&gt;
&lt;</span><span style="color: maroon">g </span><span style="color: red">id</span><span style="color: blue">=&quot;temp-transform&quot; </span><span style="color: red">transform</span><span style="color: blue">=&quot;translate(300,300)&quot;&gt;
        &lt;</span><span style="color: maroon">line </span><span style="color: red">id</span><span style="color: blue">=&quot;current-reading&quot; </span><span style="color: red">fill</span><span style="color: blue">=&quot;none&quot; </span><span style="color: red">stroke</span><span style="color: blue">=&quot;#FFFFFF&quot;
              </span><span style="color: red">stroke-width</span><span style="color: blue">=&quot;5&quot; </span><span style="color: red">stroke-linecap</span><span style="color: blue">=&quot;round&quot;
              </span><span style="color: red">stroke-miterlimit</span><span style="color: blue">=&quot;10&quot; </span><span style="color: red">x1</span><span style="color: blue">=&quot;0&quot; </span><span style="color: red">y1</span><span style="color: blue">=&quot;-180&quot; </span><span style="color: red">x2</span><span style="color: blue">=&quot;0&quot; </span><span style="color: red">y2</span><span style="color: blue">=&quot;-120&quot;/&gt;
&lt;/</span><span style="color: maroon">g</span><span style="color: blue">&gt;
    &lt;</span><span style="color: maroon">text </span><span style="color: red">transform</span><span style="color: blue">=&quot;matrix(1 0 0 1 254.1387 83.3198)&quot; </span><span style="color: red">fill</span><span style="color: blue">=&quot;#D1D3D4&quot; </span><span style="color: red">font-family</span><span style="color: blue">=&quot;'Arial'&quot;
          </span><span style="color: red">font-weight</span><span style="color: blue">=&quot;bold&quot; </span><span style="color: red">font-size</span><span style="color: blue">=&quot;29.4616&quot;&gt;</span>thermo<span style="color: blue">&lt;/</span><span style="color: maroon">text</span><span style="color: blue">&gt;
&lt;/</span><span style="color: maroon">svg</span><span style="color: blue">&gt;


&lt;/</span><span style="color: maroon">div</span><span style="color: blue">&gt;


&lt;</span><span style="color: maroon">script </span><span style="color: red">type</span><span style="color: blue">=&quot;text/javascript&quot;&gt;

    </span>(<span style="color: blue">function </span>() {

        window.onload = loaded;

        <span style="color: blue">function </span>loaded() {
            <span style="color: blue">var </span>colorTemp = document.getElementById(<span style="color: maroon">&quot;color-temp&quot;</span>);
            <span style="color: blue">var </span>reading = document.getElementById(<span style="color: maroon">'current-reading'</span>);
            <span style="color: blue">var </span>currentAngle = 0;
            <span style="color: blue">var </span>fill;

            <span style="color: blue">var </span>direction = 1;
            setInterval(<span style="color: blue">function </span>() {
                currentAngle += direction;
                <span style="color: blue">if </span>(currentAngle &gt;= 120 || currentAngle &lt;= -120) {
                    direction *= -1;
                } <span style="color: blue">else if </span>(currentAngle === 0) {
                    fill = direction === 1 ? <span style="color: maroon">&quot;#BE1E2D&quot; </span>: <span style="color: maroon">&quot;#10A2DC&quot;</span>;
                    colorTemp.setAttribute(<span style="color: maroon">&quot;fill&quot;</span>, fill);
                }
                <span style="color: #006400">// adjust the opacity
                </span>colorTemp.setAttribute(<span style="color: maroon">&quot;opacity&quot;</span>, Math.abs(currentAngle) / 120.0);

                reading.setAttribute(<span style="color: maroon">&quot;transform&quot;</span>, <span style="color: maroon">&quot;rotate(&quot; </span>+ currentAngle + <span style="color: maroon">&quot;)&quot;</span>);

            }, 25);
        }
    })();


<span style="color: blue">&lt;/</span><span style="color: maroon">script</span><span style="color: blue">&gt;
&lt;/</span><span style="color: maroon">body</span><span style="color: blue">&gt;
&lt;/</span><span style="color: maroon">html</span><span style="color: blue">&gt;
</span></pre>
]]></content:encoded>
					
					<wfw:commentRss>/blog/index.php/archives/1638/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1638</post-id>	</item>
	</channel>
</rss>
