mirror of
https://github.com/ivabus/www
synced 2024-11-25 15:15:06 +03:00
#177 Nebraska-Man strip show scrollable view on mobile
This commit is contained in:
parent
2907cfa4e0
commit
fc4a93a26c
2 changed files with 103 additions and 80 deletions
|
@ -65,39 +65,53 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.flipbook .page {
|
.flipbook .page {
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.flipbook .page img {
|
.flipbook .page img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* .flipbook.desktop .page {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.flipbook.desktop .page img {
|
||||||
|
height: 100%;
|
||||||
|
} */
|
||||||
|
|
||||||
|
#comicstrip #desktop_view {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#comistrip #flipbook_mobile {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
#comicstrip.desktop #desktop_view {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
#comicstrip.desktop #flipbook_mobile {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<section class="nb-man-latest">
|
<section class="nb-man-latest">
|
||||||
<div class="container">
|
<div class="container" id="comicstrip">
|
||||||
<div class="row">
|
<div class="row" id="desktop_view">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<div class="aspect">
|
<div class="aspect">
|
||||||
<div class="aspect-inner">
|
<div class="aspect-inner">
|
||||||
<div class="flipbook" id="flipbook">
|
{{- partial "nebraska-man-001.html" "flipbook_desktop" -}}
|
||||||
<div class="page"><img src="/Images/nb-man-cover-one.jpg" draggable="false" alt="" /></div>
|
|
||||||
<div class="page"><img src="/Images/nebraksa_man/Nebraska_Man_01.jpg" draggable="false" alt="" /></div>
|
|
||||||
<div class="page"><img src="/Images/nebraksa_man/Nebraska_Man_02.jpg" draggable="false" alt="" /></div>
|
|
||||||
<div class="page"><img src="/Images/nebraksa_man/Nebraska_Man_03.jpg" draggable="false" alt="" /></div>
|
|
||||||
<div class="page"><img src="/Images/nebraksa_man/Nebraska_Man_04.jpg" draggable="false" alt="" /></div>
|
|
||||||
<div class="page"><img src="/Images/nebraksa_man/Nebraska_Man_05.jpg" draggable="false" alt="" /></div>
|
|
||||||
<div class="page"><img src="/Images/nebraksa_man/Nebraska_Man_06.jpg" draggable="false" alt="" /></div>
|
|
||||||
<div class="page"><img src="/Images/nebraksa_man/Nebraska_Man_07.jpg" draggable="false" alt="" /></div>
|
|
||||||
<div class="page"><img src="/Images/nebraksa_man/Nebraska_Man_08.jpg" draggable="false" alt="" /></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{- partial "nebraska-man-001.html" "flipbook_mobile" -}}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
@ -187,25 +201,25 @@
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
||||||
|
|
||||||
function loadApp() {
|
function loadApp() {
|
||||||
|
|
||||||
// Create the flipbook
|
// Create the flipbook
|
||||||
|
|
||||||
$('.flipbook').turn({
|
$('.flipbook').turn({
|
||||||
|
|
||||||
// Enable gradients
|
// Enable gradients
|
||||||
|
|
||||||
gradients: true,
|
gradients: true,
|
||||||
|
|
||||||
// Auto center this flipbook
|
// Auto center this flipbook
|
||||||
|
|
||||||
autoCenter: true
|
autoCenter: true
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load the HTML4 version if there's not CSS transform
|
if (!isMobile) {
|
||||||
|
const comicstripEl = document.getElementById('comicstrip');
|
||||||
|
comicstripEl.classList.add('desktop');
|
||||||
|
|
||||||
|
const flipbookEL = document.getElementById('flipbook_desktop');
|
||||||
|
|
||||||
|
// Load the HTML4 version if there's not CSS transform
|
||||||
yepnope({
|
yepnope({
|
||||||
test : Modernizr.csstransforms,
|
test : Modernizr.csstransforms,
|
||||||
yep: ['/js/turn.js'],
|
yep: ['/js/turn.js'],
|
||||||
|
@ -214,8 +228,6 @@ yepnope({
|
||||||
complete: loadApp
|
complete: loadApp
|
||||||
});
|
});
|
||||||
|
|
||||||
var flipbookEL = document.getElementById('flipbook');
|
|
||||||
|
|
||||||
window.addEventListener('resize', function (e) {
|
window.addEventListener('resize', function (e) {
|
||||||
flipbookEL.style.width = '';
|
flipbookEL.style.width = '';
|
||||||
flipbookEL.style.height = '';
|
flipbookEL.style.height = '';
|
||||||
|
@ -225,7 +237,7 @@ window.addEventListener('resize', function (e) {
|
||||||
$(flipbookEL).turn({
|
$(flipbookEL).turn({
|
||||||
autoCenter: true
|
autoCenter: true
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
11
src/layouts/partials/nebraska-man-001.html
Normal file
11
src/layouts/partials/nebraska-man-001.html
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<div class="flipbook" id="{{- . -}}">
|
||||||
|
<div class="page"><img src="/Images/nb-man-cover-one.jpg" draggable="false" alt="" /></div>
|
||||||
|
<div class="page"><img src="/Images/nebraksa_man/Nebraska_Man_01.jpg" draggable="false" alt="" /></div>
|
||||||
|
<div class="page"><img src="/Images/nebraksa_man/Nebraska_Man_02.jpg" draggable="false" alt="" /></div>
|
||||||
|
<div class="page"><img src="/Images/nebraksa_man/Nebraska_Man_03.jpg" draggable="false" alt="" /></div>
|
||||||
|
<div class="page"><img src="/Images/nebraksa_man/Nebraska_Man_04.jpg" draggable="false" alt="" /></div>
|
||||||
|
<div class="page"><img src="/Images/nebraksa_man/Nebraska_Man_05.jpg" draggable="false" alt="" /></div>
|
||||||
|
<div class="page"><img src="/Images/nebraksa_man/Nebraska_Man_06.jpg" draggable="false" alt="" /></div>
|
||||||
|
<div class="page"><img src="/Images/nebraksa_man/Nebraska_Man_07.jpg" draggable="false" alt="" /></div>
|
||||||
|
<div class="page"><img src="/Images/nebraksa_man/Nebraska_Man_08.jpg" draggable="false" alt="" /></div>
|
||||||
|
</div>
|
Loading…
Reference in a new issue