-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
243 lines (231 loc) · 13.5 KB
/
test.html
File metadata and controls
243 lines (231 loc) · 13.5 KB
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<!DOCTYPE html>
<html lang=en>
<head>
<meta charset=utf-8>
<meta name=viewport content="width=device-width, initial-scale=1.0">
<meta name="description" content="PMD - Testing Area">
<title>PMD - Testing Area</title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
<link rel=apple-touch-icon-precomposed sizes=152x152 href="apple-touch-icon-152-precomposed.png"/>
<link rel=apple-touch-icon-precomposed sizes=144x144 href="apple-touch-icon-144-precomposed.png"/>
<link rel=apple-touch-icon-precomposed sizes=120x120 href="apple-touch-icon-120-precomposed.png"/>
<link rel=apple-touch-icon-precomposed sizes=114x114 href="apple-touch-icon-114-precomposed.png"/>
<link rel=apple-touch-icon-precomposed sizes=72x72 href="apple-touch-icon-72-precomposed.png"/>
<link rel=apple-touch-icon-precomposed sizes=57x57 href="apple-touch-icon-57-precomposed.png"/>
<link rel=apple-touch-icon-precomposed href="apple-touch-icon-precomposed.png"/>
<style>
body {
margin:0;
padding:0;
background-color:#fff;
font-size: 100%;
line-height: 1.4em;
font-family: "Calibre Light", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
img {
height: 100%;
width: 100%;
object-fit: cover;
color:transparent;
}
p {line-height: 1.5em;}
.image-caption {
z-index:3;
position:relative;
top: 60px;
padding:20px;
text-align:center;
background-color: rgb(255 255 255 / 0.75);
color: #000;
}
.grid-container-text {
display: grid;
grid-template-columns: repeat( auto-fit, minmax(350px, 1fr) );
grid-gap: 1px;
padding:75px 20px 10px 22px;
}
.grid-container {
display: grid;
grid-template-columns: repeat( auto-fit, minmax(350px, 1fr) );
grid-gap: 1px;
margin-top:-60px;
}
.text-container {
padding-right:20px;
}
.caption-text {
margin:0;
padding:0 10px;
font-size:90%;
}
/* only for somewhat larger displays */
@media only screen and (min-width: 1280px) {
.grid-container-text {
max-width:1280px;
padding:75px 0 0 0;
margin-left:auto;
margin-right:auto;
}
.grid-container {
max-width:1440px;
margin-top:-45px;
}
.text-container {
padding-left:5%;
padding-right:5%;
}
}
/* only for even larger displays */
@media only screen and (min-width: 1441px) {
.grid-container {
margin-left:auto;
margin-right:auto;
}
}
a:link, a:visited, a:hover, a:active { text-decoration: none; }
/*Target firefox to display alt text values only after images load*/
img:-moz-loading { visibility:hidden; }
.footer-container { text-align:center; margin-top:75px; font-size:90%;}
/* slideout stuff */
.slideout-menu {
position: fixed;
top: 0;
bottom: 0;
width: 256px;
min-height: 100vh;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
z-index: 0;
display: none;
}
.menu a {
text-decoration: none;
color:#fff;
}
/*.menu-section-list {tbd}*/
.slideout-menu-left {
left: 0;
background-color: #333;
color:#fff;
}
.slideout-menu-right {
right: 0;
}
.menu-section-title {
text-transform: uppercase;
color: #fff;
font-weight: 200;
font-size: 13px;
letter-spacing: 1px;
padding:10px 20px 0px 20px;
margin: 0;
/* purely for automated accessibility testing (already inherited from .slideout-menu-left) */
background-color:#333;
}
.menu-section-list {
padding: 0px;
margin: 10px 0;
list-style: none;
font-size:13px;
}
ul.menu-section-list a {
display:block;
padding:10px 20px;
}
.button-logo {
background: url('https://pmd-2993.mo.cloudinary.net/pmd-logo-m5a-black.png') no-repeat left center;
border:none;
position:absolute;
outline:none;
top:20px;
left:20px;
overflow:visible;
width:50px;
height:50px;
cursor: pointer;
}
.slideout-panel {
position: relative;
z-index: 1;
will-change: transform;
background-color: #fff; /* A background-color is required */
min-height: 100vh;
}
.slideout-open,
.slideout-open body,
.slideout-open .slideout-panel {
overflow: hidden;
}
.slideout-open .slideout-menu {
display: block;
}
</style>
<!-- Start Slideout JS Original - Moving this to inline below ...
<script src="https://cdnjs.cloudflare.com/ajax/libs/slideout/1.0.1/slideout.min.js"></script>
END Slideout JS Original -->
</head>
<body>
<nav id="menu" class="menu slideout-menu slideout-menu-left">
<h3 class="menu-section-title">Sections</h3>
<ul class="menu-section-list">
<li><a href="index.html">Home</a></li>
<li><a href="more.html">More</a></li>
</ul>
</nav>
<main id="panel">
<header>
<button class="toggle-button button-logo" title="Main Navigation"></button>
</header>
<!-- SECTION 1 (text area) -->
<div class="grid-container-text">
<div class="text-container">
<h3 class="subhead">Test</h3>
<p class="text">A page with images.</p>
</div>
</div>
<!-- SECTION 2 (2 images) -->
<div class="grid-container">
<div class="image-container">
<div class="image-caption">
<p class="caption-text">▽ Root interfaces</p>
</div>
<picture>
<source media="(min-width:481px)" srcset="https://pmd-2993.mo.cloudinary.net/rhodey-jr-roots-800w.jpeg" width="800" height="1067" />
<img src="https://pmd-2993.mo.cloudinary.net/rhodey-jr-roots-400w.jpeg" alt="Roots" width="400" height="534" />
</picture>
</div>
<div class="image-container">
<div class="image-caption">
<p class="caption-text">▽ Bonsai Bench</p>
</div>
<picture>
<source media="(min-width:481px)" srcset="https://pmd-2993.mo.cloudinary.net/bonsai-bench-long-800w.jpeg" width="800" height="1067" />
<img src="https://pmd-2993.mo.cloudinary.net/bonsai-bench-long-400w.jpeg" alt="Bonsai Bench" width="400" height="534" />
</picture>
</div>
</div>
<!-- Footer -->
<div class="footer-container">
<p><a href="#top">△ top</a></p>
</div>
</main>
<!-- Slideout JS Source - from: https://cdnjs.cloudflare.com/ajax/libs/slideout/1.0.1/slideout.min.js -->
<script>
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Slideout=t()}}(function(){var t,e,n;return function i(t,e,n){function o(r,a){if(!e[r]){if(!t[r]){var u=typeof require=="function"&&require;if(!a&&u)return u(r,!0);if(s)return s(r,!0);var l=new Error("Cannot find module '"+r+"'");throw l.code="MODULE_NOT_FOUND",l}var f=e[r]={exports:{}};t[r][0].call(f.exports,function(e){var n=t[r][1][e];return o(n?n:e)},f,f.exports,i,t,e,n)}return e[r].exports}var s=typeof require=="function"&&require;for(var r=0;r<n.length;r++)o(n[r]);return o}({1:[function(t,e,n){"use strict";var i=t("decouple");var o=t("emitter");var s;var r=false;var a=window.document;var u=a.documentElement;var l=window.navigator.msPointerEnabled;var f={start:l?"MSPointerDown":"touchstart",move:l?"MSPointerMove":"touchmove",end:l?"MSPointerUp":"touchend"};var h=function v(){var t=/^(Webkit|Khtml|Moz|ms|O)(?=[A-Z])/;var e=a.getElementsByTagName("script")[0].style;for(var n in e){if(t.test(n)){return"-"+n.match(t)[0].toLowerCase()+"-"}}if("WebkitOpacity"in e){return"-webkit-"}if("KhtmlOpacity"in e){return"-khtml-"}return""}();function c(t,e){for(var n in e){if(e[n]){t[n]=e[n]}}return t}function p(t,e){t.prototype=c(t.prototype||{},e.prototype)}function d(t){while(t.parentNode){if(t.getAttribute("data-slideout-ignore")!==null){return t}t=t.parentNode}return null}function _(t){t=t||{};this._startOffsetX=0;this._currentOffsetX=0;this._opening=false;this._moved=false;this._opened=false;this._preventOpen=false;this._touch=t.touch===undefined?true:t.touch&&true;this._side=t.side||"left";this.panel=t.panel;this.menu=t.menu;if(!this.panel.classList.contains("slideout-panel")){this.panel.classList.add("slideout-panel")}if(!this.panel.classList.contains("slideout-panel-"+this._side)){this.panel.classList.add("slideout-panel-"+this._side)}if(!this.menu.classList.contains("slideout-menu")){this.menu.classList.add("slideout-menu")}if(!this.menu.classList.contains("slideout-menu-"+this._side)){this.menu.classList.add("slideout-menu-"+this._side)}this._fx=t.fx||"ease";this._duration=parseInt(t.duration,10)||300;this._tolerance=parseInt(t.tolerance,10)||70;this._padding=this._translateTo=parseInt(t.padding,10)||256;this._orientation=this._side==="right"?-1:1;this._translateTo*=this._orientation;if(this._touch){this._initTouchEvents()}}p(_,o);_.prototype.open=function(){var t=this;this.emit("beforeopen");if(!u.classList.contains("slideout-open")){u.classList.add("slideout-open")}this._setTransition();this._translateXTo(this._translateTo);this._opened=true;setTimeout(function(){t.panel.style.transition=t.panel.style["-webkit-transition"]="";t.emit("open")},this._duration+50);return this};_.prototype.close=function(){var t=this;if(!this.isOpen()&&!this._opening){return this}this.emit("beforeclose");this._setTransition();this._translateXTo(0);this._opened=false;setTimeout(function(){u.classList.remove("slideout-open");t.panel.style.transition=t.panel.style["-webkit-transition"]=t.panel.style[h+"transform"]=t.panel.style.transform="";t.emit("close")},this._duration+50);return this};_.prototype.toggle=function(){return this.isOpen()?this.close():this.open()};_.prototype.isOpen=function(){return this._opened};_.prototype._translateXTo=function(t){this._currentOffsetX=t;this.panel.style[h+"transform"]=this.panel.style.transform="translateX("+t+"px)";return this};_.prototype._setTransition=function(){this.panel.style[h+"transition"]=this.panel.style.transition=h+"transform "+this._duration+"ms "+this._fx;return this};_.prototype._initTouchEvents=function(){var t=this;this._onScrollFn=i(a,"scroll",function(){if(!t._moved){clearTimeout(s);r=true;s=setTimeout(function(){r=false},250)}});this._preventMove=function(e){if(t._moved){e.preventDefault()}};a.addEventListener(f.move,this._preventMove);this._resetTouchFn=function(e){if(typeof e.touches==="undefined"){return}t._moved=false;t._opening=false;t._startOffsetX=e.touches[0].pageX;t._preventOpen=!t._touch||!t.isOpen()&&t.menu.clientWidth!==0};this.panel.addEventListener(f.start,this._resetTouchFn);this._onTouchCancelFn=function(){t._moved=false;t._opening=false};this.panel.addEventListener("touchcancel",this._onTouchCancelFn);this._onTouchEndFn=function(){if(t._moved){t.emit("translateend");t._opening&&Math.abs(t._currentOffsetX)>t._tolerance?t.open():t.close()}t._moved=false};this.panel.addEventListener(f.end,this._onTouchEndFn);this._onTouchMoveFn=function(e){if(r||t._preventOpen||typeof e.touches==="undefined"||d(e.target)){return}var n=e.touches[0].clientX-t._startOffsetX;var i=t._currentOffsetX=n;if(Math.abs(i)>t._padding){return}if(Math.abs(n)>20){t._opening=true;var o=n*t._orientation;if(t._opened&&o>0||!t._opened&&o<0){return}if(!t._moved){t.emit("translatestart")}if(o<=0){i=n+t._padding*t._orientation;t._opening=false}if(!(t._moved&&u.classList.contains("slideout-open"))){u.classList.add("slideout-open")}t.panel.style[h+"transform"]=t.panel.style.transform="translateX("+i+"px)";t.emit("translate",i);t._moved=true}};this.panel.addEventListener(f.move,this._onTouchMoveFn);return this};_.prototype.enableTouch=function(){this._touch=true;return this};_.prototype.disableTouch=function(){this._touch=false;return this};_.prototype.destroy=function(){this.close();a.removeEventListener(f.move,this._preventMove);this.panel.removeEventListener(f.start,this._resetTouchFn);this.panel.removeEventListener("touchcancel",this._onTouchCancelFn);this.panel.removeEventListener(f.end,this._onTouchEndFn);this.panel.removeEventListener(f.move,this._onTouchMoveFn);a.removeEventListener("scroll",this._onScrollFn);this.open=this.close=function(){};return this};e.exports=_},{decouple:2,emitter:3}],2:[function(t,e,n){"use strict";var i=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function o(t,e,n){var o,s=false;function r(t){o=t;a()}function a(){if(!s){i(u);s=true}}function u(){n.call(t,o);s=false}t.addEventListener(e,r,false);return r}e.exports=o},{}],3:[function(t,e,n){"use strict";var i=function(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}};n.__esModule=true;var o=function(){function t(){i(this,t)}t.prototype.on=function e(t,n){this._eventCollection=this._eventCollection||{};this._eventCollection[t]=this._eventCollection[t]||[];this._eventCollection[t].push(n);return this};t.prototype.once=function n(t,e){var n=this;function i(){n.off(t,i);e.apply(this,arguments)}i.listener=e;this.on(t,i);return this};t.prototype.off=function o(t,e){var n=undefined;if(!this._eventCollection||!(n=this._eventCollection[t])){return this}n.forEach(function(t,i){if(t===e||t.listener===e){n.splice(i,1)}});if(n.length===0){delete this._eventCollection[t]}return this};t.prototype.emit=function s(t){var e=this;for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++){i[o-1]=arguments[o]}var s=undefined;if(!this._eventCollection||!(s=this._eventCollection[t])){return this}s=s.slice(0);s.forEach(function(t){return t.apply(e,i)});return this};return t}();n["default"]=o;e.exports=n["default"]},{}]},{},[1])(1)});
</script>
<!-- EO Slideout JS Source -->
<!--start slideout js inline call -->
<script>
var slideout = new Slideout({
'panel': document.getElementById('panel'),
'menu': document.getElementById('menu'),
'padding': 256,
'tolerance': 70
});
// Toggle button
document.querySelector('.toggle-button').addEventListener('click', function() {
slideout.toggle();
});
</script>
<!-- end slideout js inline call -->
</body>