-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
795f1cb
commit 5786442
Showing
16 changed files
with
10,013 additions
and
1 deletion.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
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,138 @@ | ||
/* A bit custom styling */ | ||
.my-page .ui-listview li .ui-btn p { | ||
color: #c0c0c0; | ||
} | ||
.my-page .ui-listview li .ui-btn .ui-li-aside { | ||
color: #eee; | ||
} | ||
|
||
/* First breakpoint is 48em (768px). 3 column layout. Tiles 250x250 pixels incl. margin at the breakpoint. */ | ||
@media ( min-width: 48em ) { | ||
.my-page .ui-content { | ||
padding: .5625em; /* 9px */ | ||
} | ||
.my-page .ui-listview li { | ||
float: left; | ||
width: 30.9333%; /* 33.3333% incl. 2 x 1.2% margin */ | ||
height: 14.5em; /* 232p */ | ||
margin: .5625em 1.2%; | ||
} | ||
.my-page .ui-listview li > .ui-btn { | ||
-webkit-box-sizing: border-box; /* include padding and border in height so we can set it to 100% */ | ||
-moz-box-sizing: border-box; | ||
box-sizing: border-box; | ||
height: 100%; | ||
} | ||
.my-page .ui-listview li.ui-li-has-thumb .ui-li-thumb { | ||
height: auto; /* To keep aspect ratio. */ | ||
max-width: 100%; | ||
max-height: none; | ||
} | ||
/* Make all list items and anchors inherit the border-radius from the UL. */ | ||
.my-page .ui-listview li, | ||
.my-page .ui-listview li .ui-btn, | ||
.my-page .ui-listview .ui-li-thumb { | ||
-webkit-border-radius: inherit; | ||
border-radius: inherit; | ||
} | ||
/* Hide the icon */ | ||
.my-page .ui-listview .ui-btn-icon-right:after { | ||
display: none; | ||
} | ||
/* Make text wrap. */ | ||
.my-page .ui-listview h2, | ||
.my-page .ui-listview p { | ||
white-space: normal; | ||
overflow: visible; | ||
position: absolute; | ||
left: 0; | ||
right: 0; | ||
} | ||
/* Text position */ | ||
.my-page .ui-listview h2 { | ||
font-size: 1.25em; | ||
margin: 0; | ||
padding: .125em 1em; | ||
bottom: 50%; | ||
} | ||
.my-page .ui-listview p { | ||
font-size: 1em; | ||
margin: 0; | ||
padding: 0 1.25em; | ||
min-height: 50%; | ||
bottom: 0; | ||
} | ||
/* Semi transparent background and different position if there is a thumb. The button has overflow hidden so we don't need to set border-radius. */ | ||
.ui-listview .ui-li-has-thumb h2, | ||
.ui-listview .ui-li-has-thumb p { | ||
background: #111; | ||
background: rgba(0,0,0,.8); | ||
} | ||
.ui-listview .ui-li-has-thumb h2 { | ||
bottom: 35%; | ||
} | ||
.ui-listview .ui-li-has-thumb p { | ||
min-height: 35%; | ||
} | ||
/* ui-li-aside has class .ui-li-desc as well so we have to override some things. */ | ||
.my-page .ui-listview .ui-li-aside { | ||
padding: .125em .625em; | ||
width: auto; | ||
min-height: 0; | ||
top: 0; | ||
left: auto; | ||
bottom: auto; | ||
/* Custom styling. */ | ||
background: #990099; | ||
background: rgba(153,0,153,.85); | ||
-webkit-border-top-right-radius: inherit; | ||
border-top-right-radius: inherit; | ||
-webkit-border-bottom-left-radius: inherit; | ||
border-bottom-left-radius: inherit; | ||
-webkit-border-bottom-right-radius: 0; | ||
border-bottom-right-radius: 0; | ||
} | ||
/* If you want to add shadow, don't kill the focus style. */ | ||
.my-page .ui-listview li { | ||
-moz-box-shadow: 0px 0px 9px #111; | ||
-webkit-box-shadow: 0px 0px 9px #111; | ||
box-shadow: 0px 0px 9px #111; | ||
} | ||
/* Images mask the hover bg color so we give desktop users feedback by applying the focus style on hover as well. */ | ||
.my-page .ui-listview li > .ui-btn:hover { | ||
-moz-box-shadow: 0px 0px 12px #33ccff; | ||
-webkit-box-shadow: 0px 0px 12px #33ccff; | ||
box-shadow: 0px 0px 12px #33ccff; | ||
} | ||
/* Animate focus and hover style, and resizing. */ | ||
.my-page .ui-listview li, | ||
.my-page .ui-listview .ui-btn { | ||
-webkit-transition: all 500ms ease; | ||
-moz-transition: all 500ms ease; | ||
-o-transition: all 500ms ease; | ||
-ms-transition: all 500ms ease; | ||
transition: all 500ms ease; | ||
} | ||
} | ||
|
||
/* Second breakpoint is 63.75em (1020px). 4 column layout. Tiles will be 250x250 pixels incl. margin again at the breakpoint. */ | ||
@media ( min-width: 63.75em ) { | ||
.my-page .ui-content { | ||
padding: .625em; /* 10px */ | ||
} | ||
/* Set a max-width for the last breakpoint to prevent too much stretching on large screens. | ||
By setting the max-width equal to the breakpoint width minus padding we keep square tiles. */ | ||
.my-page .ui-listview { | ||
max-width: 62.5em; /* 1000px */ | ||
margin: 0 auto; | ||
} | ||
/* Because of the 1000px max-width the width will always be 230px (and margin left/right 10px), | ||
but we stick to percentage values for demo purposes. */ | ||
.my-page .ui-listview li { | ||
width: 23%; | ||
height: 230px; | ||
margin: .625em 1%; | ||
} | ||
} | ||
|
||
/* For this demo we used images with a size of 310x310 pixels. Just before the second breakpoint the images reach their max width: 1019px - 2 x 9px padding = 1001px x 30.9333% = ~310px */ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,44 @@ | ||
<!DOCTYPE html> | ||
<html class="ui-mobile"><head> | ||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Automation Bookstore Demo</title> | ||
<link rel="stylesheet" href="css/jquery.css"> | ||
<link rel="stylesheet" href="css/listview-grid.css"> | ||
<script src="js/jquery.js"></script> | ||
<script src="js/jquery_002.js"></script> | ||
<script src="js/products.js"></script> | ||
</head> | ||
<body class="ui-mobile-viewport ui-overlay-b"> | ||
<div data-role="page" data-theme="b" id="demo-page" class="my-page ui-page ui-page-theme-b ui-page-active" data-url="demo-page" tabindex="0" style="min-height: 930px;"> | ||
|
||
<div data-role="header" role="banner" class="ui-header ui-bar-inherit"> | ||
<h1 id="page-title" class="ui-title" role="heading" aria-level="1">Automation Bookstore</h1> | ||
</div><!-- /header --> | ||
|
||
<div role="main" class="ui-content"> | ||
|
||
<form class="ui-filterable"> | ||
<input id="searchBar" data-type="search" placeholder="Filter books.." class="ui-focus"> | ||
</form> | ||
<ul id="productList" data-role="listview" data-filter="true" data-input="#searchBar"> | ||
<script> | ||
var products = getProducts(); | ||
$.each(products, function () { | ||
$.each(this, function (index, product) { | ||
var list = document.getElementById('productList'); | ||
var listItem = document.createElement('li'); | ||
listItem.setAttribute('id', "pid" + product.id); | ||
listItem.innerHTML = "<a href='#'><img id='pid" + product.id + "_thumb' src='" + product.thumb + "' class='ui-li-thumb'><h2 id='pid" + product.id + "_title'>" + product.name + "</h2><p id='pid" + product.id + "_author'>" + product.author + "</p><p class='ui-li-aside' id='pid" + product.id + "_price'>$" + product.price +"</p></a>"; | ||
list.appendChild(listItem); | ||
}); | ||
}); | ||
</script> | ||
</ul> | ||
|
||
</div><!-- /content --> | ||
|
||
</div><!-- /page --> | ||
</body> | ||
</html> |
Oops, something went wrong.