vipassana-design-standards 0.0.14 → 0.0.16

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 (101) hide show
  1. package/HOW_TO_PUBLISH.md +7 -11
  2. package/README.md +26 -17
  3. package/TODO +9 -11
  4. package/demo/.gitattributes +5 -0
  5. package/demo/.ruby-version +1 -0
  6. package/demo/Gemfile +29 -0
  7. package/demo/Gemfile.lock +182 -0
  8. package/demo/Rakefile +6 -0
  9. package/demo/app/assets/config/manifest.js +2 -0
  10. package/demo/app/assets/stylesheets/application.css +15 -0
  11. package/demo/app/controllers/application_controller.rb +3 -0
  12. package/demo/app/controllers/demo_controller.rb +4 -0
  13. package/demo/app/views/demo/index.html.erb +2 -0
  14. package/demo/app/views/layouts/application.html.erb +73 -0
  15. package/demo/bin/bundle +114 -0
  16. package/demo/bin/rails +4 -0
  17. package/demo/bin/rake +4 -0
  18. package/demo/bin/setup +25 -0
  19. package/demo/config/application.rb +37 -0
  20. package/demo/config/boot.rb +3 -0
  21. package/demo/config/credentials.yml.enc +1 -0
  22. package/demo/config/environment.rb +5 -0
  23. package/demo/config/environments/development.rb +56 -0
  24. package/demo/config/environments/production.rb +72 -0
  25. package/demo/config/environments/test.rb +50 -0
  26. package/demo/config/initializers/assets.rb +12 -0
  27. package/demo/config/initializers/content_security_policy.rb +25 -0
  28. package/demo/config/initializers/filter_parameter_logging.rb +8 -0
  29. package/demo/config/initializers/inflections.rb +16 -0
  30. package/demo/config/initializers/permissions_policy.rb +11 -0
  31. package/demo/config/locales/en.yml +33 -0
  32. package/demo/config/puma.rb +43 -0
  33. package/demo/config/routes.rb +5 -0
  34. package/demo/config.ru +6 -0
  35. package/demo/public/404.html +67 -0
  36. package/demo/public/422.html +67 -0
  37. package/demo/public/500.html +66 -0
  38. package/demo/public/apple-touch-icon-precomposed.png +0 -0
  39. package/demo/public/apple-touch-icon.png +0 -0
  40. package/demo/public/favicon.ico +0 -0
  41. package/demo/public/robots.txt +1 -0
  42. package/demo.html +55 -0
  43. package/dist/0.0.16/css/bootstrap5-theme.css +12623 -0
  44. package/dist/0.0.16/css/bootstrap5-theme.css.map +1 -0
  45. package/dist/0.0.16/css/bootstrap5-theme.min.css +6 -0
  46. package/dist/0.0.16/css/bootstrap5-theme.rtl.css +12586 -0
  47. package/dist/0.0.16/css/bootstrap5-theme.rtl.min.css +6 -0
  48. package/dist/0.0.16/css/fonts-gu.css +65 -0
  49. package/dist/0.0.16/css/fonts-gu.min.css +1 -0
  50. package/dist/0.0.16/css/fonts-ja.css +2399 -0
  51. package/dist/0.0.16/css/fonts-ja.min.css +1 -0
  52. package/dist/0.0.16/css/fonts-km.css +2399 -0
  53. package/dist/0.0.16/css/fonts-km.min.css +1 -0
  54. package/dist/0.0.16/css/fonts.css +472 -0
  55. package/dist/0.0.16/css/fonts.css.map +1 -0
  56. package/dist/0.0.16/css/fonts.min.css +1 -0
  57. package/dist/0.0.16/css/logo.css +135 -0
  58. package/dist/0.0.16/css/logo.css.map +1 -0
  59. package/dist/0.0.16/css/logo.min.css +1 -0
  60. package/dist/0.0.16/js/bootstrap.bundle.js +7075 -0
  61. package/dist/0.0.16/js/bootstrap.bundle.js.map +1 -0
  62. package/dist/0.0.16/js/bootstrap.bundle.min.js +7 -0
  63. package/dist/0.0.16/js/bootstrap.bundle.min.js.map +1 -0
  64. package/dist/css/bootstrap5-theme.css +201 -4552
  65. package/dist/css/bootstrap5-theme.css.map +1 -1
  66. package/dist/css/bootstrap5-theme.min.css +1 -1
  67. package/dist/css/bootstrap5-theme.rtl.css +12586 -0
  68. package/dist/css/bootstrap5-theme.rtl.min.css +6 -0
  69. package/dist/css/fonts-gu.css +65 -0
  70. package/dist/css/fonts-gu.min.css +1 -0
  71. package/dist/css/fonts-ja.css +2399 -0
  72. package/dist/css/fonts-ja.min.css +1 -0
  73. package/dist/css/fonts-km.css +2399 -0
  74. package/dist/css/fonts-km.min.css +1 -0
  75. package/dist/css/fonts.css +23 -4386
  76. package/dist/css/fonts.css.map +1 -1
  77. package/dist/css/fonts.min.css +1 -1
  78. package/dist/css/logo.css +0 -9
  79. package/dist/css/logo.css.map +1 -1
  80. package/dist/css/logo.min.css +1 -0
  81. package/dist/js/bootstrap.bundle.js +7075 -0
  82. package/dist/js/bootstrap.bundle.js.map +1 -0
  83. package/dist/js/bootstrap.bundle.min.js +7 -0
  84. package/dist/js/bootstrap.bundle.min.js.map +1 -0
  85. package/index.html +8 -8
  86. package/lib/vipassana/design_standards_helper.rb +111 -0
  87. package/lib/vipassana/logos_inline_svg.rb +1 -1
  88. package/lib/vipassana/translations.rb +9 -1
  89. package/lib/vipassana-design-standards.rb +1 -1
  90. package/package.json +13 -2
  91. package/src/javascripts/index.js +4 -7
  92. package/src/stylesheets/bootstrap5-theme.scss +11 -1
  93. package/src/stylesheets/fonts.scss +16 -4867
  94. package/src/stylesheets/layout/vds-header.scss +8 -0
  95. package/src/stylesheets/layout/vds-layout.scss +6 -5
  96. package/src/stylesheets/logo.scss +1 -8
  97. package/src/stylesheets/specific-fonts/fonts-gu.css +65 -0
  98. package/src/stylesheets/specific-fonts/fonts-ja.css +2399 -0
  99. package/src/stylesheets/specific-fonts/fonts-km.css +2399 -0
  100. package/vipassana-design-standards.gemspec +1 -1
  101. package/lib/vipassana/logo_helper.rb +0 -50
package/index.html CHANGED
@@ -3,9 +3,9 @@
3
3
  <head>
4
4
  <meta charset="utf-8"/>
5
5
  <title>Vipassana Meditation as Taught by S.N Goenka - Design Standards</title>
6
- <link rel="stylesheet" href="./src/stylesheets/index.css?ver=0.14">
7
- <link rel="stylesheet" href="./src/stylesheets/fonts.css?ver=0.14">
8
- <link rel="stylesheet" href="./src/stylesheets/logo.css?ver=0.14">
6
+ <link rel="stylesheet" href="./src/stylesheets/index.css?ver=0.16">
7
+ <link rel="stylesheet" href="./dist/css/fonts.css?ver=0.16">
8
+ <link rel="stylesheet" href="./dist/css/logo.css?ver=0.16">
9
9
 
10
10
  <link rel="icon" href="/dist/favicon.png">
11
11
 
@@ -29,26 +29,26 @@
29
29
  </button>
30
30
  </a>
31
31
 
32
- <a href="dist/logos.zip?ver=0.14">
32
+ <a href="dist/logos.zip?ver=0.16">
33
33
  <button type="button" class="btn-primary">
34
34
  <i class="gg-software-download"></i>Recommended Logos <small>(2Mb)</small>
35
35
  </button>
