Отсканируй на iPhone, чтобы установить
# Tilt Scroll
Share a web page from Safari to this Shortcut and it will allow you to tilt your device towards you or away from you to scroll up and down within the viewport.
Most iPhones shouldn't have a problem. Glitchy on my iPad Air.
With this initial release, refresh the page to stop the script.
#### TODO
- Add function to stop the script
- Refine variable speed
Что нового
Версия 1.0
First release
Что делает
Действий: 3-
CommentThis is an initial release. Only Safari is supported through the Shortcut. /u/dialup_ on reddit. @canibeanartist on RoutineHub, Instagram, Snapchat, Twitter.
-
Run JavaScript on Web Page
-
Stop This Shortcut
Посмотреть как код
Все действия этой команды, записанные на Cherri — языке программирования для приложения «Быстрые команды». Отлично подходит, чтобы разобраться, как она работает.
#include 'actions/web'
#define color blue
#define glyph moveArrow
/*
This is an initial release. Only Safari is supported through the Shortcut.
/u/dialup_ on reddit.
@canibeanartist on RoutineHub, Instagram, Snapchat, Twitter.
*/
runJavaScriptOnWebpage("const handleOrientation = event => {\nconst x = event.beta;\n\n if (x < 37 && x > 23) return;\n \n if (x > 37 && x <= 45) {\n window.scrollBy(0, 1);\n } else if (x > 45 && x <= 50) {\n window.scrollBy(0, 2);\n } else if (x > 50) {\n window.scrollBy(0, 4);\n } else {\n window.scrollBy(0, -2);\n }\n};\n\nwindow.addEventListener(\"deviceorientation\", handleOrientation);\n\ncompletion();")
stop()
Открыть в Cherri Playground
Декомпилировано с помощью cherri 2.3.0 (GPL-2.0). Перед компиляцией могут понадобиться небольшие исправления.
Оценки и отзывы
Написать отзыв–
из 5
★★★★★
★★★★
★★★
★★
★
0 ratings
Пока нет отзывов. Поделись мнением первым!
Реклама
Ещё от canibeanartist
Вам также может понравиться
Реклама