Skip to content

Commit

Permalink
fix: sample image updates following the selected value in settings page
Browse files Browse the repository at this point in the history
Signed-off-by: DingChil <[email protected]>
  • Loading branch information
DingChil committed Oct 26, 2023
1 parent ab0f33d commit 3d6e164
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
d="M1 11C1 5.47715 5.47715 1 11 1H174C179.523 1 184 5.47715 184 11V20H1V11Z"
fill="#EDEFF2"
/>
<g filter="url(#filter0_dd_4854_27839)">
<g filter="url(#filter0_dd_4854_23104)">
<rect fill="white" height="22" rx="5" width="22" x="97" y="39" />
</g>
<path
d="M111.444 50.0005L109.602 51.8427C108.717 52.7275 107.283 52.7275 106.398 51.8427L104.556 50.0005C103.359 48.8028 102.763 47.1299 102.936 45.4453L102.983 44.9834L101.438 46.5283C99.5205 48.4462 99.5205 51.5547 101.438 53.4718L104.528 56.5617C106.446 58.4795 109.555 58.4795 111.472 56.5617L113.017 55.0168L113.064 54.5548C113.237 52.871 112.642 51.1982 111.444 50.0005Z"
fill="url(#paint0_linear_4854_27839)"
d="M111.444 50.0004L109.602 51.8426C108.717 52.7274 107.283 52.7274 106.398 51.8426L104.556 50.0004C103.359 48.8027 102.763 47.1298 102.936 45.4453L102.983 44.9833L101.438 46.5283C99.5205 48.4461 99.5205 51.5547 101.438 53.4718L104.528 56.5616C106.446 58.4795 109.555 58.4795 111.472 56.5616L113.017 55.0167L113.064 54.5548C113.237 52.871 112.642 51.1981 111.444 50.0004Z"
fill="url(#paint0_linear_4854_23104)"
/>
<path
d="M104.556 50.0004L106.398 48.1582C107.283 47.2734 108.717 47.2734 109.602 48.1582L111.397 49.9528C112.624 51.1801 113.234 52.8952 113.057 54.6219L113.017 55.0167L114.562 53.4718C116.479 51.5539 116.479 48.4453 114.562 46.5282L111.472 43.4384C109.554 41.5205 106.445 41.5205 104.528 43.4384L103.018 44.9482C102.996 44.9708 102.981 45.0013 102.978 45.0333L102.936 45.4452C102.763 47.1298 103.359 48.8027 104.556 50.0004Z"
fill="url(#paint1_linear_4854_27839)"
fill="url(#paint1_linear_4854_23104)"
/>
<defs>
<filter
id="filter0_dd_4854_27839"
id="filter0_dd_4854_23104"
color-interpolation-filters="sRGB"
filterUnits="userSpaceOnUse"
height="52"
Expand All @@ -41,7 +41,7 @@
<feOffset dy="5" />
<feGaussianBlur stdDeviation="7.5" />
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0794837 0" />
<feBlend in2="BackgroundImageFix" mode="normal" result="effect1_dropShadow_4854_27839" />
<feBlend in2="BackgroundImageFix" mode="normal" result="effect1_dropShadow_4854_23104" />
<feColorMatrix
in="SourceAlpha"
result="hardAlpha"
Expand All @@ -52,19 +52,19 @@
<feGaussianBlur stdDeviation="2" />
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.109969 0" />
<feBlend
in2="effect1_dropShadow_4854_27839"
in2="effect1_dropShadow_4854_23104"
mode="normal"
result="effect2_dropShadow_4854_27839"
result="effect2_dropShadow_4854_23104"
/>
<feBlend
in="SourceGraphic"
in2="effect2_dropShadow_4854_27839"
in2="effect2_dropShadow_4854_23104"
mode="normal"
result="shape"
/>
</filter>
<linearGradient
id="paint0_linear_4854_27839"
id="paint0_linear_4854_23104"
gradientUnits="userSpaceOnUse"
x1="111.517"
x2="103.553"
Expand All @@ -76,7 +76,7 @@
<stop offset="0.9991" stop-color="#6A8BFF" />
</linearGradient>
<linearGradient
id="paint1_linear_4854_27839"
id="paint1_linear_4854_23104"
gradientUnits="userSpaceOnUse"
x1="104.694"
x2="111.837"
Expand Down
14 changes: 14 additions & 0 deletions src/components/image/ImageSelectTextWithoutIcon.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<template>
<svg fill="none" height="90" viewBox="0 0 185 90" width="185" xmlns="http://www.w3.org/2000/svg">
<rect fill="white" height="89" rx="10.5" stroke="#DCDEE1" width="184" x="0.5" y="0.5" />
<rect fill="#D9D9D9" height="9" rx="4.5" width="128.4" x="6" y="47" />
<rect fill="#D9D9D9" height="9" rx="4.5" width="104" x="6" y="60" />
<rect fill="#D9D9D9" height="9" rx="4.5" width="34.8" x="99" y="34" />
<rect fill="white" height="9" rx="4.5" width="88.2" x="7" y="34" />
<rect fill="#4F5AFF" fill-opacity="0.2" height="9" rx="4.5" width="88.2" x="7" y="34" />
<path
d="M1 11C1 5.47715 5.47715 1 11 1H174C179.523 1 184 5.47715 184 11V20H1V11Z"
fill="#EDEFF2"
/>
</svg>
</template>
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const defaultConfig = {
/** If user not set token at welcome page set false */
isFinishSetup: false,
/** When select text (by mouse or keyboard) show popup */
autoPopup: true,
autoPopup: false,
/** Self host url */
selfHostUrl: '',
/** Azure specify ApiVersion */
Expand Down
1 change: 1 addition & 0 deletions src/csui/Index/TheEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ const handleClosePopup = () => {
}
const handleMouseOverTail = () => {
shortcutUsed.value = false
showWebpilotPopup.value = true
}
Expand Down
2 changes: 1 addition & 1 deletion src/options/components/SwitchButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ function toggleSwitch() {
}
.off {
left: 60%;
left: 67%;
}
</style>
8 changes: 4 additions & 4 deletions src/options/views/ExtensionView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
@on-change="onAutoPopupChange"
/>
</div>
<ImageSelectText />
<ImageSelectTextWithIcon v-if="store.config.autoPopup" />
<ImageSelectTextWithoutIcon v-else />
<div :class="$style['shortcut-setting']">
<span :class="$style['shortcut-setting-label']">Shortcut</span>
<ShortcutInput v-model="shortcutKeys" @change="onChangeShortcut" />
Expand All @@ -23,16 +24,15 @@
</div>
</template>

<script lang="ts"></script>

<script lang="ts" setup>
import {ref} from 'vue'
import {storeToRefs} from 'pinia'
import useStore from '@/stores/store'
import ShortcutInput from '@/components/ShortcutInput.vue'
import ImageSelectText from '@/components/image/ImageSelectText.vue'
import ImageSelectTextWithIcon from '@/components/image/ImageSelectTextWithIcon.vue'
import ImageSelectTextWithoutIcon from '@/components/image/ImageSelectTextWithoutIcon.vue'
import WebpilotLogo from '../images/icon-logo.vue'
import SwitchButton from '../components/SwitchButton.vue'
Expand Down
6 changes: 4 additions & 2 deletions src/tabs/components/StepThree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
style="margin-top: 16px"
@change="onAutoPopupChange"
/>
<ImageSelectText style="margin-top: 12px" />
<ImageSelectTextWithIcon v-if="autoPopup" style="margin-top: 12px" />
<ImageSelectTextWithoutIcon v-else style="margin-top: 12px" />
<WebpilotAlert
style="margin-top: 6px"
:tips="$gettext('Webpilot will answer based on the current page if no text is selected')"
Expand All @@ -47,7 +48,8 @@ import {$gettext} from '@/utils/i18n'
import WebpilotCheckbox from '@/components/WebpilotCheckbox.vue'
import WebpilotAlert from '@/components/WebpilotAlert.vue'
import WebpilotButton from '@/components/WebpilotButton.vue'
import ImageSelectText from '@/components/image/ImageSelectText.vue'
import ImageSelectTextWithIcon from '@/components/image/ImageSelectTextWithIcon.vue'
import ImageSelectTextWithoutIcon from '@/components/image/ImageSelectTextWithoutIcon.vue'
import useStore from '@/stores/store'
import ShortcutInput from '@/components/ShortcutInput.vue'
Expand Down

0 comments on commit 3d6e164

Please sign in to comment.