Posts by MrSoul

    Great, I used the first solution.

    However, it only seems to work with a get() (I'm having trouble understanding which variable you can call with or without a get()).


    And I've just found for the parameters in skin_settings :

    • In xml: get:skin_settings.design_margin
    • In actions : skin_settings.design_margin

    However, I have just one small question about this: if I want to retrieve several variables in the same XML parameter, it doesn't work any more:

    To fill in childmargin="30 30 120", childmargin="get:skin_settings.design_margin get:skin_settings.design_margin get:skin_settings.design_marginbottom" doesn't work, any idea how?

    to get the displayed pixel size of the parent use layer[boxbg].pixelwidth/height

    to get the pixel size of the image use layer[boximg].imagewidth/height (after layer[boximg].loaded=true)

    in layer[boximg].resize set the images width/height to be contained in the parents pixelwidth/height

    Thank you, that was very helpful!

    I've decided to compare the aspect ratio of the viewport without the margins to the aspect ratio of the image so that it works regardless of the size of the image/viewport:


    So I've got two little questions to improve things and make the code cleaner:

    - Can we add general variables like those found in the skin_settings parameters?

    - Could we have something like this on the hotspots :

    XML
    <hotspot [...] imgurl="../photos/20230815144033_4711.jpg" onclick="open_lightbox();" />

    rather than :

    XML
    <hotspot [...] onclick="set(layer[boximg].img_url, '../photos/20230815144033_4711.jpg'); open_lightbox();" />

    And how do you set it up? (retrieve the imgurl parameter in the action to reuse it)

    PS: Sorry, I have a lot of trouble with the doc, English is not my natural language, I'd even say I'm rubbish at it and this one is "exhaustive"!

    I've added an action that sets ‘prop’ to width for horizontal screens (desktop) and to height for vertical screens (mobile). It also updates it if the screen size changes.

    It doesn't fix the problem, but it makes it less obvious, so if you have any ideas, I'd love to hear them.

    PS: what would be the best method of getting the size of the image I want to open?
    PS2: Wouldn't it be easier to use an iframe? But then, how do you send the image url from KrPano to the iframe? (to have just one html+js, or php page)


    Hello,

    I'm having a problem with the "prop" value, which is causing a bug in my Lightbox.

    This lightbox is built with a container layer to add margin and darken the background, and inside, a layer that contains the image.

    I'd like this image to be displayed at a maximum of 100% of the parent at its largest width, while respecting its aspect ratio.

    First of all, the maxwidth and maxheight parameters don't work with percentages, which doesn't suit me (if the image is smaller than its context, then it's zoomed in, which I don't want).

    But I especially have a problem with "prop"from what I've tested:

    • If the image size is not defined, it will be displayed at its original size, regardless of the context.
    • If width and height are set to 100%, the image is displayed at 100% of the context (after deducting the margins defined in the container), but this logically breaks the aspect ratio.
    • If the width or height is set to 100% and the other value is set to prop, then the aspect ratio is respected and the 100% value respects the context and its margins, but the other axis set to prop no longer respects the context and may go outside the margins and the viewport...

    As a result, in my example, if I want to display a horizontal image on a vertical screen, the image is taken out of the screen, and if I invert height and width, then it would be the vertical images that would be taken out of the display on a horizontal screen.

    In short, what I'd like is the equivalent of the "object-fit: contain;" function in css:

    CSS
    img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    Do you have any ideas on how to get round this problem?

    Here's my code:

    Thank you

    Thank you very much Klaus, this has enabled me to make the little lightbox I needed.

    I do have one small problem though.

    With my code, if I want to display a horizontal image on mobile, it goes outside the margins defined in the boxbg layer.

    How can I ensure that the image in the boximg layer is displayed at 100% of both axes of the parent (boxbg), without the margins and while maintaining its aspect ratio?

    Last little question, is there anything else I need to optimise in my code?


    Thank you

    Hello,

    There's something I didn't quite understand about the positioning of the layers.

    Basically, I'd like to have a container layer that takes up 100% of the safezone (or at least the viewport), minus a margin (say 30px top, right, left, and for the bottom, the size of the controlbar + 30px).

    I've tried a width="calc:100%-60px", but the 100% isn't taken into account.

    Are there any variables that could help me?

    Hello everyone,


    For several years now, various optimisation guidelines have been recommending the use of the WebP (and AV1 / AV2) format for web projects.


    WebP is a modern, open image format developed by Google that is 25-35% smaller than JPEG.

    What's more, this format can be considered mature, with a 96% compatibility rate.


    Using this format has a number of advantages:

    • Less storage space required on servers.
    • Less bandwidth needed to serve these experiences to visitors.
    • Reduced loading times.
    • Improved metrics.

    And as a corollary :

    • Lower hosting costs.
    • Greener hosting.
    • A better user experience.
    • Improved SEO.


    *attention* It's about time we were able to integrate it into KrPano *smile*


    PS: There is also the AVIF format, which is more recent and more impressive in many respects, but for the moment it is much less widely adopted, with a 92% compatibility rate. But it's worth keeping a close eye on, especially in version 2 (AV2), as it could well replace WebP in the years to come.

    Hello,

    I am in the process of recreating my Google API keys, however, I have a small question.
    I would like to restrict my key, only for the necessary APIs.

    The choice is wide:

    • Directions API
    • Distance Matrix API
    • Geocoding API
    • Geolocation API
    • Maps Elevation API
    • Maps Embed API
    • Maps JavaScript API
    • Maps SDK for Android
    • Maps SDK for iOS
    • Maps Static API
    • Places API
    • Roads API
    • Street View Publish API
    • Street View Static API
    • Time Zone API


    I would say that the Google Map module needs :

    • Maps JavaScript API
    • Geolocation API
    • Maps Static API

    Am I right?

    Thanks in advance.