2024-02-19 22:53:42 +00:00
|
|
|
export default {
|
2024-03-12 08:19:23 +00:00
|
|
|
css: ({ dt }) => `
|
2024-02-19 22:53:42 +00:00
|
|
|
.p-image-mask {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2024-03-12 11:27:32 +00:00
|
|
|
--p-mask-background: ${dt('image.mask.background')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
2024-04-10 06:16:00 +00:00
|
|
|
.p-image-preview {
|
2024-02-19 22:53:42 +00:00
|
|
|
position: relative;
|
|
|
|
display: inline-flex;
|
|
|
|
line-height: 0;
|
|
|
|
}
|
|
|
|
|
2024-04-10 06:16:00 +00:00
|
|
|
.p-image-preview-mask {
|
2024-02-19 22:53:42 +00:00
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
|
|
|
top: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
opacity: 0;
|
|
|
|
transition: opacity 0.3s;
|
|
|
|
border: 0 none;
|
|
|
|
padding: 0;
|
|
|
|
cursor: pointer;
|
|
|
|
background: transparent;
|
2024-03-12 11:27:32 +00:00
|
|
|
color: ${dt('image.preview.indicator.color')};
|
2024-03-12 08:19:23 +00:00
|
|
|
transition: background-color ${dt('transition.duration')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
2024-04-10 06:16:00 +00:00
|
|
|
.p-image-preview:hover > .p-image-preview-mask {
|
2024-02-19 22:53:42 +00:00
|
|
|
opacity: 1;
|
|
|
|
cursor: pointer;
|
2024-03-12 11:27:32 +00:00
|
|
|
background: ${dt('image.preview.indicator.background')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-image-preview-icon {
|
|
|
|
width: 1.5rem;
|
|
|
|
height: 1.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-image-toolbar {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
display: flex;
|
|
|
|
z-index: 1;
|
|
|
|
padding: 1rem;
|
|
|
|
gap: 0.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-image-action {
|
|
|
|
display: inline-flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
2024-03-12 11:27:32 +00:00
|
|
|
color: ${dt('image.action.color')};
|
2024-02-19 22:53:42 +00:00
|
|
|
background: transparent;
|
|
|
|
width: 3rem;
|
2024-04-10 06:16:00 +00:00
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
border: 0 none;
|
|
|
|
cursor: pointer;
|
|
|
|
user-select: none;
|
2024-02-19 22:53:42 +00:00
|
|
|
height: 3rem;
|
|
|
|
border-radius: 50%;
|
|
|
|
outline-color: transparent;
|
2024-03-12 08:19:23 +00:00
|
|
|
transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, outline-color ${dt('transition.duration')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-image-action:hover {
|
2024-03-12 11:27:32 +00:00
|
|
|
color: ${dt('image.action.hover.color')};
|
|
|
|
background: ${dt('image.action.hover.background')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-image-action:focus-visible {
|
2024-03-12 08:19:23 +00:00
|
|
|
outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('focus.ring.color')};
|
|
|
|
outline-offset: ${dt('focus.ring.offset')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-image-action .p-icon {
|
|
|
|
font-size: 1.5rem;
|
|
|
|
width: 1.5rem;
|
|
|
|
height: 1.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-image-action.p-disabled {
|
|
|
|
pointer-events: auto;
|
|
|
|
}
|
|
|
|
|
2024-04-10 06:16:00 +00:00
|
|
|
.p-image-original {
|
2024-02-19 22:53:42 +00:00
|
|
|
transition: transform 0.15s;
|
|
|
|
max-width: 100vw;
|
|
|
|
max-height: 100vh;
|
|
|
|
}
|
|
|
|
|
2024-04-10 06:16:00 +00:00
|
|
|
.p-image-original-enter-active {
|
2024-02-19 22:53:42 +00:00
|
|
|
transition: all 150ms cubic-bezier(0, 0, 0.2, 1);
|
|
|
|
}
|
|
|
|
|
2024-04-10 06:16:00 +00:00
|
|
|
.p-image-original-leave-active {
|
2024-02-19 22:53:42 +00:00
|
|
|
transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
|
|
}
|
|
|
|
|
2024-04-10 06:16:00 +00:00
|
|
|
.p-image-original-enter-from,
|
|
|
|
.p-image-original-leave-to {
|
2024-02-19 22:53:42 +00:00
|
|
|
opacity: 0;
|
|
|
|
transform: scale(0.7);
|
|
|
|
}
|
|
|
|
`
|
|
|
|
};
|