Skip to content
Browse files

too many things changed, wasnt keeping up...

  • Loading branch information...
1 parent 9ea0c65 commit 799e9d0f761c63f0eb63f887d01d046ebbb0e953 @tilomitra committed Jun 28, 2011
Showing with 98 additions and 47 deletions.
  1. +16 −2 crictainment.appcache
  2. +25 −10 css/interface.css
  3. BIN img/refresh_default.png
  4. +17 −16 index.html
  5. +20 −18 js/controller.js
  6. +1 −1 js/main.js
  7. +19 −0 js/ui.js
View
18 crictainment.appcache
@@ -1,7 +1,21 @@
CACHE MANIFEST
-# 2011-06-21:v1
+# 2011-06-21:v3
+
+CACHE:
img/background-texture.png
img/container-bg-wall.png
img/vid-icon.png
img/photo-icon.png
-fonts/Arvo-Regular-webfont.svg
+fonts/Arvo-Regular-webfont.svg
+
+
+NETWORK:
+# explicit list of stuff that can be accessed over the network
+http://sandbox.tilomitra.com
+http://joehewitt.github.com
+http://yui.yahooapis.com
+http://query.yahooapis.com
+http://fonts.googleapis.com
+http://www.espncricinfo.com
+http://www.cricinfo.com
+http://p.imgci.com/
View
35 css/interface.css
@@ -56,7 +56,7 @@
/* END FONT FACE */
html {
- background:transparent url('../img/background-texture.png') no-repeat scroll 0 0;
+ background:transparent url('../img/background-texture.png') repeat scroll 0 0;
}
@@ -94,6 +94,9 @@ input[type=button], a {
background:transparent;
text-align:center;
}
+#loading a {
+ color: transparent;
+}
#box {
z-index:1000;
position:absolute;
@@ -111,9 +114,9 @@ input[type=button], a {
opacity:0.8;
}
#refresh {
- float: right;
- top: -28px;
- right: 39px;
+ float: left;
+ top: 0px;
+ left: 33px;
position: relative;
}
@@ -386,14 +389,23 @@ input[type=button], a {
width: 96%;
-webkit-box-shadow: 0px 0px 5px black;
-moz-box-shadow: 0px 0px 5px black;
- background:#b0bdc8 url('../img/menuHead-apple.png') repeat-x scroll;
- text-align:center;
+ background: #499bea;
+ background: -moz-linear-gradient(top, #499bea 0%, #207ce5 100%);
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#499bea), color-stop(100%,#207ce5));
+ background: -webkit-linear-gradient(top, #499bea 0%,#207ce5 100%);
+ background: -o-linear-gradient(top, #499bea 0%,#207ce5 100%);
+ background: -ms-linear-gradient(top, #499bea 0%,#207ce5 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#499bea', endColorstr='#207ce5',GradientType=0 );
+ background: linear-gradient(top, #499bea 0%,#207ce5 100%); text-align:center;
}
#colorHead h3 {
- -webkit-text-shadow:2px 2px 1px #545c61;
- color:white;
- font-size:96%;
- margin-top: 6px;
+ color: #0E2D6B;
+ font-size: 96%;
+ margin-top: 2px;
+ -webkit-text-shadow: -1px 1px #68AAE8;
+ text-shadow: -1px 1px #68AAE8;
+ font-weight: normal;
+ font-family: "ArvoRegular";
}
#storiesContainer {
@@ -409,6 +421,9 @@ input[type=button], a {
bottom: 0px;
-webkit-transform: translate3d(0,0,0);
z-index:200;
+ -webkit-box-shadow:1px 1px 10px black;
+ -moz-box-shadow: 1px 1px 10px black;
+ box-shadow:1px 1px 10px black;
}
#videoWrapper, #photoWrapper {
View
BIN img/refresh_default.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
33 index.html
@@ -1,26 +1,30 @@
<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<head>
<title>Crictainment</title>
- <link rel="apple-touch-icon-precomposed" href="img/crictainment_icon.png" />
+
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<meta name="apple-touch-fullscreen" content="yes" />
<meta name="viewport" content="width=device-width,maximum-scale=1.0" />
<meta name = "viewport" content = "initial-scale = 1.0, user-scalable = no">
- <script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"
- charset="utf-8"></script>
+
+ <link rel="apple-touch-icon-precomposed" href="img/crictainment_icon.png" />
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.3.0/build/cssreset/reset-min.css">
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.3.0/build/cssgrids/grids-min.css">
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.3.0/build/cssbase/base-min.css">
+ <link rel="apple-touch-startup-image" media="(orientation: landscape)" href="img/startup-image-landscape.png"/>
<link rel="stylesheet" href="css/interface.css" media="screen" charset="utf-8">
<link rel="stylesheet" href="css/animation.css" media="screen" charset="utf-8">
<link href='http://fonts.googleapis.com/css?family=Arvo' rel='stylesheet' type='text/css'>
-
+ <script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"
+ charset="utf-8"></script>
<script src="js/main.js" charset="utf-8"></script>
<script src="http://joehewitt.github.com/scrollability/scrollability-min.js" charset="utf-8"></script>
+ <script src="js/disable-mobile-safari.js"></script>
</head>
@@ -29,7 +33,12 @@
<div class="yui3-g" id="wrapper">
<div class="yui3-u" id="load"></div>
<div class="yui3-u-1" id="header">
- <h1>Crictainment</h1><div id="refresh"><a href="#"><img src="img/refresh_default.png" id="refreshBtn"></a></div>
+ <div id="refresh">
+ <a href="#">
+ <img src="img/refresh_default.png" id="refreshBtn" alt="Refresh Page">
+ </a>
+ </div>
+ <h1>Crictainment</h1>
</div>
<div class="yui3-u-23-24" id="container">
@@ -42,14 +51,6 @@
<div id="featureWrapper2">
<div class="yui3-u-1" id="featureWrapper"></div>
</div>
-
- <!-- <div class="yui3-u-1" id="menubar">
- <ul>
- <li><a href="news.html" id="news">News</li>
- <li><a href="videos.html" id="videos">Videos</a></li>
- <li><a href="tweets.html" id="tweets">Tweets</a></li>
- </ul>
- </div>-->
<div id="colorHead" class="yui3-u-1 newsHead"><h3>News and Views</div>
<div class="yui3-u" id="storiesContainer">
<div class="yui3-u-1" id="storiesWrapper"></div>
@@ -59,9 +60,9 @@
</div>
<div class="yui3-u-1" id="footer">
- <a href="news.html" id="newsLink" class="selectedLink">News</a>
- <a href="videos.html" id="videosLink">Videos</a>
- <a href="pictures.html" id="photosLink">Photos</a>
+ <a href="#news" id="newsLink" class="selectedLink">News</a>
+ <a href="#videos" id="videosLink">Videos</a>
+ <a href="#pictures" id="photosLink">Photos</a>
</div>
</div>
View
38 js/controller.js
@@ -4,18 +4,32 @@
Y.controller = {
init: function() {
- //this.listen();
+ this.listen();
this.listenToFooter();
this.listenToFeaturesAndCricinfo();
this.listenToCricketNextStories();
this.listenToRefresh();
},
+
listen: function() {
+ var moveContainerVertically = function(touchEvent) {
+ //console.log(touchEvent.targetTouches.length);
+
+ if (touchEvent.targetTouches.length === 2) {
+
+ var avgScreenY = Math.round((touchEvent.touches[0].pageY + touchEvent.touches[1].pageY)/2);
+ //console.log(avgScreenY);
+ var w = Y.one('#storiesContainer');
+ var top = w.get("offsetTop");
+ var offset = avgScreenY - top;
+ //avgScreenY = (avgScreenY > 40) ? avgScreenY : 40;
+ w.setStyle('top', avgScreenY + offset + 'px');
+ }
+
+ };
- var self = this;
- Y.all('.story a, .story div').each(function(n) {
- self.stop(n);
- });
+ Y.one('#storiesWrapper').on('touchmove', Y.ui.moveContainerVertically);
+ //Y.one('#photoWrapper').on('touchmove', moveContainerVertically);
},
listenToFeaturesAndCricinfo: function() {
@@ -29,18 +43,6 @@
Y.one('#featureWrapper').delegate("click", fetchArticle, ".featureStory a");
Y.one('#storiesWrapper').delegate("click", fetchArticle, "div.cricinfo-cls a");
-
- // Y.all(".featureLink, div.cricinfo-cls a").each(function(n) {
- // //console.log(n);
- // //console.log(Y.Node.create(n._node.parentNode).getDOMNode());
- // n.on('click', function(e) {
- // e.preventDefault();
- // var href = e.currentTarget._stateProxy.href;
- // Y.ui.showSpinner();
- // Y.data.fetchCricinfoArticle(href);
- // Y.ui.hideSpinner();
- // });
- // });
},
listenToCricketNextStories: function() {
@@ -165,6 +167,6 @@
// }
}
- }, '1.0' /* module version */, {
+ }, '2.0' /* module version */, {
requires: ['base','data','ui']
});
View
2 js/main.js
@@ -41,7 +41,7 @@ YUI({
Y.ui.createFeaturesScrollView();
Y.ui.createStoriesScrollView();
- Y.later(500,Y.controller,"init");
+ Y.later(750,Y.controller,"init");
Y.later(600, Y.ui, "instantiateNewsOverlay");
Y.ui.hideSpinner();
View
19 js/ui.js
@@ -27,6 +27,8 @@ YUI.add('ui', function(Y) {
if (s.hasClass('hide')) {
s.removeClass('hide');
}
+
+
},
hideNewsBar: function() {
@@ -52,6 +54,7 @@ YUI.add('ui', function(Y) {
if (v.hasClass('hide')) {
v.removeClass('hide');
}
+
},
@@ -202,6 +205,22 @@ YUI.add('ui', function(Y) {
},
+ moveContainerVertically: function(touchEvent) {
+ //console.log(touchEvent.targetTouches.length);
+
+ if (touchEvent.targetTouches.length === 2) {
+
+ var avgScreenY = Math.round((touchEvent.touches[0].pageY + touchEvent.touches[1].pageY)/2);
+ //console.log(avgScreenY);
+ var w = Y.one('#storiesContainer');
+ var top = w.get("offsetTop");
+ var offset = avgScreenY - top;
+ //avgScreenY = (avgScreenY > 40) ? avgScreenY : 40;
+ w.setStyle('top', avgScreenY + offset + 'px');
+ }
+
+ },
+
createSpinner: function(canvas, options) {
if (!options) {
options = {};

0 comments on commit 799e9d0

Please sign in to comment.
Something went wrong with that request. Please try again.