-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add icon list in historical data page (#135)
* add icon list in historical data page * fix height and width
- Loading branch information
Showing
4 changed files
with
107 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.image-stack { | ||
position: relative; | ||
overflow: hidden; | ||
} | ||
|
||
.image-stack-child { | ||
position: absolute; | ||
transition: left 0.5s ease-in-out; | ||
} | ||
|
||
.image-stack-child img { | ||
border-radius: 50%; | ||
box-shadow: 0px 4px 5px rgba(0, 0, 0, 0.3); | ||
transition: width 0.5s ease-in-out, height 0.5s ease-in-out; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React, { useState } from "react"; | ||
import "./index.css"; | ||
|
||
const ImageStack = ({ | ||
imageSrcs, | ||
imageWidth, | ||
imageHeight, | ||
}: { | ||
imageSrcs: string[]; | ||
imageWidth: number; | ||
imageHeight: number; | ||
}) => { | ||
const [expanded, setExpanded] = useState(false); | ||
|
||
const handleMouseEnter = () => { | ||
setExpanded(true); | ||
}; | ||
|
||
const handleMouseLeave = () => { | ||
setExpanded(false); | ||
}; | ||
|
||
return ( | ||
<div | ||
className="image-stack" | ||
style={{ | ||
height: imageHeight, | ||
width: imageWidth * 1.05 * imageSrcs.length | ||
}} | ||
onMouseEnter={handleMouseEnter} | ||
onMouseLeave={handleMouseLeave} | ||
> | ||
{imageSrcs.map((image, index) => ( | ||
<div | ||
className="image-stack-child" | ||
style={{ left: expanded ? index * imageWidth * 1.05 : index * imageWidth * 0.7 }} | ||
key={index} | ||
> | ||
<img | ||
src={image} | ||
alt={`Image ${index + 1}`} | ||
style={{ | ||
width: imageWidth, | ||
height: imageHeight, | ||
}} | ||
/> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default ImageStack; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters