Skip to content

Commit

Permalink
Merge pull request atlemo#6 from lucanos/master
Browse files Browse the repository at this point in the history
Demo PHP File by lucanos
  • Loading branch information
Atle Mo committed Sep 19, 2012
2 parents 3f86801 + 8befb03 commit 0ad2164
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions demo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

$raw_files = glob('*.*');
$files = array();

foreach( $raw_files as $r ){
if( preg_match( '/\.(?:png|jpg|jpeg)$/' , $r ) )
$files[] = $r;
}

?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Subtle Pattern Demo</title>
<style>
body , html { padding:0;margin:0;height:100%; }
body { background:#ccc none repeat 0 0; }
form { padding:10px;text-align:center;background:#FFF;border-bottom:1px solid #000; }
</style>
</head>
<body>
<form>
<select id="image">
<option><?php echo implode( "</option>\n <option>" , $files ); ?></option>
</select>
</form>

<script src="http://code.jquery.com/jquery.min.js"></script>
<script>
$(document).ready(function(){

$('#image')
.bind('keyup change unfocus blur',function(){
$('body').css( 'background-image' , 'url('+$(this).val()+')' );
})
.blur();

});
</script>
</body>
</html>

0 comments on commit 0ad2164

Please sign in to comment.