From 402c0c8af9b54fbbf8c15b94a89615146f932e33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sat, 19 Jan 2019 15:33:12 +0100 Subject: [PATCH] add cases to mobile screenshots --- static/css/combo-style.css | 67 ++++++++++++++++++++++ static/img/mobile-case.svg | 112 +++++++++++++++++++++++++++++++++++++ static/js/combo.public.js | 22 ++++++++ 3 files changed, 201 insertions(+) create mode 100644 static/img/mobile-case.svg diff --git a/static/css/combo-style.css b/static/css/combo-style.css index 62012df..9980f6d 100644 --- a/static/css/combo-style.css +++ b/static/css/combo-style.css @@ -879,3 +879,70 @@ span#counter { display: none; } } + +div.textcell.tablette { + text-align: center; +} + +div.mobile-case { + display: inline-block; + background: url(../img/mobile-case.svg) top left no-repeat; + width: 400px; + height: 720px; + position: relative; + overflow: hidden; +} + +div.mobile-case div.screen { + position: absolute; + overflow: hidden; + left: 12px; + top: 52px; + bottom: 67px; + right: 28px; +} + +div.mobile-case div.screen div.mobile-top-bar { + position: absolute; + top: 0; + left: 0; + background: rgba(0, 0, 0, 0.7); + width: 100%; + text-align: right; + color: white; + box-sizing: border-box; + padding-right: 5px; + height: 21px; +} + +div.mobile-case div.screen div.mobile-app-content { + position: absolute; + top: 21px; + left: 0; + width: 100%; + bottom: 0; +} + +div.mobile-case + div.mobile-case { + position: relative; + top: 40px; +} + +div.mobile-case + div.mobile-case + div.mobile-case { + position: relative; + top: 10px; +} + +div.mobile-case .screen { + background: #dc1822; +} + +div.mobile-case + div.mobile-case .screen { + background: #00aa9e; +} + +div.mobile-case + div.mobile-case + div.mobile-case .screen { + background: #de3559; +} + +@media(max-width: 668px) { div.tablette { display: none; } } diff --git a/static/img/mobile-case.svg b/static/img/mobile-case.svg new file mode 100644 index 0000000..7003916 --- /dev/null +++ b/static/img/mobile-case.svg @@ -0,0 +1,112 @@ + + + +image/svg+xml diff --git a/static/js/combo.public.js b/static/js/combo.public.js index 238c72e..e4f7dbc 100644 --- a/static/js/combo.public.js +++ b/static/js/combo.public.js @@ -4,6 +4,28 @@ $(function() { $('a[href^="#"]').on('click', function() { $.scrollTo($(this).attr('href'), 1000); } ); + + if ($('.mobile-case').length) { + setInterval(function() { + var $clock = $('.mobile-case .clock'); + var date = new Date(); + $clock.text(('0' + date.getHours()).slice(-2) + ':' + ('0' + date.getMinutes()).slice(-2)); + }, 500); + } + + $('.textcell.tablette img').each(function(idx, elem) { + var $cell = $(elem).parents('div.textcell'); + var $mobile_case = $('
' + + '
' + + '
--:--
' + + '
' + + '
' + + '
' + + '
'); + $mobile_case.find('.mobile-app-content').append($(elem).detach()); + $cell.append($mobile_case); + }); + if ($('.ecrans').length > 0) { var $window = $(window); var offset = parseInt(Math.random()*2000);