Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #18 from crdlc/feature-homeNewVisuals
Browse files Browse the repository at this point in the history
Feature home new visuals
  • Loading branch information
Cristian Rodriguez committed Jun 18, 2012
2 parents 8dc5a6e + 4655e7c commit dcb2656
Show file tree
Hide file tree
Showing 33 changed files with 74 additions and 28 deletions.
3 changes: 2 additions & 1 deletion apps/browser/manifest.webapp
Expand Up @@ -57,6 +57,7 @@
},
"default_locale": "en-US",
"icons": {
"120": "/style/icons/Browser.png"
"120": "/style/icons/Browser.png",
"60": "/style/icons/60/Browser.png"
}
}
Binary file added apps/browser/style/icons/60/Browser.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion apps/calculator/manifest.webapp
Expand Up @@ -54,7 +54,8 @@
},
"default_locale": "en-US",
"icons": {
"120": "/style/icons/Calculator.png"
"120": "/style/icons/Calculator.png",
"60": "/style/icons/60/Calculator.png"
},
"orientation": "portrait-primary"
}
Binary file added apps/calculator/style/icons/60/Calculator.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions apps/calendar/manifest.webapp
Expand Up @@ -16,8 +16,7 @@
"orientation": "portrait-primary",
"default_locale": "en-US",
"icons": {
"120": "/style/icons/Calendar.png"
"120": "/style/icons/Calendar.png",
"60": "/style/icons/60/Calendar.png"
}
}


Binary file added apps/calendar/style/icons/60/Calendar.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion apps/camera/manifest.webapp
Expand Up @@ -54,6 +54,7 @@
},
"default_locale": "en-US",
"icons": {
"120": "/style/icons/Camera.png"
"120": "/style/icons/Camera.png",
"60": "/style/icons/60/Camera.png"
}
}
Binary file added apps/camera/style/icons/60/Camera.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion apps/clock/manifest.webapp
Expand Up @@ -54,7 +54,8 @@
},
"default_locale": "en-US",
"icons": {
"120": "/style/icons/Clock.png"
"120": "/style/icons/Clock.png",
"60": "/style/icons/60/Clock.png"
},
"orientation": "portrait-primary"
}
Binary file added apps/clock/style/icons/60/Clock.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion apps/contacts/manifest.webapp
Expand Up @@ -21,6 +21,7 @@
},
"default_locale": "en-US",
"icons": {
"120": "/style/icons/Contacts.png"
"120": "/style/icons/Contacts.png",
"60": "/style/icons/60/Contacts.png"
}
}
Binary file added apps/contacts/style/icons/60/Contacts.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion apps/email/manifest.webapp
Expand Up @@ -14,6 +14,7 @@
},
"default_locale": "en-US",
"icons": {
"79": "/style/icons/Email.png"
"79": "/style/icons/Email.png",
"60": "/style/icons/60/Email.png"
}
}
Binary file added apps/email/style/icons/60/Email.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion apps/fm/manifest.webapp
Expand Up @@ -21,6 +21,7 @@
},
"default_locale": "en-US",
"icons": {
"128": "/style/icons/Fm.png"
"128": "/style/icons/Fm.png",
"60": "/style/icons/60/Fm.png"
}
}
Binary file added apps/fm/style/icons/60/Fm.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 13 additions & 2 deletions apps/homescreen/js/appmanager.js
Expand Up @@ -127,6 +127,18 @@ var Applications = (function() {
return coreApplications.indexOf(origin) !== -1;
};

var deviceWidth = document.documentElement.clientWidth;

/*
* Returns the size of the icon
*
* {Array} Sizes orderer largest to smallest
*
*/
function getIconSize(sizes) {
return sizes[(deviceWidth < 480) ? sizes.length - 1 : 0];
}

/*
* Returns an icon given an origin
*
Expand Down Expand Up @@ -154,7 +166,7 @@ var Applications = (function() {
// application to it (technically, manifests are supposed to
// have those). Otherwise return the url directly as it could be
// a data: url.
var icon = icons[sizes[0]];
var icon = icons[getIconSize(sizes)];
if (icon.indexOf('data:') !== 0) {
icon = origin + icon;
}
Expand Down Expand Up @@ -205,4 +217,3 @@ var Applications = (function() {
getManifest: getManifest
};
})();

3 changes: 1 addition & 2 deletions apps/homescreen/js/grid.js
Expand Up @@ -407,7 +407,7 @@ const GridManager = (function() {

pages.list[index].destroy(); // Destroy page
pages.list.splice(index, 1); // Removes page from the list
pages.total = index - 1; // Reset total number of pages
pages.total--; // Reset total number of pages
updatePaginationBar();
},

Expand Down Expand Up @@ -736,4 +736,3 @@ const GridManager = (function() {
}
};
})();

Binary file modified apps/homescreen/resources/images/menu.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 12 additions & 5 deletions apps/homescreen/style/grid.css
Expand Up @@ -28,8 +28,7 @@
display: inline-block;
float: left;
text-align: center;
/* It SHOULD be 2.5rem but status bar is 32px instead of 20px */
padding-bottom: 2.3rem;
padding-bottom: 2.2rem;
font-family:'Open Sans';
}

