diff --git a/webroot/css/widget.css b/webroot/css/widget.css index 4ec17e02f3a13411cc8f10b686c89b6e257ee1e5..dba281a3a0825816f5649b1560804571857a8bbc 100644 --- a/webroot/css/widget.css +++ b/webroot/css/widget.css @@ -1,6 +1,7 @@ body { background-color:#261C13; } a { color:#0071BB; } a:hover { color:#777878; } + td, div { font-family:Lucida Grande, Lucida Sans Unicode, Calibri, Arial, Helvetica, Sans, FreeSans, Jamrul, Garuda, Kalimati; @@ -8,37 +9,18 @@ td, div color:#000000; } -.widget_wide, .widget_narrow, .widget_square, .widget_smallwide, .widget_smallnarrow { +.widget_4x2, .widget_2x4, .widget_2x2, .widget_2x1, .widget_1x2 { position:absolute; border: 1px solid #F2EFE5; background-color:#75695E; font-family:Lucida Grande, Lucida Sans Unicode, Calibri, Arial, Helvetica, Sans, FreeSans, Jamrul, Garuda, Kalimati; - font-size:1.5em; + font-size:16pt; color:#000000; } -.widget_wide { - width:800px; - height:380px; -} - -.widget_narrow { - width:380px; - height:800px; -} - -.widget_square { - width:380px; - height:380px; -} - -.widget_smallwide { - width:380px; - height:170px; -} - -.widget_smallnarrow { - width:170px; - height:170px; -} +.widget_4x2 { width:800px; height:380px; } +.widget_2x4 { width:380px; height:800px; } +.widget_2x2 { width:380px; height:380px; } +.widget_2x1 { width:380px; height:170px; } +.widget_1x2 { width:170px; height:380px; } diff --git a/webroot/img/warpzone.png b/webroot/img/warpzone.png new file mode 100644 index 0000000000000000000000000000000000000000..5a1eff3ddd99e9c092cc6365316647ce2ee2c0ef Binary files /dev/null and b/webroot/img/warpzone.png differ diff --git a/webroot/index.php b/webroot/index.php index a52b4cb44df0777e2bc374a52e43f68f9ea6900d..6327f618c79c33a60b0450e2353d177d541c6ee9 100644 --- a/webroot/index.php +++ b/webroot/index.php @@ -1,33 +1,39 @@ <head> - <link rel="stylesheet" type="text/css" href="css/widget.css" /> <title>Warpzone's Marvin</title> + <link rel="stylesheet" type="text/css" href="css/widget.css" /> <script src="js/jquery-1.4.4.js" type="text/javascript"></script> - <script src="js/marvin.js" type="text/javascript"></script> + <script src="js/marvin.js" type="text/javascript"></script> </head> <body> <img src="img/warpzone.png"> - <?php - $widgets = array( - array( - "ZoneOffen", // widget name - 16,200, // position - "widget_smallwide" // css-class - ) - ); + <div style="position:absolute;left:40px;top:200px;"> + <?php + $widgets = array( + //array("widget_name",x,y,"size_class"); + array("Dummy",0,0,"widget_4x2"), + array("ZoneOffen",4,0,"widget_2x1"), + array("Dummy",4,1,"widget_2x4"), + array("Dummy",0,2,"widget_1x2"), + array("Dummy",1,2,"widget_2x2"), + array("Dummy",3,2,"widget_1x2"), + array("Dummy",0,4,"widget_2x1"), + array("Dummy",2,4,"widget_2x1") + ); - foreach ($widgets as $widgetconfig) - { - $widgetname = $widgetconfig[0]; - $widgetposx = $widgetconfig[1]; - $widgetposy = $widgetconfig[2]; - $widgetclass = $widgetconfig[3]; + foreach ($widgets as $widgetconfig) + { + $widgetname = $widgetconfig[0]; + $widgetposx = $widgetconfig[1] * 210; + $widgetposy = $widgetconfig[2] * 210; + $widgetclass = $widgetconfig[3]; - include "widgets/$widgetname/$widgetname.php"; - $widget = new $widgetname($widgetwidth,$widgetheight); - $widgetoutput = $widget->giveOutput(); - print("<div class='$widgetclass' id='$widgetname' style='left:".$widgetposx."px;top:".$widgetposy."px;'>"); - print($widgetoutput); - print("</div>"); - } - ?> + include_once "widgets/$widgetname/$widgetname.php"; + $widget = new $widgetname($widgetwidth,$widgetheight); + $widgetoutput = $widget->giveOutput(); + print("<div class='$widgetclass' id='$widgetname' style='left:".$widgetposx."px;top:".$widgetposy."px;'>"); + print($widgetoutput); + print("</div>"); + } + ?> + </div> </body> diff --git a/webroot/widgets/Dummy/Dummy.php b/webroot/widgets/Dummy/Dummy.php new file mode 100644 index 0000000000000000000000000000000000000000..0f6d2b9c17a25cc58684d534bff23290daa2e24a --- /dev/null +++ b/webroot/widgets/Dummy/Dummy.php @@ -0,0 +1,25 @@ +<?php + +require_once 'widgets/iWidget.php'; + +class Dummy implements iWidget +{ + public function __construct($width, $height) + { + + } + + + public function giveOutput() + { + $widgetOutput .= '<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">'."\n"; + $widgetOutput .= ' <tr>'."\n"; + $widgetOutput .= ' <td align="center"><b>Dummy</b></td>'."\n"; + $widgetOutput .= ' </tr>'."\n"; + $widgetOutput .= '</table>'."\n"; + + return $widgetOutput; + } +} + +?>