-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: test bindings on x86_64-unknown-linux-musl
```bash Error: Error relocating /build/resvgjs.linux-x64-musl.node: mprotect: initial-exec TLS resolves to dynamic definition in /build/resvgjs.linux-x64-musl.node › Object.<anonymous> (js-binding.js:175:31) › Module._compile (node_modules/pirates/lib/index.js:117:24) ✘ __test__/index.spec.ts exited with a non-zero exit code: 1 ```
- Loading branch information
Showing
6 changed files
with
180 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
:root { | ||
--w: 0px; | ||
--resizer-width: 16px; | ||
--line-width: 3px; | ||
--scale: 60; | ||
} | ||
|
||
|
||
.slider { | ||
/* flex: 1; */ | ||
max-width: 100%; | ||
container-type: inline-size; | ||
display: grid; | ||
grid-template-columns: auto 1fr; | ||
overflow: hidden; | ||
outline: 3px dashed lightseagreen; | ||
} | ||
|
||
.slide { | ||
position: relative; | ||
} | ||
|
||
.slide-start .img { | ||
left: 0; | ||
} | ||
|
||
.slide-end { | ||
overflow: hidden; | ||
} | ||
|
||
.slide-end .img { | ||
right: 0; | ||
} | ||
|
||
.slider-bar { | ||
overflow: hidden; | ||
/* 可拖动的最大宽度 */ | ||
max-width: calc(100cqw + var(--line-width)); | ||
clip-path: inset(0 0 0 calc(100% - var(--resizer-width)) ); | ||
|
||
animation: init-size 2s linear(0 0%, 0.109 6.67%, 0.221 9.47%, 0.361 12.27%, 0.501 13.87%, 0.621 15.07%, 0.729 16.67%, 0.821 18.27%, 0.902 21.42%, 0.962 23.76%, 1.008 26.1%, 1.041 28.7%, 1.055 30.3%, 1.064 32.2%, 1.069 34.1%, 1.07 36%, 1.061 40.5%, 1.015 53.4%, 1.006 57.4%, 0.999 61.6%, 0.995 71.2%, 1 100%); | ||
/* animation: init-size 1s ease-in; */ | ||
|
||
border: none; | ||
background: none; | ||
outline: none; | ||
user-select: none; | ||
/* 隐藏 Firefox 中的 resizer */ | ||
opacity: 0; | ||
|
||
position: relative; | ||
z-index: 99; | ||
|
||
/* 父元素固定高度时 */ | ||
top: 0; | ||
/* 初始宽度 */ | ||
width: 50cqw; | ||
height: var(--resizer-width); | ||
transform: translateX(calc( var(--resizer-width) / 2)) scaleY(var(--scale)); | ||
resize: horizontal; | ||
} | ||
|
||
::-webkit-resizer { | ||
background: none; | ||
} | ||
|
||
/* 拖动手柄 */ | ||
.slide:first-of-type::before { | ||
animation: fadeIn .38s 1.1s both; | ||
|
||
content: ''; | ||
pointer-events: none; | ||
position: absolute; | ||
right: 0; | ||
z-index: 2048; | ||
height: 22px; | ||
width: 30px; | ||
border-radius: 999px; | ||
top: 50%; | ||
transform: translate(50%, -50%) scale(1); | ||
background: url("https://codyhouse.co/demo/image-comparison-slider/img/cd-arrows.svg") no-repeat center center; | ||
|
||
-webkit-backdrop-filter: blur(6px); | ||
backdrop-filter: blur(6px); | ||
border: 2px solid rgba(255, 255, 255, .6); | ||
background-color: rgba(0, 0, 0, 0.2); | ||
box-shadow: rgba(0, 0, 0, 0.35) 0px 0px 4px; | ||
transition: border-color .2s, box-shadow .2s; | ||
} | ||
|
||
.slide:first-of-type:hover::before { | ||
border-color: rgba(255, 255, 255, 1); | ||
box-shadow: rgba(0, 0, 0, 0.4) 0px 0px 5px; | ||
} | ||
|
||
/* 中间的分割线 */ | ||
.slide:first-of-type::after { | ||
content: ''; | ||
position: absolute; | ||
right: 0; | ||
top: 0; | ||
transform: translate(50%, 0); | ||
z-index: 1024; | ||
width: var(--line-width); | ||
height: 100%; | ||
background-color: rgba(255, 255, 255, .8); | ||
pointer-events: none; | ||
transition: background-color .2s, box-shadow .2s; | ||
} | ||
|
||
.slide:first-of-type:hover::after { | ||
background-color: rgba(255, 255, 255, 1); | ||
box-shadow: rgba(0, 0, 0, 0.35) 0px 0px 4px; | ||
} | ||
|
||
.slider .img { | ||
max-width: 100cqw; | ||
position: absolute; | ||
top: 50%; | ||
transform: translateY(-50%); | ||
right: 0; | ||
} | ||
|
||
@keyframes init-size { | ||
0% { | ||
width: 0; | ||
} | ||
} | ||
@keyframes fadeIn { | ||
0% { | ||
opacity: 0; | ||
transform: translate(50%, -50%) scale(0); | ||
} | ||
} |
Binary file not shown.