Skip to content

Commit

Permalink
Changed markdown page
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianFun123 committed Sep 9, 2023
1 parent 0efe40c commit 6cffead
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 53 deletions.
8 changes: 4 additions & 4 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"petrel": "^1.0.7",
"portal-vue": "^2.1.7",
"sass": "^1.43.4",
"v-animate-css": "^1.0.1",
"v-animate-css": "0.0.5",
"vue": "^2.6.11",
"vue-router": "^3.5.1"
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500;600&family=Space+Mono:ital,wght@0,400;0,700;1,400&family=DM+Mono:wght@300;400;500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500;600&family=Space+Mono:ital,wght@0,400;0,700;1,400&family=DM+Mono:wght@300;400;500&family=DM+Sans&family=DM+Serif+Text&display=swap" rel="stylesheet">

<meta id="metaThemeColor" name="theme-color" content="#212531">

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div style="min-height: 100%;">
<side-bar/>
<side-bar />
<router-view :class="{'mobile': $store.state.mobileVersion}" id="page" />

<div v-if="$store.state.user.type == 'AWAITING_ACCESS'" id="fullscreen-alert">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/HomeHeader.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<h1 v-if="$store.state.user.logged_in">Welcome, {{ $store.state.user.name }}</h1>
<h1 v-if="$store.state.user.logged_in">Welcome, <span v-animate-css="{classes: 'fadeIn', delay: 0}">{{ $store.state.user.name }}</span></h1>
<h1 v-else>Welcome to {{ $store.state.appInfo.custom_name || 'Pastefy' }}!</h1><br>

<div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/sidebar/Sidebar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<router-link to="/" id="logo" :class="{'mobile': $store.state.mobileVersion && this.$route.path !== '/'}">
<router-link to="/" id="logo" :class="{'mobile': $store.state.mobileVersion && this.$route.path !== '/'}" >
<img :src="$store.state.appInfo.custom_logo ? $store.state.appInfo.custom_logo : require('../../assets/logo.png')">
</router-link>
<div id="sidebar"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Vue.config.productionTip = false


Vue.use(PortalVue)
Vue.use(VAnimateCss)
Vue.use(VAnimateCss);

let worker = null

Expand Down
14 changes: 7 additions & 7 deletions frontend/src/views/Homepage.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<template>
<div>
<HomeHeader />
<WebsiteBanner paste="pb-homep" />
<div v-if="$store.state.user.logged_in">
<WebsiteBanner paste="pb-homep" v-animate-css="{classes: 'fadeIn', delay: 50}" />

<div id="folders">
<div v-if="$store.state.user.logged_in">
<div id="folders" v-animate-css="{classes: 'fadeIn', delay: 100}">
<h3 style="margin-top: 20px; margin-bottom: 20px; font-size: 24px">Folder</h3>

<FolderCard v-for="folder of folders" :key="`folder-${folder.id}`" :folder="folder" />
<NewFolderCard @created="loadFolders()" />
</div>
<div id="pastes">
<div id="pastes" v-animate-css="{classes: 'fadeIn', delay: 150}">
<a class="button" @click="$store.state.currentPaste.folder = null; $store.state.app.fullscreen = true"
style="float: right; padding: 4px 16px; margin-top: 4px">NEW</a>

