Add level of rotate config
This commit is contained in:
parent
ff6c1bae2e
commit
269e147c91
1 changed files with 12 additions and 4 deletions
|
@ -1,9 +1,17 @@
|
||||||
/// @ 0.12.4
|
/// @ 0.12.4
|
||||||
### {
|
### {
|
||||||
name: "Spiteful Rotation"
|
name: "Spiteful Rotation"
|
||||||
version: "0.0.1"
|
version: "0.1.0"
|
||||||
author: "kio, deilann, puppygirlhornypost"
|
author: "kio, deilann, puppygirlhornypost"
|
||||||
description: "A port of puppygirlhornypost's spiteful rotation script in c++, now in a misskey plugin!"
|
description: "A port of puppygirlhornypost's spiteful rotation script in c++, now in a misskey plugin!"
|
||||||
|
config: {
|
||||||
|
rotateValue: {
|
||||||
|
type: "number"
|
||||||
|
label: "Level of rotate"
|
||||||
|
description: "How hard do you need your text to rotate back and forth?"
|
||||||
|
default: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Plugin:register_post_form_action('Rotate', @(note, rewrite) {
|
Plugin:register_post_form_action('Rotate', @(note, rewrite) {
|
||||||
|
@ -12,8 +20,8 @@
|
||||||
let final = []
|
let final = []
|
||||||
for let i, array.len {
|
for let i, array.len {
|
||||||
var rotate = 0
|
var rotate = 0
|
||||||
if i%2 == 1 rotate = 1
|
if i%2 == 1 rotate = Plugin:config["rotateValue"]
|
||||||
else rotate = -1
|
else rotate = Plugin:config["rotateValue"] * -1
|
||||||
final.push(`$[rotate.deg={rotate} {array[i]}]`)
|
final.push(`$[rotate.deg={rotate} {array[i]}]`)
|
||||||
}
|
}
|
||||||
rewrite('text', `{final.join(" ")}`)
|
rewrite('text', `{final.join(" ")}`)
|
||||||
|
|
Loading…
Add table
Reference in a new issue