fancy_cards 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 920911b2a48a4b99b5464bb9acc8a2110eba8ef8
4
+ data.tar.gz: 68305fc722841bd574607cb5efbb8c0e80bf2e4e
5
+ SHA512:
6
+ metadata.gz: a6ae5f37508f59f168903d53672cf31fb3877f754e9618211be96d6e6fd964d1679d826528637681fc4249946166eeeec8ec607f2ebad23fd182b4b43ee33e1a
7
+ data.tar.gz: 9c13e510dcbeeb23463907211d804c569eb83e5b3bf3d0cbec48d24dea790258095c1545e5b6709fa708bec2f0290d913c7265dbc71a94e602d02fc02af615f5
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /.sass-cache/
11
+ /vendor/assets/stylesheets/*.map
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,49 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
28
+
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This code of conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting a project maintainer at benj_cous@hotmail.com. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
+ version 1.3.0, available at
46
+ [http://contributor-covenant.org/version/1/3/0/][version]
47
+
48
+ [homepage]: http://contributor-covenant.org
49
+ [version]: http://contributor-covenant.org/version/1/3/0/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in fancy_cards.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 benji
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,60 @@
1
+ # FancyCards
2
+
3
+ Easily add some colored cards to your application, which you can fill like you want.
4
+ FancyCards has been developed to easily fill your page with content.
5
+ ![Fancy_cards](http://puu.sh/npRKD/9c61c92fde.png)
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'fancy_cards', git: 'https://github.com/becousae/fancy_cards.git'
12
+ ```
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ ## Usage
19
+
20
+ Add a div with class `fancy-cards` to your webview, in which you will place the cards.
21
+ Cards can be generated through the `fancy_card` helper, which is available in the views.
22
+ `fancy_card` is an extension of the `render` function. Most options available to `render` are the same in `fancy_card`
23
+
24
+ Render a partial inside a fancy card by putting this in your view:
25
+ ```ruby
26
+ <%= fancy_card partial: "users/partial" %>
27
+ ```
28
+
29
+ You can also use blocks to render stuff:
30
+ ```erb
31
+ <%= fancy_card do %>
32
+ Content of fancy card
33
+ <% end %>
34
+ ```
35
+
36
+ ### Options
37
+
38
+ #### Color
39
+ Choose the color of your card by passing a color. Options are `:red`, `:blue`, `:purple`, `:green`, `:orange` and `:yellow`.
40
+ ```ruby
41
+ <%= fancy_card partial: "users/partial", color: :red %>
42
+ ```
43
+
44
+ #### Size
45
+ Choose the number of columns your fancy card will expand over by passing the `columns` option. Options are the numbers 1 to 4.
46
+ ```ruby
47
+ <%= fancy_card partial: "users/partial", columns: 1 %>
48
+ ```
49
+
50
+ ## Contributing
51
+
52
+ Bug reports and pull requests are welcome on GitHub at https://github.com/becousae/fancy_cards.
53
+ This project is intended to be a safe, welcoming space for collaboration,
54
+ and contributors are expected to adhere to the
55
+ [Contributor Covenant](http://contributor-covenant.org) code of conduct.
56
+
57
+
58
+ ## License
59
+
60
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,2 @@
1
+ = fancy_card_wrapper do
2
+ = yield
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "fancy_cards"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'fancy_cards/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "fancy_cards"
8
+ spec.version = FancyCards::VERSION
9
+ spec.authors = ["benji"]
10
+ spec.email = ["benj_cous@hotmail.com"]
11
+
12
+ spec.summary = %q{Create fancy cards to create a nice overview of information.}
13
+ spec.homepage = "https://github.com/becousae/fancy_cards"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.bindir = "exe"
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.11"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "rspec", "~> 3.0"
24
+ spec.add_dependency "purecss-rails", '~> 0.6.0'
25
+ end
@@ -0,0 +1,8 @@
1
+ require "fancy_cards/version"
2
+ require 'fancy_cards/railtie' if defined?(Rails)
3
+ require 'purecss-rails'
4
+
5
+ module FancyCards
6
+ class Engine < ::Rails::Engine
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'fancy_cards/view_helpers'
2
+ module FancyCards
3
+ class Railtie < Rails::Railtie
4
+ initializer "fancy_cards.view_helpers" do
5
+ ActionView::Base.send :include, ViewHelpers
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,3 @@
1
+ module FancyCards
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,39 @@
1
+ module FancyCards
2
+ module ViewHelpers
3
+ def fancy_card options = {}, &block
4
+ @options = options
5
+ render partial: options[:partial], layout: "fancy_cards/fancy_card_layout", &block
6
+ end
7
+
8
+ def fancy_card_wrapper
9
+ content_tag :div, class: outer_wrapper_class(@options[:columns]) do
10
+ content_tag :div, class: inner_wrapper_class(@options[:color]) do
11
+ yield
12
+ end
13
+ end
14
+ end
15
+
16
+ private
17
+
18
+ def default_params
19
+ {
20
+ partial: nil,
21
+ color: nil,
22
+ columns: 1
23
+ }
24
+ end
25
+
26
+ def outer_wrapper_class columns = 1
27
+ {
28
+ "1" => %w[pure-u-1 pure-u-sm-1-2 pure-u-md-1-3 pure-u-lg-1-4],
29
+ "2" => %w[pure-u-1 pure-u-md-2-3 pure-u-lg-1-2],
30
+ "3" => %w[pure-u-1 pure-u-lg-3-4],
31
+ "4" => %w[pure-u-1]
32
+ }.fetch(columns.to_s, %w[pure-u-1 pure-u-sm-1-2 pure-u-md-1-3 pure-u-lg-1-4])
33
+ end
34
+
35
+ def inner_wrapper_class color = :white
36
+ ["fancy-card", "fancy-card-#{color.to_s}"]
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,52 @@
1
+ /*
2
+ =require purecss/grids
3
+ =require purecss/grids-responsive
4
+ */
5
+ .fancy-cards {
6
+ /* Pure-g settings */
7
+ letter-spacing: -.31em;
8
+ text-rendering: optimizespeed;
9
+ font-family: FreeSans,Arimo,"Droid Sans",Helvetica,Arial,sans-serif;
10
+ display: -webkit-flex;
11
+ -webkit-flex-flow: row wrap;
12
+ display: -ms-flexbox;
13
+ -ms-flex-flow: row wrap; }
14
+ .fancy-cards .fancy-card {
15
+ margin: 0.6em;
16
+ padding: 0.5em;
17
+ border: 1px solid;
18
+ color: white;
19
+ -webkit-border-radius: 2px;
20
+ -moz-border-radius: 2px;
21
+ -ms-border-radius: 2px;
22
+ border-radius: 2px;
23
+ min-height: 150px;
24
+ transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
25
+ box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.14), 0 4px 5px 0 rgba(0, 0, 0, 0.098), 0 1px 10px 0 rgba(0, 0, 0, 0.084); }
26
+ .fancy-cards .fancy-card .fancy-card-title {
27
+ margin-top: 0;
28
+ text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
29
+ .fancy-cards .fancy-card.fancy-card-blue {
30
+ background: #1f8dd6; }
31
+ .fancy-cards .fancy-card.fancy-card-blue .fancy-card-text {
32
+ color: #03c2f0; }
33
+ .fancy-cards .fancy-card.fancy-card-purple {
34
+ background: #8058a5; }
35
+ .fancy-cards .fancy-card.fancy-card-purple .fancy-card-text {
36
+ color: #c883ff; }
37
+ .fancy-cards .fancy-card.fancy-card-green {
38
+ background: #5eb95e; }
39
+ .fancy-cards .fancy-card.fancy-card-green .fancy-card-text {
40
+ color: #a1f089; }
41
+ .fancy-cards .fancy-card.fancy-card-red {
42
+ background: #dd514c; }
43
+ .fancy-cards .fancy-card.fancy-card-red .fancy-card-text {
44
+ color: #eca49a; }
45
+ .fancy-cards .fancy-card.fancy-card-orange {
46
+ background: #f37b1d; }
47
+ .fancy-cards .fancy-card.fancy-card-orange .fancy-card-text {
48
+ color: #ffbe81; }
49
+ .fancy-cards .fancy-card.fancy-card-yellow {
50
+ background: #fad232; }
51
+ .fancy-cards .fancy-card.fancy-card-yellow .fancy-card-text {
52
+ color: #fff086; }
@@ -0,0 +1,130 @@
1
+ /*
2
+ =require purecss/grids
3
+ =require purecss/grids-responsive
4
+ */
5
+
6
+ // Colors
7
+
8
+ $card-margin: 0.6em;
9
+ $card-padding: 0.5em;
10
+ $card-border-width: 1px;
11
+ $card-border-radius: 2px;
12
+ $card-color: #fff;
13
+ $card-min-height: 150px;
14
+ $card-transition: box-shadow .2s cubic-bezier(.4, 0, .2, 1);
15
+ $card-box-shadow: 0 2px 4px -1px rgba(0,0,0,0.14),0 4px 5px 0 rgba(0,0,0,0.098),0 1px 10px 0 rgba(0,0,0,0.084);
16
+
17
+ $card-title-shadow: 0 1px 3px rgba(0,0,0,0.6);
18
+
19
+ $card-colors: (
20
+ blue: (
21
+ background: rgb(31, 141, 214),
22
+ text: rgb(03, 194, 240)
23
+ ), purple: (
24
+ background: rgb(128, 88, 165),
25
+ text: rgb(200, 131, 255)
26
+ ), green: (
27
+ background: rgb(94, 185, 94),
28
+ text: rgb(161, 240, 137)
29
+ ), red: (
30
+ background: rgb(221, 81, 76),
31
+ text: rgb(236, 164, 154)
32
+ ), orange: (
33
+ background: rgb(243, 123, 29),
34
+ text: rgb(255, 190, 129)
35
+ ), yellow: (
36
+ background: rgb(250, 210, 50),
37
+ text: rgb(255, 240, 134)
38
+ )
39
+ );
40
+
41
+ // Functions
42
+
43
+ @function card-background-color( $color ) {
44
+ @return map-get( map-get( $card-colors, $color ), background );
45
+ }
46
+
47
+ @function card-text-color( $color ) {
48
+ @return map-get( map-get( $card-colors, $color ), text );
49
+ }
50
+
51
+ // Mixins
52
+
53
+ @mixin border-radius($radius) {
54
+ -webkit-border-radius: $radius;
55
+ -moz-border-radius: $radius;
56
+ -ms-border-radius: $radius;
57
+ border-radius: $radius;
58
+ }
59
+
60
+ // Styles
61
+
62
+ .fancy-cards {
63
+ /* Pure-g settings */
64
+ letter-spacing: -.31em;
65
+ text-rendering: optimizespeed;
66
+ font-family: FreeSans,Arimo,"Droid Sans",Helvetica,Arial,sans-serif;
67
+ display: -webkit-flex;
68
+ -webkit-flex-flow: row wrap;
69
+ display: -ms-flexbox;
70
+ -ms-flex-flow: row wrap;
71
+
72
+ .fancy-card {
73
+ margin: $card-margin;
74
+ padding: $card-padding;
75
+ border: $card-border-width solid;
76
+ color: $card-color;
77
+ @include border-radius( $card-border-radius );
78
+ min-height: $card-min-height;
79
+ transition: $card-transition;
80
+ box-shadow: $card-box-shadow;
81
+
82
+ .fancy-card-title {
83
+ margin-top: 0;
84
+ text-shadow: $card-title-shadow;
85
+ }
86
+
87
+ }
88
+
89
+ .fancy-card.fancy-card-blue {
90
+ background: card-background-color( blue );
91
+ .fancy-card-text {
92
+ color: card-text-color( blue );
93
+ }
94
+ }
95
+
96
+ .fancy-card.fancy-card-purple {
97
+ background: card-background-color( purple );
98
+ .fancy-card-text {
99
+ color: card-text-color( purple );
100
+ }
101
+ }
102
+
103
+ .fancy-card.fancy-card-green {
104
+ background: card-background-color( green );
105
+ .fancy-card-text {
106
+ color: card-text-color( green );
107
+ }
108
+ }
109
+
110
+ .fancy-card.fancy-card-red {
111
+ background: card-background-color( red );
112
+ .fancy-card-text {
113
+ color: card-text-color( red );
114
+ }
115
+ }
116
+
117
+ .fancy-card.fancy-card-orange {
118
+ background: card-background-color( orange );
119
+ .fancy-card-text {
120
+ color: card-text-color( orange );
121
+ }
122
+ }
123
+
124
+ .fancy-card.fancy-card-yellow {
125
+ background: card-background-color( yellow );
126
+ .fancy-card-text {
127
+ color: card-text-color( yellow );
128
+ }
129
+ }
130
+ }
metadata ADDED
@@ -0,0 +1,117 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fancy_cards
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - benji
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-03-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.11'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.11'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: purecss-rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.6.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.6.0
69
+ description:
70
+ email:
71
+ - benj_cous@hotmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".rspec"
78
+ - CODE_OF_CONDUCT.md
79
+ - Gemfile
80
+ - LICENSE
81
+ - README.md
82
+ - Rakefile
83
+ - app/views/fancy_cards/_fancy_card_layout.html.haml
84
+ - bin/console
85
+ - bin/setup
86
+ - fancy_cards.gemspec
87
+ - lib/fancy_cards.rb
88
+ - lib/fancy_cards/railtie.rb
89
+ - lib/fancy_cards/version.rb
90
+ - lib/fancy_cards/view_helpers.rb
91
+ - vendor/assets/stylesheets/fancy_cards.css
92
+ - vendor/assets/stylesheets/fancy_cards.css.scss
93
+ homepage: https://github.com/becousae/fancy_cards
94
+ licenses:
95
+ - MIT
96
+ metadata: {}
97
+ post_install_message:
98
+ rdoc_options: []
99
+ require_paths:
100
+ - lib
101
+ required_ruby_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ required_rubygems_version: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ requirements: []
112
+ rubyforge_project:
113
+ rubygems_version: 2.5.2
114
+ signing_key:
115
+ specification_version: 4
116
+ summary: Create fancy cards to create a nice overview of information.
117
+ test_files: []