<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic HubL with Javascript - Progress Bar in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/HubL-with-Javascript-Progress-Bar/m-p/580877#M27511</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been trying to implement a progress bar as a HubSpot custom module but the HubL field seems to not be stored in my Javascript variable. Could anyone share insights on what might be wrong? Please find the HTML, CSS, JS and JSON files below.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div id="container"&amp;gt;&amp;lt;/div&amp;gt;

&amp;lt;div class="maximum"&amp;gt;{{ module.percentage }}&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;LI-CODE lang="css"&gt;#container {
  margin: 20px;
  width: 400px;
  height: 8px;
  position: relative;
}
#maximum {
  display: none;
} &lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;var bar = new ProgressBar.Line(container, {
    strokeWidth: 4,
    easing: 'easeInOut',
    duration: 5000,
    color: '#FF2170',
    trailColor: '#eee',
    trailWidth: 1,
    svgStyle: {width: '100%', height: '100%'},
    text: {
      style: {
        // Text color.
        // Default: same as stroke color (options.color)
        color: '#ff2170',
        position: 'absolute',
        right: '0',
        top: '30px',
        padding: 0,
        margin: 0,
        transform: null
      },
      autoStyleContainer: false
    },
    from: {color: '#FF2170'},
    to: {color: '#FF2170'},
    step: (state, bar) =&amp;gt; {
      bar.setText(Math.round(bar.value() * 100) + ' %');
    }
  });

  var maxm = document.querySelectorAll('.maximum');

  
  bar.animate(maxm);  // Number from 0.0 to 1.0&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "name": "percentage",
    "label": "Progress Percentage (in %)",
    "required": false,
    "locked": false,
    "display": "slider",
    "min": 0.01,
    "max": 1,
    "step": 0.01,
    "type": "number",
    "prefix": "",
    "suffix": "",
    "default": null
  }
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Feb 2022 11:15:07 GMT</pubDate>
    <dc:creator>VGentile</dc:creator>
    <dc:date>2022-02-22T11:15:07Z</dc:date>
  </channel>
</rss>