36
36
  </a>
37
37
 
38
- <a href="dist/fonts.zip?ver=0.14">
38
+ <a href="dist/fonts.zip?ver=0.16">
39
39
  <button type="button" class="btn-primary">
40
40
  <i class="gg-software-download"></i>Fonts <small>(600kb)</small>
41
41
  </button>
42
42
  </a>
43
43
 
44
44
  <p>
45
- <a href="dist/dhamma-wheel.svg?ver=0.14">
45
+ <a href="dist/dhamma-wheel.svg?ver=0.16">
46
46
  <button type="button" class="btn-outline-primary">
47
47
  <i class="gg-software-download"></i>Dhamma Wheel <small>(SVG)</small>
48
48
  </button>
49
49
  </a>
50
50
 
51
- <a href="dist/favicon.png?ver=0.14">
51
+ <a href="dist/favicon.png?ver=0.16">
52
52
  <button type="button" class="btn-outline-primary">
53
53
  <i class="gg-software-download"></i>Favicon
54
54
  </button>
@@ -223,7 +223,7 @@
223
223
 
224
224
  <script type="module">
225
225
  import { createApp } from 'https://unpkg.com/vue@3/dist/vue.esm-browser.js'
226
- import App from './src/javascripts/index.js?ver=0.14'
226
+ import App from './src/javascripts/index.js?ver=0.16'
227
227
 
228
228
  createApp(App).mount('#app')
229
229
  </script>
