Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"MD013": false,
"MD033": false
}
101 changes: 77 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,107 @@
<h1 align="center"><img alt="Transpose" src="assets/transpose.png" height="150px"/></h1>

<div align="center">
<img alt="Transpose" src="https://github.com/mrstev3n/Transpose-plugin/blob/master/assets/transpose.png" height="150px" />
A simple Figma plugin to flip any layer's size.
</div>

<div align="center">
A simple figma plugin to flip any layers size.

</br>

![GitHub last commit](https://img.shields.io/github/last-commit/mrstev3n/Transpose-plugin?color=blue&style=plastic)
![Repo size](https://img.shields.io/github/repo-size/mrstev3n/Transpose-plugin?color=orange&style=plastic)

</div>

## Installation

Install the plugin and show some love, directly from the Figma Community
Click below to install directly from the Figma community

<a href="https://www.figma.com/community/plugin/1009022712992810988/Transpose"><img alt="Install Plugin" src="https://img.shields.io/endpoint?url=https://figma-plugin-badges.vercel.app/api/installs/1009022712992810988"/></a>
<a href="https://www.figma.com/community/plugin/1009022712992810988/Transpose"><img alt="Install Plugin" src="https://img.shields.io/endpoint?url=https://figma-plugin-badges.vercel.app/api/installs/1009022712992810988" height=24/></a>

## Usage

Select One (1) or more layers and run the plugin.
### 1. Transpose > Each one

Select one or more layers and run the plugin. Each layer will be resized individually.

!["Layer flip"](assets/banner.gif)

</br>

### 2. Transpose > Grouped

Select multiple layers and choose this option to resize them as a group. (Feature coming soon)

</br>

> #### Tips: Launch plugin actions with custom keyboard shortcuts
>
> For **Mac users**, it is possible to natively associate a keyboard shortcut to your Figma plugin from settings.
> - Learn more in this [YouTube video](https://www.youtube.com/watch?v=r-6q1AJNeTQ) or use
> [this method](https://www.youtube.com/watch?v=hkbTDbXc5Ng) for **Windows users**.

![](https://github.com/mrstev3n/Transpose-plugin/blob/master/assets/banner.gif)
## Object handled

Lil typo in the GIF 😅 : Read "Width" instead of "Weight" and "Transposition Done" instead of "Transpisition Done"
- RECTANGLE
- ELLIPSE
- POLYGON
- TEXT
- SHAPE_WITH_TEXT
- GROUP
- FRAME
- COMPONENT/ INSTANCE
- LINE (New: special handling to preserve the central position)

#### ProTip : Use a custom keyboard to lauch the plugin
## Support

## Contributing
Do you find this plugin useful? </br> Please consider making a donation to support 🙏🏼

Contributions are welcomed, feel free to make a pull request or create an issue
<p>
<a href="https://www.buymeacoffee.com/mrstev3n"><img alt="Buy Me A Coffee" src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" height=32></a>
<a href="https://liberapay.com/mrstev3n/"><img alt="Liberapay" src="https://img.shields.io/badge/Liberapay-F6C915?style=flat&logo=liberapay&logoColor=black" height=32></a>
</p>

## Code

### Quick Setup

- Clone the repository.
- `npm install` installs all the dependencies.
- `npm run build` builds and bundles the plugin.
- Import the manifest into Figma and test.

### Contribution

Contributions are welcome. Feel free to make a pull request or create an issue.

[![GitHub pull-requests](https://img.shields.io/github/issues-pr/mrstev3n/Transpose-plugin.svg)](https://GitHub.com/mrstev3n/Transpose-plugin/pull/)
[![GitHub issues](https://img.shields.io/github/issues/mrstev3n/Transpose-plugin.svg)](https://GitHub.com/mrstev3n/Transpose-plugin/issues/)

## Development
## Credits and Thanks

V2 - Maker: [@mrstev3n](https://github.com/mrstev3n),
V2 - Tester: [@rickfaf](https://github.com/rickfaf)

Install the packages
```
npm i
```
- Plugin with parameters: Transpose, each one | grouped

Run the plugin in dev mode
```
npx webpack --mode=development --watch
```
V1 - Maker: [@mrstev3n](https://github.com/mrstev3n)

Build for production
```
npx webpack --mode=production
```
- Run-once plugin with simple flip action

Big thanks to [@boussarilatif](https://github.com/boussarilatif) & [@rickfaf](https://github.com/rickfaf) for support, testing, and code snippets </br> useful for the proper functioning of the plugin.

</br>

## Other Links

<p>
<a href="https://figma.com/@steven"><img src="https://img.shields.io/badge/figma-%23F24E1E.svg?style=for-the-badge&logo=figma&logoColor=white" height=24></a>
<a href="https://twitter.com/mrstev3n"><img src="https://img.shields.io/badge/twitter-%231DA1F2.svg?&style=for-the-badge&logo=twitter&logoColor=white" height=24></a>
</p>

## License

© 2021 Steven Houessou-adin

[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/mrstev3n/Transpose-plugin/blob/master/LICENSE)

3 changes: 0 additions & 3 deletions code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ function startPluginWithParameters(parameters: ParameterValues): string {

// Group & Flip selected layers W & H



break;
default:
return;
Expand All @@ -99,7 +97,6 @@ function startPluginWithParameters(parameters: ParameterValues): string {
node.type === "POLYGON" ||
node.type === "TEXT" ||
node.type === "SHAPE_WITH_TEXT" ||
node.type === "COMPONENT" ||
node.type === "GROUP")
)
}
13 changes: 9 additions & 4 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@
"main": "code.js",
"editorType": [
"figma",
"figjam" ],
"parameterOnly": true,
"figjam"
],
"documentAccess": "dynamic-page",
"networkAccess": {
"allowedDomains": ["none"]
},
"parameters": [
{
"name": "Type",
"key": "type",
"description": "Chose a type of transpose",
"description": "Choose a type of transpose",
"allowFreeform": false
}
]
],
"parameterOnly": true
}