I asked myself the same question. I am not an expert on this topic at all, but I had the following thought: physically, one point of the figure should lead to a circular (or elliptical) translucent shadow. Thus, the entire pattern, consisting of several points, should lead to a combination of many such circular shadows.
So, I drew a small shadow in Photoshop (brush, size 7, opacity 33%, color # 3b3b3b). This is almost invisible:

Then I wrote a little HTML with Javascript to try and see how it looks (definitely not an ideal technique :-):
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Title</title> <script type="text/javascript" language="javascript"> function pageload() { var drawingContainerElem = document.getElementById("drawing-container"); var shadowContainerElem = document.getElementById("shadow-container"); this.drawDot = function(x, y) { var imgElem = document.createElement("img"); imgElem.style.left = x + "px"; imgElem.style.top = y + "px"; imgElem.src = "blue-dot.png"; drawingContainerElem.appendChild(imgElem); } this.drawShadow = function(x, y) { var imgElem = document.createElement("img"); imgElem.style.left = x + "px"; imgElem.style.top = y + "px"; imgElem.src = "soft-shadow.png"; shadowContainerElem.appendChild(imgElem); } this.drawDotAndShadow = function(x, y) { drawShadow(x - 5, y - 1); drawDot(x, y); } for (var x = 50; x < 70; x ++) { for (var y = 50; y < 58; y ++) { drawDotAndShadow(x, y); } } for (var x = 0; x < 15; x ++) { for (var y = 0; y < x; y ++) { drawDotAndShadow(69 + 15 - x, 54 + y); drawDotAndShadow(69 + 15 - x, 54 - y); } } } </script> <style type="text/css"> #drawing-container { position: absolute; left: 2em; top: 2em; width: 400px; height: 400px; z-index: 2; } #shadow-container { position: absolute; left: 2em; top: 2em; width: 400px; height: 400px; z-index: 1; } #drawing-container img { position: absolute; } #shadow-container img { position: absolute; } </style> </head> <body onload="javascript:pageload()"> <div id="drawing-container"></div> <div id="shadow-container"></div> </body> </html>
This is the result:

There are probably many opportunities for optimization, and, of course, you would not do it with javascript this way ... Maybe you can find a way to render efficiently on the iPhone? If so, let me know!
Possible improvements:
- Make the center of the shadow circle darker (more opacity) and the rest lighter (less opacity) to achieve the main shadow.
- Scale the shadow: make it a little smaller to achieve the effect of depth.
Chris lercher
source share