Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Landing pad
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ivelov-vm
Landing pad
Commits
0996c0f8
Commit
0996c0f8
authored
1 year ago
by
ivelov-vm
Browse files
Options
Downloads
Patches
Plain Diff
feat: add 404 page
parent
494eb926
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
public/img/404.png
+0
-0
0 additions, 0 deletions
public/img/404.png
src/pages/BlogPage.vue
+5
-5
5 additions, 5 deletions
src/pages/BlogPage.vue
src/pages/NotFoundPage.vue
+58
-0
58 additions, 0 deletions
src/pages/NotFoundPage.vue
src/plugins/router.js
+5
-0
5 additions, 0 deletions
src/plugins/router.js
with
68 additions
and
5 deletions
public/img/404.png
0 → 100644
+
0
−
0
View file @
0996c0f8
947 KiB
This diff is collapsed.
Click to expand it.
src/pages/BlogPage.vue
+
5
−
5
View file @
0996c0f8
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<div
<div
class=
"absolute bg-gray-bg blur-[58px] rounded-[190px] w-[380px] h-[380px] z-0 -right-[82px] -top-[51px]"
class=
"absolute bg-gray-bg blur-[58px] rounded-[190px] w-[380px] h-[380px] z-0 -right-[82px] -top-[51px]"
></div>
></div>
<section
class=
"relative z-10 px-[6.7%] mt-6"
>
<section
class=
"relative z-10 px-[6.7%] mt-6"
>
<router-link
<router-link
to=
"/blogs"
to=
"/blogs"
...
@@ -57,10 +57,10 @@ export default {
...
@@ -57,10 +57,10 @@ export default {
mounted
()
{
mounted
()
{
window
.
addEventListener
(
"
scroll
"
,
this
.
onScroll
);
window
.
addEventListener
(
"
scroll
"
,
this
.
onScroll
);
if
(
!
this
.
$route
.
params
.
id
||
!
this
.
blogs
[
this
.
$route
.
params
.
id
-
1
])
{
//
if (!this.$route.params.id || !this.blogs[this.$route.params.id - 1]) {
this
.
$router
.
push
(
"
/blogs
"
);
//
this.$router.push("/blogs");
return
;
//
return;
}
//
}
this
.
blog
=
this
.
blogs
[
this
.
$route
.
params
.
id
-
1
];
this
.
blog
=
this
.
blogs
[
this
.
$route
.
params
.
id
-
1
];
},
},
...
...
This diff is collapsed.
Click to expand it.
src/pages/NotFoundPage.vue
0 → 100644
+
58
−
0
View file @
0996c0f8
<
template
>
<div
class=
"min-h-screen bg-cover bg-no-repeat bg-center bg-blend-multiply bg-gray-300 bg-[url('../public/img/404.png')]"
>
<HeaderComponent
current-page=
"404"
transparent
text-white
></HeaderComponent>
<h1
class=
"text-white font-medium text-[3.375rem] leading-[4.5rem] mt-10 sm:mt-20 md:mt-[214px] w-max mx-auto relative"
>
<FeatureLeftSvg
class=
"absolute -translate-x-[91%] w-[51px] h-[51px] text-blue -top-[25px]"
></FeatureLeftSvg>
Oops!
</h1>
<p
class=
"mt-2 text-white leading-[1.625rem] text-center text-lg w-auto mx-auto"
>
It looks like something went wrong
<br>
Reload the page or return to the home screen
</p>
<div
class=
"flex justify-center mt-[30px]"
>
<router-link
to=
"/"
class=
"text-white rounded leading-[1.813rem] text-lg py-[14px] px-10 text-center w-max bg-blue hover:bg-blue-700 transition-colors"
>
Go to main page
</router-link>
</div>
</div>
</
template
>
<
script
>
import
HeaderComponent
from
"
../components/HeaderComponent.vue
"
;
import
FeatureLeftSvg
from
"
../components/svg/FeatureLeftSvg.vue
"
;
export
default
{
name
:
"
NotFoundPage
"
,
data
()
{
return
{
scroll
:
window
.
scrollY
,
blog
:
{},
};
},
mounted
()
{
window
.
addEventListener
(
"
scroll
"
,
this
.
onScroll
);
if
(
!
this
.
$route
.
params
.
id
||
!
this
.
blogs
[
this
.
$route
.
params
.
id
-
1
])
{
this
.
$router
.
push
(
"
/blogs
"
);
return
;
}
this
.
blog
=
this
.
blogs
[
this
.
$route
.
params
.
id
-
1
];
},
beforeDestroy
()
{
window
.
removeEventListener
(
"
scroll
"
,
this
.
onScroll
);
},
methods
:
{
onScroll
()
{
this
.
scroll
=
window
.
scrollY
;
},
},
components
:
{
HeaderComponent
,
FeatureLeftSvg
},
};
</
script
>
This diff is collapsed.
Click to expand it.
src/plugins/router.js
+
5
−
0
View file @
0996c0f8
...
@@ -4,6 +4,7 @@ import HomePage from "../pages/HomePage";
...
@@ -4,6 +4,7 @@ import HomePage from "../pages/HomePage";
import
ServicesPage
from
"
../pages/ServicesPage
"
;
import
ServicesPage
from
"
../pages/ServicesPage
"
;
import
BlogsPage
from
"
../pages/BlogsPage
"
;
import
BlogsPage
from
"
../pages/BlogsPage
"
;
import
BlogPage
from
"
../pages/BlogPage
"
;
import
BlogPage
from
"
../pages/BlogPage
"
;
import
NotFoundPage
from
"
../pages/NotFoundPage
"
;
Vue
.
use
(
VueRouter
);
Vue
.
use
(
VueRouter
);
const
router
=
new
VueRouter
({
const
router
=
new
VueRouter
({
...
@@ -24,6 +25,10 @@ const router = new VueRouter({
...
@@ -24,6 +25,10 @@ const router = new VueRouter({
path
:
"
/blogs/:id
"
,
path
:
"
/blogs/:id
"
,
component
:
BlogPage
,
component
:
BlogPage
,
},
},
{
path
:
"
/:pathMatch(.*)*
"
,
component
:
NotFoundPage
,
},
],
],
mode
:
"
history
"
,
mode
:
"
history
"
,
});
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment