Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 7b56d7d

Browse files
authored
UX: adjust artificat UI styles (#1240)
1 parent f40e094 commit 7b56d7d

File tree

2 files changed

+55
-28
lines changed

2 files changed

+55
-28
lines changed

assets/javascripts/discourse/components/ai-artifact.gjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export default class AiArtifactComponent extends Component {
123123
{{#unless this.requireClickToRun}}
124124
<div class="ai-artifact__footer">
125125
<DButton
126-
class="btn-flat btn-icon-text ai-artifact__expand-button"
126+
class="btn-transparent btn-icon-text ai-artifact__expand-button"
127127
@icon="discourse-expand"
128128
@label="discourse_ai.ai_artifact.expand_view_label"
129129
@action={{this.toggleView}}
Lines changed: 54 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,38 @@
1-
@keyframes slideUp {
1+
@keyframes remove {
22
to {
3-
transform: translateY(-100%);
3+
height: 0;
4+
overflow: hidden;
45
}
56
}
67

7-
@keyframes vanishing {
8+
@keyframes fade {
89
to {
9-
display: none;
10+
opacity: 0;
1011
}
1112
}
1213

1314
.ai-artifact__wrapper {
15+
height: 500px;
16+
padding-bottom: 2em;
17+
1418
iframe {
1519
width: 100%;
1620
height: calc(100% - 2em);
1721
}
18-
height: 500px;
19-
padding-bottom: 2em;
22+
23+
&:not(.ai-artifact__expanded) {
24+
iframe {
25+
box-shadow: var(--shadow-card);
26+
}
27+
}
2028
}
2129

2230
.ai-artifact__click-to-run {
2331
display: flex;
2432
justify-content: center;
2533
align-items: center;
2634
height: 100%;
35+
background: var(--primary-very-low);
2736
}
2837

2938
.ai-artifact__panel {
@@ -41,43 +50,68 @@ html.ai-artifact-expanded {
4150

4251
.ai-artifact__expand-button {
4352
margin-left: auto;
53+
padding-right: 0;
54+
55+
.d-icon {
56+
font-size: var(--font-down-1);
57+
}
4458
}
4559
}
4660

61+
.ai-artifact__panel--wrapper {
62+
opacity: 0;
63+
transition: opacity 0.5s ease-in-out;
64+
}
65+
4766
.ai-artifact__expanded {
67+
position: fixed;
68+
top: 0;
69+
left: 0;
70+
height: 100%;
71+
width: 100%;
72+
z-index: z("fullscreen");
73+
background-color: var(--secondary);
74+
4875
.ai-artifact__footer {
4976
display: none;
5077
}
5178

5279
.ai-artifact__panel--wrapper {
53-
position: fixed;
54-
top: 0;
80+
position: absolute;
81+
top: 2em;
5582
left: 2em;
5683
right: 2em;
5784
height: 2em;
5885
z-index: 1000000;
59-
animation: vanishing 0.5s 3s forwards;
86+
display: flex;
87+
justify-content: center;
88+
opacity: 1;
6089
}
6190

6291
.ai-artifact__panel {
6392
display: block;
64-
position: fixed;
65-
top: 0;
66-
left: 2em;
67-
right: 2em;
68-
height: 2em;
69-
transition: transform 0.5s ease-in-out;
70-
animation: slideUp 0.5s 3s forwards;
71-
background-color: var(--secondary-low);
93+
position: absolute;
94+
animation:
95+
fade 0.75s forwards,
96+
remove 1s forwards;
97+
animation-delay: 4s;
98+
background-color: var(--primary);
7299
opacity: 0.9;
100+
border-radius: var(--d-button-border-radius);
73101
transform: translateY(0);
102+
box-shadow: var(--shadow-card);
103+
font-size: var(--font-up-1);
104+
105+
&:hover {
106+
animation-play-state: paused;
107+
opacity: 1;
108+
}
74109

75110
button {
76-
width: 100%;
77-
text-align: left;
78111
box-sizing: border-box;
79-
justify-content: flex-start;
112+
justify-content: center;
80113
color: var(--secondary-very-high);
114+
margin: 0 auto;
81115

82116
&:hover {
83117
color: var(--secondary-very-high);
@@ -99,11 +133,4 @@ html.ai-artifact-expanded {
99133
bottom: 0;
100134
z-index: z("fullscreen");
101135
}
102-
position: fixed;
103-
top: 0;
104-
left: 0;
105-
height: 100%;
106-
width: 100%;
107-
z-index: z("fullscreen");
108-
background-color: var(--secondary);
109136
}

0 commit comments

Comments
 (0)