Взгляните на следующий пример:
var shadowDirection = 0;
var filters = [
'drop-shadow(8px 8px 10px red)',
'drop-shadow(28px 28px 10px red)',
'drop-shadow(-28px -28px 10px red)'
];
var currentFilter = 0;
function start() {
window.setInterval(runDemo, 1000);
}
function runDemo() {
shadowDirection += 45;
currentFilter = (currentFilter + 1) % filters.length;
shadowText.innerHTML = "Shadow Direction: " + shadowDirection % 360;
shadowText.style.filter = filters[currentFilter];
}
<body onload="start()">
<h1 id="shadowText" style="position: absolute; top: 25; left:25; padding: 10; filter: drop-shadow(8px 8px 10px red)">Shadow Direction: 0</h1>
</body>