Skip to content

Commit 805473c

Browse files
committed
feat(dashboard): paragraphs in 3D context
1 parent 4ae5c81 commit 805473c

File tree

12 files changed

+302
-268
lines changed

12 files changed

+302
-268
lines changed

packages/better-write-app/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
"three/examples/jsm/capabilities/WebGL.js",
119119
"three/examples/jsm/geometries/TextGeometry.js",
120120
"three/examples/jsm/loaders/FontLoader",
121+
"three/examples/jsm/loaders/FontLoader.js",
121122
"v-tooltip",
122123
"vue",
123124
"vue-i18n",

packages/better-write-app/public/three/fonts/poppins.typeface.json

+1
Large diffs are not rendered by default.

packages/better-write-app/src/components/editor/pdf/configuration/PDFConfiguration.vue

+5-20
Original file line numberDiff line numberDiff line change
@@ -28,46 +28,31 @@
2828
<PDFConfigurationSetParagraph
2929
v-motion
3030
:initial="{ opacity: 0, y: 30 }"
31-
:visible-once="{
32-
opacity: 1,
33-
y: 0,
34-
}"
31+
:enter="{ opacity: 1, y: 0 }"
3532
:delay="0"
3633
/>
3734
<PDFConfigurationSetHeadingOne
3835
v-motion
3936
:initial="{ opacity: 0, y: 30 }"
40-
:visible-once="{
41-
opacity: 1,
42-
y: 0,
43-
}"
37+
:enter="{ opacity: 1, y: 0 }"
4438
:delay="0"
4539
/>
4640
<PDFConfigurationSetHeadingTwo
4741
v-motion
4842
:initial="{ opacity: 0, y: 30 }"
49-
:visible-once="{
50-
opacity: 1,
51-
y: 0,
52-
}"
43+
:enter="{ opacity: 1, y: 0 }"
5344
:delay="0"
5445
/>
5546
<PDFConfigurationSetHeadingThree
5647
v-motion
5748
:initial="{ opacity: 0, y: 30 }"
58-
:visible-once="{
59-
opacity: 1,
60-
y: 0,
61-
}"
49+
:enter="{ opacity: 1, y: 0 }"
6250
:delay="0"
6351
/>
6452
<PDFConfigurationSetLineBreak
6553
v-motion
6654
:initial="{ opacity: 0, y: 30 }"
67-
:visible-once="{
68-
opacity: 1,
69-
y: 0,
70-
}"
55+
:enter="{ opacity: 1, y: 0 }"
7156
:delay="0"
7257
/>
7358
</div>

packages/better-write-app/src/components/landing/LandingFirst.vue

-87
This file was deleted.

packages/better-write-app/src/components/landing/LandingFooter.vue

-46
This file was deleted.

packages/better-write-app/src/components/landing/LandingHeader.vue

Whitespace-only changes.

packages/better-write-app/src/lang/br/landing.ts

+29
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,34 @@ export default {
1111
website: 'Editor',
1212
desktop: 'Desktop',
1313
},
14+
paragraphs: [
15+
'— Entre o relento e o desespero, sobrevivi.',
16+
` É possível observar uma casa modesta ao
17+
final da estrada, interrompendo a passagem para
18+
todos os tipos de locomoção.`,
19+
'— Não! Não! NÃO!',
20+
` — Desculpe-me pela arrogância, podê-lo-ei
21+
retribuir satisfatoriamente em outras circunstâncias.`,
22+
` O que nos resta acabará por romper o futuro promissor.`,
23+
` O imbróglio não pode ser resolvido. A
24+
complacência dos envolvidos na discussão foi dissolvida
25+
pelo puro ódio individualista.`,
26+
`Comecei a palrar,
27+
Sufocando o desprovido,
28+
Aprendi a falhar,
29+
Compreendendo o improviso,
30+
Sustentei a salvar,
31+
Desfalecendo no auspício.`,
32+
'Escrever melhor ou melhor escrever?',
33+
'A criatividade é a salvação para o ostracismo cotidiano.',
34+
'— Música para meus ouvidos! Uníssono da vitória!',
35+
'— A passagem está logo ali! Vamos!',
36+
`Kino apareceu na fresta, de relance, mais que o suficiente
37+
para Linea aceitar a perda.`,
38+
`No último esforço,
39+
Percebi a insolência,
40+
Recebendo o amor doloroso,
41+
Aceitei a clarência.`,
42+
],
1443
},
1544
}

packages/better-write-app/src/pages/Landing.vue

