Archiv der Kategorie ‘Uncategorized‘

 
 

-webkit-transform : Use 3D for 2D

My students are often surprised when I show them web app demos for the iphone. They simply weren’t aware that you could use SVG or webkit-transform/transition to get some really smooth running interactive animation and graphics.

I’ve been wanting to post an intermediate level example on this site for awhile but haven’t gotten around to it until now.

This will only work in a webkit browser like chrome, safari/safari mobile etc…

Den ganzen Beitrag lesen…

PHP File Loads Itself

This is weird idea I had right before I went to sleep last night. I might actually use it for something… have a look:

loadme.php:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 
<?php
  $file = file_get_contents("loadme.php");
 
  $file = preg_split("/\?\>\n/", $file);
  $file = preg_replace("/^/m", "z",$file[1]);
 
  echo $file;
 
  die();
?>
one
two
three
four
 
'; ?>

The above just adds a z in front of each new line. So it outputs:

zone ztwo zthree zfour

It could be used for preprocessing a document. Something like:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 
<?php require_once("processor.php"); ?>;
 
html
  head
    meta charset="utf-8"
    title (test site)
 
  body
     #nav
       .btn(one) .btn(two) .btn(three)
 
     #left (left side)
 
     #center
        .entry
          h1(Hello This is an entry)
          (this is some text)
        .entry
          h1(Another Entry)
          (more text)
 
     #right (right side)
 
     #footer (Vorbin Saucer 2012)

The php would then turn the above markup into regular html. Kind of interesting…