flying_objects 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 17c1d2bf120cac960874d085cd81e9eb76155665
4
+ data.tar.gz: 269c3817dfc4907c84162ff4bb8718eb119b18a5
5
+ SHA512:
6
+ metadata.gz: 9f91b52b835cd0ce980116f8db6f5a3993c0c9d4ba48b1975c4428e8f66f937d3c1c780883e2a919e3ea45d61440c00c300d622aed1b90c616cefb9e3fb10e12
7
+ data.tar.gz: 5e497c72ddc21ea6badca129119208b6083119cef7756a42f9864b1252d672909491f6fb8f6c9da07a97a78e8dfcc362c4d97561e06e751161c8398c78a017be
@@ -0,0 +1,8 @@
1
+ require "flying_objects/version"
2
+
3
+ module FlyingObjects
4
+ module Rails
5
+ class Engine < ::Rails::Engine
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,3 @@
1
+ module FlyingObjects
2
+ VERSION = "1.0.0"
3
+ end
@@ -0,0 +1,71 @@
1
+
2
+ var vmin=2;
3
+ var vmax=5;
4
+ var vr=2;
5
+ var timer1;
6
+
7
+ function iecompattest(){
8
+ return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
9
+ }
10
+
11
+ function Chip(chipname,width,height){
12
+ this.named=chipname;
13
+ this.vx=vmin+vmax*Math.random();
14
+ this.vy=vmin+vmax*Math.random();
15
+ this.w=width+20;
16
+ this.h=height;
17
+ this.xx=0;
18
+ this.yy=0;
19
+ this.timer1=null;
20
+ }
21
+
22
+ function movechip(chipname){
23
+ if (document.getElementById){
24
+ eval("chip="+chipname);
25
+ if (window.innerWidth || window.opera){
26
+ pageX=window.pageXOffset;
27
+ pageW=window.innerWidth-40;
28
+ pageY=window.pageYOffset;
29
+ pageH=window.innerHeight-20;
30
+ }
31
+ else if (document.body){
32
+ pageX=iecompattest().scrollLeft;
33
+ pageW=iecompattest().offsetWidth-40;
34
+ pageY=iecompattest().scrollTop;
35
+ pageH=iecompattest().offsetHeight-20;
36
+ }
37
+
38
+ chip.xx=chip.xx+chip.vx;
39
+ chip.yy=chip.yy+chip.vy;
40
+
41
+ chip.vx+=vr*(Math.random()-0.5);
42
+ chip.vy+=vr*(Math.random()-0.5);
43
+ if(chip.vx>(vmax+vmin)) chip.vx=(vmax+vmin)*2-chip.vx;
44
+ if(chip.vx<(-vmax-vmin)) chip.vx=(-vmax-vmin)*2-chip.vx;
45
+ if(chip.vy>(vmax+vmin)) chip.vy=(vmax+vmin)*2-chip.vy;
46
+ if(chip.vy<(-vmax-vmin)) chip.vy=(-vmax-vmin)*2-chip.vy;
47
+
48
+ if(chip.xx<=pageX){
49
+ chip.xx=pageX;
50
+ chip.vx=vmin+vmax*Math.random();
51
+ }
52
+ if(chip.xx>=pageX+pageW-chip.w){
53
+ chip.xx=pageX+pageW-chip.w;
54
+ chip.vx=-vmin-vmax*Math.random();
55
+ }
56
+ if(chip.yy<=pageY)
57
+ {chip.yy=pageY;
58
+ chip.vy=vmin+vmax*Math.random();
59
+ }
60
+ if(chip.yy>=pageY+pageH-chip.h)
61
+ {chip.yy=pageY+pageH-chip.h;
62
+ chip.vy=-vmin-vmax*Math.random();
63
+ }
64
+
65
+ document.getElementById(chip.named).style.left=chip.xx+"px";
66
+ document.getElementById(chip.named).style.top=chip.yy+"px";
67
+
68
+
69
+ chip.timer1=setTimeout("movechip('"+chip.named+"')",50);
70
+ }
71
+ }
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: flying_objects
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Rakesh PD
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-01-31 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.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
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
+ description: One important feature of DHTML is it's ability to move elements around
56
+ the page freely, without having to be tied down to one single spot on the page.
57
+ "Virtual Max" took full advantage of this feature and created his cool "floating
58
+ images" script for our Dynamic Drive surfers to use and enjoy. It's a cross-browser
59
+ script that moves any number of images around the page (by wrapping the images inside
60
+ <div>s, and animating each <div>), each following a randomly determined path. Furthermore,
61
+ the images are clickable, making this script not only insanely cool, but practical
62
+ as well!.
63
+ email:
64
+ - errakeshpd@gmail.com
65
+ executables: []
66
+ extensions: []
67
+ extra_rdoc_files: []
68
+ files:
69
+ - lib/flying_objects.rb
70
+ - lib/flying_objects/version.rb
71
+ - vendor/assets/javascripts/moveobj.js
72
+ homepage: https://github.com/errakeshpd/flying_objects
73
+ licenses:
74
+ - MIT
75
+ metadata:
76
+ allowed_push_host: https://rubygems.org
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ requirements: []
92
+ rubyforge_project:
93
+ rubygems_version: 2.5.2
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: make moving objects around your website.
97
+ test_files: []