UX: adjust artificat UI styles (#1240)

This commit is contained in:
Kris 2025-04-01 16:11:36 -04:00 committed by GitHub
parent f40e094945
commit 7b56d7d4fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 55 additions and 28 deletions

View File

@ -123,7 +123,7 @@ export default class AiArtifactComponent extends Component {
{{#unless this.requireClickToRun}} {{#unless this.requireClickToRun}}
<div class="ai-artifact__footer"> <div class="ai-artifact__footer">
<DButton <DButton
class="btn-flat btn-icon-text ai-artifact__expand-button" class="btn-transparent btn-icon-text ai-artifact__expand-button"
@icon="discourse-expand" @icon="discourse-expand"
@label="discourse_ai.ai_artifact.expand_view_label" @label="discourse_ai.ai_artifact.expand_view_label"
@action={{this.toggleView}} @action={{this.toggleView}}

View File

@ -1,22 +1,30 @@
@keyframes slideUp { @keyframes remove {
to { to {
transform: translateY(-100%); height: 0;
overflow: hidden;
} }
} }
@keyframes vanishing { @keyframes fade {
to { to {
display: none; opacity: 0;
} }
} }
.ai-artifact__wrapper { .ai-artifact__wrapper {
height: 500px;
padding-bottom: 2em;
iframe { iframe {
width: 100%; width: 100%;
height: calc(100% - 2em); height: calc(100% - 2em);
} }
height: 500px;
padding-bottom: 2em; &:not(.ai-artifact__expanded) {
iframe {
box-shadow: var(--shadow-card);
}
}
} }
.ai-artifact__click-to-run { .ai-artifact__click-to-run {
@ -24,6 +32,7 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: 100%; height: 100%;
background: var(--primary-very-low);
} }
.ai-artifact__panel { .ai-artifact__panel {
@ -41,43 +50,68 @@ html.ai-artifact-expanded {
.ai-artifact__expand-button { .ai-artifact__expand-button {
margin-left: auto; margin-left: auto;
padding-right: 0;
.d-icon {
font-size: var(--font-down-1);
}
} }
} }
.ai-artifact__panel--wrapper {
opacity: 0;
transition: opacity 0.5s ease-in-out;
}
.ai-artifact__expanded { .ai-artifact__expanded {
position: fixed;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: z("fullscreen");
background-color: var(--secondary);
.ai-artifact__footer { .ai-artifact__footer {
display: none; display: none;
} }
.ai-artifact__panel--wrapper { .ai-artifact__panel--wrapper {
position: fixed; position: absolute;
top: 0; top: 2em;
left: 2em; left: 2em;
right: 2em; right: 2em;
height: 2em; height: 2em;
z-index: 1000000; z-index: 1000000;
animation: vanishing 0.5s 3s forwards; display: flex;
justify-content: center;
opacity: 1;
} }
.ai-artifact__panel { .ai-artifact__panel {
display: block; display: block;
position: fixed; position: absolute;
top: 0; animation:
left: 2em; fade 0.75s forwards,
right: 2em; remove 1s forwards;
height: 2em; animation-delay: 4s;
transition: transform 0.5s ease-in-out; background-color: var(--primary);
animation: slideUp 0.5s 3s forwards;
background-color: var(--secondary-low);
opacity: 0.9; opacity: 0.9;
border-radius: var(--d-button-border-radius);
transform: translateY(0); transform: translateY(0);
box-shadow: var(--shadow-card);
font-size: var(--font-up-1);
&:hover {
animation-play-state: paused;
opacity: 1;
}
button { button {
width: 100%;
text-align: left;
box-sizing: border-box; box-sizing: border-box;
justify-content: flex-start; justify-content: center;
color: var(--secondary-very-high); color: var(--secondary-very-high);
margin: 0 auto;
&:hover { &:hover {
color: var(--secondary-very-high); color: var(--secondary-very-high);
@ -99,11 +133,4 @@ html.ai-artifact-expanded {
bottom: 0; bottom: 0;
z-index: z("fullscreen"); z-index: z("fullscreen");
} }
position: fixed;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: z("fullscreen");
background-color: var(--secondary);
} }