Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Aslemammad committed Dec 14, 2023
1 parent 83e3520 commit 3cb6786
Show file tree
Hide file tree
Showing 18 changed files with 738 additions and 755 deletions.
32 changes: 17 additions & 15 deletions components/MobileNavDropdownItem.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
<template>
<div class="mb-1">
<div :class="[opened ? 'bg-ui-backgroundTertiary' : '']" class="rounded-md px-1 w-full h-full" @click="$emit('click')" >
<slot>Navlink</slot>
</div>
<div class="mb-1">
<div
:class="[opened ? 'bg-ui-backgroundTertiary' : '']"
class="rounded-md px-1 w-full h-full"
@click="$emit('click')"
>
<slot>Navlink</slot>
</div>

<div v-if="opened">
<slot name="popup"/>
</div>
<div v-if="opened">
<slot name="popup" />
</div>
</div>
</template>

<script>
import { defineComponent } from '@vue/composition-api'
export default defineComponent({
props: {
opened: {
type: Boolean,
default: false
}
}
props: {
opened: {
type: Boolean,
default: false,
},
},
})
</script>
82 changes: 42 additions & 40 deletions components/NavDropdownItem.vue
Original file line number Diff line number Diff line change
@@ -1,56 +1,58 @@
<template>
<div class="group popup-parent cursor-pointer relative md:px-1 md:py-3 flex justify-center rounded-md flex-col gap-2 hover:text-ui-primary text-ui-typo">
<span class=" group-hover:bg-ui-backgroundTertiary nav-link">
<slot>Navlink</slot>
</span>

<div ref="popupRef" class="popup" @click="hidePopup(), $emit('signal:close')">
<slot name="popup" />
</div>
<div
class="group popup-parent cursor-pointer relative md:px-1 md:py-3 flex justify-center rounded-md flex-col gap-2 hover:text-ui-primary text-ui-typo"
>
<span class="group-hover:bg-ui-backgroundTertiary nav-link">
<slot>Navlink</slot>
</span>

<div
ref="popupRef"
class="popup"
@click="hidePopup(), $emit('signal:close')"
>
<slot name="popup" />
</div>
</div>
</template>

<script>
import { defineComponent, ref } from '@vue/composition-api'
export default defineComponent({
setup() {
const popupRef = ref(null)
const hidePopup = () => {
const hidden = 'hidden'
const popup = popupRef.value
popup.classList.add(hidden)
window.setTimeout(()=>popup.classList.remove(hidden), 20)
}
return {popupRef, hidePopup}
},
setup() {
const popupRef = ref(null)
const hidePopup = () => {
const hidden = 'hidden'
const popup = popupRef.value
popup.classList.add(hidden)
window.setTimeout(() => popup.classList.remove(hidden), 20)
}
return { popupRef, hidePopup }
},
})
</script>

