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

[Site] Better the CSS, and Make Display Mobile-Friendly #241

Open
pishoyg opened this issue Sep 13, 2024 · 7 comments
Open

[Site] Better the CSS, and Make Display Mobile-Friendly #241

pishoyg opened this issue Sep 13, 2024 · 7 comments
Labels
dev Why: Developer experience UI Why: Better user interface user Why: User convenience
Milestone

Comments

@pishoyg
Copy link
Owner

pishoyg commented Sep 13, 2024

No description provided.

@pishoyg pishoyg added maintenance UI Why: Better user interface user Why: User convenience labels Sep 13, 2024
@pishoyg pishoyg added this to the Pipeline: Site milestone Sep 13, 2024
@pishoyg pishoyg added this to coptic Sep 13, 2024
@github-project-automation github-project-automation bot moved this to Todo in coptic Sep 13, 2024
pishoyg added a commit that referenced this issue Sep 15, 2024
This keeps things simple and localized, and will make it possible to
reuse the styling for other subpages as well.
@pishoyg pishoyg reopened this Sep 16, 2024
@pishoyg
Copy link
Owner Author

pishoyg commented Sep 16, 2024

  1. Flashcard pages are far from having mobile-friendly display. Make them look more like they do on Anki.
  2. Revisit the Crum Xooxle page display.

@pishoyg
Copy link
Owner Author

pishoyg commented Oct 8, 2024

Adding the card class might do the trick.

@pishoyg pishoyg changed the title [Site] Make Display Mobile-Friendly [Site] Better the CSS, and Make Display Mobile-Friendly Oct 9, 2024
@pishoyg
Copy link
Owner Author

pishoyg commented Oct 9, 2024

TODO:

  1. All images in the Crum notes to be resized by the @media rule.
  2. Fix the Crum note styling (might be automatically fixed if images in the Crum notes are allowed to be resized by the @media rule).
  3. KELLIA search results have a fixed width, and they don't show on mobile!
  4. Can / should you store all images under one <figure> tag?
  5. Do you need to restore the figure img rule's vertical-align: top property?
  6. Eliminate all styling from within the HTML. Restrict styling, including tag attributes such as width, to CSS.
  7. Partially revert dd5ee96, using resized logos. The larger logos might be making the page a little slower, and they often end up rendering in their original sizes, e.g. on GitHub Android or on Edge Android! While this is, technically speaking, a browser issue rather than our own issue, it's still nice to address it.

pishoyg added a commit that referenced this issue Oct 9, 2024
Summary of changes:
- Control the KELLIA table width using percentages rather than `px`
  units. This makes the display much better on mobile. It's still not
  mobile-friendly, because the results (search) table has tables within
  cells! But it's a bit better. More content actually shows on small
  screens than previously, and we start losing content at around ~500px
  rather than ~670px.
