bimi 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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/bimi/version.rb +1 -1
  3. data/lib/bimi.rb +77 -18
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de80df0b6b1b4ff98eb97b27fa5ae7d2bdb42e58db45c20380b5a072c03e82b7
4
- data.tar.gz: a6bb3274542892c548438303c4e5830c72fdafb21cbea418b5083fc2587b57a2
3
+ metadata.gz: 1fd51e260bfe7607cee90f6b8f7b575c88a15079142d2da1bcea170caa86afe6
4
+ data.tar.gz: 6f2cf7c9ec4dbf6734999ee755ee56b5cf173f920288b4e9b42f947237259d12
5
5
  SHA512:
6
- metadata.gz: a6b9a15d363cbced4b264caf292d43c095708e965342a045398bde0de0eb628aa3079b4234bf709f2e11ac4ace204c904011b5ef70500b49e36ef25e4a77e0d5
7
- data.tar.gz: dd141c1446d33d1a477ea14232236075861ad6512f260beca52963c880411bedb48406536b74fc5a841344a181b35ce8bff382e7bacbc6635dd6b7028628ec84
6
+ metadata.gz: f6e880b818a0e06c14d8465d1741e19a6549ad67617e8bea8c52dcf905c3d307f9ebe4f77e978e7a14cc377582d6e04112a7ac0d2fd36d1aaf941d40f726afd8
7
+ data.tar.gz: 28d42667fed641b42e9a4b44fba34d1faab114bdf64ee6358baf5d179d3cb8d7fe9482d40b00c18651421f2a0aba39ba23b0eca6a685d680b10ea2cc53a5b68a
data/lib/bimi/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BIMI
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
data/lib/bimi.rb CHANGED
@@ -18,6 +18,22 @@ module BIMI
18
18
 
19
19
  RAINBOW = [196, 208, 220, 190, 82, 51, 63, 129, 201].freeze
20
20
 
21
+ SPARKLES = %w[✦ ✧ ✨ ⋆ ✩ ✶ ✷ ✸ ✺ ⁕ ·].freeze
22
+
23
+ TAGLINES = [
24
+ "your brand is beautiful",
25
+ "looking sharp, inbox-ready",
26
+ "logos to the moon",
27
+ "ship it with style",
28
+ "now that's a brand indicator",
29
+ "deliverability and vibes",
30
+ "fresh off the mark",
31
+ "your logo, but make it verified",
32
+ "authenticated drip"
33
+ ].freeze
34
+
35
+ BANNER_WIDTH = 48
36
+
21
37
  def self.check(domain = "yourdomain.example")
22
38
  out = $stdout
23
39
  return _static(domain, out) unless out.tty?
@@ -25,63 +41,106 @@ module BIMI
25
41
  out.sync = true
26
42
  out.print("\e[?25l")
27
43
  begin
44
+ _fanfare(out)
28
45
  _banner(out)
29
46
  _run_steps(domain, out)
30
- _victory(domain, out)
47
+ _finale(domain, out)
31
48
  ensure
32
49
  out.print("\e[?25h")
33
50
  end
34
51
  true
35
52
  end
36
53
 
54
+ def self._sparkle
55
+ "\e[38;5;#{RAINBOW.sample}m#{SPARKLES.sample}\e[0m"
56
+ end
57
+
58
+ def self._confetti_line(width, density)
59
+ Array.new(width) { rand < density ? _sparkle : " " }.join
60
+ end
61
+
62
+ def self._fanfare(out)
63
+ 8.times do
64
+ out.print("\r#{_confetti_line(BANNER_WIDTH, 0.25)}")
65
+ sleep(0.05)
66
+ end
67
+ out.print("\r#{" " * BANNER_WIDTH}\r")
68
+ end
69
+
37
70
  def self._banner(out)
38
71
  letters = %w[B I M I]
39
- 8.times do |frame|
40
- out.print("\r")
41
- letters.each_with_index do |ch, i|
42
- color = RAINBOW[(frame + i * 2) % RAINBOW.length]
43
- out.print("\e[38;5;#{color};1m #{ch} ")
72
+ revealed = +""
73
+ letters.each_with_index do |ch, i|
74
+ color = RAINBOW[(i * 2) % RAINBOW.length]
75
+ revealed << "\e[38;5;#{color};1m #{ch} "
76
+ 4.times do
77
+ trail = "#{_sparkle} #{_sparkle} #{_sparkle}"
78
+ out.print("\r #{revealed}\e[0m #{trail}\e[K")
79
+ sleep(0.05)
44
80
  end
45
- out.print("\e[0m")
46
- sleep(0.08)
47
81
  end
48
- out.puts("\e[0m brand indicators for message identification\n\n")
82
+ 12.times do |frame|
83
+ tinted = letters.each_with_index.map do |ch, i|
84
+ color = RAINBOW[(frame + i * 2) % RAINBOW.length]
85
+ "\e[38;5;#{color};1m #{ch} "
86
+ end.join
87
+ left = _sparkle
88
+ right = _sparkle
89
+ out.print("\r #{left} #{tinted}\e[0m#{right}\e[K")
90
+ sleep(0.06)
91
+ end
92
+ out.puts("\e[0m")
93
+ out.puts(" \e[2mbrand indicators for message identification\e[0m\n\n")
49
94
  end
50
95
 
51
96
  def self._run_steps(domain, out)
52
97
  STEPS.each_with_index do |step, idx|
53
98
  label = "#{step} for \e[1m#{domain}\e[0m"
54
- frames = 12 + rand(8)
99
+ frames = 10 + rand(6)
55
100
  frames.times do |f|
56
101
  color = RAINBOW[(f + idx) % RAINBOW.length]
57
102
  out.print("\r\e[38;5;#{color}m#{SPINNER[f % SPINNER.length]}\e[0m #{label}\e[K")
58
- sleep(0.05)
103
+ sleep(0.04)
59
104
  end
60
- out.puts("\r\e[32m✓\e[0m #{label}\e[K")
105
+ out.puts("\r\e[32m✓\e[0m #{label} #{_sparkle}#{_sparkle}\e[K")
61
106
  end
62
107
  out.puts
63
108
  end
64
109
 
65
- def self._victory(domain, out)
66
- msg = " BIMI looks good for #{domain}! "
110
+ def self._finale(domain, out)
111
+ canvas_h = 4
112
+ canvas_h.times { out.puts }
113
+ 12.times do
114
+ out.print("\e[#{canvas_h}A")
115
+ canvas_h.times do
116
+ out.print("\r#{_confetti_line(BANNER_WIDTH, 0.28)}\e[K\n")
117
+ end
118
+ sleep(0.06)
119
+ end
120
+ out.print("\e[#{canvas_h}A")
121
+ canvas_h.times { out.print("\r\e[K\n") }
122
+ out.print("\e[#{canvas_h}A")
123
+
124
+ msg = " BIMI IS LIT for #{domain} "
67
125
  bar = "═" * msg.length
68
126
  out.puts("\e[38;5;82m╔#{bar}╗\e[0m")
69
- 8.times do |frame|
127
+ 14.times do |frame|
70
128
  tinted = msg.each_char.with_index.map do |ch, i|
71
129
  color = RAINBOW[(frame + i) % RAINBOW.length]
72
130
  "\e[38;5;#{color};1m#{ch}"
73
131
  end.join
74
132
  out.print("\e[38;5;82m║\e[0m#{tinted}\e[0m\e[38;5;82m║\e[0m\r")
75
- sleep(0.1)
133
+ sleep(0.08)
76
134
  end
77
135
  out.puts
78
136
  out.puts("\e[38;5;82m╚#{bar}╝\e[0m")
79
- out.puts("\n \e[2mpreview release — real record, SVG, and VMC checks land in a future version\e[0m\n\n")
137
+ out.puts("\n \e[3m\e[38;5;#{RAINBOW.sample}m#{SPARKLES.sample} #{TAGLINES.sample} #{SPARKLES.sample}\e[0m")
138
+ out.puts("\n \e[2mpreview release — real record, SVG, and VMC checks coming in a future version\e[0m\n\n")
80
139
  end
81
140
 
82
141
  def self._static(domain, out)
83
142
  out.puts("BIMI check for #{domain}")
84
143
  STEPS.each { |s| out.puts(" ok #{s}") }
85
- out.puts("BIMI looks good for #{domain}!")
144
+ out.puts("BIMI is lit for #{domain} — #{TAGLINES.sample}!")
86
145
  end
87
146
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bimi
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
  - Steve Whittaker