aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2023-01-28 20:28:59 +1100
committerTerry Truong <terry06890@gmail.com>2023-01-28 20:37:53 +1100
commit3c5144ece678063ba3cd9d96dce98b9479d4205c (patch)
treed0e12fd82bbc6eab35fb1e6ad08260ff5a9db4c0 /src/components
parent94a8ad9b067e5a2c442ce47ce72d1a53eb444160 (diff)
Adjust info and help modal styling
Fix minor typos in store.ts, App.vue, IconButton, etc
Diffstat (limited to 'src/components')
-rw-r--r--src/components/HelpModal.vue10
-rw-r--r--src/components/IconButton.vue4
-rw-r--r--src/components/TileInfoModal.vue43
-rw-r--r--src/components/TolTile.vue8
4 files changed, 41 insertions, 24 deletions
diff --git a/src/components/HelpModal.vue b/src/components/HelpModal.vue
index 7eb2ea2..5ebc36e 100644
--- a/src/components/HelpModal.vue
+++ b/src/components/HelpModal.vue
@@ -182,9 +182,10 @@
<br/>
<h1 class="text-lg font-bold">Keyboard Shortcuts</h1>
<ul class="list-disc pl-4">
- <li>Ctrl-F opens the search bar</li>
- <li>Ctrl-Shift-F toggles the search animation</li>
- <li>Esc closes an open pane, and cancels an active search or auto mode</li>
+ <li><span class="font-bold">Ctrl-F</span> opens the search bar</li>
+ <li><span class="font-bold">Ctrl-Shift-F</span> toggles the search animation</li>
+ <li><span class="font-bold">Esc</span> closes an open pane,
+ and cancels an active search or auto mode</li>
</ul>
<br/>
<h1 class="text-lg font-bold">Unusual Node Names</h1>
@@ -419,6 +420,9 @@
:disabled="tutOpen" @click.stop="onStartTutorial">
Start Tutorial
</s-button>
+ <p class="absolute text-xs md:text-sm text-stone-500 right-2 bottom-2">
+ Last updated 28/01/23
+ </p>
</div>
</div>
</template>
diff --git a/src/components/IconButton.vue b/src/components/IconButton.vue
index 9357e97..a897c6f 100644
--- a/src/components/IconButton.vue
+++ b/src/components/IconButton.vue
@@ -1,6 +1,6 @@
<template>
-<div :style="styles" class="p-2 rounded-full hover:cursor-pointer"
- :class="{'hover:brightness-125': !disabled, 'brightness-50': disabled}">
+<div :style="styles" class="p-2 rounded-full"
+ :class="{'hover:brightness-125': !disabled, 'brightness-50': disabled, 'hover:cursor-pointer': !disabled}">
<slot class="w-full h-full">?</slot>
</div>
</template>
diff --git a/src/components/TileInfoModal.vue b/src/components/TileInfoModal.vue
index 2d0e354..52dd1b2 100644
--- a/src/components/TileInfoModal.vue
+++ b/src/components/TileInfoModal.vue
@@ -18,16 +18,17 @@
{{getDisplayName(nodeName, tolNode)}}
</h1>
<div class="flex justify-evenly text-sm md:text-base">
- <div> Children: {{(tolNode.children.length).toLocaleString()}} </div>
- <div> Tips: {{(tolNode.tips).toLocaleString()}} </div>
+ <div><span class="font-bold">Children:</span> {{(tolNode.children.length).toLocaleString()}}</div>
+ <div><span class="font-bold">Tips:</span> {{(tolNode.tips).toLocaleString()}}</div>
<div v-if="tolNode.iucn != null">
<a href="https://en.wikipedia.org/wiki/Endangered_species_(IUCN_status)"
- target="_blank" title="IUCN Conservation Status">IUCN</a>:
+ target="_blank" title="IUCN Conservation Status" class="font-bold">IUCN: </a>
<span :style="iucnStyles(tolNode.iucn)">{{getDisplayIucn(tolNode.iucn)}}</span>
</div>
<div>
<a :href="'https://tree.opentreeoflife.org/opentree/argus/opentree13.4@' + tolNode.otolId"
- target="_blank" title="Look up in Open Tree of Life">OTOL <external-link-icon class="inline-block w-3 h-3"/></a>
+ target="_blank" title="Look up in Open Tree of Life" class="font-bold">OTOL
+ <external-link-icon class="inline-block w-3 h-3"/></a>
</div>
</div>
<div v-if="nodes.length > 1" class="text-center text-sm px-2">
@@ -60,34 +61,35 @@
<ul class="rounded shadow overflow-x-auto p-1"
:style="{backgroundColor: store.color.bg, color: store.color.text}">
<li v-if="imgInfos[idx]!.url != ''">
- <span :style="{color: store.color.alt}">Source: </span>
- <a :href="imgInfos[idx]!.url" target="_blank">Link</a>
+ <span :style="sourceLabelStyles">Source: </span>
+ <a :href="imgInfos[idx]!.url" target="_blank" :style="aStyles">Link</a>
<external-link-icon class="inline-block w-3 h-3 ml-1"/>
</li>
<li v-if="imgInfos[idx]!.artist != ''" class="whitespace-nowrap">
- <span :style="{color: store.color.alt}">Artist: </span>
+ <span :style="sourceLabelStyles">Artist: </span>
{{imgInfos[idx]!.artist}}
</li>
<li v-if="imgInfos[idx]!.credit != ''" class="whitespace-nowrap">
- <span :style="{color: store.color.alt}">Credits: </span>
+ <span :style="sourceLabelStyles">Credits: </span>
{{imgInfos[idx]!.credit}}
</li>
<li>
- <span :style="{color: store.color.alt}">License: </span>
- <a :href="licenseToUrl(imgInfos[idx]!.license)" target="_blank">
+ <span :style="sourceLabelStyles">License: </span>
+ <a :href="licenseToUrl(imgInfos[idx]!.license)" target="_blank" :style="aStyles">
{{imgInfos[idx]!.license}}
</a>
<external-link-icon class="inline-block w-3 h-3 ml-1"/>
</li>
<li v-if="imgInfos[idx]!.src != 'picked'">
- <span :style="{color: store.color.alt}">Obtained via: </span>
- <a v-if="imgInfos[idx]!.src == 'eol'" href="https://eol.org/">EoL</a>
- <a v-else href="https://www.wikipedia.org/">Wikipedia</a>
+ <span :style="sourceLabelStyles">Obtained via: </span>
+ <a v-if="imgInfos[idx]!.src == 'eol'" href="https://eol.org/"
+ :style="aStyles">EoL</a>
+ <a v-else href="https://www.wikipedia.org/" :style="aStyles">Wikipedia</a>
<external-link-icon class="inline-block w-3 h-3 ml-1"/>
</li>
<li>
- <span :style="{color: store.color.alt}">Changes: </span>
- Cropped and resized
+ <span :style="sourceLabelStyles">Changes: </span>
+ Cropped &amp; resized
</li>
</ul>
</template>
@@ -95,7 +97,7 @@
</div>
<div v-if="descInfos[idx]! != null">
<div>{{descInfos[idx]!.text}}</div>
- <div class="text-sm text-right">
+ <div class="text-sm text-stone-600 text-right">
<a :href="'https://en.wikipedia.org/?curid=' + descInfos[idx]!.wikiId"
target="_blank">From Wikipedia</a>
<external-link-icon class="inline-block w-3 h-3 ml-1"/>
@@ -260,6 +262,15 @@ function getImgStyles(tolNode: TolNode | null): Record<string,string> {
boxShadow: store.shadowNormal,
};
}
+const sourceLabelStyles = computed((): Record<string,string> => {
+ return {
+ color: store.color.textDark,
+ fontWeight: 'bold',
+ };
+});
+const aStyles = computed((): Record<string,string> => ({
+ color: store.color.alt,
+}));
function iucnStyles(iucn: string): Record<string,string>{
let col = 'currentcolor';
switch (iucn){
diff --git a/src/components/TolTile.vue b/src/components/TolTile.vue
index 1f6e1d3..99aa4e1 100644
--- a/src/components/TolTile.vue
+++ b/src/components/TolTile.vue
@@ -32,7 +32,7 @@
<info-icon v-if="infoIconDisabled" :style="infoIconStyles" :class="infoIconClasses"
@click.stop="onInfoIconClick" @mousedown.stop @mouseup.stop/>
</div>
- <transition name="fadein">
+ <transition name="fadeout">
<div v-if="inFlash" class="absolute w-full h-full top-0 left-0 rounded-[inherit] bg-amber-500/70 z-20"/>
</transition>
</div>
@@ -42,7 +42,7 @@
@leaf-click-held="onInnerLeafClickHeld" @nonleaf-click-held="onInnerNonleafClickHeld"
@info-click="onInnerInfoIconClick"/>
</div>
- <transition name="fadein">
+ <transition name="fadeout">
<div v-if="inFlash" :style="{top: scrollOffset + 'px'}"
class="absolute w-full h-full left-0 rounded-[inherit] bg-amber-500/70"/>
</transition>
@@ -226,7 +226,9 @@ const pendingScrollHdlr = ref(0); // Used for throttling updating of scrollOffse
function onScroll(): void {
if (pendingScrollHdlr.value == 0){
pendingScrollHdlr.value = setTimeout(() => {
- scrollOffset.value = rootRef.value!.scrollTop;
+ if (rootRef.value != null){
+ scrollOffset.value = rootRef.value!.scrollTop;
+ }
pendingScrollHdlr.value = 0;
}, store.animationDelay);
}