-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(components): added WeakHardwareOverlay
- added tests - fix entry setupSpeedkitLayer
- Loading branch information
1 parent
d3adc73
commit 43f255e
Showing
14 changed files
with
170 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<template> | ||
<speedkit-weak-hardware-overlay> | ||
<div v-font="$getFont('Montserrat Alternates', 400, 'normal')"> | ||
<p>{{ text }}</p> | ||
<base-button id="nuxt-speedkit-button-init-app"> | ||
{{ buttonText }} | ||
</base-button> | ||
</div> | ||
</speedkit-weak-hardware-overlay> | ||
</template> | ||
|
||
<script setup> | ||
import SpeedkitWeakHardwareOverlay from '#speedkit/components/WeakHardwareOverlay'; | ||
import BaseButton from '@/components/base/Button'; | ||
import useFonts from '#speedkit/composables/fonts'; | ||
const { $getFont } = useFonts(); | ||
defineProps({ | ||
text: { | ||
type: String, | ||
default: | ||
'To improve your experience, extensive features have been disabled.' | ||
}, | ||
buttonText: { | ||
type: String, | ||
default: 'Click here to enable them.' | ||
} | ||
}); | ||
</script> | ||
|
||
<style lang="postcss" scoped> | ||
.nuxt-speedkit-weak-hardware-overlay { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
width: 100%; | ||
height: 100%; | ||
background: rgb(0 0 0 / 60%); | ||
backdrop-filter: blur(em(4px)); | ||
& div { | ||
font-size: 14px; | ||
text-align: center; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<template> | ||
<main :class="{ mounted }" tag="main"> | ||
<div> | ||
WeakHardwareOverlay | ||
<speedkit-weak-hardware-overlay /> | ||
</div> | ||
<speedkit-layer /> | ||
</main> | ||
</template> | ||
|
||
<script setup> | ||
import { ref, onMounted } from 'vue'; | ||
import SpeedkitLayer from '#speedkit/components/SpeedkitLayer'; | ||
import SpeedkitWeakHardwareOverlay from '#speedkit/components/WeakHardwareOverlay'; | ||
const mounted = ref(false); | ||
onMounted(() => { | ||
mounted.value = true; | ||
}); | ||
defineOptions({ | ||
layout: 'blank' | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<template> | ||
<div v-if="isServer" class="nuxt-speedkit-weak-hardware-overlay"> | ||
<slot> | ||
Area is disabled for performance reasons.<br /> | ||
<button id="nuxt-speedkit-button-init-app">Click for activation</button> | ||
</slot> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { ref, onMounted } from 'vue'; | ||
const isServer = ref(true); | ||
onMounted(() => (isServer.value = false)); | ||
</script> | ||
|
||
<style lang="postcss" scoped> | ||
/*! purgecss start ignore */ | ||
.nuxt-speedkit-weak-hardware-overlay { | ||
@nest html:not(.nuxt-speedkit-reduced-view) & { | ||
display: none; | ||
} | ||
} | ||
/*! purgecss end ignore */ | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters