-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: middleware for non supported screens
- Loading branch information
Showing
10 changed files
with
77 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
enum ScreenSize { | ||
WIDTH = 1820, | ||
HEIGHT = 1080, | ||
} | ||
|
||
export default defineNuxtRouteMiddleware(() => { | ||
const { width } = useWindowSize(); | ||
|
||
const isValidResolutions = width.value >= ScreenSize.WIDTH; | ||
|
||
if (!isValidResolutions) { | ||
return navigateTo('/non-supported-screen'); | ||
} | ||
}); |
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
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,44 @@ | ||
<template> | ||
<main> | ||
<div>;-;</div> | ||
<h1>Non supported screen</h1> | ||
<p>Sorry, NuChat is not supported on this screen size yet.</p> | ||
</main> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
main { | ||
width: 80%; | ||
height: 100vh; | ||
margin: 0 auto; | ||
display: flex; | ||
flex-flow: column; | ||
justify-content: center; | ||
align-items: center; | ||
div { | ||
font-size: 10rem; | ||
font-weight: 700; | ||
color: #ccc; | ||
text-align: center; | ||
margin-bottom: 2rem; | ||
} | ||
h1 { | ||
font-size: 3rem; | ||
font-weight: 700; | ||
color: $primary; | ||
text-align: center; | ||
margin-bottom: 2rem; | ||
} | ||
p { | ||
font-size: 1.5rem; | ||
font-weight: 500; | ||
color: #333; | ||
text-align: center; | ||
width: 50%; | ||
margin-bottom: 1rem; | ||
} | ||
} | ||
</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