Expand Down Expand Up @@ -60,6 +59,7 @@
.apps ol > li > div > img {
width: 6rem;
height: 6rem;
border-radius: 50%; /* rounded icons */
}

/* label wrapper */
Expand All @@ -81,7 +81,7 @@
display: block;
width: 94%; /* At least 6% of margin between labels of different apps */
position: relative;
height: 1.5rem; /* 15px in otoro */
height: 1.6rem; /* 15px in otoro */
margin: 0 auto;
}

Expand All @@ -98,7 +98,7 @@
margin-bottom: .5rem;
box-shadow: 0 0 5px 5px #666;
-moz-transform: scale(1.1);
border-radius: 1rem;
border-radius: 50%; /* rounded icons */
width: 6rem;
height: 6rem;
}
Expand Down Expand Up @@ -148,7 +148,8 @@
opacity: .8;
}

.apps[data-transitioning] ol > li > div > img, .apps[data-transitioning] ol > li > div {
.apps[data-transitioning] ol > li > div > img,
.apps[data-transitioning] ol > li > div {
-moz-animation-name: none;
}

Expand All @@ -159,3 +160,9 @@
.apps ol > li[data-dragging] {
opacity: 0;
}

@media screen and (min-device-width: 480px) {
.apps ol > li > div > img, .apps .draggable > img {
border-radius: .5rem; /* squared icons */
}
}
3 changes: 2 additions & 1 deletion apps/market/manifest.webapp
Expand Up @@ -54,6 +54,7 @@
},
"default_locale": "en-US",
"icons": {
"120": "/style/icons/Market.png"
"120": "/style/icons/Market.png",
"60": "/style/icons/60/Market.png"
}
}
Binary file added apps/market/style/icons/60/Market.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion apps/music/manifest.webapp
Expand Up @@ -54,7 +54,8 @@
},
"default_locale": "en-US",
"icons": {
"120": "/style/icons/Music.png"
"120": "/style/icons/Music.png",
"60": "/style/icons/60/Music.png"
},
"orientation": "portrait-primary"
}
Binary file added apps/music/style/icons/60/Music.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion apps/settings/manifest.webapp
Expand Up @@ -56,7 +56,8 @@
},
"default_locale": "en-US",
"icons": {
"120": "/style/icons/Settings.png"
"120": "/style/icons/Settings.png",
"60": "/style/icons/60/Settings.png"
},
"orientation": "portrait-primary"
}
Binary file added apps/settings/style/icons/60/Settings.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion apps/sms/manifest.webapp
Expand Up @@ -59,7 +59,8 @@
"default_locale": "en-US",
"background_page": "/background.html#0",
"icons": {
"120": "/style/icons/Sms.png"
"120": "/style/icons/Sms.png",
"60": "/style/icons/60/Sms.png"
},
"orientation": "portrait-primary"
}
Binary file added apps/sms/style/icons/60/Sms.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 20 additions & 3 deletions apps/system/js/cards_view/cards_view.js
Expand Up @@ -16,6 +16,25 @@ var CardsView = (function() {
var cardsList = cardsView.getElementsByTagName('ul')[0];
var displayedApp,
runningApps;
var HVGA = document.documentElement.clientWidth < 480;

/*
* Returns an icon URI
*
* @param{String} the app's origin
*/
function getIconURI(origin) {
var icons = runningApps[origin].manifest.icons;

var sizes = Object.keys(icons).map(function parse(str) {
return parseInt(str, 10);
});

sizes.sort(function(x, y) { return y - x; });

var index = sizes[(HVGA) ? sizes.length - 1 : 0];
return origin + icons[index];
}

// Build and display the card switcher overlay
// Note that we rebuild the switcher each time we need it rather
Expand Down Expand Up @@ -57,12 +76,10 @@ var CardsView = (function() {

//display app icon on the tab
if (DISPLAY_APP_ICON) {
var icons = runningApps[origin].manifest.icons;
var iconSrc = origin + icons[Object.keys(icons)[0]];
var appIcon = document.createElement('img');

appIcon.classList.add('appIcon');
appIcon.src = iconSrc;
appIcon.src = getIconURI(origin);
card.appendChild(appIcon);
}

Expand Down
3 changes: 2 additions & 1 deletion apps/tasks/manifest.webapp
Expand Up @@ -54,7 +54,8 @@
},
"default_locale": "en-US",
"icons": {
"120": "/style/icons/Tasks.png"
"120": "/style/icons/Tasks.png",
"60": "/style/icons/60/Tasks.png"
},
"orientation": "portrait-primary"
}
Binary file added apps/tasks/style/icons/60/Tasks.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion apps/video/manifest.webapp
Expand Up @@ -55,6 +55,7 @@
"default_locale": "en-US",
"hackKillMe": true,
"icons": {
"120": "/style/icons/Video.png"
"120": "/style/icons/Video.png",
"60": "/style/icons/60/Video.png"
}
}
Binary file added apps/video/style/icons/60/Video.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dcb2656

Please sign in to comment.