update code samples
This commit is contained in:
parent
ddba29d562
commit
b98a7c7b8c
27
README.md
27
README.md
|
|
@ -4,28 +4,33 @@ A web component for drawing patterns with css.
|
|||
|
||||

|
||||
|
||||
## Example
|
||||
|
||||
include [css-doodle.js](css-doodle.js) in your html:
|
||||
|
||||
```html
|
||||
<css-doodle grid="5">
|
||||
<script src="./css-doodle.js"></script>
|
||||
```
|
||||
|
||||
drawing the above circles with css:
|
||||
|
||||
```html
|
||||
<css-doodle grid="6">
|
||||
:doodle {
|
||||
width: 50vh;
|
||||
height: 50vh;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
background: #f1ffd9;
|
||||
background: #fafff1;
|
||||
}
|
||||
|
||||
--size: @rand(200%);
|
||||
width: var(--size);
|
||||
height: var(--size);
|
||||
border-radius: 50%;
|
||||
background-color: hsla(
|
||||
@rand(100), 80%, 50%, @rand(.8)
|
||||
background: hsla(
|
||||
@rand(360), 80%, 50%, @rand(.8)
|
||||
);
|
||||
</css-doodle>
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
include css-doodle.js in your html:
|
||||
|
||||
```
|
||||
<script src="./css-doodle.js"></script>
|
||||
```
|
||||
|
|
|
|||
|
|
@ -12,19 +12,22 @@
|
|||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<css-doodle grid="5">
|
||||
:host {
|
||||
<css-doodle grid="6">
|
||||
:doodle {
|
||||
width: 50vh;
|
||||
height: 50vh;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
background: #f1ffd9;
|
||||
background: #fafff1;
|
||||
}
|
||||
|
||||
--size: @rand(200%);
|
||||
width: var(--size);
|
||||
height: var(--size);
|
||||
background: hsla(@rand(100), 80%, 50%, @rand(.8));
|
||||
border-radius: 50%;
|
||||
background: hsla(
|
||||
@rand(360), 80%, 50%, @rand(.8)
|
||||
);
|
||||
</css-doodle>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 9.0 KiB |
Loading…
Reference in New Issue