catpop 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac4a2b937c6ad0748ffda79d74217e968445cc989ec72ec467a730a0fd070418
4
- data.tar.gz: b322365b7050e4887c14a4e015f3eeb431f50652f3dc078da8c7b9fc24338733
3
+ metadata.gz: 99bfb013a015035be8a7c7ab3c11c620e566c707fc0dd1e71c9ad774ae01d087
4
+ data.tar.gz: d73c17c3649383b1db70f338dce8122b4b93e185763d9eac2d71bb25e12f3aed
5
5
  SHA512:
6
- metadata.gz: 27535272ad025999b112de84cbb2a6af7bcf01c3e3091eec25407eaf0bdd6b4bba2471c069ef392f2c6d462a273fd9b1ba46b26327645cc6025c46a58168f197
7
- data.tar.gz: '08548073d87ad4bdfe908b02c72757564d973d60b85463c35b6195bd2cffaa70d53433705e9e8943653b1406481d2a8f01c951fafb4cae4bef3a3901c383f6dd'
6
+ metadata.gz: 3d7d27b44fc4dd3b318511221b125bae4583708e7311b968fb6fc79e3a3f808c073cefbe66e46246621d61dbd28efa60ef3c6fce24a82faac8d8a014ad1e4e7c
7
+ data.tar.gz: 263f52b088fe1f66f86807651d8afe1c3a46452f13dbfdbd34cb2ed01eda6a9b314c83252f7b136a1143366471d1d96bbef68d856b65e49c2b373b1453c707c1
@@ -0,0 +1,34 @@
1
+ document.addEventListener('DOMContentLoaded', function() {
2
+ const SHOWING_TIME = 3000;
3
+ const INTERVAL_TIME = 1000;
4
+
5
+ function showCat() {
6
+ // define emojis
7
+ const emojis = ["🐱", "🐈", "🐈‍⬛"];
8
+ const emoji = emojis[Math.floor(Math.random() * emojis.length)];
9
+
10
+ // define the size of the cat (1 ~ 10 em)
11
+ const catSize = Math.floor(Math.random() * 10) + 1;
12
+
13
+ // create div element
14
+ const catDiv = document.createElement('div');
15
+ catDiv.className = 'catpop';
16
+ catDiv.style.position = 'fixed';
17
+ catDiv.style.top = Math.floor(Math.random() * 90) + 'vh';
18
+ catDiv.style.left = Math.floor(Math.random() * 90) + 'vw';
19
+ catDiv.style.fontSize = catSize + 'em';
20
+ catDiv.innerText = emoji;
21
+
22
+ // append the div element to the body
23
+ document.body.appendChild(catDiv);
24
+
25
+ // remove the div element after a while
26
+ setTimeout(() => catDiv.remove(), SHOWING_TIME);
27
+ }
28
+
29
+
30
+ showCat();
31
+
32
+ // show cat every INTERVAL_TIME
33
+ setInterval(showCat, INTERVAL_TIME);
34
+ });
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Catpop
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: catpop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - tmasuyama1114
@@ -19,6 +19,7 @@ executables: []
19
19
  extensions: []
20
20
  extra_rdoc_files: []
21
21
  files:
22
+ - lib/assets/javascripts/catpop.js
22
23
  - lib/catpop.rb
23
24
  - lib/catpop/popup_helper.rb
24
25
  - lib/catpop/railtie.rb