Skip to content

The Open Standard for Generative UI

1.5 KB
Raw Blame
@use "../../cssUtils.scss" as cssUtils;

.openui-image-block-wrapper {
  flex: 1 1 0;
  min-width: 0;
  min-height: 240px;
  max-height: 240px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  isolation: isolate;
  border-radius: cssUtils.$radius-2xl;
  padding: calc(cssUtils.$space-l - 2px) calc(cssUtils.$space-l + 2px);
  overflow: hidden;

  &::before {
    content: "";
    position: absolute;
    inset: -20px;
    background-image: var(--bg-image);
    background-size: 150%;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.2;
    filter: blur(12px);
    z-index: 0;
    border-radius: inherit;
  }

  &--mobile {
    height: auto;
    width: 100%;
    padding: 0;
  }

  &--error {
    visibility: hidden;
  }
}

.openui-image-block-image {
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  border: 4px solid cssUtils.$border-default;
  border-radius: cssUtils.$radius-l;
  position: relative;
  z-index: 1;

  &--mobile {
    border-radius: cssUtils.$radius-2xl;
    width: 100%;
    height: auto;
  }

  &--error {
    visibility: hidden;
  }
}

.openui-image-block-loader {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  border-width: 3px;
  border-style: solid;
  height: 24px;
  width: 24px;
  animation: openui-image-block-spin 1s linear infinite;
  border-radius: cssUtils.$radius-full;
  border-color: rgb(209, 213, 219);
  border-top-color: rgb(37, 99, 235);
  z-index: 2;
}

@keyframes openui-image-block-spin {
  to {
    transform: rotate(360deg);
  }
}