Skip to content

Commit

Permalink
fix(update): update components & pages
Browse files Browse the repository at this point in the history
  • Loading branch information
ThornWalli committed Jun 13, 2023
1 parent f24656a commit 27daf75
Show file tree
Hide file tree
Showing 33 changed files with 234 additions and 381 deletions.
2 changes: 2 additions & 0 deletions playground/.nuxtignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
pages/**/components/**/*.vue
# pages/**/*.vue
# !pages/index.vue
7 changes: 1 addition & 6 deletions playground/components/InfoLayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import { useHead } from '#imports';
import SpeedkitLayer from '#speedkit/components/SpeedkitLayer';
import BaseButton from '@/components/base/Button';
import useFonts from '#speedkit/composables/fonts';
const { $getFont } = useFonts();
useHead({
Expand All @@ -45,12 +44,8 @@ useHead({
)
]
});
</script>
<script>
export default {
inheritAttrs: false
};
defineOptions({ inheritAttrs: false });
</script>

<style lang="postcss" scoped>
Expand Down
30 changes: 14 additions & 16 deletions playground/components/elements/GithubCorner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,21 @@
</a>
</template>

<script>
export default {
props: {
title: {
type: String,
default: 'View source on GitHub'
},
target: {
type: String,
default: '_blank'
},
url: {
type: String,
default: 'https://your-url'
}
<script setup>
defineProps({
title: {
type: String,
default: 'View source on GitHub'
},
target: {
type: String,
default: '_blank'
},
url: {
type: String,
default: 'https://your-url'
}
};
});
</script>

<style lang="postcss" scoped>
Expand Down
2 changes: 2 additions & 0 deletions playground/components/elements/LoaderTest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
<script setup>
import { ref } from 'vue';
import { onMounted } from '#imports';
import useCritical from '#speedkit/composables/critical';
const { isCritical } = useCritical();
const active = ref(false);
onMounted(() => (active.value = true));
Expand Down
9 changes: 7 additions & 2 deletions playground/components/fragments/PageHeaderMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</template>

<script setup>
import { watch, computed } from 'vue';
import { watch, computed, ref, onMounted } from 'vue';
import { useRoute } from '#app';
import Headline from '@/components/base/Headline';
import LinkList from '@/components/base/LinkList';
Expand Down Expand Up @@ -70,7 +70,12 @@ const props = defineProps({
}
});
const inert = computed(() => props.modelValue);
const mounted = ref(false);
onMounted(() => {
mounted.value = true;
});
const inert = computed(() => mounted.value && !props.modelValue);
const emit = defineEmits(['update:modelValue']);
const route = useRoute();
Expand Down
4 changes: 3 additions & 1 deletion playground/layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<template>
<div>
<page-header v-model="menuOpened" v-bind="pageHeaderData" />
<slot :inert="menuOpened" />
<main :inert="menuOpened">
<slot />
</main>
<info-layer v-if="!$config.public.disableInfoLayer" critical />
<github-corner :url="$config.public.githubRepoUrl" />
</div>
Expand Down
37 changes: 18 additions & 19 deletions playground/nuxt.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,27 @@ export default defineNuxtConfig(async () => {
runtimeConfig: {
public: {
githubRepoUrl: repository.url,
disableInfoLayer: true
disableInfoLayer: false
}
},

app: {
baseURL: getBaseUrl()
baseURL: getBaseUrl(),
head: {
htmlAttrs: {
lang: 'en'
},
meta: [
{
charset: 'utf-8'
},
{
name: 'viewport',
content: 'width=device-width, initial-scale=1'
}
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
}
},

devServer: {
Expand Down Expand Up @@ -385,23 +400,7 @@ export default defineNuxtConfig(async () => {
]
},

modules: ['../src/module'],

head: {
htmlAttrs: {
lang: 'en'
},
meta: [
{
charset: 'utf-8'
},
{
name: 'viewport',
content: 'width=device-width, initial-scale=1'
}
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
}
modules: ['../src/module']
};
});

Expand Down
4 changes: 2 additions & 2 deletions playground/pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<main class="page-index">
<div>
<module-stage v-bind="stage" />
<module-text-a v-bind="textA" />
<module-image-text v-bind="imageTextA" />
Expand All @@ -9,7 +9,7 @@
<module-image-text v-bind="imageTextB" />
<module-text-b v-bind="textB" />
<module-video-vimeo v-bind="videoVimeoB" />
</main>
</div>
</template>

<script setup>
Expand Down
19 changes: 3 additions & 16 deletions playground/pages/tests/iframe/components/Critical.vue
Original file line number Diff line number Diff line change
@@ -1,30 +1,17 @@
<template>
<preview-container>
<template #default>
<default-iframe class="test-iframe" v-bind="iframe" />
<default-iframe class="test-iframe" :iframe-src="iframeSrc" />
</template>
<template #title>
<p>Critical<br />Iframe</p>
</template>
</preview-container>
</template>

<script>
<script setup>
import DefaultIframe from '#speedkit/components/SpeedkitIframe';
import PreviewContainer from '@/components/PreviewContainer';
export default {
components: {
DefaultIframe,
PreviewContainer
},
data() {
return {
iframe: {
src: 'https://grabarzundpartner.de'
}
};
}
};
const iframeSrc = 'https://grabarzundpartner.de';
</script>
19 changes: 3 additions & 16 deletions playground/pages/tests/iframe/components/Lazy.vue
Original file line number Diff line number Diff line change
@@ -1,30 +1,17 @@
<template>
<preview-container id="lazyContainer">
<template #default>
<default-iframe class="test-iframe" v-bind="iframe" />
<default-iframe class="test-iframe" :src="iframeSrc" />
</template>
<template #title>
<p>Lazy<br />Iframe</p>
</template>
</preview-container>
</template>

<script>
<script setup>
import DefaultIframe from '#speedkit/components/SpeedkitIframe';
import PreviewContainer from '@/components/PreviewContainer';
export default {
components: {
DefaultIframe,
PreviewContainer
},
data() {
return {
iframe: {
src: 'https://grabarzundpartner.de'
}
};
}
};
const iframeSrc = 'https://grabarzundpartner.de';
</script>
13 changes: 3 additions & 10 deletions playground/pages/tests/iframe/index.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
<template>
<main>
<div>
<critical critical />
<lazy />
</main>
</div>
</template>

<script>
<script setup>
import Critical from './components/Critical';
import Lazy from './components/Lazy';
export default {
components: {
Critical,
Lazy
}
};
</script>
43 changes: 16 additions & 27 deletions playground/pages/tests/image/components/Critical.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,25 @@
</preview-container>
</template>

<script>
<script setup>
import SpeedkitImage from '#speedkit/components/SpeedkitImage';
import PreviewContainer from '@/components/PreviewContainer';
export default {
components: {
SpeedkitImage,
PreviewContainer
},
data() {
return {
image: {
title: 'Critical - Image',
source: {
format: 'jpg',
src: '/img/critical.jpg',
sizes: {
default: '100vw',
xxs: '100vw',
xs: '100vw',
sm: '100vw',
md: '100vw',
lg: '100vw',
xl: '100vw',
xxl: '100vw'
}
}
}
};
const image = {
title: 'Critical - Image',
source: {
format: 'jpg',
src: '/img/critical.jpg',
sizes: {
default: '100vw',
xxs: '100vw',
xs: '100vw',
sm: '100vw',
md: '100vw',
lg: '100vw',
xl: '100vw',
xxl: '100vw'
}
}
};
</script>
41 changes: 15 additions & 26 deletions playground/pages/tests/image/components/Lazy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,24 @@
</preview-container>
</template>

<script>
<script setup>
import SpeedkitImage from '#speedkit/components/SpeedkitImage';
import PreviewContainer from '@/components/PreviewContainer';
export default {
components: {
SpeedkitImage,
PreviewContainer
},
data() {
return {
image: {
title: 'Lazy - Image',
source: {
src: '/img/lazy.jpg',
sizes: {
default: '100vw',
xxs: '100vw',
xs: '100vw',
sm: '100vw',
md: '100vw',
lg: '100vw',
xl: '100vw',
xxl: '100vw'
}
}
}
};
const image = {
title: 'Lazy - Image',
source: {
src: '/img/lazy.jpg',
sizes: {
default: '100vw',
xxs: '100vw',
xs: '100vw',
sm: '100vw',
md: '100vw',
lg: '100vw',
xl: '100vw',
xxl: '100vw'
}
}
};
</script>
13 changes: 3 additions & 10 deletions playground/pages/tests/image/index.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
<template>
<main>
<div>
<critical critical />
<lazy />
</main>
</div>
</template>

<script>
<script setup>
import Critical from './components/Critical';
import Lazy from './components/Lazy';
export default {
components: {
Critical,
Lazy
}
};
</script>
Loading

0 comments on commit 27daf75

Please sign in to comment.