Skip to content

Commit

Permalink
fix: futher improve card styling on mobile
Browse files Browse the repository at this point in the history
fix: crash on massive fonts on mobile
  • Loading branch information
ThaUnknown committed Jul 11, 2024
1 parent 087075a commit 3d807eb
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
7 changes: 2 additions & 5 deletions common/components/cards/SmallCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
{media.title.userPreferred}
</div>
<div class='d-flex flex-row mt-auto pt-10 font-weight-medium justify-content-between w-full text-muted'>
<div class='d-flex align-items-center' style='margin-left: -3px'>
<div class='d-flex align-items-center pr-5' style='margin-left: -2px'>
<span class='material-symbols-outlined font-size-24 pr-5'>calendar_month</span>
{media.seasonYear || 'N/A'}
</div>
<div class='d-flex align-items-center'>
<div class='d-flex align-items-center text-nowrap text-right'>
{formatMap[media.format]}
<span class='material-symbols-outlined font-size-24 pl-5'>monitor</span>
</div>
Expand All @@ -58,9 +58,6 @@
</div>

<style>
.first-check:first-child :global(.absolute-container) {
left: -48% !important
}
.first-check:hover {
z-index: 30;
/* fixes transform scaling on click causing z-index issues */
Expand Down
2 changes: 1 addition & 1 deletion common/css.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

a[href]:active, button:not([disabled]):active, fieldset:not([disabled]):active, input:not([disabled]):active, optgroup:not([disabled]):active, option:not([disabled]):active, select:not([disabled]):active, textarea:not([disabled]):active, details:active, [tabindex]:not([tabindex="-1"]):active, [contenteditable]:active, [controls]:active {
transition: transform 0.1s ease-in-out;
transform: scale(0.95);
transform: scale(0.95) !important;
}

.btn-secondary {
Expand Down
6 changes: 5 additions & 1 deletion common/modules/parser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Metadata from 'matroska-metadata'
import { arr2text } from 'uint8-util'
import { fontRx } from './util.js'
import { SUPPORTS } from '@/modules/support.js'

export default class Parser {
parsed = false
Expand Down Expand Up @@ -34,7 +35,10 @@ export default class Parser {
for (const file of files) {
if (fontRx.test(file.filename) || file.mimetype?.toLowerCase().includes('font')) {
// this is cursed, but required, as capacitor-node's IPC hangs for 2mins when runnig on 32bit android when sending uint8's
this.client.dispatch('file', { data: arr2text(file.data) })
const data = arr2text(file.data)
// IPC crashes if the message is >16MB, wild
if (SUPPORTS.isAndroid && data.length > 15_000_000) continue
this.client.dispatch('file', { data })
}
}
})
Expand Down
2 changes: 1 addition & 1 deletion common/modules/webtorrent.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import HTTPTracker from 'bittorrent-tracker/lib/client/http-tracker.js'
import { hex2bin, arr2hex, text2arr } from 'uint8-util'
import Parser from './parser.js'
import { defaults, fontRx, subRx, videoRx } from './util.js'
import { SUPPORTS } from './support.js'
import { SUPPORTS } from '@/modules/support.js'

// HACK: this is https only, but electron doesnt run in https, weirdge
if (!globalThis.FileSystemFileHandle) globalThis.FileSystemFileHandle = false
Expand Down
3 changes: 3 additions & 0 deletions common/views/Home/Section.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
</div>

<style>
.gallery :global(.first-check:first-child) :global(.absolute-container) {
left: -48% !important
}
.text-muted:hover {
color: var(--dm-link-text-color-hover) !important;
}
Expand Down
2 changes: 1 addition & 1 deletion common/views/Search.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

<style>
.d-grid:has(.item.small-card) {
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important
grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)) !important
}
.d-grid:has(.card.full-card) {
grid-template-columns: repeat(auto-fill, minmax(52rem, 1fr)) !important
Expand Down

0 comments on commit 3d807eb

Please sign in to comment.