purecss-francine | CSS drawing in the style of an 18th-century oil painting | Animation library
kandi X-RAY | purecss-francine Summary
kandi X-RAY | purecss-francine Summary
HTML/CSS drawing in the style of an 18th-century oil painting. Hand-coded entirely in HTML & CSS.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of purecss-francine
purecss-francine Key Features
purecss-francine Examples and Code Snippets
Community Discussions
Trending Discussions on purecss-francine
QUESTION
How could I make my CSS drawings fluid, so that they would resize easily and could be used instead of an SVG image for a website and app? For instance, this smiley face drawing. Currently, the window cuts it off because it is set in absolute units. I've tried using relative units instead of pixels, but resizing just shifts all the elements of the image.
Is there a JS way of changing all units evenly to make three or four sizes of the drawing? Or a way to use variables to change every element while keeping them at the same ratios and spacing? This amazing painting seems to resize like I want mine to, but I can't tell what is making it responsive by looking over the code myself.
My example image:
...ANSWER
Answered 2019-Nov-16 at 07:18You can change all fixed px
units to %. First you need to define the base for width
and height
, and then you need to find the ratio between any stat and width
/ height
(padding-right
/ width
or padding-top
/ height
). In this case the width
and height
are both equal to 500px
, so that's make life easy.
How to calculate:
- The base value is 500 -
width
&height
for#head
. Don't change them for now. - Take a fixed value (
100px
), and calculate100 / 500 * 100
to find the percentage value. - Replace the fixed value with the result
20%
. - Run the code to see that everything is still in place.
- Repeat 2-4 all fixed units (except the head's width/height) were replace.
- Replace the head's
width
&height
values. I've usingvmin
values, you can control them from JS.
The result:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install purecss-francine
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page