@@ -13,6 +13,9 @@ import '@vaadin/vaadin-lumo-styles/style.js';
13
13
import '@vaadin/vaadin-material-styles/color' ;
14
14
import '@vaadin/vaadin-material-styles/typography' ;
15
15
16
+ // Import banner image
17
+ import tocBanner from './images/toc-banner.webp' ;
18
+
16
19
if ( ! localStorage . getItem ( 'vaadin.docsApp.preferredExample' ) ) {
17
20
localStorage . setItem ( 'vaadin.docsApp.preferredExample' , 'Java' ) ;
18
21
}
@@ -151,3 +154,91 @@ class Footer extends LitElement {
151
154
}
152
155
153
156
customElements . define ( 'dspublisher-article-footer' , Footer ) ;
157
+
158
+ class TocFooter extends LitElement {
159
+ createRenderRoot ( ) {
160
+ return this ;
161
+ }
162
+
163
+ render ( ) {
164
+ return html `
165
+ < style >
166
+ .toc-footer {
167
+ margin-top : 2rem ;
168
+ width : 11.25rem ;
169
+ }
170
+
171
+ .toc-footer--img img {
172
+ margin-top : 1rem ;
173
+ width : 100% ;
174
+ height : auto;
175
+ border-radius : 0.25rem ;
176
+ }
177
+
178
+ .toc-footer--content {
179
+ line-height : 1.5 ;
180
+ font-size : var (--docs-font-size-2xs );
181
+ color : var (--docs-secondary-text-color );
182
+ }
183
+
184
+ .toc-footer--heading {
185
+ font-weight : 600 ;
186
+ color : var (--docs-heading-text-color ) !important ;
187
+ }
188
+
189
+ .toc-footer > a ::after {
190
+ content : none !important ;
191
+ }
192
+
193
+ /* Hide the footer on mobile when the TOC is closed */
194
+ @media screen and (max-width : 65rem ) {
195
+ .toctoggle : not ([open ]) + .toc > dspublisher-toc-footer {
196
+ display : none;
197
+ }
198
+
199
+ .toc-footer {
200
+ width : auto;
201
+ display : flex;
202
+ flex-direction : row-reverse;
203
+ align-items : flex-start;
204
+ gap : 1rem ;
205
+ justify-content : flex-end;
206
+ }
207
+
208
+ .toc-footer--img {
209
+ flex-shrink : 0 ;
210
+ width : 4rem ;
211
+ }
212
+
213
+ .toc-footer--img img {
214
+ margin-top : 0 ;
215
+ width : 100% ;
216
+ height : auto;
217
+ border-radius : 0.25rem ;
218
+ }
219
+
220
+ .toc-footer--content {
221
+ flex : 1 ;
222
+ padding-top : 0.25rem ;
223
+ }
224
+ }
225
+ </ style >
226
+
227
+ < div class ="toc-footer ">
228
+ < a href ="https://vaadin.com/learn/training " class ="toc-footer--link ">
229
+
230
+ < div class ="toc-footer--heading "> Video tutorial</ div >
231
+ < div class ="toc-footer--content ">
232
+ Learn Vaadin fundamentals through short video tutorials.
233
+ </ div >
234
+
235
+ < div class ="toc-footer--img ">
236
+ < img src =${ tocBanner . src } alt ="Learn by watching"
237
+ </ div >
238
+ </ a >
239
+ </ div>
240
+ ` ;
241
+ }
242
+ }
243
+
244
+ customElements . define ( 'dspublisher-toc-footer' , TocFooter ) ;
0 commit comments