-
Notifications
You must be signed in to change notification settings - Fork 0
/
drawers.html
163 lines (156 loc) · 4.92 KB
/
drawers.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Scripted Pixels' Drawers, one at a time</title>
<link rel="stylesheet" href="css/reset.css">
<style>
/* setup the very basis for the document */
body {
font-family: 'Helvetica Neue';
text-align:center;
font-weight: lighter;
font-size: 16px;
line-height: 1.1;
padding: 0 0.5rem;
color: #fff;
min-width: 320px;
}
.container {
display: inline-block;
position: relative;
margin: 1rem auto;
display: block;
clear: both;
width: 100%;
max-width: 500px;
}
a {
color: #f0f0f0;
text-decoration: none;
}
a:hover p {
text-decoration: underline;
}
h1, h2, h3 {
font-family: 'CodeLightRegular', 'Helvetica Neue';
}
h1, h2 {
display: inline-block;
text-align: center;
line-height: 1.1;
width: 100%;
}
h1 {
font-size: 30px;
font-size: 3rem;
}
h2 {
font-size: 18px;
font-size: 1.8rem;
margin: 0 auto 1rem;
}
p {
margin: 0 auto 1rem;
letter-spacing: 0.1rem;
}
ol {
list-style: none;
}
ol li {
border: thin solid rgba(255,255,255,0.5);
padding: 1rem 1rem 0;
border-bottom: 0;
margin:0 auto;
cursor: pointer;
}
ol li:last-child {
border-bottom: thin solid rgba(255,255,255,0.5);
}
ol li h3 {
display: inline-block;
letter-spacing: 1px;
font-size: 1.3rem;
text-align: left;
width: 100%;
}
ol li h3:after {
content: '+';
float: right;
}
ol li article {
display: inline-block;
overflow: hidden;
margin: 1rem 0 0;
width: 100%;
max-height: 0px;
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
-ms-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
ol li.open article {
height: auto;
max-height: 900px;
-webkit-transition: all 0.4s ease-in;
-moz-transition: all 0.4s ease-in;
-o-transition: all 0.4s ease-in;
-ms-transition: all 0.4s ease-in;
transition: all 0.4s ease-in;
}
ol li.open h3:after {
content: '-';
}
</style>
</head>
<body>
<div class="container">
<section>
<ol>
<li class="open">
<h3> Drawer Title </h3>
<article>
<p> Drawer content </p>
</article>
</li>
<li class="">
<h3 class=""> Drawer Title </h3>
<article>
<p> Drawer content </p>
</article>
</li>
<li class="">
<h3 class=""> Drawer Title </h3>
<article>
<p> Drawer content </p>
</article>
</li>
<li class="">
<h3 class=""> Drawer Title </h3>
<article>
<p> Drawer content </p>
</article>
</li>
</ol>
</section>
</div>
<!-- jQuery libraries -->
<script src="js/jquery-1.10.2.min.js"></script>
<script src="js/detectmobilebrowser.js"></script>
<script src="js/jquery.easing.1.3.js"></script>
<!-- TOUCH EVENTS -->
<script src="js/jquery.tappable.js"></script>
<script>
jQuery(document).ready(function($){
$('ol li').tappable();
$('ol li').on('click', function(){
$('ol li').not(this).removeClass('open');
$(this).toggleClass('open');
});
});
</script>
</body>
</html>