forked from atlemo/SubtlePatterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request atlemo#6 from lucanos/master
Demo PHP File by lucanos
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |