Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customise visual design for mobile devices #29

Open
tomstuart opened this issue Oct 25, 2014 · 3 comments
Open

Customise visual design for mobile devices #29

tomstuart opened this issue Oct 25, 2014 · 3 comments

Comments

@tomstuart
Copy link
Contributor

The font sizes and page proportions don’t look good on a mobile device (e.g. my iPhone). It would be nice to use media queries to make things look better for mobile browsers.

@mudge
Copy link
Contributor

mudge commented Oct 25, 2014

An easy fix for this is to add the following to the layout head and tweak the h1 font size a little:

    <meta name="viewport" content="width=device-width, initial-scale=1">

The only issue is the cellular automaton's fixed width. I tried moving its dimensions into the stylesheet (a width of 100% and a height of 50%) but it no longer renders correctly. I switched from using this.canvas.width and this.canvas.height to this.canvas.offsetWidth and this.canvas.offsetHeight (see http://stackoverflow.com/questions/294250/how-do-i-retrieve-an-html-elements-actual-width-and-height) but the cell sizes were still all wrong. One to investigate further, I think.

@tomstuart
Copy link
Contributor Author

All I know is that the <canvas> width and height attributes control the dimensions of the underlying bitmap, which is unaffected by anything you can do in CSS — the latter just controls how the bitmap is scaled for display. (This now makes me realise that it’s silly have a cellSize in the JavaScript: we should just do 1 cell = 1 pixel, and then scale up in CSS if we want a chunkier display.)

@mudge
Copy link
Contributor

mudge commented Jan 23, 2019

Is this still the case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants