Added countdown page
This commit is contained in:
3
app/imports/constants/LAUNCH_DATE.js
Normal file
3
app/imports/constants/LAUNCH_DATE.js
Normal file
@@ -0,0 +1,3 @@
|
||||
const LAUNCH_DATE = new Date(1588867200000);
|
||||
|
||||
export default LAUNCH_DATE;
|
||||
@@ -4,12 +4,14 @@
|
||||
:light="!darkMode"
|
||||
>
|
||||
<v-navigation-drawer
|
||||
v-if="$route.path !== '/countdown'"
|
||||
v-model="drawer"
|
||||
app
|
||||
>
|
||||
<Sidebar />
|
||||
</v-navigation-drawer>
|
||||
<v-toolbar
|
||||
v-if="$route.path !== '/countdown'"
|
||||
app
|
||||
color="secondary"
|
||||
dark
|
||||
@@ -53,6 +55,7 @@
|
||||
</v-toolbar>
|
||||
<v-content>
|
||||
<v-alert
|
||||
v-if="$route.path !== '/countdown'"
|
||||
icon="priority_high"
|
||||
type="error"
|
||||
dismissible
|
||||
|
||||
47
app/imports/ui/pages/LaunchCountdown.vue
Normal file
47
app/imports/ui/pages/LaunchCountdown.vue
Normal file
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<v-layout
|
||||
column
|
||||
align-center
|
||||
justify-center
|
||||
class="fill-height"
|
||||
>
|
||||
<h1>
|
||||
DiceCloud verison 2 beta will launch in
|
||||
</h1>
|
||||
<h1 style="font-size: 64px;">
|
||||
<countdown
|
||||
:time="time"
|
||||
:interval="100"
|
||||
tag="p"
|
||||
>
|
||||
<template slot-scope="props">
|
||||
<span v-if="props.days">
|
||||
{{ props.days }} days,
|
||||
</span>{{ props.hours }}:{{ props.minutes }}:{{ props.seconds }}
|
||||
</template>
|
||||
</countdown>
|
||||
</h1>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import VueCountdown from '@chenfengyuan/vue-countdown';
|
||||
import LAUNCH_DATE from '/imports/constants/LAUNCH_DATE.js';
|
||||
export default{
|
||||
components:{
|
||||
countdown: VueCountdown,
|
||||
},
|
||||
data: function () {
|
||||
let now = new Date();
|
||||
let timeLeft = LAUNCH_DATE - now
|
||||
setTimeout(() => {
|
||||
this.$router.push('/');
|
||||
}, timeLeft);
|
||||
return {
|
||||
counting: false,
|
||||
time: timeLeft,
|
||||
};
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -1,5 +1,6 @@
|
||||
import { RouterFactory, nativeScrollBehavior } from 'meteor/akryum:vue-router2';
|
||||
import getEntitledCents from '/imports/api/users/patreon/getEntitledCents.js';
|
||||
import LAUNCH_DATE from '/imports/constants/LAUNCH_DATE.js';
|
||||
|
||||
// Components
|
||||
import Home from '/imports/ui/pages/Home.vue';
|
||||
@@ -14,6 +15,7 @@ import Friends from '/imports/ui/pages/Friends.vue' ;
|
||||
import Account from '/imports/ui/pages/Account.vue' ;
|
||||
import NotImplemented from '/imports/ui/pages/NotImplemented.vue';
|
||||
import PatreonLevelTooLow from '/imports/ui/pages/PatreonLevelTooLow.vue';
|
||||
import LaunchCountdown from '/imports/ui/pages/LaunchCountdown.vue';
|
||||
|
||||
let userSubscription = Meteor.subscribe('user');
|
||||
|
||||
@@ -62,6 +64,15 @@ function ensurePatronTier5(to, from, next){
|
||||
RouterFactory.configure(factory => {
|
||||
factory.addRoutes([
|
||||
{
|
||||
path: '/countdown',
|
||||
name: 'Countdown',
|
||||
components: {
|
||||
default: LaunchCountdown,
|
||||
},
|
||||
meta: {
|
||||
title: 'Countdown to Launch',
|
||||
},
|
||||
},{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
components: {
|
||||
@@ -185,4 +196,18 @@ RouterFactory.configure(factory => {
|
||||
|
||||
// Create the router instance
|
||||
const router = routerFactory.create();
|
||||
router.beforeEach((to, from, next) => {
|
||||
let user = Meteor.user();
|
||||
if (
|
||||
to.path === '/countdown' ||
|
||||
to.path === '/sign-in' ||
|
||||
(user.roles && user.roles.includes('admin'))
|
||||
){
|
||||
next();
|
||||
} else if (new Date() < LAUNCH_DATE){
|
||||
next('/countdown');
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
});
|
||||
export default router;
|
||||
|
||||
964
app/package-lock.json
generated
964
app/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -18,6 +18,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.9.2",
|
||||
"@chenfengyuan/vue-countdown": "^1.1.5",
|
||||
"animejs": "^2.2.0",
|
||||
"bcrypt": "^3.0.8",
|
||||
"core-js": "^2.6.11",
|
||||
|
||||
Reference in New Issue
Block a user