Skip to content

Commit

Permalink
FEAT-990 Mobile landscape mode and functional size sliders (#998)
Browse files Browse the repository at this point in the history
  • Loading branch information
annappropriate authored Jul 22, 2024
1 parent a89a818 commit 971e4af
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/gui/FlashcardModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ export class FlashcardModal extends Modal {

// Setup base containers
this.modalEl.style.height = this.settings.flashcardHeightPercentage + "%";
this.modalEl.style.maxHeight = this.settings.flashcardHeightPercentage + "%";
this.modalEl.style.width = this.settings.flashcardWidthPercentage + "%";
this.modalEl.style.maxWidth = this.settings.flashcardWidthPercentage + "%";
this.modalEl.setAttribute("id", "sr-modal");

this.contentEl.addClass("sr-modal-content");
Expand Down
42 changes: 37 additions & 5 deletions styles.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,40 @@
.is-mobile #sr-modal {
--top-space: calc(var(--safe-area-inset-top) + var(--header-height) + var(--size-4-2));
width: 100vw !important;
height: calc(100vh - var(--top-space)) !important;
margin-top: var(--top-space);
@media only screen and (orientation: landscape) {
.is-mobile .sr-flashcard {
flex-direction: row;
}

.is-mobile .sr-header {
flex-direction: column;
flex: 0 1 0;
}

.is-mobile .sr-content {
flex: 1 0 0;
}

.is-mobile .sr-response {
flex-direction: column;
flex: 0 1 0;
}

.is-mobile .sr-controls {
flex-direction: column;
}

.is-mobile .sr-title {
display: none;
}

.is-mobile .sr-response-button {
writing-mode: vertical-lr;
}
}

#sr-modal {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}

#sr-modal .modal-title {
Expand Down

0 comments on commit 971e4af

Please sign in to comment.