From: Artem Daniliants Date: Thu, 1 Apr 2010 02:25:43 +0000 (+0300) Subject: Created first draft of the site X-Git-Tag: v0.2-RC1~4 X-Git-Url: http://git.maemo.org/git/?p=speedfreak;a=commitdiff_plain;h=435d3512c198d29f7f49e31937a79a0cfdfff379 Created first draft of the site --- diff --git a/Server/application/controllers/pages.php b/Server/application/controllers/pages.php index 00e6507..db04c66 100644 --- a/Server/application/controllers/pages.php +++ b/Server/application/controllers/pages.php @@ -12,8 +12,95 @@ class Pages_Controller extends Template_Controller { public function index() { - $this->template->title = 'Maemo application for car enthusiasts'; + $this->template->title = 'Maemo5 application for car enthusiasts and speed freaks'; $this->template->header = 'Home'; - $this->template->content = 'HOMEZ'; + $this->template->content = ' +SpeedFreak is a free application for your mobile that allows you to measure your car\'s performance such as acceleration and top speed. In order to make it even +more interesting you can compete against others on our leaderboards to see who\'s car packs the most punch! +

+ +SpeedFreak is developed by group of enthusiastic programmers with passion for speed and OpenSource. If you want to get involved by contributing code, ideas, bug reports, translation and more just click on +community link! +'; + $this->template->sidebar_title = 'SpeedFreak for Nokia N900'; + $this->template->sidebar_content =' +
+

Download SpeedFreak for Nokia N900.

+

Download now

+'; + + + + } + + public function leaderboards($category='') + { + //@todo: Fix this hack. OMG what a horrible hack. That's what I get for coding at 4am =) + $categories = array('acceleration-0-20' => 'Acceleration from 0 to 20 km/h', 'acceleration-0-40' => 'Acceleration from 0 to 40 km/h', 'acceleration-0-100'=> 'Acceleration from 0 to 100 km/h'); + + if (!array_key_exists($category,$categories)) + $category='acceleration-0-100'; + + $this->template->title = $categories[$category]; + + $results = new Result_Model(); + if ($rows=$results->get_results($category,10)){ + $output = ''; + foreach ($rows as $r){ + $output .= ' + + '.$r->username.' + '.$r->value.' seconds + '.$r->result_date.' +'; + } + $output =' + + + + + + +'.$output.' +
NickRecord (seconds)Date
+ +'; + } + else + $output="No results :("; + + + + $this->template->header = $categories[$category]; + $this->template->content = $output; + $this->template->sidebar_title = 'Categories'; + $this->template->sidebar_content =' + +'; + + + + } + + public function screenshots() + { + $this->template->title = 'Screenshots'; + $this->template->header = 'Screenshots'; + $this->template->content = ' +Our freaky elfs are still working on those. Check back later =) +'; + $this->template->sidebar_title = 'SpeedFreak for Nokia N900'; + $this->template->sidebar_content =' +
+

Download SpeedFreak for Nokia N900.

+

Download now

