![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
= MagicDoor Generator
Generates custom button images with RMagick using the famous {sliding doors css tehnique}[http://www.alistapart.com/articles/slidingdoors].
== A brief introduction
While it can be argued that this functionality is being preceded by CSS 3, this code provides a happy crossbrowser experience, backed by the ability of using copyrighted fonts.
The script works by splitting a large wide image into two narrow ones that accomodate the length of a provided text. The location where the split ocurrs can be specified as an optional parameter.
If you're using rails be sure to check out the {custom helpers}[http://github.com/viseztrance/magic_door_helpers].
== Generating buttons
Bellow you'll find a simple example of creating an image button:
options = { :text => "Please click me" :image => "wide-button-template.png" :file_name => "click-me.png", :css => "color: #333; font-size: 25" }
file = MagicDoor.new(options) file.save
You may set defaults in order to make subsequent calls simpler:
MagicDoor.defaults.merge!({ :source_path => "/project/path/buttons", :destination_path => "/project/path/buttons/cache", :split_at => 11, :css => "padding: 10; font-weight: bold; font-size: 14; color: #fff; text-align: center; text-shadow: #cecefe 0 1; font: '/project/path/fonts/MyriadPro-Semibold.otf" })
== Limitations
All CSS sizes are calculated in pixels, so you should not add any measurement units after the numbers.
The padding property does not affect the top and bottom region.
Parsing the CSS and mapping it to RMagick is somewhat tendious, as such there are only a few css properties supported. Please consult the docs for a complete list.
== Command Line
You can run MagicDoor from the command line:
$ magic-door -t "hello world" -i "/home/daniel/Desktop/button.png" -f "/home/daniel/hello.png"
== Source code
The source code is hosted on Github: http://github.com/viseztrance/magic_door
To get MagicDoor from source:
git clone git@github.com:viseztrance/magic_door.git
== Acknowledgements
I would like to thank {OkapiStudio}[http://okapistudio.com] - my employer for allowing me to share this code.
== License
This package is licensed under the MIT license and/or the Creative Commons Attribution-ShareAlike.
FAQs
Unknown package
We found that magic_door demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.