Skip to content

Commit 429ee58

Browse files
committed
fix: box responsive
1 parent 887ea53 commit 429ee58

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

src/components/faucet/FaucetDetail.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
<section
55
ref="DOMpopup"
6-
class="popup fixed flex flex-col items-center rounded w-[90vw] max-w-[36rem] bg-grey-300 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[1000] justify-center text-grey-50 before:absolute before:top-0 before:bottom-0 before:left-0 before:right-0 before:rounded before:bg-500 before:z-min after:absolute after:top-px after:left-px after:bottom-px after:right-px after:bg-grey-500 after:rounded after:z-min"
6+
class="popup fixed flex flex-col items-center rounded w-[90vw] max-w-[36rem] max-h-[90vh] justify-start bg-grey-300 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[1000] md:justify-center text-grey-50 before:absolute before:top-0 before:bottom-0 before:left-0 before:right-0 before:rounded before:bg-500 before:z-min after:absolute after:top-px after:left-px after:bottom-px after:right-px after:bg-grey-500 after:rounded after:z-min"
77
>
8-
<div ref="DOMFaucetRequest" class="py-12 px-20 w-full" v-if="store.isVisible">
8+
<div ref="DOMFaucetRequest" class="py-8 md:py-12 px-8 md:px-20 w-full overflow-scroll" v-if="store.isVisible">
99
<FaucetContentForm :name="store.selectedFaucet.name ?? 'Faucet'" :options="store.faucetAmount" v-show="store.contentStep === 0" class="js-faucetform opacity-100" :error="error" @requestFaucet="requestFaucet" />
1010
<div>
1111
<div ref="gnoRequestLogo" v-show="store.contentStep >= 1" class="opacity-0">

src/components/faucet/content/FaucetContentForm.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<template>
22
<div>
3-
<h2 class="text-600 mb-12">{{ name }}</h2>
4-
<form class="w-full space-y-12" @submit.prevent="requestFaucet">
3+
<h2 class="text-500 md:text-600 mb-8 md:mb-12">{{ name }}</h2>
4+
<form class="w-full space-y-7 md:space-y-12" @submit.prevent="requestFaucet">
55
<Input :label="'Enter your wallet address'" :placeholder="'e.g. g1juwee0ynsdvaukvxk3j5s4cl6nn24uxwlydxrl'" v-model="bindAddress" required />
66
<Select v-if="store.selectedFaucet.amounts" :label="'Select faucet amount'" :options="options" @update="(option) => SelectAmount(option)" />
77
<Recaptcha @validation="captchaValidation" :captchakey="store.selectedFaucet.recaptcha" />
88
<div>
9-
<div class="flex gap-4">
9+
<div class="flex flex-col md:flex-row gap-4">
1010
<Button text="Cancel" variant="outline" @click.prevent="() => closePopup()" class="w-full" />
1111
<Button text="Request drip" class="w-full" type="submit" :disabled="captchaValid === false || bindAddress === ''" />
1212
</div>

src/components/ui/Recaptcha.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<template>
2-
<vue-recaptcha theme="dark" :sitekey="captchakey" @verify="handleSuccess" @error="handleError"></vue-recaptcha>
2+
<vue-recaptcha theme="dark" :size="screenWidth < 768 ? 'compact' : 'normal'" :sitekey="captchakey" @verify="handleSuccess" @error="handleError"></vue-recaptcha>
33
</template>
44

55
<script setup lang="ts">
66
import { onMounted } from 'vue'
7+
import { useWindowSize } from '@vueuse/core'
78
89
type Props = {
910
captchakey: string
@@ -12,6 +13,8 @@ defineProps<Props>()
1213
1314
const emit = defineEmits(['validation'])
1415
16+
const { width: screenWidth } = useWindowSize()
17+
1518
const handleError = (res: string) => {
1619
emit('validation', { code: 'error', secret: res ?? 'error' })
1720
}

src/stores/faucetDetail.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const useFaucetDetail = defineStore('faucetDetail', {
7171

7272
gsap.to(this.DOM.bg, { autoAlpha: this.isOpen ? 1 : 0, duration: 1, delay: this.isOpen ? 0 : 0.4 })
7373
gsap.to(this.DOM.popup, {
74-
top: this.isOpen ? '55%' : '50%',
74+
top: this.isOpen ? '50%' : '45%',
7575
autoAlpha: this.isOpen ? 1 : 0,
7676
'clip-path': this.isOpen ? 'polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)' : 'polygon(0% 0%, 100% 0%, 100% 0%, 0% 0%)',
7777
duration: 0.6,

0 commit comments

Comments
 (0)