Hi!
I added this new section to my Dawn theme with the following code. I would like the text to be across the page when the page is loaded rather than starting on the right. Would love help on how to do this? Thank you!!
{%- if section.blocks.size > 0 and section.settings.show_marquee_bar -%}
<div class="marquee-bar messages">
<marquee width="100%" scrollamount="{{ section.settings.speed }}" direction="{{ section.settings.direction }}" {% if section.settings.pause_on_hover %}onmouseover="this.stop();" onmouseout="this.start();"{% endif %}>
{%- for block in section.blocks -%}
<div class="message" style="background:{{block.settings.colorBackground}};color:{{block.settings.colorText}};">{{block.settings.message}}</div>
{%- endfor -%}
</marquee>
</div>
<style>
.marquee-bar.messages{
position: relative;
overflow: hidden;
display: flex;
}
.marquee-bar .message{
text-align:center;
padding:2px 7%;
display: inline-block;
}
</style>
{%- endif -%}
{% schema %}
{
"name": "Marquee",
"settings": [
{
"type": "checkbox",
"id": "show_marquee_bar",
"label": "Show"
},
{
"type": "select",
"id": "direction",
"options": [
{
"value": "left",
"label": "Right to Left"
},
{
"value": "right",
"label": "Left to Right"
}
],
"default": "right",
"label": "Direction"
},
{
"type": "checkbox",
"id": "pause_on_hover",
"label": "Pause on hover"
},
{
"type": "text",
"id": "speed",
"label": "Speed",
"default": "3"
}
],
"blocks": [
{
"type": "header",
"name": "Message",
"settings": [
{
"id": "message",
"type": "textarea",
"label": "Message"
},
{
"type": "color",
"id": "colorBackground",
"label": "Background color",
"default": "#ffffff"
},
{
"type": "color",
"id": "colorText",
"label": "Text color",
"default": "#000"
}
]
}
],
"presets": [
{
"name": "Marquee"
}
]
}
{% endschema %}
Website:
https://isla-base-theme.myshopify.com/pages/press-alternative
password: demo