Is it possible to caputure the browser widow/screen size in Hubl?
OR
Is it possible to capture and pass it to Hubl using Javascript?
The following code is what I've tried so far but Hubl doesn't seem to recognize the javascript.
<script type="text/javascript">
let swidth = screen.width;
if (swidth < 1025) {
console.log("Mobile: Screen width is at least 1025px");
{% set screensize = "mobile" %}
} else {
console.log("Desktop: Screen width is at greater than 1025px");
{% set screensize = "desktop" %}
}
</script>
Ok, well as I say you can't do that eith HubL and if you can't share anymore of what yo're trying to achieve we're at a bit of an impass.
I created a module for a client before where the hero video had to be different on mobile and achieved it with this use of javascript and module fields