github-badge 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ pkg/*
2
+ *.gem
3
+ .bundle
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source :gemcutter
2
+
3
+ gemspec
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Nico Hagenburger
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,59 @@
1
+ github-badge
2
+ ============
3
+
4
+ A 3d Github badge as Compass extension ([original blog post](http://www.hagenburger.net/BLOG/3d-Github-badge-with-pure-CSS3.html))
5
+
6
+
7
+ Usage
8
+ -----
9
+
10
+ Make sure, you’re using [Sass](http://sass-lang.com/) and [Compass](http://compass-style.org/).
11
+
12
+ HTML:
13
+
14
+ <a id="github" href="https://github.com/hagenburger">
15
+ <span>Fork me on GitHub!</span>
16
+ <span>Get free lemonade!</span>
17
+ </a>
18
+
19
+ SCSS:
20
+
21
+ @import "compass";
22
+ @import "github-badge";
23
+
24
+ #github {
25
+ @include github-badge;
26
+ }
27
+
28
+
29
+ Customization
30
+ -------------
31
+
32
+ @import "compass";
33
+ @import "github-badge";
34
+
35
+ #github {
36
+ @include github-badge(
37
+ $background: image-url("background.png"),
38
+ $backside-backround: blue,
39
+ $text-color: #00f,
40
+ $backside-text-color: rgba(white, 0.5)
41
+ );
42
+ }
43
+
44
+
45
+ Dependencies
46
+ ------------
47
+
48
+ * Sass 3.1 (3.0 is not supported)
49
+ * Compass 0.10 and 0.11
50
+
51
+
52
+ Licence
53
+ -------
54
+
55
+ Released under the MIT Licence. See MIT-LICENCE for details.
56
+
57
+ © [Nico Hagenburger](http://www.hagenburger.net/) 2011
58
+
59
+ Follow [Nico on Twitter](http://twitter.com/hagenburger) or [Github](https://github.com/hagenburger).
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path("../lib/github-badge/version", __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "github-badge"
6
+ s.version = Github::Badge::VERSION
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ['Nico Hagenburger']
9
+ s.email = ['gems@hagenburger.net']
10
+ s.homepage = "http://www.hagenburger.net/BLOG/3d-Github-badge-with-pure-CSS3.html"
11
+ s.summary = "A 3d Github badge as Compass extension"
12
+ s.description = "A 3d Github badge as Compass extension"
13
+
14
+ s.required_rubygems_version = ">= 1.3.6"
15
+
16
+ s.add_dependency "sass", ">= 3.1.0.alpha.0"
17
+ s.add_dependency "compass", ">= 0.10.0"
18
+
19
+ s.add_development_dependency "bundler", ">= 1.0.0"
20
+
21
+ s.files = `git ls-files`.split("\n")
22
+ s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
23
+ s.require_path = 'lib'
24
+ end
@@ -0,0 +1,11 @@
1
+ base_directory = File.join(File.dirname(__FILE__), '..')
2
+ Compass::Frameworks.register('github-badge', :path => base_directory)
3
+
4
+ require 'sass'
5
+ module Sass::Script::Functions
6
+ def compass_legacy_mode
7
+ version = Compass.version
8
+ legacy_mode = (version[:major].to_i == 0 and version[:minor].to_i < 11)
9
+ Sass::Script::Bool.new(legacy_mode)
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ module Github
2
+ module Badge
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,60 @@
1
+ @mixin github-badge($background: black, $backside-background: red, $text-color: white, $backside-text-color: $text-color) {
2
+ left: -65px;
3
+ height: 30px;
4
+ top: 40px;
5
+ position: absolute;
6
+ text-decoration: none;
7
+ width: 250px;
8
+ @include rotate(-45deg);
9
+ span {
10
+ background: $background;
11
+ color: $text-color;
12
+ font-size: 14px;
13
+ left: 0;
14
+ padding: 5px 0;
15
+ position: absolute;
16
+ text-align: center;
17
+ width: 250px;
18
+ @if compass-legacy-mode() {
19
+ @include box-shadow(rgba(red, 0.2), 1px, 1px, 10px);
20
+ }
21
+ @else {
22
+ color:green;
23
+ @include box-shadow(rgba(black, 0.2) 1px 1px 10px);
24
+ }
25
+ @include transition(opacity, 1s);
26
+ &:last-child {
27
+ // this is the backside
28
+ background: $backside-background;
29
+ color: $backside-text-color;
30
+ opacity: 0;
31
+ }
32
+ }
33
+ &:hover span {
34
+ &:first-child {
35
+ opacity: 0;
36
+ }
37
+ &:last-child {
38
+ opacity: 1;
39
+ }
40
+ }
41
+
42
+ @media all and (-webkit-transform-3d) {
43
+ span {
44
+ opacity: 1 !important;
45
+ -webkit-backface-visibility: hidden;
46
+ -webkit-transition: -webkit-transform 1s;
47
+ &:last-child {
48
+ -webkit-transform: rotateX(180deg);
49
+ }
50
+ }
51
+ &:hover span {
52
+ &:first-child {
53
+ -webkit-transform: rotateX(180deg);
54
+ }
55
+ &:last-child {
56
+ -webkit-transform: rotateX(360deg);
57
+ }
58
+ }
59
+ }
60
+ }
metadata ADDED
@@ -0,0 +1,116 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: github-badge
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 0
9
+ version: 0.1.0
10
+ platform: ruby
11
+ authors:
12
+ - Nico Hagenburger
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-01-18 00:00:00 +01:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: sass
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 3
29
+ - 1
30
+ - 0
31
+ - alpha
32
+ - 0
33
+ version: 3.1.0.alpha.0
34
+ type: :runtime
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: compass
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ segments:
44
+ - 0
45
+ - 10
46
+ - 0
47
+ version: 0.10.0
48
+ type: :runtime
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: bundler
52
+ prerelease: false
53
+ requirement: &id003 !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ segments:
58
+ - 1
59
+ - 0
60
+ - 0
61
+ version: 1.0.0
62
+ type: :development
63
+ version_requirements: *id003
64
+ description: A 3d Github badge as Compass extension
65
+ email:
66
+ - gems@hagenburger.net
67
+ executables: []
68
+
69
+ extensions: []
70
+
71
+ extra_rdoc_files: []
72
+
73
+ files:
74
+ - .gitignore
75
+ - Gemfile
76
+ - MIT-LICENSE
77
+ - README.md
78
+ - Rakefile
79
+ - github-badge.gemspec
80
+ - lib/github-badge.rb
81
+ - lib/github-badge/version.rb
82
+ - stylesheets/github-badge.scss
83
+ has_rdoc: true
84
+ homepage: http://www.hagenburger.net/BLOG/3d-Github-badge-with-pure-CSS3.html
85
+ licenses: []
86
+
87
+ post_install_message:
88
+ rdoc_options: []
89
+
90
+ require_paths:
91
+ - lib
92
+ required_ruby_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ segments:
97
+ - 0
98
+ version: "0"
99
+ required_rubygems_version: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ segments:
104
+ - 1
105
+ - 3
106
+ - 6
107
+ version: 1.3.6
108
+ requirements: []
109
+
110
+ rubyforge_project:
111
+ rubygems_version: 1.3.6
112
+ signing_key:
113
+ specification_version: 3
114
+ summary: A 3d Github badge as Compass extension
115
+ test_files: []
116
+