@@ -0,0 +1,111 @@
1
+ module Vipassana
2
+ module DesignStandardsHelper
3
+ require "vipassana/logos_inline_svg.rb"
4
+ require "vipassana/translations.rb"
5
+
6
+ def is_rtl?(locale)
7
+ locale.to_sym.in? [:ar, :fa, :he]
8
+ end
9
+
10
+ def vds_favicon_tag
11
+ favicon_link_tag "https://design-standards.dhamma.org/dist/favicon.png"
12
+ end
13
+
14
+ def vds_asset_url(path, localhost = false)
15
+ return "http://localhost:5500/dist/#{path}" if localhost # For localhost dev, just run vscode liveserver
16
+
17
+ version = Gem.loaded_specs['vipassana-design-standards'].version
18
+ "https://design-standards.dhamma.org/dist/#{version}/#{path}"
19
+ end
20
+
21
+ def vds_bootstrap_theme_css_tag(locale: I18n.locale, localhost: false)
22
+ tags = [
23
+ stylesheet_link_tag(vds_asset_url("css/bootstrap5-theme#{is_rtl?(locale) ? '.rtl' : ''}.min.css", localhost)),
24
+ ]
25
+ # Add specific fonts for languages not compatible with Footlight and Lato
26
+ if locale.to_sym.in? [:gu, :ja, :km]
27
+ tags << stylesheet_link_tag(vds_asset_url("css/fonts-#{locale}.min.css"))
28
+ end
29
+
30
+ tags.join.html_safe
31
+ end
32
+
33
+ def vds_bootstrap_theme_js_tag(locale: I18n.locale, localhost: false)
34
+ javascript_include_tag vds_asset_url("js/bootstrap.bundle.min.js", localhost)
35
+ end
36
+
37
+ def vds_logo_svg(locale: I18n.locale, disposition: "default", tagline: true, height: nil, width: nil)
38
+ height = 70 if height.nil? && width.nil?
39
+
40
+ data = VDS_SVGS[locale.to_sym] || VDS_SVGS[:en]
41
+ disposition += '-no-tagline' if tagline == false
42
+ string = data[disposition.to_sym] || data[:normal]
43
+
44
+ string.gsub!("<svg", "<svg height=\"#{height}\"") if height.present?
45
+ string.gsub!("<svg", "<svg width=\"#{width}\"") if width.present?
46
+
47
+ string.html_safe
48
+ end
49
+
50
+ def vds_logo_html(locale: I18n.locale, disposition: "default", size: '18', tagline: true, dark: false)
51
+ trans = VDS_TRANSLATIONS[locale.to_sym] || VDS_TRANSLATIONS[:en]
52
+
53
+ if disposition == "mobile"
54
+ disposition = "left-two-lines"
55
+ tagline = false
56
+ end
57
+
58
+ result = <<-HTML
59
+ <div class="vipassana-logo"
60
+ data-disposition="#{disposition}"
61
+ data-tagline="#{tagline}"
62
+ data-dark-mode="#{dark}"
63
+ data-reverse="#{trans[:reverse]}"
64
+ style="font-size: #{size}px">
65
+ <img class="logo-wheel" src="https://design-standards.dhamma.org/dist/dhamma-wheel.svg" />
66
+ <div class="logo-text">
67
+ <h1 class="logo-title">
68
+ <span data-start-with="#{trans[:vipassana_meditation].at(0).downcase}">
69
+ #{trans[:vipassana_meditation]}
70
+ </span>
71
+ <span class="logo-space">&nbsp;</span>
72
+ <span>#{trans[:as_taught]}</span>
73
+ </h1>
74
+ <div class="logo-subtitle">#{trans[:in_the_tradition]}</div>
75
+ </div>
76
+ </div>
77
+ HTML
78
+ result.html_safe
79
+ end
80
+
81
+ # Some icons from bootstrap icons, so all websites use the same
82
+ def vds_icon_locale
83
+ result = <<-HTML
84
+ <svg xmlns="http://www.w3.org/2000/svg" width="1.2em" height="1.2em" fill="currentColor" class="bi bi-translate" viewBox="0 0 16 16">
85
+ <path d="M4.545 6.714 4.11 8H3l1.862-5h1.284L8 8H6.833l-.435-1.286H4.545zm1.634-.736L5.5 3.956h-.049l-.679 2.022H6.18z"/>
86
+ <path d="M0 2a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v3h3a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-3H2a2 2 0 0 1-2-2V2zm2-1a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H2zm7.138 9.995c.193.301.402.583.63.846-.748.575-1.673 1.001-2.768 1.292.178.217.451.635.555.867 1.125-.359 2.08-.844 2.886-1.494.777.665 1.739 1.165 2.93 1.472.133-.254.414-.673.629-.89-1.125-.253-2.057-.694-2.82-1.284.681-.747 1.222-1.651 1.621-2.757H14V8h-3v1.047h.765c-.318.844-.74 1.546-1.272 2.13a6.066 6.066 0 0 1-.415-.492 1.988 1.988 0 0 1-.94.31z"/>
87
+ </svg>
88
+ HTML
89
+ result.html_safe
90
+ end
91
+
92
+ def vds_icon_account
93
+ result = <<-HTML
94
+ <svg xmlns="http://www.w3.org/2000/svg" width="2.2em" height="2.2em" fill="currentColor" class="bi bi-person-circle" viewBox="0 0 16 16">
95
+ <path d="M11 6a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"/>
96
+ <path fill-rule="evenodd" d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8zm8-7a7 7 0 0 0-5.468 11.37C3.242 11.226 4.805 10 8 10s4.757 1.225 5.468 2.37A7 7 0 0 0 8 1z"/>
97
+ </svg>
98
+ HTML
99
+ result.html_safe
100
+ end
101
+
102
+ def vds_icon_menu
103
+ result = <<-HTML
104
+ <svg xmlns="http://www.w3.org/2000/svg" width="1.8em" height="1.8em" fill="currentColor" class="bi bi-list" viewBox="0 0 16 16">
105
+ <path fill-rule="evenodd" d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5z"/>
106
+ </svg>
107
+ HTML
108
+ result.html_safe
109
+ end
110
+ end
111
+ end