+'; + + + } } \ No newline at end of file diff --git a/Server/application/models/database_dump.sql b/Server/application/models/database_dump.sql deleted file mode 100644 index 92aefd1..0000000 --- a/Server/application/models/database_dump.sql +++ /dev/null @@ -1,90 +0,0 @@ -# Sequel Pro dump -# Version 1630 -# http://code.google.com/p/sequel-pro -# -# Host: localhost (MySQL 5.1.37) -# Database: speedfreak -# Generation Time: 2010-03-19 11:11:11 +0200 -# ************************************************************ - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - - -# Dump of table categories -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `categories`; - -CREATE TABLE `categories` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `slug` varchar(255) NOT NULL, - `description` varchar(255) NOT NULL, - `unit` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - KEY `slug` (`slug`) -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; - -LOCK TABLES `categories` WRITE; -/*!40000 ALTER TABLE `categories` DISABLE KEYS */; -INSERT INTO `categories` (`id`,`slug`,`description`,`unit`) -VALUES - (1,'acceleration-0-20','Acceleration from 0km/h to 20km/h','km/h'), - (2,'acceleration-0-40','Acceleration from 0km/h to 40km/h','km/h'), - (3,'acceleration-0-100','Acceleration from 0km/h to 100km/h','km/h'); - -/*!40000 ALTER TABLE `categories` ENABLE KEYS */; -UNLOCK TABLES; - - -# Dump of table results -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `results`; - -CREATE TABLE `results` ( - `cat_id` int(11) NOT NULL, - `user_id` int(11) NOT NULL, - `value` text NOT NULL, - `result_date` datetime NOT NULL, - KEY `cat_id` (`cat_id`), - KEY `user_id` (`user_id`), - CONSTRAINT `results_ibfk_1` FOREIGN KEY (`cat_id`) REFERENCES `categories` (`id`), - CONSTRAINT `results_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - - -# Dump of table users -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `users`; - -CREATE TABLE `users` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `username` char(255) DEFAULT NULL, - `password` char(255) DEFAULT NULL, - `email` char(255) DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `login_unique` (`username`), - UNIQUE KEY `email_unique` (`email`) -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; - - - - - - -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/Server/application/views/pages/base.php b/Server/application/views/pages/base.php index 6c44a1b..d7c8da7 100644 --- a/Server/application/views/pages/base.php +++ b/Server/application/views/pages/base.php @@ -1,75 +1,50 @@ - - - -<?php echo $title; ?> - SpeedFreak - - - - - - - - -render(); ?> - - - -
-
- - - -
-
-
-
-
-
-
-
-
-
-
-
-

- -
-
-
-
-
-
-
-
-
-
-
-
- - - -
-
- -render(); ?> - - - +set('title',$title)->render(); ?> + +
+
+ +
+
+
+
+
+
+
+
+
+
+
+

+ +
+
+