Expand All @@ -24,11 +24,11 @@
</div>
</div>
<div v-else>
<p>
<p v-animate-css="{classes: 'fadeIn', delay: 100}">
Pastefy is a code-paster. Just paste your code into the input-field on the left side and voilá!<br>
</p><br><br>
<h2 style="margin-bottom: 10px" v-if="$store.state.app.lastPastes.length">Your last created pastes</h2>
<div id="pastes">
<h2 v-animate-css="{classes: 'fadeIn', delay: 150}" style="margin-bottom: 10px" v-if="$store.state.app.lastPastes.length">Your last created pastes</h2>
<div id="pastes" v-animate-css="{classes: 'fadeIn', delay: 200}">
<PasteCard v-for="paste of $store.state.app.lastPastes" :key="paste.id" :paste="paste" />
</div>
</div>
Expand Down
105 changes: 79 additions & 26 deletions frontend/src/views/Paste.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,36 @@
<h2>Please log in to see this paste.</h2>
</template>
<template v-else>
<div :class="{'lightened-top': language === 'markdown' && !multiPastes}">
<div id="action-buttons" :class="{mobile: $store.state.mobileVersion}" v-animate-css="{classes: 'fadeIn', delay: 50}">
<a v-if="isPWA()" @click="copyURL">Copy URL</a>
<a v-if="language == 'json'" @click="jsonPretty">{{ jsonPrettified ? 'UNPRETTY' : 'PRETTY' }}</a>
<a href="#paste-contents" @click="readCode = true" v-if="extraContent !== ''">CODE</a>
<a v-if="$store.state.user.logged_in && ($store.state.user.id == userid || $store.state.user.type === 'ADMIN')"
@click="$refs.deleteConfirmation.open()">DELETE</a>
<a @click="editPaste(true)" v-if="!$store.state.mobileVersion">FORK</a>
<a v-if="$store.state.user.logged_in && $store.state.user.id == userid" @click="editPaste()">EDIT</a>
<a :href="rawURL" v-if="!passwordRequired && !multiPastes">RAW</a>
<a id="copy-contents" @click="copy">
<i class="material-icons">content_copy</i>
</a>
</div>

<h1 v-animate-css="{classes: 'fadeIn', delay: 50}">{{ title }}</h1>

<div id="action-buttons" :class="{mobile: $store.state.mobileVersion}">
<a v-if="isPWA()" @click="copyURL">Copy URL</a>
<a v-if="language == 'json'" @click="jsonPretty">{{ jsonPrettified ? 'UNPRETTY' : 'PRETTY' }}</a>
<a href="#paste-contents" @click="readCode = true" v-if="extraContent !== ''">CODE</a>
<a v-if="$store.state.user.logged_in && ($store.state.user.id == userid || $store.state.user.type === 'ADMIN')"
@click="$refs.deleteConfirmation.open()">DELETE</a>
<a @click="editPaste(true)" v-if="!$store.state.mobileVersion">FORK</a>
<a v-if="$store.state.user.logged_in && $store.state.user.id == userid" @click="editPaste()">EDIT</a>
<a :href="rawURL" v-if="!passwordRequired && !multiPastes">RAW</a>
<a id="copy-contents" @click="copy">
<i class="material-icons">content_copy</i>
</a>
</div>
<h1>{{ title }}<span class="language"
v-if="language !== null && language == 'markdown' && !multiPastes">{{ language }}</span>
</h1>
<div id="tabs" v-if="multiPastes != null && Object.keys(multiPastes).length > 1">

<div v-animate-css="{classes: 'fadeIn', delay: 100}" id="tabs" v-if="multiPastes != null && Object.keys(multiPastes).length > 1">
<a v-for="(tab,i) of multiPastes" :key="i" @click="changeTab(i)"
:class="{selected: multiPastesSelected==i}">
{{ tab.name }}
</a>
</div>
<div id="preview" v-if="extraContent !== ''" v-html="extraContent"></div>
<div v-animate-css="{classes: 'fadeIn', delay: 150}" id="preview" v-if="extraContent !== ''" v-html="extraContent"></div>
<template v-if="extraContent == '' || readCode">
<h1 v-if="extraContent !== ''" style="margin-top: 30px;">
<h1 v-if="extraContent !== ''" style="margin-top: 30px;" v-animate-css="{classes: 'fadeIn', delay: 50}">
{{ language == 'markdown' ? 'Markdown ' : '' }}Code</h1>
<code id="paste-contents">
<code id="paste-contents" v-animate-css="{classes: 'fadeIn', delay: 100}">
<div id="line-nums" v-if="showLineNums">
<a
v-for="(line, lineNum) of rawContent.split('\n')"
Expand All @@ -65,10 +67,10 @@

