/**
* @license
* Copyright 2016 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
module.exports = function(filename, screenshots) {
return `
<!doctype html>
<title>${filename}</title>
<style>
html {
overflow-x: scroll;
overflow-y: hidden;
height: 100%;
background: linear-gradient(to left, #4CA1AF , #C4E0E5);
background-attachment: fixed;
padding: 10px;
}
body {
white-space: nowrap;
background: linear-gradient(to left, #4CA1AF , #C4E0E5);
width: 100%;
margin: 0;
}
img {
margin: 4px;
}
</style>
<body>
<script>
var shots = ${JSON.stringify(screenshots)};
shots.forEach(s => {
var i = document.createElement('img');
i.src = s.datauri;
i.title = s.timestamp;
document.body.appendChild(i);
});
</script>
`;
};
|