💝 Smooth animation

This commit is contained in:
ful1e5 2021-02-02 17:54:11 +05:30
parent e71b23738f
commit e4aa2ccbee
4 changed files with 17 additions and 13 deletions

View file

@ -108,7 +108,7 @@ const main = async () => {
const { data: imgNData } = PNG.sync.read(imgN);
const diff = Pixelmatch(img1Data, imgNData, null, width, height, {
threshold: 0.2,
threshold: 0.12,
});
if (diff <= 100) {

View file

@ -10,7 +10,7 @@ AUTHOR = "Kaiz Khatri"
URL = "https://github.com/ful1e5/apple_cursor"
# XCursor
X_DELAY: int = 5
X_DELAY: int = 10
X_SIZES: List[Tuple[int, int]] = [
(22, 22),
(24, 24),
@ -28,7 +28,7 @@ X_SIZES: List[Tuple[int, int]] = [
# Windows Cursor
WIN_DELAY = 3
WIN_DELAY = 1
CANVAS_SIZE = (32, 32)
SIZE = (24, 24)
@ -91,7 +91,7 @@ WIN_CURSORS_CFG: Dict[str, Dict[str, str]] = {
# Static
#
"right_ptr.png": {"to": "Alternate", "position": "top_left"},
"cross.png": {"to": "Cross"},
"cross.png": {"to": "Cross", "size": (32, 32)},
"left_ptr.png": {"to": "Default", "position": "top_left"},
"bottom_left_corner.png": {"to": "Diagonal_1"},
"bottom_right_corner.png": {"to": "Diagonal_2"},

View file

@ -36,7 +36,7 @@ def xbuild(bitmaps_dir: LikePath, x_out_dir: Path) -> None:
with CursorAlias.from_bitmap(png, hotspot) as alias:
x_cfg = alias.create(X_SIZES, delay)
print(f"Building {x_cfg.stem} XCursor...")
print(f"Building '{x_cfg.stem}' XCursor...")
XCursor.create(x_cfg, x_out_dir)
add_missing_xcursor(x_out_dir / "cursors")
@ -67,11 +67,12 @@ def wbuild(bitmaps_dir: LikePath, win_out_dir: Path) -> None:
size = item["size"]
win_key = item["win_key"]
canvas_size = item["canvas_size"]
win_delay = item["win_delay"]
win_cfg = alias.reproduce(size, canvas_size, position, delay=3).rename(
win_key
)
print(f"Building {win_cfg.stem} Windows Cursor...")
win_cfg = alias.reproduce(
size, canvas_size, position, delay=win_delay
).rename(win_key)
print(f"Building '{win_cfg.stem}' Windows Cursor...")
WindowsCursor.create(win_cfg, win_out_dir)
WindowsPackager(win_out_dir, THEME_NAME, COMMENT, AUTHOR, URL)
@ -92,9 +93,12 @@ def build(bitmaps_dir: LikePath, x_out_dir: Path, win_out_dir: Path) -> None:
size = item["size"]
win_key = item["win_key"]
canvas_size = item["canvas_size"]
win_delay = item["win_delay"]
win_cfg = alias.reproduce(size, canvas_size, position, delay=3).rename(win_key)
print(f"Building {win_cfg.stem} Windows Cursor...")
win_cfg = alias.reproduce(size, canvas_size, position, delay=win_delay).rename(
win_key
)
print(f"Building '{win_cfg.stem}' Windows Cursor...")
WindowsCursor.create(win_cfg, win_out_dir)
config = get_config(bitmaps_dir)
@ -107,7 +111,7 @@ def build(bitmaps_dir: LikePath, x_out_dir: Path, win_out_dir: Path) -> None:
with CursorAlias.from_bitmap(png, hotspot) as alias:
x_cfg = alias.create(X_SIZES, delay)
print(f"Building {x_cfg.stem} XCursor...")
print(f"Building '{x_cfg.stem}' XCursor...")
XCursor.create(x_cfg, x_out_dir)
if item.get("win_key"):

View file

@ -4,7 +4,7 @@
</g>
<g>
<animateTransform attributeName="transform" type="rotate" from="0 100 100" to="360 100 100" additive="sum"
begin="0s" dur="1.2s" repeatCount="indefinite" />
begin="0s" dur="0.6s" repeatCount="indefinite" />
<path
d="M48.8356 150.752C35.8793 137.872 28.1997 119.687 28.1997 100.06C28.1997 93.609 29.0651 87.3584 30.6869 81.416C30.6937 81.412 30.7004 81.4081 30.7072 81.4041C54.815 67.2655 86.0938 75.4985 100.013 99.9873C72.506 99.9873 49.3739 122.926 48.8356 150.752Z"
fill="url(#paint0_linear)" />

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Before After
Before After