Giter VIP home page Giter VIP logo

Comments (11)

filips123 avatar filips123 commented on May 22, 2024 1

I tested this with Huawei P20 which isn't so small phone 🙂.

I've used Chrome for Android in PWA mode and I've got screen.width = 360 and screen.height = 748 in developer tools.

from stealth.

cookiengineer avatar cookiengineer commented on May 22, 2024

Well, currently the UI kind of requires a minimum resolution of 500x... and it requires CSS media queries to work; can't influence that without a custom app that uses an own webview implementation.

What is your device resolution? Is it higher than 500px in screen width? If so, there might be some glitch with the <meta name="viewport"> as I've set it to be not user-scalable and to have always a scale of 1. Not sure whether all mobile browsers respect that setting correctly.

I could probably cheat around that behaviour with the CSS zoom: x.y property, but this would cause so many other problems (especially with context menu, tabs, sidebars etc.) that it's a very bad idea.

from stealth.

cookiengineer avatar cookiengineer commented on May 22, 2024

Huawei P20

Hm... gsmarena says that the actual display resolution is 1080 x 2240 pixels, 18.7:9 ratio (~429 ppi density) so I guess something's wrong with my assumption that scale=1 is actually a 1:1 translation to real pixels.

Could you check what the window.devicePixelRatio value returns?

from stealth.

filips123 avatar filips123 commented on May 22, 2024

@cookiengineer Yes, this is weird. window.devicePixelRatio returns 3.

from stealth.

cookiengineer avatar cookiengineer commented on May 22, 2024

The devicePixelRatio = 3 actually makes sense, as the window.innerWidth * 3 is the actual display resolution then.

What happens if you change the browser/index.html's viewport meta tag like this:

-		<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
+		<meta name="viewport" content="initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">

(removing the width=device-width entry)

from stealth.

filips123 avatar filips123 commented on May 22, 2024

It is still same.

from stealth.

cookiengineer avatar cookiengineer commented on May 22, 2024

Okay, after reading the css-device-adapt specification I guess the behaviour that is wanted for the Stealth Browser is this:

<meta name="viewport" content="user-scalable=no">

... because this will actually lead to the correct behaviour when navigating around, and will render the UI in the scale factor that is given by the device. If I'm gonna implement a zoom functionality, it has to be applied to the iframe anyways; instead of the rest of the user interface, so I guess the CSS zoom factor will then be modifiable via overridden shortcuts or gestures.

from stealth.

cookiengineer avatar cookiengineer commented on May 22, 2024

I pushed the fix to X0, and so far with testing this seems to be the wanted behaviour for the user interface. It works on my legacy Android 4.4 that has a device pixel ratio of ~2.3 and with the device emulator in Chrome (which apparently just sets different zoom levels based on its profiles).

Can you confirm that the UI looks not so broken on your mobile?

from stealth.

filips123 avatar filips123 commented on May 22, 2024

Icons and now in one line and text has no overflows.

But I now think that the icons are too small and it is hard to click them.

screenshot

from stealth.

cookiengineer avatar cookiengineer commented on May 22, 2024

What I don't understand in the screenshot is the relation between font-sizes. The baseline for all fonts is 16px font-size, and it's inherited by the article element in the iframe.

Yet the radio elements in the settings are rendered in a completely different size compared to the surrounding content.

Honestly I have no idea on how to fix this without messing up the rest of the codebase. Maybe with some setting for UI scale that then is applied via zoom on the UI elements in the header/sidebars!?

Gotta think about this one a bit.

from stealth.

cookiengineer avatar cookiengineer commented on May 22, 2024

It took a very long while, but I've implemented a new UI today.

The new UI will blend in a toggle button once the screen width is too small to fit in all the UI elements, which will toggle the Tab sidebar and the additional settings as an overlay.

from stealth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.