import styled from "styled-components/macro"; /** * scale is a percentage (0-100%) * */ type OverlayImageProps = { src: string, scale?: number, }; export const OverlayImage = styled.img.attrs(({ src, }) => ({ draggable: false, src, }))` width: ${({ scale = 100 }) => `${scale}%`}; &:active { outline: 2px solid red; outline-offset: -2px; } `; type OverlayImageContainerProps = { opacity: number, }; export const OverlayImageContainer = styled.div.attrs(({ opacity, }) => ({ style: { opacity, }, }))` display: flex; &:hover { > span { display: inline; } } `; export const OverlayImageSubContainer = styled.div` flex-shrink: 0; `; export const OverlayImageSize = styled.span` position: absolute; display: none; left: 0; bottom: -1.5em; width: 15ch; color: red; font-family: ${p => p.theme.fonts.f1Regular}; font-size: 1em; text-shadow: -1px -1px 1px rgba(255,255,255,.1), 1px 1px 1px rgba(0,0,0,.5); `;