Skip to content

Commit 7d724bf

Browse files
committed
Add dismissible info bar to Sophia page
1 parent 25fb06a commit 7d724bf

1 file changed

Lines changed: 70 additions & 5 deletions

File tree

docs/sophia.md

Lines changed: 70 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,48 @@ applies_to: both
1919
text-align: center;
2020
}
2121
.sophia-info-bar a { color: #f8a839; }
22+
.sophia-info-bar-inner {
23+
display: flex;
24+
align-items: center;
25+
justify-content: center;
26+
gap: 0.75rem;
27+
flex-wrap: wrap;
28+
}
29+
.sophia-info-bar-dismiss {
30+
flex-shrink: 0;
31+
background: rgba(255,255,255,0.12);
32+
border: 1px solid rgba(255,255,255,0.25);
33+
border-radius: 4px;
34+
color: rgba(255,255,255,0.85);
35+
cursor: pointer;
36+
font-size: 0.8rem;
37+
padding: 0.25rem 0.65rem;
38+
min-height: 2rem;
39+
min-width: 3rem;
40+
}
41+
.sophia-info-bar-dismiss:hover { background: rgba(255,255,255,0.22); color: #fff; }
42+
.sophia-info-bar-reopen {
43+
display: none;
44+
background: rgba(50, 50, 65, 0.92);
45+
backdrop-filter: blur(4px);
46+
border: none;
47+
border-radius: 0 0 8px 8px;
48+
box-shadow: 0 2px 8px rgba(0,0,0,0.4);
49+
color: rgba(255,255,255,0.8);
50+
cursor: pointer;
51+
font-size: 1rem;
52+
padding: 0.25rem 0.85rem 0.3rem;
53+
position: absolute;
54+
right: 1.5rem;
55+
z-index: 10;
56+
white-space: nowrap;
57+
line-height: 1;
58+
transition: color 0.15s, transform 0.15s;
59+
}
60+
.sophia-info-bar-reopen:hover {
61+
color: rgba(255,255,255,0.9);
62+
transform: translateY(1px);
63+
}
2264
.sophia-page-wrapper .iframe-parent {
2365
flex: 1;
2466
height: auto !important;
@@ -28,12 +70,35 @@ applies_to: both
2870
}
2971
</style>
3072

31-
<div class="sophia-page-wrapper">
32-
<div class="sophia-info-bar">
33-
You are chatting with a <strong>Sophia</strong> instance configured to answer questions about RESTHeart.
34-
Sophia is an AI platform by SoftInstigate, available as a managed cloud service or for on-premises deployment —
35-
<a href="/docs/cloud/sophia/">learn more</a>.
73+
<div class="sophia-page-wrapper" style="position:relative">
74+
<div class="sophia-info-bar" id="sophia-info-bar">
75+
<div class="sophia-info-bar-inner">
76+
<span>You are chatting with a <strong>Sophia</strong> instance configured to answer questions about RESTHeart.
77+
Sophia is an AI platform by SoftInstigate, available as a managed cloud service or for on-premises deployment —
78+
<a href="/docs/cloud/sophia/">learn more</a>.</span>
79+
<button class="sophia-info-bar-dismiss" id="sophia-info-bar-dismiss" aria-label="Dismiss">Got it</button>
80+
</div>
3681
</div>
82+
<button class="sophia-info-bar-reopen" id="sophia-info-bar-reopen" aria-label="Show info">&#x2139;</button>
83+
<script>
84+
(function() {
85+
var bar = document.getElementById('sophia-info-bar');
86+
var reopen = document.getElementById('sophia-info-bar-reopen');
87+
function dismiss() {
88+
bar.style.display = 'none';
89+
reopen.style.display = 'block';
90+
sessionStorage.setItem('sophia-info-bar-dismissed', '1');
91+
}
92+
function show() {
93+
bar.style.display = '';
94+
reopen.style.display = 'none';
95+
sessionStorage.removeItem('sophia-info-bar-dismissed');
96+
}
97+
if (sessionStorage.getItem('sophia-info-bar-dismissed')) { dismiss(); }
98+
document.getElementById('sophia-info-bar-dismiss').addEventListener('click', dismiss);
99+
reopen.addEventListener('click', show);
100+
})();
101+
</script>
37102

38103
<div class="iframe-parent m-0 p-0">
39104
<!-- set the --vh property to set the height of the iframe correctly on desktop and mobile screen

0 commit comments

Comments
 (0)