Skip to content

Commit b89734b

Browse files
committed
Add preliminary fencing div/overlay, with Paul's help.
1 parent d5eb058 commit b89734b

File tree

2 files changed

+56
-57
lines changed

2 files changed

+56
-57
lines changed

src/components/cards/card.css

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22
@import "../../css/colors.css";
33
@import "../../css/z-index.css";
44

5+
.card-container-overlay {
6+
position: fixed;
7+
z-index: $z-index-card;
8+
}
9+
510
.card-container {
611
position:absolute;
712
z-index: $z-index-card;
813
margin: 0.5rem 2rem;
914
min-width: 468px;
1015
}
1116

12-
.card-container-overlay {
13-
margin: auto;
14-
pointer-events: none;
15-
overflow: hidden;
16-
}
17-
1817
.left-card, .right-card {
1918
height: 90%;
2019
position: absolute;

src/components/cards/cards.jsx

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import React, {Fragment} from 'react';
33
import classNames from 'classnames';
44
import {FormattedMessage} from 'react-intl';
55
import Draggable from 'react-draggable';
6-
// import Box from '../box/box.jsx';
76

87
import styles from './card.css';
98

@@ -278,64 +277,65 @@ const Cards = props => {
278277
const steps = content[activeDeckId].steps;
279278

280279
return (
281-
/* <Box
282-
// Use static `cards-overlay` class for bounds of draggables
280+
<div
283281
className={styles.cardContainerOverlay}
284282
style={{
285-
width: 500, // props.stageSize.width,
286-
height: 500 // props.stageSize.height
283+
width: `${window.innerWidth + (2 * 300)}px`,
284+
height: `${window.innerHeight + (2 * 300)}px`,
285+
top: `${-300}px`,
286+
left: `${-300}px`
287287
}}
288-
> */
289-
<Draggable
290-
bounds="parent"
291-
position={{x: x, y: y}}
292-
onDrag={onDrag}
293-
onStart={onStartDrag}
294-
onStop={onEndDrag}
295288
>
296-
<div className={styles.cardContainer}>
297-
<div className={styles.card}>
298-
<CardHeader
299-
expanded={expanded}
300-
step={step}
301-
totalSteps={steps.length}
302-
onCloseCards={onCloseCards}
303-
onShowAll={onShowAll}
304-
onShrinkExpandCards={onShrinkExpandCards}
305-
/>
306-
<div className={expanded ? styles.stepBody : styles.hidden}>
307-
{steps[step].deckIds ? (
308-
<PreviewsStep
309-
content={content}
310-
deckIds={steps[step].deckIds}
311-
onActivateDeckFactory={onActivateDeckFactory}
312-
onShowAll={onShowAll}
313-
/>
314-
) : (
315-
steps[step].video ? (
316-
<VideoStep
317-
dragging={dragging}
318-
video={translateVideo(steps[step].video, locale)}
289+
<Draggable
290+
bounds="parent"
291+
position={{x: x, y: y}}
292+
onDrag={onDrag}
293+
onStart={onStartDrag}
294+
onStop={onEndDrag}
295+
>
296+
<div className={styles.cardContainer}>
297+
<div className={styles.card}>
298+
<CardHeader
299+
expanded={expanded}
300+
step={step}
301+
totalSteps={steps.length}
302+
onCloseCards={onCloseCards}
303+
onShowAll={onShowAll}
304+
onShrinkExpandCards={onShrinkExpandCards}
305+
/>
306+
<div className={expanded ? styles.stepBody : styles.hidden}>
307+
{steps[step].deckIds ? (
308+
<PreviewsStep
309+
content={content}
310+
deckIds={steps[step].deckIds}
311+
onActivateDeckFactory={onActivateDeckFactory}
312+
onShowAll={onShowAll}
319313
/>
320314
) : (
321-
<ImageStep
322-
image={translateImage(steps[step].image, locale)}
323-
title={steps[step].title}
324-
/>
325-
)
326-
)}
327-
{steps[step].trackingPixel && steps[step].trackingPixel}
315+
steps[step].video ? (
316+
<VideoStep
317+
dragging={dragging}
318+
video={translateVideo(steps[step].video, locale)}
319+
/>
320+
) : (
321+
<ImageStep
322+
image={translateImage(steps[step].image, locale)}
323+
title={steps[step].title}
324+
/>
325+
)
326+
)}
327+
{steps[step].trackingPixel && steps[step].trackingPixel}
328+
</div>
329+
<NextPrevButtons
330+
expanded={expanded}
331+
isRtl={isRtl}
332+
onNextStep={step < steps.length - 1 ? onNextStep : null}
333+
onPrevStep={step > 0 ? onPrevStep : null}
334+
/>
328335
</div>
329-
<NextPrevButtons
330-
expanded={expanded}
331-
isRtl={isRtl}
332-
onNextStep={step < steps.length - 1 ? onNextStep : null}
333-
onPrevStep={step > 0 ? onPrevStep : null}
334-
/>
335336
</div>
336-
</div>
337-
</Draggable>
338-
/* </Box> */
337+
</Draggable>
338+
</div>
339339
);
340340
};
341341

0 commit comments

Comments
 (0)