SolidScribe/client/src/pages/SharePage.vue
Max G 6bb856689d * Adjusted theme colors to add more contrast on white theme while making black more OLED friendly
* Links now get an underline on hover
* Cleaned up CSS variable names, added another theme color for more control
* Cleaned up unused CSS, removed scrollbars popping up, tons of other little UI tweaks
* Renamed shared notes to inbox
* Tweaked form display, seperated login and create accouts
* Put login/sign up form on home page
* Created more legitimate marketing for home page
* Tons up updates to note page and note input panel
* Better support for two users editing a note
* MUCH better diff handling, web sockets restore notes with unsaved diffs
* Moved all squire text modifier functions into a mixin class
* It now says saving when closing a note
* Lots of cleanup and better handiling of events on mount and destroy
* Scroll behavior modified to load notes when closer to bottom of page
* Pretty decent shared notes and sharable link support
* Updated help text
* Search now includes tag suggestions and attachment suggestions
* Cleaned up scratch pad a ton, allow for users to create new scratch pads
* Created a 404 Page and a Shared note page
* So many other small improvements. Oh my god, what is wrong with me, not doing commits!?
2020-06-07 20:57:35 +00:00

105 lines
2.3 KiB
Vue

<template>
<div class="ui grid">
<div class="sixteen wide column"></div>
<div class="sixteen wide column" v-if="text.length > 0 || title.length > 0">
<div class="ui text container squire-box" :style="{ 'background-color':styleObject['noteBackground'], 'color':styleObject['noteText']}">
<h1 v-if="title">{{title}}</h1>
<div v-if="text" v-html="text"></div>
</div>
</div>
<div class="sixteen wide column" v-if="!$store.getters.getLoggedIn">
<div class="ui text container">
<h2 class="ui header">
<img class="small-logo" loading="lazy" src="/api/static/assets/logo.svg" alt="Solid Scribe Logo">
<div class="content">
Solid Scribe is an easy, free, secure Note App
<div class="sub header">
Encrypted notes, only readable by you. Unless you share them.
</div>
</div>
</h2>
<div class="ui grid">
<div class="eight wide center aligned column">
<router-link class="ui compact green button" to="/login">
<i class="plug icon"></i>Sign Up
</router-link>
</div>
<div class="eight wide center aligned column">
<router-link class="ui compact green button" to="/">
<i class="comment outline icon"></i>
Learn More
</router-link>
</div>
</div>
</div>
</div>
<div class="ui sixteen wide center aligned column">
<h4>{{ failText }}</h4>
</div>
</div>
</template>
<script>
import axios from 'axios';
export default {
name: 'SharePage',
data(){
return {
title: '',
text: '',
failText: '',
styleObject:{},
}
},
beforeMount(){
//You can put something here for live updates
// this.$io.on
this.openNote()
},
methods:{
fail(){
this.failText = 'Failed to open Shared Note'
this.$bus.$emit('notification', 'Failed to Open Shared Note')
},
openNote(){
const noteId = this.$route.params.id
const sharedKey = this.$route.params.token
axios.post('/api/public/opensharednote', {noteId, sharedKey})
.then( ({data}) => {
if(data.success){
this.title = data.title
this.text = data.text
this.styleObject = data.styleObject
} else {
this.fail()
}
})
.catch(error => { this.fail() })
}
}
}
</script>
<style type="text/css" scoped>
.small-logo {
width: 30px;
height: auto;
}
</style>