+ +
+
+
+
+
+
+
+
+
+
+
+render(); ?> \ No newline at end of file diff --git a/Server/application/views/pages/footer.php b/Server/application/views/pages/footer.php new file mode 100644 index 0000000..8a6516b --- /dev/null +++ b/Server/application/views/pages/footer.php @@ -0,0 +1,9 @@ + +
+
+ +render(); ?> + + \ No newline at end of file diff --git a/Server/application/views/pages/head.php b/Server/application/views/pages/head.php new file mode 100644 index 0000000..c388d8b --- /dev/null +++ b/Server/application/views/pages/head.php @@ -0,0 +1,14 @@ + + + +<?php echo $title; ?> - SpeedFreak + + + + + + + + +render(); ?> + \ No newline at end of file diff --git a/Server/static/css/layout.css b/Server/static/css/layout.css index 46af83e..23044fe 100644 --- a/Server/static/css/layout.css +++ b/Server/static/css/layout.css @@ -42,10 +42,10 @@ #page4 .column-2 .column-2{ width:285px;} /* ============================= page5 ===========================*/ -#page5 .col-1{ width:285px;} -#page5 .col-2{ width:580px;} +#general .col-1{ width:285px;} +#general .col-2{ width:580px;} -#page5 .box1 .col-1{ width:569px;} -#page5 .box1 .col-2{ width:230px;} +#default .box1 .col-1{ width:569px;} +#default .box1 .col-2{ width:230px;} /* ============================= page6 ===========================*/ \ No newline at end of file diff --git a/Server/static/css/style.css b/Server/static/css/style.css index 9f798b7..de0ddb7 100644 --- a/Server/static/css/style.css +++ b/Server/static/css/style.css @@ -20,8 +20,9 @@ a {color:#21b3c6; outline:none;} a:hover{text-decoration:none;} p {padding-top:20px;} h2{ font-size:3.846em; text-transform:uppercase; line-height:1.2em; padding-bottom:2px;} -h3{ font-size:2.308em; background:url(../static/img/title-bg.gif) no-repeat 0 2px; color:#fff; line-height:1.2em; padding-bottom:5px;} -h4{ font-size:1.538em; line-height:1.2em; padding-bottom:12px;} +h3{ font-size:2.308em; background:url(../../static/img/title-bg.gif) no-repeat 0 2px; color:#fff; line-height:1.2em; padding-bottom:5px;} +h2{ font-size:1.538em; line-height:1.2em; padding-bottom:12px;} +h1{ font-size:1.938em; line-height:1.2em; padding-bottom:12px; text-transform:uppercase;} h5{ font-size:1.538em; line-height:1.2em; padding:7px 0 0 13px;} strong{ color:#21b3c6; display:block; padding-bottom:3px;} @@ -39,9 +40,9 @@ strong{ color:#21b3c6; display:block; padding-bottom:3px;} /* ============================= header ====================== */ #header{ padding-top:5px;} -#header .menu{ background:url(../static/img/menu-tail.gif) top repeat-x;} -#header .menu .left-bg{ background:url(../static/img/menu-left-bg.gif) left top no-repeat;} -#header .menu .right-bg{ background:url(../static/img/menu-right-bg.gif) right top no-repeat; height:42px; width:100%; overflow:hidden;} +#header .menu{ background:url(../../static/img/menu-tail.gif) top repeat-x;} +#header .menu .left-bg{ background:url(../../static/img/menu-left-bg.gif) left top no-repeat;} +#header .menu .right-bg{ background:url(../../static/img/menu-right-bg.gif) right top no-repeat; height:42px; width:100%; overflow:hidden;} #header .menu ul{ padding:10px 0 0 24px;} #header .menu li{ float:left; padding-right:21px;} #header .menu a{ font-size:1.231em; text-decoration:none; color:#496487; font-weight:bold; letter-spacing:-1px;} @@ -50,36 +51,36 @@ strong{ color:#21b3c6; display:block; padding-bottom:3px;} #header .logo{ padding:100px 0 0 64px;} /* ============================= content ====================== */ -#content{ border:solid 1px #000; background:url(../static/img/content-top-bg.gif) no-repeat 0 0 #090c11; padding-bottom:14px;} +#content{ border:solid 1px #000; background:url(../../static/img/content-top-bg.gif) no-repeat 0 0 #090c11; padding-bottom:14px;} .indent{ padding:11px 9px 0 10px;} .indent-1{ padding:11px 0 0 10px;} .indent-2{ padding:11px 0 0 0;} -.box1{ background:url(../static/img/box1-bot-tail.gif) bottom repeat-x #161c25; width:100%;} -.box1 .left-border{ background:url(../static/img/box1-border.gif) left repeat-y;} -.box1 .right-border{ background:url(../static/img/box1-border.gif) right repeat-y;} -.box1 .top-border{ background:url(../static/img/box1-border.gif) top repeat-x;} -.box1 .left-bot{ background:url(../static/img/box1-corner-left-bot.gif) left bottom no-repeat;} -.box1 .right-bot{ background:url(../static/img/box1-corner-right-bot.gif) right bottom no-repeat;} -.box1 .left-top{ background:url(../static/img/box1-corner-left-top.gif) left top no-repeat;} -.box1 .right-top{ background:url(../static/img/box1-corner-right-top.gif) right top no-repeat; padding:1px;} +.box1{ background:url(../../static/img/box1-bot-tail.gif) bottom repeat-x #161c25; width:100%;} +.box1 .left-border{ background:url(../../static/img/box1-border.gif) left repeat-y;} +.box1 .right-border{ background:url(../../static/img/box1-border.gif) right repeat-y;} +.box1 .top-border{ background:url(../../static/img/box1-border.gif) top repeat-x;} +.box1 .left-bot{ background:url(../../static/img/box1-corner-left-bot.gif) left bottom no-repeat;} +.box1 .right-bot{ background:url(../../static/img/box1-corner-right-bot.gif) right bottom no-repeat;} +.box1 .left-top{ background:url(../../static/img/box1-corner-left-top.gif) left top no-repeat;} +.box1 .right-top{ background:url(../../static/img/box1-corner-right-top.gif) right top no-repeat; padding:1px;} .box1 .indent1{ padding:10px 5px 25px 15px;} .box1 .indent2{ padding:20px 37px 38px 31px;} .box1 .indent3{ padding:28px 25px 25px 30px;} .box1 .indent4{ padding:20px 5px 25px 22px;} -.box2{ background:url(../static/img/box2-border.gif) top repeat-x #141922; width:100%; color:#3b4252;} -.box2 .left-border{ background:url(../static/img/box2-border.gif) left repeat-y;} -.box2 .right-border{ background:url(../static/img/box2-border.gif) right repeat-y;} -.box2 .bot-border{ background:url(../static/img/box2-border.gif) bottom repeat-x;} -.box2 .left-top{ background:url(../static/img/box2-corner-left-top.gif) left top no-repeat;} -.box2 .right-top{ background:url(../static/img/box2-corner-right-top.gif) right top no-repeat;} -.box2 .left-bot{ background:url(../static/img/box2-corner-left-bot.gif) left bottom no-repeat;} -.box2 .right-bot{ background:url(../static/img/box2-corner-right-bot.gif) right bottom no-repeat;} +.box2{ background:url(../../static/img/box2-border.gif) top repeat-x #141922; width:100%; color:#3b4252;} +.box2 .left-border{ background:url(../../static/img/box2-border.gif) left repeat-y;} +.box2 .right-border{ background:url(../../static/img/box2-border.gif) right repeat-y;} +.box2 .bot-border{ background:url(../../static/img/box2-border.gif) bottom repeat-x;} +.box2 .left-top{ background:url(../../static/img/box2-corner-left-top.gif) left top no-repeat;} +.box2 .right-top{ background:url(../../static/img/box2-corner-right-top.gif) right top no-repeat;} +.box2 .left-bot{ background:url(../../static/img/box2-corner-left-bot.gif) left bottom no-repeat;} +.box2 .right-bot{ background:url(../../static/img/box2-corner-right-bot.gif) right bottom no-repeat;} .box2 .indent1{ padding:18px 18px 22px 18px;} -.box2 .title{ background:url(../static/img/title-tail.gif) top repeat-x;} -.box2 .title .left-bg{ background:url(../static/img/title-left-bg.gif) left top no-repeat;} -.box2 .title .right-bg{ background:url(../static/img/title-right-bg.gif) right top no-repeat; height:41px;} +.box2 .title{ background:url(../../static/img/title-tail.gif) top repeat-x;} +.box2 .title .left-bg{ background:url(../../static/img/title-left-bg.gif) left top no-repeat;} +.box2 .title .right-bg{ background:url(../../static/img/title-right-bg.gif) right top no-repeat; height:41px;} .text1{ font-size:0.923em; line-height:1.167em;} .text2{ font-size:0.923em; line-height:1.25em; color:#3b4252;} @@ -91,31 +92,31 @@ strong{ color:#21b3c6; display:block; padding-bottom:3px;} .text4{ color:#616a81;} .text5{ line-height:1.154em;} -.line1{ background:url(../static/img/line.gif) repeat-y 294px 0;} -.line2{ background:url(../static/img/line.gif) repeat-y 592px 0;} +.line1{ background:url(../../static/img/line.gif) repeat-y 294px 0;} +.line2{ background:url(../../static/img/line.gif) repeat-y 592px 0;} .extra-title{ padding:5px 0 0 12px;} .gallery{ margin:5px 0 0 0;} .gallery a{ display:inline-block; margin-right:20px;} .gallery .last{ margin-right:0;} .gallery .link{ margin:30px 30px 0 20px !important;} -.unline{ background:url(../static/img/unline.gif) bottom repeat-x; padding-bottom:10px; margin-bottom:20px;} +.unline{ background:url(../../static/img/unline.gif) bottom repeat-x; padding-bottom:10px; margin-bottom:20px;} .email{ color:#21b3c6;} -.link{display:inline-block; float:right; background:url(../static/img/link-left-bg.gif) top left no-repeat; line-height:1em; text-decoration:none; margin-top:7px; color:#f9f9f8; font-size:0.923em; font-weight:bold; cursor:pointer;} -.link span{ display:inline-block; background:url(../static/img/link-right-bg.gif) top right no-repeat; padding:0 10px;} -.link span span{ background:url(../static/img/link-tail.gif) top repeat-x; padding:5px 1px 6px 0;} -.link:hover{ background:url(../static/img/link-left-bg-act.gif) top left no-repeat;} -.link:hover span{ background:url(../static/img/link-right-bg-act.gif) top right no-repeat;} -.link:hover span span{ background:url(../static/img/link-tail-act.gif) top repeat-x;} +.link{display:inline-block; float:right; background:url(../../static/img/link-left-bg.gif) top left no-repeat; line-height:1em; text-decoration:none; margin-top:7px; color:#f9f9f8; font-size:0.923em; font-weight:bold; cursor:pointer;} +.link span{ display:inline-block; background:url(../../static/img/link-right-bg.gif) top right no-repeat; padding:0 10px;} +.link span span{ background:url(../../static/img/link-tail.gif) top repeat-x; padding:5px 1px 6px 0;} +.link:hover{ background:url(../../static/img/link-left-bg-act.gif) top left no-repeat;} +.link:hover span{ background:url(../../static/img/link-right-bg-act.gif) top right no-repeat;} +.link:hover span span{ background:url(../../static/img/link-tail-act.gif) top repeat-x;} .link1{ display:inline-block; margin:5px 0 0 7px; vertical-align:top;} -.link2{ display:inline-block; background:url(../static/img/link2-tail.gif) top repeat-x; color:#141a23 !important; font-weight:bold; text-decoration:none; margin:6px 0 0 4px; vertical-align:top; cursor:pointer;} -.link2 span{ display:inline-block; background:url(../static/img/link2-left-bg.gif) left top no-repeat;} -.link2 span span{ background:url(../static/img/link2-right-bg.gif) right top no-repeat; padding:3px 6px 5px 8px;} +.link2{ display:inline-block; background:url(../../static/img/link2-tail.gif) top repeat-x; color:#141a23 !important; font-weight:bold; text-decoration:none; margin:6px 0 0 4px; vertical-align:top; cursor:pointer;} +.link2 span{ display:inline-block; background:url(../../static/img/link2-left-bg.gif) left top no-repeat;} +.link2 span span{ background:url(../../static/img/link2-right-bg.gif) right top no-repeat; padding:3px 6px 5px 8px;} .link2:hover{ color:#ff1e4f !important;} -.list li{ font-size:0.923em; line-height:1.75em; background:url(../static/img/list-unline.gif) bottom repeat-x; width:100%;} +.list li{ font-size:0.923em; line-height:1.75em; background:url(../../static/img/list-unline.gif) bottom repeat-x; width:100%;} .list .last{ background:none;} .list a{ color:#616a81; text-decoration:none;} .list a:hover, .list .active{ color:#ff1e50;} diff --git a/Server/static/img/speedfreak_n900.png b/Server/static/img/speedfreak_n900.png new file mode 100644 index 0000000..2829ca9 Binary files /dev/null and b/Server/static/img/speedfreak_n900.png differ diff --git a/Server/static/js/cufon-replace.js b/Server/static/js/cufon-replace.js index 0e96788..176c337 100644 --- a/Server/static/js/cufon-replace.js +++ b/Server/static/js/cufon-replace.js @@ -1,3 +1,3 @@ Cufon.replace('.menu a', { fontFamily: 'Myriad Pro', hover:true }); -Cufon.replace('h2, h3, h4', { fontFamily: 'Myriad Pro BC', color: '-linear-gradient(#9198be, #9198be, #fff, #fff, #fff, #fff, #fff, #a4a4c1, #fff, #fff, #fff, #fff, #fefefe)' }); +Cufon.replace('h1, h2, h3, h4', { fontFamily: 'Myriad Pro BC', color: '-linear-gradient(#9198be, #9198be, #fff, #fff, #fff, #fff, #fff, #a4a4c1, #fff, #fff, #fff, #fff, #fefefe)' }); Cufon.replace('h5', { fontFamily: 'Myriad Pro BC', color: '-linear-gradient(#ff1e4f, #ff1e4f, #ff1e4f, #ff1e4f, #ff1e4f, #9f071b, #9f071b, #f51c49, #f51c49, #f51c49, #f51c49)' });