It’s a common practice to use images to improve the overall look and feel of your web pages. Many web sites use image slide shows to show relevant images for the content displayed in the web page. An example implementation of the same can be found
here on W3Schools website.
In this blog we will discuss how we can use similar functionality to improve the aesthetic appeal of your dashboard. We discuss two approaches, one using standard SAP Lumira Designer components and one using CSS animation effect.
Using SAP Lumira Designer standard components:
Using standard CSS animations
- To avoid the network traffic that’s generated everytime the image changes we use CSS animations to achieve similar functionality
- Create another SAP Lumira Designer application and create the structure as seen below
- Now create a CSS file with the below content and attach it to the applications Custom CSS property
#PNL_CASSEROLE_panel1{
overflow: hidden !important;
margin: auto !important;
}
.slideshow-container {
transition: 1s ease;
overflow: visible !important;
}
.slide {
animation: slide 24s ease infinite;
}
@keyframes slide {
0% {
transform: translateY(0px);
}
15% {
transform: translateY(0px);
}
30% {
transform: translateY(300px);
}
45% {
transform: translateY(300px);
}
60% {
transform: translateY(600px);
}
75% {
transform: translateY(600px);
}
90% {
transform: translateY(900px);
}
99% {
transform: translateY(900px);
}
100% {
transform: translateY(0);
}
}
- Assign slideshow-container slide as the CSS Class to the Panel PNL_CASSROLE_CONTAINER
- Set the image properties as below
- Basically we are arranging the images one above the other in the Panel and showing the portion of each image one after another using the transform effect
- Lastly make a note of the overflow and margin override that has been specified for the Panel container in the CSS file using the Panel ID identifier
#PNL_CASSEROLE_panel1{
overflow: hidden !important;
margin: auto !important;
}
- Its important to have the Panel ID correctly mentioned in the CSS file, make sure you update this if you are using a different Panel ID
- Now launch the application and watch the pages slide after the time interval specified in the CSS animation property
- This approach doesnt generate the additional postback calls that are generated in the previous approach
The CSS approach works in Chrome, IE 11 as well as Edge browser. Do let me know what do you think of these options or if you have trouble setting this up.