Skip to content

Commit

Permalink
New snippet: date picker (19)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thibaut committed May 3, 2012
1 parent e4d53b3 commit 0976bf8
Show file tree
Hide file tree
Showing 6 changed files with 691 additions and 0 deletions.
20 changes: 20 additions & 0 deletions 19-date-picker/LICENSE
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2012 Thibaut Courouble

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39 changes: 39 additions & 0 deletions 19-date-picker/README.md
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,39 @@
# Mini Calendar / Date Picker — HML5 & CSS3 Snippet

**Demo**: [demo.webinterfacelab.com/19-date-picker](http://demo.webinterfacelab.com/19-date-picker/)

[![Preview](http://www.webinterfacelab.com/snippets/mini-calendar-date-picker/preview.png)](http://www.webinterfacelab.com/snippets/mini-calendar-date-picker)

This snippet is implemented with [Sass](https://github.com/nex3/sass), with help from [Bourbon](https://github.com/thoughtbot/bourbon).

To compile:

`sass --update scss:css -r ../bourbon/lib/bourbon.rb`

To compile and watch:

`sass --watch scss:css -r ../bourbon/lib/bourbon.rb`

## Browser Compatibility

Firefox 4+, Safari 4+, Chrome 13+, Opera 10+, Internet Explorer 6+.

## Credits

Coded by [Thibaut Courouble](http://thibaut.me).

Original PSD by [James McDonald](http://dribbble.com/shots/240129-Calender).

For more snippets, visit [WebInterfaceLab.com](http://www.webinterfacelab.com) or follow [@WebInterfaceLab](http://twitter.com/WebInterfaceLab).

## License

Copyright (c) 2012 Thibaut Courouble

Licensed under the MIT License

## More CSS3

Have a look at my [CSS3 Toolkits](http://www.webinterfacelab.com/css3-web-interface-toolkits):

[![Thumb #1](http://cdn.webinterfacelab.com/elegant/thumb-180-1.png)](http://www.webinterfacelab.com/css3-web-interface-toolkits/elegant) [![Thumb #2](http://cdn.webinterfacelab.com/simple/thumb-180-1.png)](http://www.webinterfacelab.com/css3-web-interface-toolkits/simple) [![Thumb #3](http://cdn.webinterfacelab.com/elegant/thumb-180-2.png)](http://www.webinterfacelab.com/css3-web-interface-toolkits/elegant) [![Thumb #4](http://cdn.webinterfacelab.com/simple/thumb-180-2.png)](http://www.webinterfacelab.com/css3-web-interface-toolkits/simple)
322 changes: 322 additions & 0 deletions 19-date-picker/css/style.css
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,322 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}

article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}

body {
line-height: 1;
}

ol, ul {
list-style: none;
}

blockquote, q {
quotes: none;
}

blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}

table {
border-collapse: collapse;
border-spacing: 0;
}

/*
* Copyright (c) 2012 Thibaut Courouble
* http://www.webinterfacelab.com
*
* Licensed under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*/
/* ========================================================
Page
===================================================== */
html, body {
min-height: 100%;
}

body {
color: #404040;
font-family: 'Lucida Grande', Verdana, sans-serif;
font-size: 13px;
font-weight: normal;
line-height: 20px;
background-repeat: no-repeat;
background-color: #dbdede;
background-image: -webkit-gradient(radial, center center, 0, center center, 460, color-stop(0%, #dbdede), color-stop(100%, #bfbdbe));
background-image: -webkit-radial-gradient(center, circle cover, #dbdede, #bfbdbe);
background-image: -moz-radial-gradient(center, circle cover, #dbdede, #bfbdbe);
background-image: -ms-radial-gradient(center, circle cover, #dbdede, #bfbdbe);
background-image: -o-radial-gradient(center, circle cover, #dbdede, #bfbdbe);
background-image: radial-gradient(center, circle cover, #dbdede, #bfbdbe);
}

.container {
width: 640px;
margin: 80px auto;
text-align: center;
}

/* ========================================================
Calendar
===================================================== */
.cal {
position: relative;
padding: 4px;
font-weight: bold;
background: #bebfc0;
background: rgba(0, 0, 0, 0.1);
border-radius: 5px;
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: baseline;
zoom: 1;
*display: inline;
*vertical-align: auto;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2), 0 1px rgba(255, 255, 255, 0.4);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2), 0 1px rgba(255, 255, 255, 0.4);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2), 0 1px rgba(255, 255, 255, 0.4);
}
.cal:before {
content: '';
position: absolute;
right: 4px;
bottom: 3px;
left: 4px;
height: 6px;
background: #d9d9d9;
border: 1px solid #909090;
border-radius: 4px;
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.cal a {
text-decoration: none;
}
.cal tr:first-child td {
border-top: 0;
}
.cal td:first-child {
border-left: 0;
}
.cal tr:first-child a {
border-top: 0;
margin-top: 0;
}
.cal tr:last-child a {
border-bottom: 0;
margin-bottom: 0;
}
.cal td:first-child a {
border-left: 0;
margin-left: 0;
}
.cal td:last-child a {
border-right: 0;
margin-right: 0;
}
.cal tr:last-child td:first-child a {
border-radius: 0 0 0 3px;
}
.cal tr:last-child td:last-child a {
border-radius: 0 0 3px 0;
}

.cal-table {
position: relative;
margin: 0 0 1px;
border-collapse: separate;
border-left: 1px solid #979797;
border-right: 1px solid #979797;
border-bottom: 1px solid #bbb;
border-radius: 0 0 3px 3px;
-webkit-box-shadow: 1px 0 rgba(0, 0, 0, 0.1), -1px 0 rgba(0, 0, 0, 0.1);
-moz-box-shadow: 1px 0 rgba(0, 0, 0, 0.1), -1px 0 rgba(0, 0, 0, 0.1);
box-shadow: 1px 0 rgba(0, 0, 0, 0.1), -1px 0 rgba(0, 0, 0, 0.1);
}

.cal-caption {
width: 100%;
padding-bottom: 1px;
line-height: 32px;
text-align: center;
color: #fff;
text-shadow: 0 -1px rgba(0, 0, 0, 0.3);
border-radius: 3px 3px 0 0;
background-color: #629c2e;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #89c84d), color-stop(75%, #629c2e), color-stop(100%, #548d20));
background-image: -webkit-linear-gradient(top, #89c84d 0%, #629c2e 75%, #548d20);
background-image: -moz-linear-gradient(top, #89c84d 0%, #629c2e 75%, #548d20);
background-image: -ms-linear-gradient(top, #89c84d 0%, #629c2e 75%, #548d20);
background-image: -o-linear-gradient(top, #89c84d 0%, #629c2e 75%, #548d20);
background-image: linear-gradient(top, #89c84d 0%, #629c2e 75%, #548d20);
-webkit-box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), inset 0 1px rgba(0, 0, 0, 0.1), inset 0 2px rgba(255, 255, 255, 0.25), 0 1px 3px rgba(0, 0, 0, 0.4);
-moz-box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), inset 0 1px rgba(0, 0, 0, 0.1), inset 0 2px rgba(255, 255, 255, 0.25), 0 1px 3px rgba(0, 0, 0, 0.4);
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), inset 0 1px rgba(0, 0, 0, 0.1), inset 0 2px rgba(255, 255, 255, 0.25), 0 1px 3px rgba(0, 0, 0, 0.4);
}
.cal-caption a {
line-height: 30px;
padding: 0 10px;
color: #fff;
font-size: 20px;
font-weight: normal;
}
.cal-caption .prev {
float: left;
}
.cal-caption .next {
float: right;
}

.cal-body td {
width: 30px;
font-size: 11px;
border-top: 1px solid #eaeaea;
border-left: 1px solid #eaeaea;
}
.cal-body a {
display: block;
position: relative;
line-height: 28px;
text-align: center;
color: #555;
background: #fff;
}
.cal-body a:hover {
background: #fafafa;
}

.cal-off a {
color: #ccc;
font-weight: normal;
}

.cal-today a {
color: #000;
background-color: #f5f5f5;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f5f5f5), color-stop(70%, white));
background-image: -webkit-linear-gradient(top, #f5f5f5 0%, white 70%);
background-image: -moz-linear-gradient(top, #f5f5f5 0%, white 70%);
background-image: -ms-linear-gradient(top, #f5f5f5 0%, white 70%);
background-image: -o-linear-gradient(top, #f5f5f5 0%, white 70%);
background-image: linear-gradient(top, #f5f5f5 0%, white 70%);
}

.cal-selected a, .cal-body a:active {
margin: -1px;
color: #b2494d;
background: #fff5f6;
border: 1px solid #e7d4d4;
}

.cal-check a {
color: #f79901;
overflow: hidden;
}
.cal-check a:before {
content: '';
position: absolute;
top: -6px;
right: -6px;
width: 12px;
height: 12px;
background-color: #ffb83b;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffb83b), color-stop(100%, #ff6c00));
background-image: -webkit-linear-gradient(top, #ffb83b, #ff6c00);
background-image: -moz-linear-gradient(top, #ffb83b, #ff6c00);
background-image: -ms-linear-gradient(top, #ffb83b, #ff6c00);
background-image: -o-linear-gradient(top, #ffb83b, #ff6c00);
background-image: linear-gradient(top, #ffb83b, #ff6c00);
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
}

.lt-ie8 .cal-table {
*border-collapse: collapse;
}
.lt-ie8 .cal-body a {
zoom: 1;
}

/* ========================================================
About
===================================================== */
.about {
margin: 80px auto;
padding: 15px 20px;
width: 300px;
text-align: center;
color: #777;
text-shadow: 0 1px rgba(255, 255, 255, 0.6);
background: rgba(0, 0, 0, 0.05);
border-radius: 3px;
}
.about a {
padding: 1px 3px;
margin: 0 -1px;
color: #1468c8;
text-decoration: none;
border-radius: 2px;
}
.about a:hover {
color: #fff;
text-shadow: 0 1px #0063A6;
background: #0090D2;
}

.links {
zoom: 1;
}
.links:before, .links:after {
content: "";
display: table;
}
.links:after {
clear: both;
}
.links a {
padding: 6px 0;
float: left;
width: 50%;
font-size: 14px;
}

.author {
margin-top: 15px;
font-size: 11px;
}
Loading

0 comments on commit 0976bf8

Please sign in to comment.