+84-2
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,87 @@
11
<template>
22
<main class="min-h-screen w-full overflow-x-hidden">
3-
<LandingFirst />
3+
<section
4+
id="landing-base"
5+
class="flex flex-col bg-theme-background-2 z-max text-white items-center justify-between min-h-screen w-full overflow-x-hidden"
6+
>
7+
<div
8+
v-if="webgl.isLoaded.value"
9+
class="flex-1 bg-theme-background-2 container mx-auto flex px-5 py-24 flex-col justify-center items-center z-50"
10+
>
11+
<div class="lg:flex-grow w-full flex flex-col items-center text-center">
12+
<div class="flex justify-start items-end">
13+
<img
14+
class="shadow-lg rounded-xs w-12 md:w-18"
15+
src="@/assets/logo.png"
16+
/>
17+
<span
18+
class="ml-5 relative top-3 sm:top-4 lg:top-6 md:ml-10 text-3xl sm:text-4xl lg:text-5xl font-bold"
19+
>Better Write.</span
20+
>
21+
</div>
22+
<v-typical
23+
v-motion
24+
:initial="{ opacity: 0, y: 50 }"
25+
:enter="{ opacity: 1, y: 0, transition: { delay: 300 } }"
26+
class="mt-8 border-b leading-relaxed text-lg blink"
27+
:steps="[
28+
t('landing.first.typical.1'),
29+
1500,
30+
t('landing.first.typical.2'),
31+
150,
32+
t('landing.first.typical.3'),
33+
1500,
34+
t('landing.first.typical.3'),
35+
1500,
36+
]"
37+
:loop="Infinity"
38+
:wrapper="'p'"
39+
></v-typical>
40+
<div
41+
v-motion
42+
class="flex items-center justify-between w-1/2 lg:w-5/12 xl:w-1/3 mt-32"
43+
:initial="{ opacity: 0 }"
44+
:enter="{ opacity: 1, transition: { delay: 300 } }"
45+
>
46+
<button
47+
class="flex items-center justify-center font-bold transition-colors shadow-xl w-full text-base md:text-lg px-6 py-3 md:px-5 md:py-5 border border-gray-800 bg-black-opacity hover:bg-gray-900 text-gray-200 flex flex-col"
48+
@click.prevent.stop="onClick"
49+
>
50+
<div>
51+
{{ t('landing.first.editor.website') }}
52+
</div>
53+
<div class="text-xs">
54+
{{ version }}
55+
</div>
56+
</button>
57+
</div>
58+
</div>
59+
</div>
60+
<div
61+
v-else
62+
class="flex justify-center items-center h-screen w-full bg-theme-background-2 z-umax"
63+
>
64+
<Spinner :width="150" :height="150" />
65+
</div>
66+
</section>
467
</main>
568
</template>
669

770
<script setup lang="ts">
871
import { useHead } from '@vueuse/head'
972
import { useI18n } from 'vue-i18n'
10-
import { computed, onMounted } from 'vue'
73+
import { computed, onMounted, nextTick } from 'vue'
1174
import { useWebGL } from '@/use/webgl'
75+
import { useEnv } from '@/use/env'
76+
import { useNProgress } from '@vueuse/integrations'
77+
import { useRouter } from 'vue-router'
78+
import VTypical from 'vue-typical'
1279
1380
const { t } = useI18n()
1481
const webgl = useWebGL()
82+
const env = useEnv()
83+
const { isLoading } = useNProgress()
84+
const router = useRouter()
1585
1686
onMounted(() => {
1787
document.body.removeAttribute('class')
@@ -28,4 +98,16 @@
2898
})
2999
30100
webgl.init()
101+
102+
const version = computed(() => `v${env.packageVersion()}`)
103+
104+
const onClick = async () => {
105+
isLoading.value = true
106+
107+
await nextTick
108+
109+
router.push('/').finally(() => {
110+
isLoading.value = false
111+
})
112+
}
31113
</script>

packages/better-write-app/src/use/defines.ts

+25
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,30 @@ import i18n from '@/lang'
44
export const useDefines = () => {
55
const { t } = i18n.global
66

7+
const landing = () => {
8+
const name = () => {
9+
// vue-i18n limitation zzzzzzzzzzzzzzz
10+
const arr = [
11+
t('landing.first.paragraphs[0]'),
12+
t('landing.first.paragraphs[1]'),
13+
t('landing.first.paragraphs[3]'),
14+
t('landing.first.paragraphs[4]'),
15+
t('landing.first.paragraphs[5]'),
16+
t('landing.first.paragraphs[6]'),
17+
t('landing.first.paragraphs[7]'),
18+
t('landing.first.paragraphs[8]'),
19+
t('landing.first.paragraphs[9]'),
20+
t('landing.first.paragraphs[10]'),
21+
t('landing.first.paragraphs[11]'),
22+
t('landing.first.paragraphs[12]'),
23+
]
24+
25+
return arr[Math.floor(Math.random() * arr.length)]
26+
}
27+
28+
return { name }
29+
}
30+
731
const pdf = () => {
832
const fixFonts = () => {
933
return ['EB Garamond', 'Cormorant Garamond']
@@ -215,5 +239,6 @@ export const useDefines = () => {
215239
return {
216240
pdf,
217241
themes,
242+
landing,
218243
}
219244
}

0 commit comments

Comments
 (0)