mirror of
https://gitlab.com/walljm/dynamicbible.git
synced 2025-07-27 01:19:52 -04:00
FEATURE: Added support for changing the font.
This commit is contained in:
parent
374af296d3
commit
9335b1f9c9
File diff suppressed because one or more lines are too long
@ -34,4 +34,8 @@ ion-card .title {
|
||||
.button-wp, .button-md, .button-ios {
|
||||
margin-right: -6px;
|
||||
}
|
||||
}
|
||||
|
||||
html {
|
||||
--card-font: Roboto, Helvetica, Arial, sans-serif;
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
err-message {
|
||||
|
||||
error-message {
|
||||
font-family: var(--card-font);
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ passage {
|
||||
user-select: text !important;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
font-family: var(--card-font);
|
||||
}
|
||||
|
||||
passage .button {
|
||||
|
@ -1,4 +1,5 @@
|
||||
strongs-modal {
|
||||
font-family: var(--card-font);
|
||||
a {
|
||||
cursor: pointer !important;
|
||||
color: black;
|
||||
|
@ -7,6 +7,8 @@
|
||||
}
|
||||
|
||||
strongs {
|
||||
font-family: var(--card-font);
|
||||
|
||||
ion-scroll {
|
||||
height: 250px;
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
words {
|
||||
font-family: var(--card-font);
|
||||
.button {
|
||||
color: #632761;
|
||||
}
|
||||
|
@ -65,22 +65,32 @@
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-range min="6" max="20" step="1" snaps="true" [(ngModel)]="this.profileService.profile().font_size" (ionChange)="textSizeChanged()">
|
||||
<ion-label range-left class="small-text">A</ion-label>
|
||||
<ion-label range-left class="small-text">a</ion-label>
|
||||
<ion-label range-right>A</ion-label>
|
||||
</ion-range>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label>Font Family</ion-label>
|
||||
<ion-select [(ngModel)]="this.profileService.profile().font_family" (ionChange)="fontFamilyChanged()">
|
||||
<ion-option value="Roboto, Helvetica, Arial, sans-serif">Sans Serif</ion-option>
|
||||
<ion-option value="'Times New Roman', serif">Times</ion-option>
|
||||
<ion-option value="Georgia, serif">Georgia</ion-option>
|
||||
<ion-option value="Merriweather, serif">Merriweather</ion-option>
|
||||
<ion-option value="Consolas, monotype">Monospaced</ion-option>
|
||||
</ion-select>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
|
||||
|
||||
<ion-list-header><ion-icon name="log-in" item-left></ion-icon>Login/Logout</ion-list-header>
|
||||
|
||||
<ng-template [ngIf]="!profileService.currentUser()">
|
||||
<ion-item center>
|
||||
<button ion-button full (click)="profileService.authenticate()">Login With Google</button>
|
||||
<button ion-button block (click)="profileService.authenticate()">Login With Google</button>
|
||||
</ion-item>
|
||||
</ng-template>
|
||||
<ng-template [ngIf]="profileService.currentUser()">
|
||||
<ion-item center>
|
||||
<button ion-button full (click)="profileService.logout()">Logout</button>
|
||||
<button ion-button block (click)="profileService.logout()">Logout</button>
|
||||
</ion-item>
|
||||
</ng-template>
|
||||
</ion-content>
|
||||
|
@ -30,7 +30,6 @@ body {
|
||||
font-size: 1.2em;
|
||||
font-weight: bold;
|
||||
}
|
||||
font-family: "Roboto", "Arial", "Helvetica", sans-serif;
|
||||
max-width: 800px;
|
||||
margin: 12px auto;
|
||||
}
|
||||
|
@ -148,7 +148,11 @@ export class SearchPage implements OnInit
|
||||
this.profileService.textSizeChanged();
|
||||
this.profileService.localSave();
|
||||
}
|
||||
|
||||
fontFamilyChanged()
|
||||
{
|
||||
this.profileService.fontFamilyChanged();
|
||||
this.profileService.localSave();
|
||||
}
|
||||
actionsMenu()
|
||||
{
|
||||
this.menu.open('actions');
|
||||
|
@ -54,11 +54,21 @@
|
||||
<ion-list-header><ion-icon name="text" item-left></ion-icon>Adjust Text</ion-list-header>
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-range min="6" max="20" step="1" snaps="true" [(ngModel)]="profileService.profile().font_size" (ionChange)="textSizeChanged()">
|
||||
<ion-label range-left class="small-text">A</ion-label>
|
||||
<ion-range min="6" max="20" step="1" snaps="true" [(ngModel)]="this.profileService.profile().font_size" (ionChange)="textSizeChanged()">
|
||||
<ion-label range-left class="small-text">a</ion-label>
|
||||
<ion-label range-right>A</ion-label>
|
||||
</ion-range>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label>Font Family</ion-label>
|
||||
<ion-select [(ngModel)]="this.profileService.profile().font_family" (ionChange)="fontFamilyChanged()">
|
||||
<ion-option value="Roboto, Helvetica, Arial, sans-serif">Sans Serif</ion-option>
|
||||
<ion-option value="'Times New Roman', serif">Times</ion-option>
|
||||
<ion-option value="Georgia, serif">Georgia</ion-option>
|
||||
<ion-option value="Merriweather, serif">Merriweather</ion-option>
|
||||
<ion-option value="Consolas, monotype">Monospaced</ion-option>
|
||||
</ion-select>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
|
||||
<ion-list-header><ion-icon name="log-in" item-left></ion-icon>Login/Logout</ion-list-header>
|
||||
|
@ -23,6 +23,11 @@ export class SettingsPage
|
||||
this.profileService.localSave();
|
||||
}
|
||||
|
||||
fontFamilyChanged()
|
||||
{
|
||||
this.profileService.fontFamilyChanged();
|
||||
this.profileService.localSave();
|
||||
}
|
||||
reset()
|
||||
{
|
||||
this.profileService.reset()
|
||||
|
@ -263,6 +263,7 @@ export class ProfileService
|
||||
user[k] = t[k];
|
||||
|
||||
this.textSizeChanged();
|
||||
this.fontFamilyChanged();
|
||||
return updated;
|
||||
}
|
||||
|
||||
@ -305,12 +306,19 @@ export class ProfileService
|
||||
$('html').css('font-size', this.profile().font_size + 'px');
|
||||
}
|
||||
|
||||
fontFamilyChanged()
|
||||
{
|
||||
document.querySelector('html').style.cssText = '--card-font: '+this.profile().font_family;
|
||||
this.textSizeChanged();
|
||||
}
|
||||
|
||||
static createDefaultUser(): User
|
||||
{
|
||||
return {
|
||||
username: DEFAULT_USER_NAME,
|
||||
uid: null,
|
||||
font_size: 10,
|
||||
font_family: 'roboto, helvetica, arial, sans-serif',
|
||||
saved_pages: [],
|
||||
items: [],
|
||||
|
||||
@ -344,6 +352,7 @@ export type User = {
|
||||
append_to_bottom: boolean,
|
||||
insert_next_to_item: boolean,
|
||||
font_size: number,
|
||||
font_family: string,
|
||||
saved_pages: SavedPage[],
|
||||
verses_on_new_line: boolean,
|
||||
show_verse_numbers: boolean,
|
||||
|
Loading…
x
Reference in New Issue
Block a user