-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Google Translate implementation #78: Small font size. Mini version fo…
…r iOS.
- Loading branch information
Showing
21 changed files
with
127 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
ReaderTranslator/Components/ViewRepresentable/Scripts/gtranslator.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(function() { | ||
const css = " \ | ||
#source { font-size: 18px!important; } \ | ||
.translation { font-size: 18px!important; } \ | ||
" | ||
|
||
var style = document.createElement('style') | ||
style.innerHTML = css | ||
document.head.appendChild(style) | ||
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
(function() { | ||
const css = " \ | ||
.reader-mini #gb, .reader-mini .tlid-input, .reader-mini .gp-footer { display: none; } \ | ||
#source { font-size: 18px!important; } \ | ||
.translation { font-size: 18px!important; } \ | ||
" | ||
|
||
let style = document.createElement('style') | ||
style.innerHTML = css | ||
document.head.appendChild(style) | ||
|
||
let mode = localStorage.getItem('readerTranslatorMode') || 'full' | ||
readerTranslatorMode(mode) | ||
})() | ||
|
||
function readerTranslatorMode(mode) { | ||
localStorage.setItem('readerTranslatorMode', mode) | ||
let elm = document.querySelector('body') | ||
elm.className = elm.className.replace('reader-mini', '') | ||
|
||
if(mode=='mini') { elm.className += " reader-mini" } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// GTranslatorView.swift | ||
// ReaderTranslatorMobile | ||
// | ||
// Created by Viktor Kushnerov on 28/2/20. | ||
// Copyright © 2020 Viktor Kushnerov. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct GTranslatorMiniView: View { | ||
@ObservedObject private var store = Store.shared | ||
|
||
var body: some View { | ||
GTranslatorRepresenter(selectedText: self.$store.translateAction) | ||
.onAppear { | ||
GTranslatorRepresenter.isMiniMode = true | ||
} | ||
} | ||
} | ||
|
||
struct GTranslatorMiniView_Previews: PreviewProvider { | ||
static var previews: some View { | ||
GTranslatorMiniView() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.