smooth-components 1.1.7 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/smooth-components.js +5 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,20 +35,20 @@ The `<Poster />` component is ideal for showcasing images like movie posters, ar
|
|
|
35
35
|
### Usage
|
|
36
36
|
|
|
37
37
|
```tsx
|
|
38
|
-
import { Poster } from
|
|
38
|
+
import { Poster } from 'smooth-components'
|
|
39
39
|
|
|
40
|
-
function
|
|
40
|
+
function Example() {
|
|
41
41
|
return (
|
|
42
42
|
<Poster
|
|
43
|
-
alt="
|
|
44
|
-
src="
|
|
43
|
+
alt="Taxi Driver"
|
|
44
|
+
src="./cyberpunk.webp"
|
|
45
45
|
styles={{
|
|
46
46
|
width: 240,
|
|
47
47
|
height: 360,
|
|
48
|
-
opacity: 0.95
|
|
48
|
+
opacity: 0.95
|
|
49
49
|
}}
|
|
50
50
|
/>
|
|
51
|
-
)
|
|
51
|
+
)
|
|
52
52
|
}
|
|
53
53
|
```
|
|
54
54
|
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.poster-container{position:relative;z-index:30;border-radius:2px;overflow:hidden;cursor:pointer;transform:translateY(0) scale(1);transition:all .4s cubic-bezier(.25,.46,.45,.94);border:18px solid;border-top-color:#1c1c1c;border-left-color:#181818;border-right-color:#0e0e0e;border-bottom-color:#0a0a0a;box-shadow:-1px -1px #ffffff12,1px 1px #00000080,0 2px 4px #0003,0 6px 12px #00000026,0 12px 24px #0000001f,0 20px 40px #0000001a,0 32px 64px #00000014}.poster-container:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:5;pointer-events:none;border-radius:1px;box-shadow:inset 0 3px 8px #0009,inset 0 -2px 6px #0006,inset 3px 0 8px #0006,inset -3px 0 8px #0006,inset 0 1px #000c}.poster-container:after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:20;pointer-events:none;background:linear-gradient(130deg,rgba(255,255,255,.14) 0%,rgba(255,255,255,.06) 12%,rgba(255,255,255,.01) 28%,transparent 45%,transparent 60%,rgba(0,0,0,.03) 100%),linear-gradient(to bottom,rgba(255,255,255,.06) 0%,transparent 20%),linear-gradient(to bottom,#b4dcdc05,#b4dcdc03);transition:all .4s cubic-bezier(.25,.46,.45,.94)}.poster-image{width:100%;height:100%;object-fit:cover;-webkit-user-select:none;user-select:none;pointer-events:none;display:block;position:relative;z-index:1;filter:contrast(.97) brightness(.98);transition:all .4s cubic-bezier(.25,.46,.45,.94)}.poster-image-glint{position:absolute;top:0;left:-120%;width:60%;height:100%;pointer-events:none;z-index:15;background:linear-gradient(105deg,transparent 20%,rgba(255,255,255,.15) 45%,rgba(255,255,255,.3) 50%,rgba(255,255,255,.15) 55%,transparent 80%);transform:skew(-18deg);transition:left .7s cubic-bezier(.25,.46,.45,.94)}.poster-container:hover{transform:scale(1.015) translateY(-4px);box-shadow:-1px -1px #ffffff1a,1px 1px #00000080,0 4px 8px #0003,0 8px 16px #00000026,0 16px 32px #0000001f,0 32px 64px #0000001a,0 48px 96px #00000014}.poster-container:hover:after{background:linear-gradient(125deg,rgba(255,255,255,.18) 0%,rgba(255,255,255,.08) 14%,rgba(255,255,255,.02) 30%,transparent 50%,transparent 65%,rgba(0,0,0,.04) 100%),linear-gradient(to bottom,rgba(255,255,255,.08) 0%,transparent 25%),linear-gradient(to bottom,#b4dcdc08,#b4dcdc04)}.poster-container:hover .poster-image{filter:contrast(1) brightness(1)}.poster-container:hover .poster-image-glint{left:140%}@media (min-width: 1024px){.poster-container{margin-bottom:0}}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
2
|
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
3
3
|
const m = 0.91, T = "auto", E = "auto", p = !0, h = (s) => {
|
|
4
|
-
const { alt: e, hasGlintEffect: o = p, src: c, styles: a } = s, {
|
|
4
|
+
const { alt: e, hasGlintEffect: o = p, src: c, styles: a } = s, {
|
|
5
|
+
opacity: i = m,
|
|
6
|
+
height: n = E,
|
|
7
|
+
width: r = T
|
|
8
|
+
} = a ?? {};
|
|
5
9
|
return /* @__PURE__ */ l(
|
|
6
10
|
"div",
|
|
7
11
|
{
|
package/package.json
CHANGED