开发者

Ever-expanding beam of light in background

开发者 https://www.devze.com 2023-02-21 22:54 出处:网络
I have a webpage, the background for which is going to be a flashlight. Is it possible to draw the flashlight so that the beam (a piece-of-pie shape) will expand, no matter the size of the user\'s bro

I have a webpage, the background for which is going to be a flashlight. Is it possible to draw the flashlight so that the beam (a piece-of-pie shape) will expand, no matter the size of the user's browser? For example (love that ascii art):

                      /
                    /
                  /
                /
 ________/ |  /
|     _    |/
|________  |\
         \_|  \
                \
                  \开发者_如何学编程
                    \
                      \

With the rays expanding until they hit the side of the viewport.

I don't want to use a simple image because it will be a fixed size. I was also thinking of using a Javascript drawing library like Raphael, but I don't know if there's a better way.


You could use an oversized background image, center it on the element and if they use an extremely large screen the effect will still work.

0

精彩评论

暂无评论...
验证码 换一张
取 消