<?xml version="1.0" encoding="iso-8859-1"?><rss version="0.91">
    <channel>
        <title>phpguru.org - Richard Heyes' ramblings and code</title>
        <link>http://www.phpguru.org/</link>
        <description>
            Quality PHP and Javascript code, along with a mild smattering of humour. Also second home of the RGraph HTML5 canvas graph library.
        </description>

                    <item>
                <title>WebKit/CSS Reflections</title>
                <link>http://www.phpguru.org/article/479</link>
                <pubDate>Thu, 24 Jun 2010 18:40:39 +0100</pubDate>
                <description>
                    <![CDATA[<p class="firstLetter"><ul>
    <li><a href="#intro">Introduction</a></li>
    <li><a href="#format">Format</a></li>
    <li><a href="#example1">Example 1</a></li>
    <li><a href="#example2">Example 2</a></li>
    <li><a href="#example3">Example 3</a></li>
    <li><a href="#example4">Example 4</a></li>
    <li><a href="#example5">Example 5</a></li>
    <li><a href="#links">Related links</a></li>
</ul>

<a name="intro"></a>
<h4>Introduction</h4>

CSS Reflections are as their name suggests - refections of elements provided by CSS. They're very easy to accomplish and provide
simple but effective effects which you could use, for example, in a photo gallery. Currently these appear to be WebKit only - so
Google Chrome and Safari.

<!-- 
         direction: above, below, left or right
            offset: Is a length or percentage
    mask-box-image: Can be omitted
-->

<a name="format"></a>
<h4>The format</h4>

    The CSS identifier is <i>-webkit-box-reflect</i>, and it takes either two or three values:
    
    <ul>
        <li>The direction of the reflection. This can be <i>left</i>, <i>right</i>, <i>top</i> or <i>bottom</i>.</li>
        <li>The offset. This can be in pixels or a percentage. Bear in mind that the size and offset of the reflection does not affect the page layout.</li>
        <li>A color mask for the gradient (optional). Using this you can achieve graduated reflections, as shown below.</li>
    </ul>

<a name="example1"></a>
<h4>Example 1</h4>

    <p>
        This shows a basic reflection on the right of an image:
    </p>

    <img src="/images/ajax.jpg" style="-webkit-box-reflect: right 0" width="74" height="160"/>

    <pre class="code">
-webkit-box-reflect: right 0;
</pre>

<a name="example2"></a>
<h4>Example 2</h4>

    <p>
        This is the same image but with the reflection on the left hand side and offset a little. Note that the layout of the
        page is not affected by the reflection (much like <i>box-shadow</i> in this respect).
    </p>
    
    <img src="/images/ajax.jpg" style="-webkit-box-reflect: left 5" width="74" height="160"/>
    
    <pre class="code">
-webkit-box-reflect: left 5;
</pre>

<a name="example3"></a>
<h4>Example 3</h4>
    <p>
        This example has a mask applied using a gradient.
    </p>

    <img src="/images/ajax.jpg" style="-webkit-box-reflect: right 0 -webkit-gradient(linear, right top, left top, from(rgba(255,255,255,0.7)), to(transparent))" width="74" height="160"/>
    
    <pre class="code">
-webkit-box-reflect: right 0 -webkit-gradient(linear, right top, left top, from(rgba(255,255,255,0.7)), to(transparent))
</pre>

    <p>
        As you can see, this example uses a gradient mask to produce a fade out effect.
    </p>

<a name="example4"></a>
<h4>Example 4</h4>
    
    <p>
        As you can see below, reflections work on just about any element, not just images.
    </p>
    
    <p style="border: 2px solid gray; padding: 5px; width: 230px; -webkit-box-reflect: right 0">
        lorem ipsum delore lorem ipsum
        lorem ipsum delore lorem ipsum
        lorem ipsum delore lorem ipsum
        lorem ipsum delore lorem ipsum
    </p>
    
    <pre class="code">
border: 2px solid gray; padding: 5px; width: 230px; -webkit-box-reflect: right 0
</pre>

<a name="example5"></a>
<h4>Example 5</h4>
    
    <p>
        You even use CSS reflections on video elements if you wish. This shows a short video reflected to the right. It only plays
        in Google Chrome, (Safari doesn't support the video).
    </p>
    
    <video src="/html5/video.webm" style="width: 300px; -webkit-box-reflect: right 5px -webkit-gradient(linear, right top, left top, from(white), to(transparent))" controls></video>


<a name="links"></a>
<h4>Related links</h4>

<ul>
    <li><a href="http://webkit.org/blog/182/css-reflections/">http://webkit.org/blog/182/css-reflections/</a></li>
</ul>]]>
                </description>
            </item>
                    <item>
                <title>19th June RGraph release</title>
                <link>http://www.phpguru.org/article/477</link>
                <pubDate>Sat, 19 Jun 2010 22:22:24 +0100</pubDate>
                <description>
                    <![CDATA[<p class="firstLetter">Back online and fully plugged in; this weeks release incorporates a 
new layout for the documentation pages, making them easier to read and 
navigate.

<ul>
  <li>Documented grid autofit properties for the Bar, Gantt, Hbar, Line 
and Scatter charts</li>
  <li>Reorganized the documentation pages</li>
  <li>Added a warning to the website for MSIE 6 & 7</li>
</ul>

<a href="http://www.rgraph.net" style="float: right; font-weight: bold">Go to the RGraph website &raquo;</a>]]>
                </description>
            </item>
                    <item>
                <title>5th June 2010 RGraph release</title>
                <link>http://www.phpguru.org/article/475</link>
                <pubDate>Sun, 06 Jun 2010 01:56:57 +0100</pubDate>
                <description>
                    <![CDATA[<p class="firstLetter">Not too many changes this week:

<ul>
  <li>Added properties to the Horizontal Bar chart: <i>chart.title.xaxis</i>, <i>chart.title.yaxis</i>, <i>chart.title.xaxis.pos</i>, <i>chart.title.yaxis.pos</i>
</li>
  <li>Slightly increased the area recognised to initiate resizing the Rose (ie the size of the hotspot)</li>
  <li>Added adjusting to the TRadar</li>
</ul>

<p>

On a separate note - I've updated the <a href="http://www.phpguru.org/geolocation.html"><b>HTML5 GeoLocation example</b></a> with an embedded Google map. This will probably be more useful to you. Also, if you have the Google Toolbar installed, MSIE appears to have GeoLocation support (!).]]>
                </description>
            </item>
                    <item>
                <title>29th May 2010 RGraph release</title>
                <link>http://www.phpguru.org/article/474</link>
                <pubDate>Sat, 29 May 2010 23:32:39 +0100</pubDate>
                <description>
                    <![CDATA[<p class="firstLetter">Back to crappy rain here. Still, at least I'm not melting. Not entirely sure which I prefer - melting or freezing. It does however mean I've spent more time on RGraph. Here's this weeks skinny:

<ul>
  <li>Added adjusting to the Bar chart</li>
  <li>Added gray border effect to the Odometer</li>
  <li>Added chart.tickmarks.highlight to the Odometer</li>
  <li>Added adjusting to the Progress bar</li>
  <li>Added adjusting to the Rose chart</li>
  <li>Added chart.ymin to the Scatter chart</li>
</ul>

<a href="http://www.rgraph.net" style="float: right; font-weight: bold">Go to the RGraph website &raquo;</a>

<br clear="all" /><br />

As you can see below, there's also an article that may be of interest detailing the new notification system that is a part of Google Chrome. It allows non-modal dialogs, which may be more useful to you and your application than a simple alert().]]>
                </description>
            </item>
                    <item>
                <title>22nd May 2010 RGraph release</title>
                <link>http://www.phpguru.org/article/472</link>
                <pubDate>Sun, 23 May 2010 00:27:30 +0100</pubDate>
                <description>
                    <![CDATA[<p class="firstLetter">It's far too hot to be concerned with updating RGraph much, hence this release doesn't have much to it. It's mainly very minor tweaks and a few documentation updates. It does however introduce interactive adjustments on the Line chart. This will be useful when doing demonstrations etc. This will be expanded to other graph types in time. You can see the adjustments feature <a href="http://www.rgraph.net/docs/adjusting.html" target="_blank">here</a>.]]>
                </description>
            </item>
                    <item>
                <title>15th May RGraph release</title>
                <link>http://www.phpguru.org/article/470</link>
                <pubDate>Sat, 15 May 2010 20:59:52 +0100</pubDate>
                <description>
                    <![CDATA[<p class="firstLetter">A few more changes than usual today:

<ul>
  <li>Updated the .getSegment() core function for use with the Rose and Donut variant charts</li>
  <li>Added RGraph.array_pad() function to the core library</li>
  <li>Grouped Bar charts can now have shadows going to the left</li>
  <li>The Line chart linewidth can now, as well as being a single number, be an array of numbers, one for each line</li>
  <li>You can now have labels on the inside of the Line charts Y axis as opposed to having them in the gutter</li>
  <li>The ModalDialog and zoom background DIVs are now much better in regards to page coverage (the semi-opaque background)</li>
  <li>You can now pass a color as the second argument to RGraph.Redraw() which it will use</li>
  <li>Resizing the window when zoomed no longer hides the zoom</li>
  <li>Little bit of work on the Odometer pointers and MSIE compatibility</li>
  <li>Added a "digital" readout option to the Odometer, as shown on the example page</li>
  <li>The Progress Bar can now have an "in-bar" indicator</li>
  <li>Converted the Pie chart to use RGraph.getSegment() for tooltips</li>
  <li>You can now set the strokestyle with the Rose chart</li>
  <li>Converted the Rose chart to use RGraph.getSegment() for tooltips</li>
  <li>Added chart.line.linewidth to the Scatter chart, and, as with the line, it can be either a number or an array of numbers</li>
  <li>The Scatter chart option chart.line.stepped can now, as well as simply true or false, be an array of booleans. This allows you to have multiple lines, some stepped, some not</li>
</ul>

<a href="http://www.rgraph.net" style="float: right; font-weight: bold">Go to the RGraph website &raquo;</a>]]>
                </description>
            </item>
                    <item>
                <title>8th May 2010 RGraph release</title>
                <link>http://www.phpguru.org/article/469</link>
                <pubDate>Sun, 09 May 2010 02:00:32 +0100</pubDate>
                <description>
                    <![CDATA[<p class="firstLetter">It's Spring! And so the website has had a bit of a clean out and it's now a little more streamlined. Other changes include:

<ul>
  <li>You can now have multi-line labels by using the text "\r\n" in your label (without the quotes). There's an example of this on the tooltips documentation page: <a href="http://www.rgraph.net/docs/tooltips.html" target="_blank">http://www.rgraph.net/docs/tooltips.html</a></li>
  <li>Resizing a graph no longer affects the page layout</li>
  <li>Added labels to the Rose chart</li>
  <li>The Rose chart origin is now the "north" axis</li>
  <li>Removed a lot of examples from the website and made the whole thing a little more streamlined</li>
  <li>Once visible, you can now double click a zoomed area to expand it to a full size zoom. You can see this on the line graph on the front page.</li>
</ul>

<a href="http://www.rgraph.net" style="float: right; font-weight: bold">Go to the RGraph website &raquo;</a>]]>
                </description>
            </item>
            </channel>
</rss>