- Delete idempotent rules for unused classes `sense_n` and `sense_id`.
- Delete an idempotent `float: right` rule for `.bible`.
- Remove the table border on small screens. We thought that changing the
  table border colors to light gray (#DDD) instead of black would
  prettify the rendering on small screens. We implemented it
  simplistically with a single `td`-generic rule, without implementing
  the `last-child`- or `first-child`-specific rules. It's not worth
  maintaining, so we simply delete it.
pishoyg added a commit that referenced this issue Oct 9, 2024
This gives us the ability to extract text from the HTML more granularly,
which will help us output an optimized HTML, while also retaining just
the HTML tags that we need.

The reduced HTML will also help us make the search page more
mobile-friendly.
pishoyg added a commit that referenced this issue Oct 9, 2024
Also get rid of the KELLIA tables, to make the search page more
mobile-friendly.
pishoyg added a commit that referenced this issue Oct 9, 2024
Newlines are problematic, because they get converted downstream (by the
Xooxle engine) to `<br>` tags.
pishoyg added a commit that referenced this issue Oct 9, 2024
Pick up the use of the correct HTML class.

NOTE: We (temporarily) changed the value of the `--web_mask` flag in
Flashcards, in order to rewrite copticsite data.
pishoyg added a commit that referenced this issue Oct 9, 2024
This is a followup to 7f6f726. We added
the classes for the spellings and the dialect codes, but not types!
pishoyg added a commit that referenced this issue Oct 9, 2024
Pick up the addition of the `type` class.
pishoyg added a commit that referenced this issue Oct 9, 2024
pishoyg added a commit that referenced this issue Oct 9, 2024
@pishoyg
Copy link
Owner Author

pishoyg commented Oct 9, 2024

Thanks to 90d16eb, and the subsequent d46980f, the new search page is much more mobile-friendly. We no longer have tables within tables!
Right now, we start losing content in the KELLIA table at 412px.

NOTE: We could perhaps make up for some of that loss by eliminating padding or margins!

pishoyg added a commit that referenced this issue Oct 9, 2024
This partially reverts dd5ee96.

The larger logos might be making the page a little slower, and they
often end up rendering in their original sizes, e.g. on GitHub Android
or on Edge Android! While this is, technically speaking, a browser issue
rather than our own issue, it's still nice to address it.
pishoyg added a commit that referenced this issue Oct 21, 2024
This mainly picks up changes related to #227, but there are also other
categories of changes.
pishoyg added a commit that referenced this issue Oct 26, 2024
This makes it possible to read the CSS file from a different domain.
This is useful when developing the site locally, when we try to test the
site by opening an HTML file without a server.

See
https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin.
pishoyg added a commit that referenced this issue Oct 26, 2024
Pick up disabling CORS for CSS files. And pick up the new images for 1.
pishoyg added a commit that referenced this issue Oct 27, 2024
pishoyg added a commit that referenced this issue Oct 27, 2024
pishoyg added a commit that referenced this issue Oct 27, 2024
Our logic used to fail with this error when run locally *without* a
server:
```
script.js:51 Uncaught SecurityError: Failed to read the 'cssRules'
property from 'CSSStyleSheet': Cannot access rules
    at new Highlighter (script.js:51:42)
    at main (script.js:387:25)
    at script.js:679:3
```
This is due to CORS. We tried disabling CORS in
2e328af, but this ended up causing
other problems, so we reverted that commit. Now we try to work around
the failure by resorting to the Anki highlighting when failing to read
CSS rules in the JavaScript.
pishoyg added a commit that referenced this issue Oct 27, 2024
Mostly #227, with a bit of JavaScript (#241), and an image (#5).
@pishoyg pishoyg self-assigned this Oct 30, 2024
pishoyg added a commit that referenced this issue Nov 19, 2024
There is no need to fill large spaces with titles. The search
functionality is more worthy of the space.

Also keep the search panel (search box and checkboxes) on the same line
on mobile.
pishoyg added a commit that referenced this issue Nov 21, 2024
@pishoyg pishoyg modified the milestones: Pipeline: Site, Site v1.0 Nov 24, 2024
@pishoyg pishoyg removed their assignment Nov 28, 2024
pishoyg added a commit that referenced this issue Dec 10, 2024
This reduces jitter. Otherwise, if they are visible by default and only
get hidden by JavaScript, they will jitter on page load.
@pishoyg pishoyg added the dev Why: Developer experience label Feb 23, 2025
@pishoyg pishoyg modified the milestones: Site v1.0, Pipeline: Site Feb 27, 2025
pishoyg added a commit that referenced this issue Mar 2, 2025
Side Change:
- Change title capitalization.
pishoyg added a commit that referenced this issue Mar 2, 2025
Side Change:
- Change title capitalization.
@pishoyg
Copy link
Owner Author

pishoyg commented Mar 3, 2025

Chrome Developer Tools offers device toggle features. You may be able to use it to simulate a mobile environment on your laptop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev Why: Developer experience UI Why: Better user interface user Why: User convenience
Projects
Status: Todo
Development

No branches or pull requests

1 participant