trmnl_preview 0.5.2 → 0.5.4

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: ff4e3150ccec1606d5368198055556d8650b129a682ae398fa7ff29e30e42009
4
- data.tar.gz: d65492ec3e770e5203bbfd736651e56b052aa726dd1ead38bff93eccb2cbf023
3
+ metadata.gz: dd5804f039fe8932f996c097798d5a4c9211725fad19f71c230ac3d99c9c8875
4
+ data.tar.gz: d13908a4314d5a397667e59ed4576ab1cb9a396b47bf2962df12bc80f53e9d14
5
5
  SHA512:
6
- metadata.gz: b7157fc2656c9228482b11b4806280a29b9ce6ae3017af3f57a79e70b3f8f00ee125671476542808fc8411a8381e0569a4cfd19e6057ed4c7fd6a21a8ebee016
7
- data.tar.gz: c03598652d732f5922fbe7ea9b5b24c5d09e22ac2b1f793c511d59ca0739648fced9ee6c8579794298541669ffb42c5f6a37338ba523ad8b1dd193aac721a5ba
6
+ metadata.gz: e51b14f3cc1320a96a948c5c1b44622dc13a53eeb348f7b9f6ca4e928628dbccec6fd4de54598408c7d778f1891d82577ebc3853b884a122432b89d74dd11d56
7
+ data.tar.gz: 7962920070178a0701251b5f847b1b35630d6643323b1d87cb8c11c0f91f8478e842d88722f1d04743a28c69f25c78c394538daa9aa3e4777beb8647b3b53f9b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.4
4
+
5
+ - Added `shared.liquid` file to template (@mariovisic)
6
+ - Stringified custom field values to match production (@mariovisic)
7
+ - Optimized image generation (@sd416)
8
+ - Fixed preview from growing when JSON data becomes too wide (@stephenyeargin)
9
+
10
+ ## 0.5.3
11
+
12
+ - Added support for [reusable markup](https://docs.usetrmnl.com/go/reusing-markup) in `shared.liquid`
13
+ - Replaced custom case images with [\<trmnl-frame\> component](https://github.com/usetrmnl/trmnl-component)
14
+ - Updated custom Liquid filters
15
+ - Added API key validation during `trmnlp login`
16
+
3
17
  ## 0.5.2
4
18
 
5
19
  - Added `time_zone` project config option, which is injected into `trmnl.user` variables
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A basic self-hosted web server to ease the development and sharing of [TRMNL](https://usetrmnl.com/) plugins.
4
4
 
5
- [Liquid](https://shopify.github.io/liquid/) templates are rendered leveraging the [TRMNL Design System](https://usetrmnl.com/framework). They may be generated as HTML (faster, and a good approximation of the final result) or as BMP images (slower, but more accurate).
5
+ [Liquid](https://shopify.github.io/liquid/) templates are rendered leveraging the [TRMNL Design System](https://usetrmnl.com/framework). They may be generated as HTML (faster, and a good approximation of the final result) or as PNG images (slower, but more accurate).
6
6
 
7
7
  The server watches the filesystem for changes to the Liquid templates, seamlessly updating the preview without the need to refresh.
8
8
 
@@ -22,6 +22,7 @@ This is the structure of a plugin project:
22
22
  ├── half_horizontal.liquid
23
23
  ├── half_vertical.liquid
24
24
  ├── quadrant.liquid
25
+ ├── shared.liquid
25
26
  └── settings.yml
26
27
  ```
27
28
 
@@ -56,7 +57,7 @@ trmnlp push # upload
56
57
  Prerequisites:
57
58
 
58
59
  - Ruby 3.x
59
- - For BMP rendering (optional):
60
+ - For PNG rendering (optional):
60
61
  - Firefox
61
62
  - ImageMagick
62
63
 
@@ -113,6 +114,15 @@ The `settings.yml` file is part of the plugin definition.
113
114
 
114
115
  See [TRMNL documentation](https://help.usetrmnl.com/en/articles/10542599-importing-and-exporting-private-plugins#h_581fb988f0) for details on this file's contents.
115
116
 
117
+
118
+ ## Tests
119
+
120
+ To test, run:
121
+
122
+ ```sh
123
+ bin/rake
124
+ ```
125
+
116
126
  ## Contributing
117
127
 
118
128
  Bug reports and pull requests are welcome on GitHub at https://github.com/usetrmnl/trmnlp.
data/bin/rake ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rake' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12
+
13
+ bundle_binstub = File.expand_path("bundle", __dir__)
14
+
15
+ if File.file?(bundle_binstub)
16
+ if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
17
+ load(bundle_binstub)
18
+ else
19
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21
+ end
22
+ end
23
+
24
+ require "rubygems"
25
+ require "bundler/setup"
26
+
27
+ load Gem.bin_path("rake", "rake")
@@ -0,0 +1,36 @@
1
+ require 'action_view'
2
+ require 'singleton'
3
+
4
+ module Markup
5
+ module CustomLiquidFilters
6
+ class ActionViewHelpers
7
+ include Singleton
8
+ include ActionView::Helpers
9
+ end
10
+
11
+ def number_with_delimiter(number, delimiter = ',', separator = ',')
12
+ ActionViewHelpers.instance.number_with_delimiter(number, delimiter:, separator:)
13
+ end
14
+
15
+ def number_to_currency(number, unit = '$', delimiter = ',', separator = '.')
16
+ ActionViewHelpers.instance.number_to_currency(number, unit: unit, delimiter:, separator:)
17
+ end
18
+
19
+ def l_word(word, locale)
20
+ I18n.t("custom_plugins.#{word}", locale: locale)
21
+ end
22
+
23
+ def l_date(date, format, locale = 'en')
24
+ format = format.to_sym unless format.include?('%')
25
+ I18n.l(date.to_datetime, :format => format, locale: locale)
26
+ end
27
+
28
+ def pluralize(singular, count)
29
+ ActionViewHelpers.instance.pluralize(count, singular)
30
+ end
31
+
32
+ def json(obj)
33
+ JSON.generate(obj)
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,19 @@
1
+ module Markup
2
+ # This in-memory "file system" is the backing storage for custom templates defined {% template [name] %} tags.
3
+ class InlineTemplatesFileSystem < Liquid::BlankFileSystem
4
+ def initialize
5
+ super
6
+ @templates = {}
7
+ end
8
+
9
+ # called by Markup::LiquidTemplateTag to save users' custom shared templates via our custom {% template %} tag
10
+ def register(name, body)
11
+ @templates[name] = body
12
+ end
13
+
14
+ # called by Liquid::Template for {% render 'foo' %} when rendering screen markup
15
+ def read_template_file(name)
16
+ @templates[name] || raise(Liquid::FileSystemError, "Template not found: #{name}")
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,17 @@
1
+ # get all files in the current directory as this file
2
+ Pathname.new(__dir__).glob('*.rb').each { |file| require file }
3
+
4
+ module Markup
5
+ # A very thin wrapper around Liquid::Template with TRMNL-specific functionality.
6
+ class Template < Liquid::Template
7
+ def self.parse(*)
8
+ template = super
9
+
10
+ # set up a temporary in-memory file system for custom user templates, via the magic :file_system register
11
+ # which will override the default file system
12
+ template.registers[:file_system] = InlineTemplatesFileSystem.new
13
+
14
+ template
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,31 @@
1
+ module Markup
2
+ # The {% template [name] %} tag block is used in conjunction with InlineTemplatesFileSystem to allow users to define
3
+ # custom templates within the context of the current Liquid template. Generally speaking, they will define their own
4
+ # templates in the "shared" markup content, which is prepended to the individual screen templates before rendering.
5
+ class TemplateTag < Liquid::Block
6
+ NAME_REGEX = %r{\A[a-zA-Z0-9_/]+\z}
7
+
8
+ def initialize(tag_name, markup, options)
9
+ super
10
+ @name = markup.strip
11
+ end
12
+
13
+ def parse(tokens)
14
+ @body = ""
15
+ while (token = tokens.shift)
16
+ break if token.strip == "{% endtemplate %}"
17
+
18
+ @body << token
19
+ end
20
+ end
21
+
22
+ def render(context)
23
+ unless @name =~ NAME_REGEX
24
+ return "Liquid error: invalid template name #{@name.inspect} - template names must contain only letters, numbers, underscores, and slashes"
25
+ end
26
+
27
+ context.registers[:file_system].register(@name, @body.strip)
28
+ ''
29
+ end
30
+ end
31
+ end
data/lib/trmnlp/app.rb CHANGED
@@ -86,12 +86,16 @@ module TRMNLP
86
86
  end
87
87
  end
88
88
 
89
- get "/render/#{view}.bmp" do
89
+ get "/render/#{view}.png" do
90
90
  @view = view
91
91
  html = @context.render_full_page(view)
92
92
  generator = ScreenGenerator.new(html, image: true)
93
- img_path = generator.process
94
- send_file img_path, type: 'image/png', disposition: 'inline'
93
+ temp_image = generator.process
94
+
95
+ send_file temp_image.path, type: 'image/png', disposition: 'inline'
96
+
97
+ temp_image.close
98
+ temp_image.unlink
95
99
  end
96
100
  end
97
101
  end
@@ -13,6 +13,7 @@ module TRMNLP
13
13
 
14
14
  api_key = prompt("API Key: ")
15
15
  raise Error, "API key cannot be empty" if api_key.empty?
16
+ raise Error, "Invalid API key; did you copy it from the right place?" unless api_key.start_with?("user_")
16
17
 
17
18
  config.app.api_key = api_key
18
19
  config.app.save
@@ -26,7 +26,7 @@ module TRMNLP
26
26
  (@config['watch'] || []).map { |watch_path| paths.expand(watch_path) }.uniq
27
27
  end
28
28
 
29
- def custom_fields = @config['custom_fields'] || {}
29
+ def custom_fields = @config.fetch('custom_fields', {}).transform_values(&:to_s)
30
30
 
31
31
  def user_data_overrides = @config['variables'] || {}
32
32
 
@@ -46,4 +46,4 @@ module TRMNLP
46
46
  end
47
47
  end
48
48
  end
49
- end
49
+ end
@@ -6,8 +6,8 @@ require 'json'
6
6
  require 'liquid'
7
7
 
8
8
  require_relative 'config'
9
- require_relative 'custom_filters'
10
9
  require_relative 'paths'
10
+ require_relative '../markup/template'
11
11
 
12
12
  module TRMNLP
13
13
  class Context
@@ -122,7 +122,14 @@ module TRMNLP
122
122
  template_path = paths.template(view)
123
123
  return "Missing template: #{template_path}" unless template_path.exist?
124
124
 
125
- user_template = Liquid::Template.parse(template_path.read, environment: liquid_environment)
125
+ shared_template_path = paths.shared_template
126
+ if shared_template_path.exist?
127
+ full_markup = shared_template_path.read + template_path.read
128
+ else
129
+ full_markup = template_path.read
130
+ end
131
+
132
+ user_template = Markup::Template.parse(full_markup, environment: liquid_environment)
126
133
  user_template.render(user_data)
127
134
  rescue StandardError => e
128
135
  e.message
@@ -200,7 +207,8 @@ module TRMNLP
200
207
 
201
208
  def liquid_environment
202
209
  @liquid_environment ||= Liquid::Environment.build do |env|
203
- env.register_filter(CustomFilters)
210
+ env.register_filter(Markup::CustomLiquidFilters)
211
+ env.register_tag('template', Markup::TemplateTag)
204
212
 
205
213
  config.project.user_filters.each do |module_name, relative_path|
206
214
  require paths.root_dir.join(relative_path)
data/lib/trmnlp/paths.rb CHANGED
@@ -36,6 +36,8 @@ module TRMNLP
36
36
  def plugin_config = src_dir.join('settings.yml')
37
37
 
38
38
  def template(view) = src_dir.join("#{view}.liquid")
39
+
40
+ def shared_template = template('shared')
39
41
 
40
42
  def app_config = app_config_dir.join('config.yml')
41
43
 
@@ -1,11 +1,105 @@
1
- require 'ferrum'
2
1
  require 'mini_magick'
3
2
  require 'puppeteer-ruby'
4
3
  require 'base64'
4
+ require 'thread'
5
5
 
6
6
  module TRMNLP
7
7
  class ScreenGenerator
8
-
8
+ # Browser pool management for efficient resource usage
9
+ class BrowserPool
10
+ def initialize(max_size: 2)
11
+ @browsers = []
12
+ @available = Queue.new
13
+ @mutex = Mutex.new
14
+ @max_size = max_size
15
+ @shutdown = false
16
+
17
+ # Register cleanup on exit
18
+ at_exit { shutdown }
19
+ end
20
+
21
+ def with_page
22
+ browser = nil
23
+ page = nil
24
+
25
+ begin
26
+ browser = checkout_browser
27
+ page = browser.new_page
28
+ yield page
29
+ ensure
30
+ # Clean up page but keep browser alive
31
+ page&.close rescue nil
32
+ checkin_browser(browser) if browser
33
+ end
34
+ end
35
+
36
+ def shutdown
37
+ @mutex.synchronize do
38
+ return if @shutdown
39
+ @shutdown = true
40
+
41
+ # Close all browsers
42
+ @browsers.each do |browser|
43
+ browser.close rescue nil
44
+ end
45
+ @browsers.clear
46
+ end
47
+ end
48
+
49
+ private
50
+
51
+ def checkout_browser
52
+ # Try to get an available browser
53
+ browser = @available.pop(true) rescue nil
54
+
55
+ # If no browser available and we haven't reached max size, create a new one
56
+ if browser.nil?
57
+ @mutex.synchronize do
58
+ if @browsers.size < @max_size
59
+ browser = create_browser
60
+ @browsers << browser
61
+ end
62
+ end
63
+ end
64
+
65
+ # If still no browser, wait for one to become available
66
+ browser ||= @available.pop
67
+
68
+ # Verify browser is still alive
69
+ begin
70
+ browser.targets # Simple check to see if browser responds
71
+ browser
72
+ rescue
73
+ # Browser is dead, create a new one
74
+ @mutex.synchronize do
75
+ @browsers.delete(browser)
76
+ browser = create_browser
77
+ @browsers << browser
78
+ end
79
+ browser
80
+ end
81
+ end
82
+
83
+ def checkin_browser(browser)
84
+ return if @shutdown
85
+ @available.push(browser)
86
+ end
87
+
88
+ def create_browser
89
+ Puppeteer.launch(
90
+ product: 'firefox',
91
+ headless: true,
92
+ args: [
93
+ "--window-size=800,480",
94
+ "--disable-web-security"
95
+ ]
96
+ )
97
+ end
98
+ end
99
+
100
+ # Class-level browser pool shared across all instances
101
+ @@browser_pool = BrowserPool.new
102
+
9
103
  def initialize(html, opts = {})
10
104
  self.input = html
11
105
  self.image = !!opts[:image]
@@ -16,115 +110,80 @@ module TRMNLP
16
110
  def process
17
111
  convert_to_image
18
112
  image ? mono_image(output) : mono(output)
19
- output.path
20
- # IO.copy_stream(output, img_path)
113
+ output
21
114
  end
22
115
 
23
116
  private
24
117
 
25
- # def img_path
26
- # "#{Dir.pwd}/public/images/generated/#{SecureRandom.hex(3)}.bmp"
27
- # end
28
-
29
- # Constructs the command and passes the input to the vendor/puppeteer.js
30
- # script for processing. Returns a base64 encoded string
31
118
  def convert_to_image
32
119
  retry_count = 0
120
+
33
121
  begin
34
- # context = browser_instance.create_incognito_browser_context
35
- page = firefox_browser.new_page
36
- page.viewport = Puppeteer::Viewport.new(width: width, height: height)
37
- # NOTE: Use below for chromium
38
- # page.set_content(input, wait_until: ['networkidle0', 'domcontentloaded'])
39
- # Note: Use below for firefox
40
- page.set_content(input, timeout: 10000)
41
- page.evaluate(<<~JAVASCRIPT)
42
- () => {
43
- document.getElementsByTagName('html')[0].style.overflow = "hidden";
44
- document.getElementsByTagName('body')[0].style.overflow = "hidden";
45
- }
46
- JAVASCRIPT
47
- self.output = Tempfile.new
48
- page.screenshot(path: output.path, type: 'png')
49
- firefox_browser.close
50
- end
51
- rescue Puppeteer::TimeoutError, Puppeteer::FrameManager::NavigationError => e
52
- retry_count += 1
53
- firefox_browser.close
54
- if retry_count <= 1
55
- @browser = nil
56
- retry
57
- else
58
- puts "ERROR -> Converter::Html#convert_to_image_by_firefox -> #{e.message}"
122
+ @@browser_pool.with_page do |page|
123
+ # Configure page
124
+ page.viewport = Puppeteer::Viewport.new(width: width, height: height)
125
+
126
+ # Set content with appropriate wait strategy
127
+ page.set_content(input, timeout: 10000)
128
+
129
+ # Hide scrollbars
130
+ page.evaluate(<<~JAVASCRIPT)
131
+ () => {
132
+ document.getElementsByTagName('html')[0].style.overflow = "hidden";
133
+ document.getElementsByTagName('body')[0].style.overflow = "hidden";
134
+ }
135
+ JAVASCRIPT
136
+
137
+ # Take screenshot
138
+ self.output = Tempfile.new(['screenshot', '.png'])
139
+ page.screenshot(path: output.path, type: 'png')
140
+ end
141
+ rescue Puppeteer::TimeoutError, Puppeteer::FrameManager::NavigationError => e
142
+ retry_count += 1
143
+ if retry_count <= 1
144
+ retry
145
+ else
146
+ puts "ERROR -> ScreenGenerator#convert_to_image -> #{e.message}"
147
+ raise
148
+ end
59
149
  end
60
150
  end
61
151
 
62
- # Refer this PR where the author reused the browser instance https://github.com/YusukeIwaki/puppeteer-ruby/pull/100/files
63
- # This will increase the throughput of our image rendering process by 60-70%, saving about ~1.5 second per image generation.
64
- # On local it takes < 1 second now to generate the subsequent image.
65
- def firefox_browser
66
- @browser ||= Puppeteer.launch(
67
- product: 'firefox',
68
- headless: true,
69
- args: [
70
- "--window-size=#{width},#{height}",
71
- "--disable-web-security"
72
- # "--hide-scrollbars" #works only on chrome, using page.evaluate for firefox
73
- ]
74
- )
75
- end
76
-
77
- def Ferrum.cached_browser
78
- return nil unless $cached_browser
79
-
80
- $cached_browser
81
- end
82
-
83
- def Ferrum.cached_browser=(value)
84
- $cached_browser = value
85
- end
86
-
87
- # Overall at max wait for 2.5 seconds
88
- def wait_for_stop_loading(page)
89
- count = 0
90
- while page.frames.first.state != :stopped_loading && count < 20
91
- count += 1
92
- sleep 0.1
93
- end
94
- sleep 0.5 # wait_until: DomContentLoaded event is not available in ferrum
95
- end
96
-
97
152
  def mono(img)
98
153
  MiniMagick::Tool::Convert.new do |m|
99
154
  m << img.path
100
155
  m.monochrome # Use built-in smart monochrome dithering (but it's not working as expected)
101
156
  m.depth(color_depth) # Should be set to 1 for 1-bit output
102
157
  m.strip # Remove any additional metadata
103
- m << ('bmp3:' << img.path)
158
+ m << img.path
104
159
  end
105
160
  end
106
161
 
107
162
  def mono_image(img)
108
- # Changelog:
109
- # ImageMagick 6.XX used to convert the png to bitmap with dithering while maintaining the channel to 1
110
- # The same seems to be broken with imagemagick 7.XX
111
- # So in order to reduce the channel from 8 to 1, I just rerun the command, and it's working
112
- # TODO for future, find a better way to generate image screens.
163
+ # Convert to monochrome bitmap with proper dithering
164
+ # This implementation works with both ImageMagick 6.x and 7.x
113
165
  MiniMagick::Tool::Convert.new do |m|
114
166
  m << img.path
167
+
168
+ # First convert to grayscale to ensure proper channel handling
169
+ m.colorspace << 'Gray'
170
+
171
+ # Apply Floyd-Steinberg dithering for better quality
115
172
  m.dither << 'FloydSteinberg'
173
+
174
+ # Remap to a 50% gray pattern for better dithering
116
175
  m.remap << 'pattern:gray50'
117
- m.depth(color_depth) # Should be set to 1 for 1-bit output
118
- m.strip # Remove any additional metadata
119
- m << ('bmp3:' << img.path) # Converts to Bitmap.
120
- end
121
- MiniMagick::Tool::Convert.new do |m|
176
+
177
+ # Set the image type to bilevel (1-bit black and white)
178
+ m.type << 'Bilevel'
179
+
180
+ # Set color depth to 1 bit
181
+ m.depth << color_depth
182
+
183
+ # Remove any metadata to reduce file size
184
+ m.strip
185
+
122
186
  m << img.path
123
- m.dither << 'FloydSteinberg'
124
- m.remap << 'pattern:gray50'
125
- m.depth(color_depth) # Should be set to 1 for 1-bit output
126
- m.strip # Remove any additional metadata
127
- m << ('bmp3:' << img.path) # Converts to Bitmap.
128
187
  end
129
188
  end
130
189
 
@@ -134,4 +193,4 @@ module TRMNLP
134
193
 
135
194
  def color_depth = 1
136
195
  end
137
- end
196
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TRMNLP
4
- VERSION = "0.5.2".freeze
4
+ VERSION = "0.5.4".freeze
5
5
  end
@@ -0,0 +1 @@
1
+
@@ -45,9 +45,9 @@ Gem::Specification.new do |spec|
45
45
  # HTML rendering
46
46
  spec.add_dependency "liquid", "~> 5.6"
47
47
  spec.add_dependency "activesupport", "~> 8.0"
48
+ spec.add_dependency "actionview", "~> 8.0"
48
49
 
49
- # BMP rendering
50
- spec.add_dependency "ferrum", "~> 0.16"
50
+ # PNG rendering
51
51
  spec.add_dependency 'puppeteer-ruby', '~> 0.45.6'
52
52
  spec.add_dependency 'mini_magick', '~> 4.12.0'
53
53
 
@@ -59,6 +59,7 @@ Gem::Specification.new do |spec|
59
59
  spec.add_dependency "rubyzip", "~> 2.3.0"
60
60
  spec.add_dependency "thor", "~> 1.3"
61
61
  spec.add_dependency "oj", "~> 3.16.9"
62
+ spec.add_dependency "tzinfo-data", "~> 1.2025"
62
63
 
63
64
  # For more information and examples about making a new gem, check out our
64
65
  # guide at: https://bundler.io/guides/creating_gem.html
data/web/public/index.css CHANGED
@@ -14,6 +14,7 @@ menu {
14
14
  margin: 0;
15
15
  display: flex;
16
16
  justify-content: space-between;
17
+ max-width: 950px;
17
18
  }
18
19
 
19
20
  menu a {
@@ -34,49 +35,9 @@ menu a.active {
34
35
  color: white;
35
36
  }
36
37
 
37
- .case {
38
- width: 1000px;
39
- height: 680px;
40
- position: relative;
41
- }
42
-
43
- iframe {
44
- position: absolute;
45
- border: none;
46
- left: 98px;
47
- top: 65px;
48
- filter: grayscale(100%);
49
- }
50
-
51
- .case .case-overlay {
52
- position: absolute;
53
- width: 100%;
54
- height: 100%;
55
- top: 0;
56
- left: 0;
57
- background-size: cover;
58
- mix-blend-mode: multiply;
59
- pointer-events: none;
60
- }
61
-
62
- .case--none .case-overlay {
63
- background: none;
64
- }
65
-
66
- .case--white .case-overlay {
67
- background-image: url("white-case.jpg");
68
- }
69
-
70
- .case--black .case-overlay {
71
- background-image: url("black-case.jpg");
72
- }
73
-
74
- .case--clear .case-overlay {
75
- background-image: url("clear-case.jpg");
76
- }
77
-
78
- .case--none iframe {
79
- border: 1px solid black;
38
+ pre {
39
+ max-width: 950px;
40
+ overflow-x: scroll;
80
41
  }
81
42
 
82
43
  .spinner {