Skip to content

Commit 2341780

Browse files
committed
finish card-anime
1 parent 1c9b671 commit 2341780

File tree

3 files changed

+36
-19
lines changed

3 files changed

+36
-19
lines changed

lib/modules/apostrophe-assets/public/css/components/cards.less

+25-10
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,16 @@
165165
background-color: rgba(0,0,0,0.5);
166166
z-index: 2;
167167
cursor: pointer;
168+
.go-back {
169+
color: @white;
170+
display: block;
171+
height: 64px;
172+
.flex();
173+
.flex-align-items(center);
174+
i {
175+
margin: 0 5px;
176+
}
177+
}
168178
}
169179
.anime-container {
170180
position: absolute;
@@ -183,18 +193,23 @@
183193
.apos-area {
184194
max-height: 45vh;
185195
overflow-y: scroll;
196+
.apos-area-widget-wrapper {
197+
margin-bottom: 64px;
198+
}
199+
}
200+
.apos-area:after {
201+
content: '';
202+
pointer-events: none;
203+
position: absolute;
204+
left: 0;
205+
bottom: 34px;
206+
width: 100%;
207+
height: 15%;
208+
background: rgb(255,255,255);
209+
background: linear-gradient(0deg, rgba(255,255,255,1) 0%, rgba(255,255,255,1) 30%, rgba(255,255,255,0) 100%);
210+
z-index: 1;
186211
}
187212
}
188-
// .card-content:after {
189-
// content: '';
190-
// position: absolute;
191-
// top: 0;
192-
// left: 0;
193-
// width: 100%;
194-
// height: 100%;
195-
// box-shadow: inset 0px 30px 8px -10px #000, inset 0px -30px 8px -10px #fff;
196-
// z-index: 1;
197-
// }
198213
}
199214
}
200215
}

lib/modules/card-widgets/public/js/lean.js

+10-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apos.utils.widgetPlayers['card'] = function(el, data, options) {
33
if (data.clickAction == 'clickActionAnime') {
44
// Get elements
55
var body = document.querySelector('body');
6-
var navElements = document.querySelectorAll('.brand-logo, .sidenav-trigger, .nav-activator')
6+
var nav = document.querySelector('.nav-wrapper')
77
var sectionHeader = document.querySelectorAll('.section-header');
88
var aposUiElements = el.querySelectorAll('.apos-ui');
99
var animeCol = el.querySelector('.anime');
@@ -30,11 +30,6 @@ apos.utils.widgetPlayers['card'] = function(el, data, options) {
3030
block: 'center'
3131
});
3232

33-
// Calculate proportions
34-
function round(value, decimals) {
35-
return Number(Math.round(value + 'e' + decimals) + 'e-' + decimals);
36-
}
37-
3833
setTimeout(function() {
3934
var imageAnimation = anime({
4035
targets: animeImage,
@@ -54,15 +49,22 @@ apos.utils.widgetPlayers['card'] = function(el, data, options) {
5449
});
5550

5651
var navAnimation = anime({
57-
targets: navElements,
52+
targets: nav,
5853
opacity: '0',
5954
duration: 250,
6055
easing: 'easeInOutQuad'
6156
});
6257
}, 100);
58+
59+
setTimeout(function() {
60+
nav.style.display = 'none';
61+
}, 600);
62+
6363
}
6464
function imageAnimationOff() {
6565

66+
nav.style.display = 'block';
67+
6668
var imageAnimation = anime({
6769
targets: animeImage,
6870
translateX: '0',
@@ -82,7 +84,7 @@ apos.utils.widgetPlayers['card'] = function(el, data, options) {
8284
});
8385

8486
var navAnimation = anime({
85-
targets: navElements,
87+
targets: nav,
8688
opacity: '1',
8789
duration: 250,
8890
easing: 'easeInOutQuad'

lib/modules/card-widgets/views/components/anime.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
</div>
7070

7171
<div class="anime-overlay">
72-
<a class="go-back"><i class="material-icons">add</i>Go Back</a>
72+
<a class="flow-text go-back"><i class="material-icons">arrow_back</i>Go Back</a>
7373
</div>
7474

7575
<div class="anime-container">

0 commit comments

Comments
 (0)