Skip to content

Commit

Permalink
Added a bunch of stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
larz0 committed Aug 21, 2013
0 parents commit abaec0b
Show file tree
Hide file tree
Showing 7 changed files with 201 additions and 0 deletions.
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2013 @larz. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Bottom Keyframes

This is a [Brackets](http://brackets.io) extension that allows you to generator keyframes in a visual way.

![Bottom Keyframes Screenshot](http://f.cl.ly/items/1W1r2z072R07140c430C/bottom-bezier.png)

### Installation

* Select **File > Extension Manager...** (or click the "lego brick" icon in the toolbar)
* Click **Install from URL...**
* Enter the url of this repo: https://github.com/larz0/bottom-keyframes
* Click **Install**

### How to use

* Click the "graph" icon in the toolbar to open and close the panel; the panel can be resized vertically.

### Credits

This extension is based on [@jeremyckahn](https://github.com/jeremyckahn)'s amazing [Stylie](https://github.com/jeremyckahn/stylie).

### Version History

08/20/2013 v0.0.1 - I have no idea what I'm doing.
8 changes: 8 additions & 0 deletions bottom-keyframes.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* Toolbar Icon */
#bottom-keyframes-icon {
background: url(keyframes-sprite.svg);
}

#bottom-keyframes-icon.active {
background-position: 0 -24px !important;
}
19 changes: 19 additions & 0 deletions keyframe-sprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
114 changes: 114 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/*
* Copyright (c) 2013 @larz
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/

/*jslint vars: true, plusplus: true, devel: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */
/*global define, brackets, $, window */

define(function (require, exports, module) {
"use strict";

// Brackets modules
var CommandManager = brackets.getModule("command/CommandManager"),
EditorManager = brackets.getModule("editor/EditorManager"),
ExtensionUtils = brackets.getModule("utils/ExtensionUtils"),
KeyBindingManager = brackets.getModule("command/KeyBindingManager"),
Menus = brackets.getModule("command/Menus"),
NativeApp = brackets.getModule("utils/NativeApp"),
PanelManager = brackets.getModule("view/PanelManager");

// Local modules
var panelHTML = require("text!panel.html");

// jQuery objects
var $icon,
$iframe;

// Other vars
var panel,
visible = false,
realVisibility = false;

function _resizeIframe() {
if (visible && $iframe) {
var iframeWidth = panel.$panel.innerWidth();
$iframe.attr("width", iframeWidth + "px");
}
}

function _loadIframeSrc() {
var url = "http://larz0.github.io/stylie/";

$iframe.attr("src", url);
}

function _setPanelVisibility(isVisible) {
if (isVisible === realVisibility) {
return;
}

realVisibility = isVisible;
if (isVisible) {
if (!panel) {
var $panel = $(panelHTML);
$iframe = $panel.find("#bottom-keyframes-iframe");

panel = PanelManager.createBottomPanel("bottom-keyframes-panel", $panel);
$panel.on("panelResizeUpdate", function (e, newSize) {
$iframe.attr("height", newSize);
});
$iframe.attr("height", $panel.height());

_loadIframeSrc();

window.setTimeout(_resizeIframe);
}
$icon.toggleClass("active");
panel.show();
} else {
$icon.toggleClass("active");
panel.hide();
}
}

function _toggleVisibility() {
visible = !visible;
_setPanelVisibility(visible);
}

// Insert CSS for this extension
ExtensionUtils.loadStyleSheet(module, "bottom-keyframes.css");

// Add toolbar icon
$icon = $("<a>")
.attr({
id: "bottom-keyframes-icon",
href: "#",
title: "Bottom Keyframes"
})
.click(_toggleVisibility)
.appendTo($("#main-toolbar .buttons"));

// Listen for resize events
$(PanelManager).on("editorAreaResize", _resizeIframe);
$("#sidebar").on("panelCollapsed panelExpanded panelResizeUpdate", _resizeIframe);

});
12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "larz0.bottom-keyframes",
"title": "Bottom Keyframes",
"description": "Animation Playground and Generator",
"homepage": "https://github.com/larz0/bottom-keyframes",
"version": "0.0.1",
"author": "Larz (http://github.com/larz0)",
"license": "MIT",
"engines": {
"brackets": ">=0.27.0"
}
}
5 changes: 5 additions & 0 deletions panel.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div id="bottom-keyframes" class="bottom-panel vert-resizable top-resizer">
<div class="toolbar simple-toolbar-layout">
</div>
<iframe id="bottom-keyframes-iframe" width="100" height="345" seamless="true"></iframe>
</div>

0 comments on commit abaec0b

Please sign in to comment.