<style scoped>
.popup-parent{
-webkit-tap-highlight-color: transparent;
.popup-parent {
-webkit-tap-highlight-color: transparent;
}
.popup{
@apply top-12 -left-1;
@apply md:absolute overflow-hidden;
@apply group-hover:p-3 group-hover:border group-hover:w-full;
@apply group-hover:h-auto group-hover:overflow-visible;
@apply group-hover:transition-none group-hover:opacity-100;
@apply duration-200 pointer-events-none;
@apply bg-white rounded md:rounded-md border-gray-200;
@apply md:p-3 md:w-max w-full md:h-auto h-0 border-0 opacity-0;
.popup {
@apply top-12 -left-1;
@apply md:absolute overflow-hidden;
@apply group-hover:p-3 group-hover:border group-hover:w-full;
@apply group-hover:h-auto group-hover:overflow-visible;
@apply group-hover:transition-none group-hover:opacity-100;
@apply duration-200 pointer-events-none;
@apply bg-white rounded md:rounded-md border-gray-200;
@apply md:p-3 md:w-max w-full md:h-auto h-0 border-0 opacity-0;
}
@screen md{
.popup{
@apply group-hover:w-max;
box-shadow: 0px 10px 36px rgba(0, 0, 0, 0.1);
@apply group-hover:pointer-events-auto;
}
@screen md {
.popup {
@apply group-hover:w-max;
box-shadow: 0px 10px 36px rgba(0, 0, 0, 0.1);
@apply group-hover:pointer-events-auto;
}
}
</style>

54 changes: 28 additions & 26 deletions components/PreloadedImage.vue
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
<template>
<div class=" overflow-hidden">
<img :class="imageClass" :src="src" :alt="alt">
<div class="hidden">
<img v-for="source in srcs" :key="source" :src="source" alt="" rel="preload">
</div>
<div class="overflow-hidden">
<img :class="imageClass" :src="src" :alt="alt" />
<div class="hidden">
<img
v-for="source in srcs"
:key="source"
:src="source"
alt=""
rel="preload"
/>
</div>
</div>
</template>

<script>
import { defineComponent } from '@vue/composition-api'
export default defineComponent({
props: {
src: {
type: String,
required: true
},
alt: {
type: String,
default: ""
},
srcs: {
type: Array,
default: () => ([])
},
imageClass: {
type: Array,
default: () => ([])
}
props: {
src: {
type: String,
required: true,
},
alt: {
type: String,
default: '',
},
srcs: {
type: Array,
default: () => [],
},
setup() {
imageClass: {
type: Array,
default: () => [],
},
},
setup() {},
})
</script>
84 changes: 42 additions & 42 deletions components/SanityRichText.vue
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
<template>
<div id="sanity-content">
<slot name="before"/>
<SanityContent
v-if="isValidBlock(blocks)"
:blocks="blocks"
:serializers="{...sr, ...serializers}"/>
<slot name="after"/>
</div>
<div id="sanity-content">
<slot name="before" />
<SanityContent
v-if="isValidBlock(blocks)"
:blocks="blocks"
:serializers="{ ...sr, ...serializers }"
/>
<slot name="after" />
</div>
</template>

<script>
import { defineComponent, ref } from '@vue/composition-api'
import ImageSr from './sr/ImageSr.vue'
import YouTubeSr from './sr/YouTubeSr.vue'
import CodeSr from './sr/CodeSr.vue'
export default defineComponent({
props: {
blocks: {
required: true,
type: Array
},
serializers: {
type: Object,
default: () => ({})
}
props: {
blocks: {
required: true,
type: Array,
},
setup(){
const sr = ref({
types: {
image: ImageSr,
youtube: YouTubeSr,
code: CodeSr
}
})
serializers: {
type: Object,
default: () => ({}),
},
},
setup() {
const sr = ref({
types: {
image: ImageSr,
youtube: YouTubeSr,
code: CodeSr,
},
})
const isValidBlock = (block) => {
return block && Array.isArray(block)
}
return {sr, isValidBlock}
const isValidBlock = (block) => {
return block && Array.isArray(block)
}
return { sr, isValidBlock }
},
})
</script>

<style scoped>
#sanity-content a{
font-weight: bold;
@apply text-ui-primary;
#sanity-content a {
font-weight: bold;
@apply text-ui-primary;
}
#sanity-content a:hover{
text-decoration: underline;
text-decoration-color: var(--color-ui-primary-dark);
#sanity-content a:hover {
text-decoration: underline;
text-decoration-color: var(--color-ui-primary-dark);
}
#sanity-content ul{
list-style-type: square;
list-style: inside;
#sanity-content ul {
list-style-type: square;
list-style: inside;
}
#sanity-content h2{
@apply mt-10 font-sans;
#sanity-content h2 {
@apply mt-10 font-sans;
}
</style>
</style>
1 change: 0 additions & 1 deletion components/TheHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@

<script>
// import { useRoute } from '@nuxtjs/composition-api'
// import { defineComponent, ref } from '@vue/composition-api'
export default defineComponent({
setup() {
Expand Down
32 changes: 15 additions & 17 deletions components/sr/CodeSr.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
<template>
<div>
<template v-if="code && language==='html'">
<div class="mb-10" v-html="code"/>
</template>
</div>
<div>
<template v-if="code && language === 'html'">
<div class="mb-10" v-html="code" />
</template>
</div>
</template>

<script>
import { defineComponent } from '@vue/composition-api'
export default defineComponent({
props: {
code: {
type: String,
default: null
},
language: {
type: String,
default: 'html'
}
}
props: {
code: {
type: String,
default: null,
},
language: {
type: String,
default: 'html',
},
},
})
</script>
28 changes: 13 additions & 15 deletions components/sr/ImageSr.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
<template>
<div class="mb-5 border border-gray-200 rounded-md overflow-hidden">
<img class="" :alt="alt" :src="$urlFor(asset)"/>
</div>
<div class="mb-5 border border-gray-200 rounded-md overflow-hidden">
<img class="" :alt="alt" :src="$urlFor(asset)" />
</div>
</template>

<script>
import { defineComponent } from '@vue/composition-api'
export default defineComponent({
props: {
alt: {
type: String,
default: '',
},
asset: {
type: Object,
default: null
}
}
props: {
alt: {
type: String,
default: '',
},
asset: {
type: Object,
default: null,
},
},
})
</script>
Loading

0 comments on commit 3cb6786

Please sign in to comment.