Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
LukaszWatroba committed Dec 28, 2014
0 parents commit 04a75c1
Show file tree
Hide file tree
Showing 22 changed files with 1,754 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "bower"
}
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
._*
.~lock.*
.buildpath
.DS_Store
.idea
.project
.settings

# Ignore node stuff
node_modules/
npm-debug.log
libpeerconnection.log

# OS-specific
.DS_Store

# Bower components
bower

# Sublime
*.sublime-*
32 changes: 32 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"node": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": false,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"white": true,
"validthis": true,

"jasmine": true,

"globals": {
"angular": false
},

"predef": [
"inject"
]
}
29 changes: 29 additions & 0 deletions .yo-rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"generator-angularjs-library": {
"props": {
"author": {
"name": "Łukasz Wątroba",
"email": "l@lukaszwatroba.com"
},
"libraryName": {
"original": "v-accordion",
"camelized": "vAccordion",
"dasherized": "v-accordion",
"slugified": "v-accordion",
"parts": [
"v",
"accordion"
]
},
"includeModuleDirectives": false,
"includeModuleFilters": false,
"includeModuleServices": false,
"includeAngularModuleResource": false,
"includeAngularModuleCookies": false,
"includeAngularModuleSanitize": false,
"librarySrcDirectory": "src/vAccordion",
"libraryUnitTestDirectory": "test/unit/vAccordion",
"libraryUnitE2eDirectory": "test/e2e/vAccordion"
}
}
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright (c) 2014 Łukasz Wątroba

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.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# v-accordion

26 changes: 26 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "v-accordion",
"description": "vAccordion - AngularJS multi-level accordion directive.",
"authors": [
{
"name": "Łukasz Wątroba",
"email": "l@lukaszwatroba.com"
}
],
"main": ["dist/v-accordion.js"],
"ignore": [
"src",
"test",
"Gruntfile.js",
"**/.*"
],
"dependencies": {
"angular": "~1.3.8",
"angular-animate": "~1.3.8",
"valitycss": "~0.0.5"
},
"devDependencies": {
"angular-mocks": "~1.2.21",
"angular-scenario": "~1.2.21"
}
}
40 changes: 40 additions & 0 deletions demo/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
(function (angular) {
'use strict';

angular.module('myApp',
[
'vAccordion'
]
)

.controller('AccordionController', function ($scope) {

$scope.panes = [
{
header: 'Pane 1',
content: 'Curabitur et ligula. Ut molestie a, ultricies porta urna. Vestibulum commodo volutpat a, convallis ac, laoreet enim. Phasellus fermentum in, dolor. Pellentesque facilisis. Nulla imperdiet sit amet magna. Vestibulum dapibus, mauris nec malesuada fames ac turpis velit, rhoncus eu, luctus et interdum adipiscing wisi.'
},
{
header: 'Pane 2',
content: 'Lorem ipsum dolor sit amet enim. Etiam ullamcorper. Suspendisse a pellentesque dui, non felis. Maecenas malesuada elit lectus felis, malesuada ultricies.'
},
{
header: 'Pane 3',
content: 'Aliquam erat ac ipsum. Integer aliquam purus. Quisque lorem tortor fringilla sed, vestibulum id, eleifend justo vel bibendum sapien massa ac turpis faucibus orci luctus non.',

subpanes: [
{
header: 'Subpane 1',
content: 'Lorem ipsum dolor sit amet enim.'
},
{
header: 'Subpane 2',
content: 'Curabitur et ligula. Ut molestie a, ultricies porta urna. Quisque lorem tortor fringilla sed, vestibulum id.'
}
]
}
];

});

})(angular);
103 changes: 103 additions & 0 deletions dist/v-accordion.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/**
* vAccordion - AngularJS multi-level accordion directive.
* @version v0.0.1
* @link http://lukaszwatroba.github.io/v-accordion
* @author Łukasz Wątroba <l@lukaszwatroba.com>
* @license MIT License, http://www.opensource.org/licenses/MIT
*/

/***************************************
Accordion
***************************************/
/**
* Example HTML:
*
<v-accordion>
<v-pane>
<v-pane-header>[content]</v-pane-header>
<v-pane-content>[content]</v-pane-content>
</v-pane>
</v-accordion>
*/
.Accordion {
height: 100%;
width: 100%; }
.Accordion .Accordion {
margin-top: 20px;
padding-left: 20px; }

.Accordion-paneHeader {
position: relative;
cursor: pointer;
text-decoration: none;
margin-bottom: 20px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }

.Accordion-paneContent {
position: relative;
overflow: hidden;
max-height: 0px; }
.Accordion-paneContent > div {
padding-bottom: 20px;
opacity: 0;
-webkit-transition: opacity 0.5s;
transition: opacity 0.5s; }
.Accordion-paneContent.is-expanded > div {
opacity: 1; }
.Accordion-paneContent.is-expanded-add, .Accordion-paneContent.is-expanded-remove {
-webkit-transition: max-height 0.5s;
transition: max-height 0.5s; }

/* Accordion modifires
***************************************/
/* Modifier: default accordion */
.Accordion--dafault .Accordion-paneHeader {
padding: 5px 0;
border-bottom: 2px solid #D8D8D8;
-webkit-transition: color 0.25s, border-color 0.5s;
transition: color 0.25s, border-color 0.5s; }
.Accordion--dafault .Accordion-paneHeader::after, .Accordion--dafault .Accordion-paneHeader::before {
content: '';
display: block;
position: absolute;
top: 50%;
right: 0;
width: 10px;
height: 1px;
background-color: #2196F3;
-webkit-transform-origin: 50% 50%;
-ms-transform-origin: 50% 50%;
transform-origin: 50% 50%;
-webkit-transition: all 0.25s;
transition: all 0.25s; }
.Accordion--dafault .Accordion-paneHeader::before {
-webkit-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
transform: rotate(-90deg); }
.Accordion--dafault .Accordion-paneHeader:hover {
color: #2196F3; }
.Accordion--dafault .Accordion-paneHeader.is-expanded {
border-bottom-color: #2196F3; }
.Accordion--dafault .Accordion-paneHeader.is-expanded::after {
-webkit-transform: rotate(90deg);
-ms-transform: rotate(90deg);
transform: rotate(90deg);
opacity: 0; }
.Accordion--dafault .Accordion-paneHeader.is-expanded::before {
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
transform: rotate(0deg); }

.Accordion--dafault .Accordion-paneContent > div {
-webkit-transform: translateY(30px);
-ms-transform: translateY(30px);
transform: translateY(30px);
-webkit-transition: -webkit-transform 0.5s, opacity 0.5s;
transition: transform 0.5s, opacity 0.5s; }
.Accordion--dafault .Accordion-paneContent.is-expanded > div {
-webkit-transform: translateY(0);
-ms-transform: translateY(0);
transform: translateY(0); }
Loading

0 comments on commit 04a75c1

Please sign in to comment.