</template>
<template v-if="htmlPreview !== ''">
<a class="button gray" v-if="!htmlPreviewEnabled" @click="htmlPreviewEnabled = !htmlPreviewEnabled">
<a class="button gray" v-if="!htmlPreviewEnabled" @click="htmlPreviewEnabled = !htmlPreviewEnabled" v-animate-css="{classes: 'fadeIn', delay: 200}">
Show Preview
</a>
<div id="html-preview" :class="['lang-'+language]" v-else>
<div id="html-preview" :class="['lang-'+language]" v-animate-css="{classes: 'fadeIn'}" v-else>
<iframe
sandbox="allow-forms allow-modals allow-pointer-lock allow-popups allow-presentation allow-scripts allow-top-navigation-by-user-activation"
:srcdoc="htmlPreview"/>
Expand Down Expand Up @@ -541,31 +543,74 @@ h1 {
<style lang="scss">
#preview {
font-size: 17.5px;
font-size: 18px;
h1, h2, h3, h4, h5 {
margin-top: 30px;
margin-bottom: 15px;
* {
font-family: "DM Sans";
}
h1, h2, h3 {
font-family: "DM Serif Text";
}
h1 {
padding-bottom: 18px;
font-size: 36px;
margin-top: 36px;
margin-bottom: 18px;
}
h2 {
font-size: 28px;
margin-top: 28px;
margin-bottom: 14px;
}
h3 {
font-size: 23px;
margin-top: 23px;
margin-bottom: 11px;
}
h4 {
font-size: 20px;
margin-top: 20px;
margin-bottom: 10px;
}
h5 {
font-size: 18px;
margin-top: 18px;
margin-bottom: 9px;
}
table {
width: 100%;
border-collapse: collapse;
margin-bottom: 20px;
margin-top: 20px;
margin-bottom: 20px;
th {
background-color: #f2f2f2;
text-align: left;
padding: 10px;
border: 1px solid #ddd;
}
tr:nth-child(odd) {
background-color: #f9f9f9;
}
td {
padding: 10px;
border: 1px solid #ddd;
}
td, th {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 150px;
}
}
img {
Expand Down Expand Up @@ -615,4 +660,12 @@ h1 {
user-select: none;
border: var(--text-color-alpha) solid 2px;
}
.lightened-top {
opacity: 0.3;
transition: 0.3s;
&:hover {
opacity: 1;
}
}
</style>
26 changes: 16 additions & 10 deletions frontend/src/views/PublicPastes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<HomeHeader />
<div id="public">

<input @input="loadSearch()" v-model="search" type="text" placeholder="Search" class="input">
<input @input="loadSearch()" v-model="search" type="text" placeholder="Search" class="input" v-animate-css="{classes: 'fadeIn', delay: 0}">

<div v-if="search !== ''" :key="`search-${search}`">

Expand All @@ -18,19 +18,25 @@
<div v-else>
<WebsiteBanner paste="pb-trend" />

<h2 style="margin-top: 20px; margin-bottom: 10px;">Trending</h2>
<div id="pastes">
<PasteCard v-for="paste of trendingPastes" :key="`trending-${paste.id}`" :paste="paste"/>
<div v-animate-css="{classes: 'fadeIn', delay: 50}">
<h2 style="margin-top: 20px; margin-bottom: 10px;">Trending</h2>
<div id="pastes">
<PasteCard v-for="paste of trendingPastes" :key="`trending-${paste.id}`" :paste="paste"/>
</div>
</div>

<h2 style="margin-top: 40px; margin-bottom: 10px;">Latest</h2>
<div id="pastes">
<PasteCard v-for="paste of newPastes" :key="`new-${paste.id}`" :paste="paste"/>
<div v-animate-css="{classes: 'fadeIn', delay: 100}">
<h2 style="margin-top: 40px; margin-bottom: 10px;">Latest</h2>
<div id="pastes">
<PasteCard v-for="paste of newPastes" :key="`new-${paste.id}`" :paste="paste"/>
</div>
</div>

<h2 style="margin-top: 40px; margin-bottom: 10px;">Alltime Trending</h2>
<div id="pastes">
<PasteCard v-for="paste of allTimeTrendingPastes" :key="`alt-trending-${paste.id}`" :paste="paste"/>
<div v-animate-css="{classes: 'fadeIn', delay: 150}">
<h2 style="margin-top: 40px; margin-bottom: 10px;">Alltime Trending</h2>
<div id="pastes">
<PasteCard v-for="paste of allTimeTrendingPastes" :key="`alt-trending-${paste.id}`" :paste="paste"/>
</div>
</div>
</div>
</div>
Expand Down

0 comments on commit 6cffead

Please sign in to comment.