Skip to content

Commit

Permalink
gs_index: var txt size
Browse files Browse the repository at this point in the history
  • Loading branch information
parkchamchi committed Oct 21, 2024
1 parent f70686c commit ae45d7f
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 7 deletions.
9 changes: 8 additions & 1 deletion src/backend/gs_index/src/components/Corpus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@
glossColor() {
return sharedState.glossColor;
},
glossSize() {
return sharedState.glossSize + "%";
},
txtSize() {
return sharedState.txtSize + "%";
},
},
methods: {
toggleCorpusVisibility() {
Expand Down Expand Up @@ -317,7 +323,8 @@
</script>

<template>
<div :class="['corpus_wrapper', { 'full-screen': isCorpusVisible}]" :style="{ '--gloss-color': glossColor }">
<div :class="['corpus_wrapper', { 'full-screen': isCorpusVisible}]"
:style="{ '--gloss-color': glossColor, '--gloss-size': glossSize, '--txt-size': txtSize }">
<hr>
<h4 @click="toggleCorpusVisibility()"
ref="header">{{ header + ": " + corpus_id }}
Expand Down
34 changes: 32 additions & 2 deletions src/backend/gs_index/src/components/MiscOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,20 @@
},
glossColor() {
this.emitChange();
}
},
txtSize() {
this.emitChange();
},
glossSize() {
this.emitChange();
},
},
methods: {
emitChange() {
sharedState.psPerScreen = this.psPerScreen;
sharedState.glossColor = this.glossColor;
sharedState.txtSize = this.txtSize;
sharedState.glossSize = this.glossSize;
},
exportData() {
console.log("Exporting");
Expand Down Expand Up @@ -69,14 +77,36 @@
/>
</div>
<div class="col-md-2">
<label for="psPerScreen">Gloss color</label>
<label for="glossColor">Gloss color</label>
<input
type="color"
class="form-control"
id="glossColor"
v-model="glossColor"
/>
</div>
<div class="col-md-2">
<label for="txtSize">Text Size</label>
<input
type="range"
class="form-control"
id="txtSize"
v-model="txtSize"
min="50"
max="150"
/>
</div>
<div class="col-md-2">
<label for="glossSize">Gloss Size</label>
<input
type="range"
class="form-control"
id="glossSize"
v-model="glossSize"
min="50"
max="150"
/>
</div>
<div class="col-md-2 d-flex align-items-center">
<input type="file" @change="importData" class="form-control">
</div>
Expand Down
6 changes: 2 additions & 4 deletions src/backend/gs_index/src/components/Token.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script>
import { sharedState } from '../sharedState.js';
export default {
props: {
t: {
Expand Down Expand Up @@ -61,12 +59,12 @@

<style scoped>
.token_txt {
font-size: 150%;
font-size: var(--txt-size);
font-family: serif;
}
.gloss {
font-size: 90%;
font-size: var(--gloss-size);
/*font-style: italic;*/
font-family: monospace;
text-align: center;
Expand Down
2 changes: 2 additions & 0 deletions src/backend/gs_index/src/sharedState.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export const sharedState = reactive({
currentOpenCorpus: "",
psPerScreen: 16,
glossColor: "gray",
txtSize: 150,
glossSize: 90,

...savedState, //Load
});

0 comments on commit ae45d7f

Please sign in to comment.