Browse Source

bad time.

tags/v1.4.4
Ivan Bravo Bravo 9 months ago
parent
commit
0e0117d3c5

+ 1
- 0
src/.eslintrc.js View File

@@ -63,6 +63,7 @@ module.exports = {
"lodash/prefer-lodash-method": "off",
"lodash/prefer-lodash-typecheck": "warn",
"lodash/prefer-noop": "off",
"lodash/prefer-spread": "off",
"import/extensions": "off",
"max-len": "off",
"func-names": "off",

+ 11
- 0
src/assets/css/components/_button.scss View File

@@ -1,3 +1,14 @@
/*
* DreamTime.
* Copyright (C) DreamNet. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License 3.0 as published by
* the Free Software Foundation. See <https://www.gnu.org/licenses/gpl-3.0.html>
*
* Written by Ivan Bravo Bravo <ivan@dreamnet.tech>, 2019.
*/

.button {
@apply inline-flex items-center justify-center;
@apply border border-primary-500-30;

+ 11
- 0
src/assets/css/components/_container.scss View File

@@ -1,3 +1,14 @@
/*
* DreamTime.
* Copyright (C) DreamNet. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License 3.0 as published by
* the Free Software Foundation. See <https://www.gnu.org/licenses/gpl-3.0.html>
*
* Written by Ivan Bravo Bravo <ivan@dreamnet.tech>, 2019.
*/

.placeholder-container {
@apply h-screen flex flex-col justify-center;


+ 11
- 0
src/assets/css/components/_form.scss View File

@@ -1,3 +1,14 @@
/*
* DreamTime.
* Copyright (C) DreamNet. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License 3.0 as published by
* the Free Software Foundation. See <https://www.gnu.org/licenses/gpl-3.0.html>
*
* Written by Ivan Bravo Bravo <ivan@dreamnet.tech>, 2019.
*/

.field {
@apply mb-4;


+ 11
- 0
src/assets/css/components/_markdown.scss View File

@@ -1,3 +1,14 @@
/*
* DreamTime.
* Copyright (C) DreamNet. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License 3.0 as published by
* the Free Software Foundation. See <https://www.gnu.org/licenses/gpl-3.0.html>
*
* Written by Ivan Bravo Bravo <ivan@dreamnet.tech>, 2019.
*/

.markdown-content {
h2 {
@apply text-xl mb-2 font-semibold;

+ 11
- 0
src/assets/css/components/_notification.scss View File

@@ -1,3 +1,14 @@
/*
* DreamTime.
* Copyright (C) DreamNet. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License 3.0 as published by
* the Free Software Foundation. See <https://www.gnu.org/licenses/gpl-3.0.html>
*
* Written by Ivan Bravo Bravo <ivan@dreamnet.tech>, 2019.
*/

.notification {
@apply mb-4 py-2 px-4 border-2 border-dark-100 rounded-sm;
@apply bg-transparent text-generic-100 font-bold;

+ 0
- 53
src/assets/css/components/_range.scss View File

@@ -1,53 +0,0 @@
/* The slider itself */
.slider {
-webkit-appearance: none; /* Override default CSS styles */
appearance: none;
width: 100%; /* Full-width */
height: 10px; /* Specified height */
border-radius: 5px;
background: #888; /* Grey background */
outline: none; /* Remove outline */
opacity: 0.7; /* Set transparency (for mouse-over effects on hover) */
-webkit-transition: .2s; /* 0.2 seconds transition on hover */
transition: opacity .2s;
}

/* Mouse-over effects */
.slider:hover {
opacity: 1; /* Fully shown on mouse-over */
}

/* The slider handle (use -webkit- (Chrome, Opera, Safari, Edge) and -moz- (Firefox) to override default look) */
.slider::-webkit-slider-thumb {
-webkit-appearance: none; /* Override default look */
appearance: none;
width: 20px; /* Set a specific slider handle width */
height: 20px; /* Slider handle height */
border-radius: 10px;
@apply bg-primary-500; /* Green background */
cursor: pointer; /* Cursor on hover */
}

.slider::-moz-range-thumb {
width: 20px; /* Set a specific slider handle width */
height: 20px; /* Slider handle height */
border-radius: 10px;
@apply bg-primary-500; /* Green background */
cursor: pointer; /* Cursor on hover */
}
.slider-container{
position: relative;
width: 100%;
}
.slider-container .min {
font-size: 10pt;
//position: absolute;
display: inline-block;
left: 0px;
}
.slider-container .max {
font-size: 10pt;
position: absolute;
display: inline-block;
right: 0px;
}

+ 11
- 0
src/assets/css/components/_section.scss View File

@@ -1,3 +1,14 @@
/*
* DreamTime.
* Copyright (C) DreamNet. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License 3.0 as published by
* the Free Software Foundation. See <https://www.gnu.org/licenses/gpl-3.0.html>
*
* Written by Ivan Bravo Bravo <ivan@dreamnet.tech>, 2019.
*/

.section {
&:not(:last-child) {
@apply mb-6;

src/assets/css/components/_all.scss → src/assets/css/components/all.scss View File

@@ -5,4 +5,3 @@
@import './form';
@import './notification';
@import './markdown';
@import './range';

+ 0
- 115
src/assets/css/reset.scss View File

@@ -1,115 +0,0 @@
*,
*:before,
*:after {
box-sizing: border-box;
margin: 0;
}

html {
@apply bg-black text-generic-500 font-sans;
background-image: url('https://www.toptal.com/designers/subtlepatterns/patterns/papyrus-dark.png'); /* Background pattern from Toptal Subtle Patterns */
font-size: 16px;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
box-sizing: border-box;
}

body,
html {
@apply overflow-hidden;
}

body,
html,
#__nuxt,
#__layout {
@apply h-full;
}

dialog {
@apply m-auto p-0 bg-transparent text-white;
width: 32em;
max-width: 100%;

.dialog__content {
@apply p-4 bg-dark-500 rounded;
@apply flex flex-col justify-center;
}

.dialog__buttons {
@apply flex mt-4;

.button {
@apply flex-1;

&:not(:last-child) {
@apply mr-2;
}
}
}
}

dialog::backdrop {
background: rgba(25, 25, 26, 0.75);
}

.title {
@apply font-serif;
}

.swal-content {
font-size: 16px;

p {
@apply mb-2;
}

a {
@apply text-primary-500 underline;
}
}

*::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;
@apply bg-dark-800;
}

*::-webkit-scrollbar
{
width: 10px;
@apply bg-dark-800;
}

*::-webkit-scrollbar-thumb
{
@apply bg-dark-100;
transition: all .1s ease-in-out;

&:hover {
@apply bg-primary-700;
}
}

.swal2-html-container {
pre {
@apply text-xs overflow-auto bg-gray-300 p-2;
}
}

.swal2-footer {
code {
@apply text-sm text-center;
}
}

.vue-slider {
@apply w-full #{!important};
}

.vue-slider-process {
@apply bg-primary-500 #{!important};
}

+ 42
- 0
src/assets/css/reset/_base.scss View File

@@ -0,0 +1,42 @@
/*
* DreamTime.
* Copyright (C) DreamNet. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License 3.0 as published by
* the Free Software Foundation. See <https://www.gnu.org/licenses/gpl-3.0.html>
*
* Written by Ivan Bravo Bravo <ivan@dreamnet.tech>, 2019.
*/

*,
*:before,
*:after {
box-sizing: border-box;
margin: 0;
}

html {
@apply bg-black text-generic-500 font-sans;
background-image: url('~assets/images/papyrus-dark.webp'); /* Background pattern from Toptal Subtle Patterns */
font-size: 16px;
-webkit-text-size-adjust: 100%;
-webkit-font-smoothing: antialiased;
box-sizing: border-box;
}

body,
html {
@apply overflow-hidden;
}

body,
html,
#__nuxt,
#__layout {
@apply h-full;
}

.title {
@apply font-serif;
}

+ 37
- 0
src/assets/css/reset/_dialog.scss View File

@@ -0,0 +1,37 @@
/*
* DreamTime.
* Copyright (C) DreamNet. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License 3.0 as published by
* the Free Software Foundation. See <https://www.gnu.org/licenses/gpl-3.0.html>
*
* Written by Ivan Bravo Bravo <ivan@dreamnet.tech>, 2019.
*/

dialog {
@apply m-auto p-0 bg-transparent text-white;
width: 32em;
max-width: 100%;

.dialog__content {
@apply p-4 bg-dark-500 rounded;
@apply flex flex-col justify-center;
}

.dialog__buttons {
@apply flex mt-4;

.button {
@apply flex-1;

&:not(:last-child) {
@apply mr-2;
}
}
}
}

dialog::backdrop {
background: rgba(25, 25, 26, 0.75);
}

+ 43
- 0
src/assets/css/reset/_libs.scss View File

@@ -0,0 +1,43 @@
/*
* DreamTime.
* Copyright (C) DreamNet. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License 3.0 as published by
* the Free Software Foundation. See <https://www.gnu.org/licenses/gpl-3.0.html>
*
* Written by Ivan Bravo Bravo <ivan@dreamnet.tech>, 2019.
*/

.swal-content {
font-size: 16px;

p {
@apply mb-2;
}

a {
@apply text-primary-500 underline;
}
}

.swal2-html-container {
pre {
@apply text-xs overflow-auto bg-gray-300 p-2;
max-height: 100px;
}
}

.swal2-footer {
code {
@apply text-sm text-center;
}
}

.vue-slider {
@apply w-full #{!important};
}

.vue-slider-process {
@apply bg-primary-500 #{!important};
}

+ 33
- 0
src/assets/css/reset/_scrollbar.scss View File

@@ -0,0 +1,33 @@
/*
* DreamTime.
* Copyright (C) DreamNet. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License 3.0 as published by
* the Free Software Foundation. See <https://www.gnu.org/licenses/gpl-3.0.html>
*
* Written by Ivan Bravo Bravo <ivan@dreamnet.tech>, 2019.
*/

*::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;
@apply bg-dark-800;
}

*::-webkit-scrollbar
{
width: 10px;
@apply bg-dark-800;
}

*::-webkit-scrollbar-thumb
{
@apply bg-dark-100;
transition: all .1s ease-in-out;

&:hover {
@apply bg-primary-700;
}
}

+ 16
- 0
src/assets/css/reset/all.scss View File

@@ -0,0 +1,16 @@
/*
* DreamTime.
* Copyright (C) DreamNet. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License 3.0 as published by
* the Free Software Foundation. See <https://www.gnu.org/licenses/gpl-3.0.html>
*
* Written by Ivan Bravo Bravo <ivan@dreamnet.tech>, 2019.
*/

@import './base';
@import './dialog';
@import './libs';
@import './scrollbar';
@import './fonts';

src/assets/css/fonts.scss → src/assets/css/reset/fonts.scss View File


src/assets/css/utilities/_all.scss → src/assets/css/utilities/all.scss View File


BIN
src/assets/images/games/sans.png View File


BIN
src/assets/images/papyrus-dark.webp View File


+ 52
- 33
src/components/Layout/Jobbar.vue View File

@@ -1,8 +1,8 @@
<template>
<div class="layout__jobbar">
<div class="jobs__section">
<div class="section__title">
<div>
<section>
<div class="section__header">
<div class="section__title">
<span class="icon"><font-awesome-icon icon="running" /></span>
<span>Queue</span>
</div>
@@ -34,11 +34,11 @@
<img :src="photo.file.dataURL">
</figure>
</div>
</div>
</section>

<div class="jobs__section">
<div class="section__title">
<div>
<section>
<div class="section__header">
<div class="section__title">
<span class="icon"><font-awesome-icon icon="clipboard-list" /></span>
<span>Pending</span>
</div>
@@ -69,11 +69,11 @@
<img :src="photo.file.dataURL">
</figure>
</div>
</div>
</section>

<div class="jobs__section">
<div class="section__title">
<div class="flex-1">
<section>
<div class="section__header">
<div class="section__title">
<span class="icon"><font-awesome-icon icon="clipboard-check" /></span>
<span>Finished</span>
</div>
@@ -105,7 +105,7 @@
<img :src="photo.file.dataURL">
</figure>
</div>
</div>
</section>
</div>
</template>

@@ -121,38 +121,57 @@ export default {

<style lang="scss" scoped>
.layout__jobbar {
@apply relative bg-dark-500 py-2 z-10;
@apply flex flex-col;
@apply relative flex flex-col;
@apply bg-dark-500 py-2 z-10;
@apply border-l border-dark-100;
width: 200px;

&::after {
@apply border-r border-dark-300;
@apply block bottom-0 right-0 pointer-events-none absolute;
content: " ";
top: 50px;
}
}

.jobs__section {
section {
@apply flex-1 flex flex-col;
@apply overflow-hidden;
height: calc((100vh - 80px) / 3);
}

.section__title {
@apply px-4 pt-2 text-sm text-white font-semibold;
@apply flex items-center;
&:not(:first-child) {
.section__header {
&::before, &::after {
@apply block border-b;
@apply absolute right-0 pointer-events-none z-0;
content: " ";
left: 100px;
}

&::before {
@apply border-dark-200;
top: 18px;
}

&::after {
@apply border-dark-400;
top: 19px;
}
}
}

.section__header {
@apply px-4 pt-2 text-sm text-white font-semibold;
@apply relative flex items-center;

.icon {
@apply mr-2;
}

.icon {
@apply mr-2;
.section__title {
@apply flex-1 z-10;
}
}
}

.section__actions {
@apply flex flex-1 justify-end ml-2;
.section__actions {
@apply flex flex-1 justify-end ml-2;

.button {
@apply ml-2;
.button {
@apply ml-2;
}
}
}


+ 17
- 13
src/components/Layout/Navbar.vue View File

@@ -5,31 +5,31 @@
Nudify
</nuxt-link>

<nuxt-link class="navbar__item" to="/about">
About
<nuxt-link class="navbar__item" to="/settings">
Settings
</nuxt-link>

<nuxt-link class="navbar__item" to="/dreamnet">
DreamNet
</nuxt-link>
<a class="navbar__item" :href="manualURL" target="_blank">
Help
</a>

<a class="navbar__item" @click.prevent="createError">
<a v-if="isDev" class="navbar__item" @click.prevent="createError">
Error
</a>
</div>

<div class="navbar__right">
<nuxt-link v-tooltip="{placement: 'bottom', content: 'Settings'}" class="navbar__icon" to="/settings">
<font-awesome-icon icon="cog" />
<nuxt-link v-tooltip="{placement: 'bottom', content: 'About'}" class="navbar__icon" to="/about">
<font-awesome-icon icon="info-circle" />
</nuxt-link>

<nuxt-link v-tooltip="{placement: 'bottom', content: 'DreamNet'}" class="navbar__icon" to="/dreamnet">
<font-awesome-icon icon="users" />
</nuxt-link>

<a v-tooltip="{placement: 'bottom', content: 'Donate and get benefits!'}" class="navbar__icon" :href="donateUrl" target="_blank">
<font-awesome-icon :icon="['fab', 'patreon']" />
</a>

<a v-tooltip="{placement: 'bottom', content: 'Manual'}" class="navbar__icon" :href="manualURL" target="_blank">
<font-awesome-icon icon="question-circle" />
</a>
</div>
</div>
</template>
@@ -51,6 +51,10 @@ export default {
manualURL() {
return nucleus.urls?.docs?.manual || 'https://forum.dreamnet.tech/d/32-dreamtime-manual'
},

isDev() {
return process.env.name === 'development'
},
},

methods: {
@@ -65,7 +69,7 @@ export default {
<style lang="scss" scoped>
.layout__navbar {
@apply flex bg-dark-500 z-10;
@apply border-b border-dark-300;
@apply border-b border-dark-100;
height: 50px;

.navbar__left,

+ 36
- 4
src/components/Layout/Topbar.vue View File

@@ -5,9 +5,14 @@
{{ $dream.name }} {{ $dream.version }}
</div>

<div class="topbar__greetings">
<div v-show="!badTime" class="topbar__greetings">
{{ greetings }}
</div>

<div v-show="badTime" class="topbar__badtime">
<img src="~/assets/images/games/sans.png">
here we go.
</div>
</div>

<div class="topbar__buttons">
@@ -32,6 +37,10 @@ import moment from 'moment'
const { activeWindow, api } = $provider.util

export default {
data: () => ({
badTime: false,
}),

computed: {
greetings() {
const hours = moment().hours()
@@ -52,6 +61,18 @@ export default {
},
},

mounted() {
this.$router.afterEach((to, from) => {
if (to.path === '/games/badtime') {
this.$dream.name = 'BadDreamTime'
this.badTime = true
} else {
this.$dream.name = process.env.npm_package_displayName
this.badTime = false
}
})
},

methods: {
minimize() {
activeWindow().minimize()
@@ -93,7 +114,7 @@ export default {
}

.topbar__logo {
@apply flex flex-col items-center justify-center;
@apply flex flex-col items-center justify-center mr-4;
@apply font-bold px-4;
background: rgb(99, 66, 245);

@@ -107,8 +128,19 @@ export default {
}

.topbar__greetings {
@apply flex flex-col items-center justify-center;
@apply font-light px-4;
@apply flex items-center justify-center;
@apply font-light;
}

.topbar__badtime {
@apply flex items-center justify-center;
@apply lowercase font-bold text-sm;
font-family: "Comic Sans MS", serif;

img {
@apply mr-2;
height: 18px;
}
}

.topbar__buttons {

+ 1
- 1
src/layouts/default.vue View File

@@ -27,7 +27,7 @@ export default {
display: grid;
grid-template-columns: 200px 1fr 200px;
grid-template-rows: 30px 50px 1fr;
grid-template-areas: "topbar topbar topbar" "jobbar navbar navbar" "jobbar content content";
grid-template-areas: "topbar topbar topbar" "navbar navbar navbar" "content content jobbar";

.layout__topbar {
grid-area: topbar;

+ 0
- 4
src/modules/system/consola.js View File

@@ -78,8 +78,6 @@ export class Consola {
constructor(category = 'dreamtime') {
this.category = category
this.logger = Logger.create(category)

console.log(this.category, this.logger)
}

/**
@@ -99,8 +97,6 @@ export class Consola {
options,
})

console.log(this.logger)

const log = new Log(this.logger, level, message, { ...this.defaultOptions, ...options })
this.defaultOptions = {}


+ 2
- 4
src/modules/system/log.js View File

@@ -7,7 +7,7 @@
//
// Written by Ivan Bravo Bravo <ivan@dreamnet.tech>, 2019.

import { isError } from 'lodash'
import { isError, escape } from 'lodash'
import Swal from 'sweetalert2'
import { HandledError } from './errors'
import { rollbar, logrocket } from '../services'
@@ -104,8 +104,6 @@ export class Log {
delete options.error
}

console.log(this.logger)

this.handle().catch((err) => {
// eslint-disable-next-line no-console
console.error('Something incredibly bad has happened:', err)
@@ -199,7 +197,7 @@ export class Log {
let html = message

if (isError(error)) {
html = `${html}<br><br><pre>${error.stack}</pre>`
html = `${html}<br><br><pre>${escape(error.stack)}</pre>`
}

Swal.fire({

+ 4
- 4
src/nuxt.config.js View File

@@ -106,16 +106,16 @@ module.exports = {
*/
css: [
'tippy.js/dist/tippy.css',
'@sweetalert2/theme-dark/dark.css',
'cropperjs/dist/cropper.css',
'tui-image-editor/dist/tui-image-editor.css',
'tui-color-picker/dist/tui-color-picker.css',
'vue-slider-component/theme/default.css',

'~/assets/css/tailwind.scss',
'~/assets/css/reset.scss',
'~/assets/css/components/_all.scss',
'~/assets/css/utilities/_all.scss',
'~/assets/css/fonts.scss',
'~/assets/css/reset/all.scss',
'~/assets/css/components/all.scss',
'~/assets/css/utilities/all.scss',
],

/*

+ 2
- 0
src/package.json View File

@@ -57,10 +57,12 @@
"@fortawesome/free-regular-svg-icons": "^5.11.2",
"@fortawesome/free-solid-svg-icons": "^5.11.2",
"@fortawesome/vue-fontawesome": "^0.1.8",
"@sweetalert2/theme-dark": "^3.1.0",
"axios": "^0.19.0",
"better-queue": "^3.8.10",
"better-queue-memory": "^1.0.4",
"caller-callsite": "^4.1.0",
"combokeys": "^3.0.1",
"compare-versions": "^3.5.1",
"cropperjs": "^1.5.6",
"cryptr": "^6.0.1",

+ 30
- 0
src/pages/games/badtime.vue View File

@@ -0,0 +1,30 @@
<template>
<div class="badtime">
<iframe
src="https://badtime.dreamnet.tech"
name="badtime"
scrolling="no"
frameborder="0"
marginheight="0px"
marginwidth="0px"
allowfullscreen />
</div>
</template>

<script>
export default {
mounted() {
consola.track('BADTIME')
},
}
</script>

<style lang="scss" scoped>
.badtime {
@apply h-full;

iframe {
@apply border-none w-full h-full;
}
}
</style>

+ 10
- 1
src/plugins/setup.js View File

@@ -10,6 +10,7 @@
import Vue from 'vue'
import moment from 'moment'
import tippy from 'tippy.js'
import Combokeys from 'combokeys'
import { dream } from '~/modules'
import { Nudify, NudifyStore } from '~/modules/nudify'
import { HandledError, LogError } from '~/modules/system'
@@ -32,7 +33,7 @@ tippy.setDefaultProps({
arrow: true,
})

export default async ({ app }, inject) => {
export default async ({ app, redirect }, inject) => {
// catch errors
Vue.config.errorHandler = (err) => {
if (err instanceof HandledError || err instanceof LogError) {
@@ -44,6 +45,7 @@ export default async ({ app }, inject) => {

// dreamtime.
dream.setup()
app.$dream = dream
inject('dream', dream)

// nudify.
@@ -53,6 +55,13 @@ export default async ({ app }, inject) => {
NudifyStore.setup()
inject('nudify', NudifyStore)

// easter eggs!
const combokeys = new Combokeys(document.documentElement)

combokeys.bind('b a d t i m e', () => {
redirect('/games/badtime')
})

// ready
logger.info('The front-end is ready!')
}

Loading…
Cancel
Save