home-page functionality, and some design tweaks
This commit is contained in:
+24
-24
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<title>{{ userProfile.name }} - Reddit for Academic Papers</title>
|
||||
<div
|
||||
class="min-h-screen bg-slate-50 dark:bg-slate-950 font-sans text-slate-900 dark:text-slate-200 selection:bg-blue-100 dark:selection:bg-blue-900 pb-12 transition-colors duration-300">
|
||||
|
||||
@@ -15,12 +14,11 @@
|
||||
<div
|
||||
class="h-32 w-32 rounded-full border-4 border-white dark:border-slate-800 bg-slate-100 dark:bg-slate-800 overflow-hidden shadow-md ring-1 ring-slate-200 dark:ring-slate-700">
|
||||
<img :src="userProfile.avatarUrl" :alt="userProfile.name"
|
||||
class="h-full w-full object-cover transition-transform hover:scale-105" />
|
||||
class="h-full w-full object-cover transition-transform hover:scale-105">
|
||||
</div>
|
||||
<div class="absolute bottom-2 right-2 h-5 w-5 rounded-full border-[3px] border-white dark:border-slate-900 shadow-sm"
|
||||
:class="userProfile.is_active ? 'bg-emerald-500' : 'bg-gray-400'"
|
||||
title="Online Status">
|
||||
</div>
|
||||
title="Online Status" />
|
||||
</div>
|
||||
|
||||
<h1 class="text-2xl font-bold text-slate-900 dark:text-white tracking-tight">{{
|
||||
@@ -33,10 +31,10 @@
|
||||
|
||||
<div class="w-full space-y-3">
|
||||
<button
|
||||
@click=" activeTab = 'settings' "
|
||||
class="w-full py-2.5 px-4 bg-slate-900 dark:bg-blue-600 hover:bg-slate-800 dark:hover:bg-blue-500 text-white font-medium rounded-lg text-sm transition-all shadow-sm active:scale-95 cursor-pointer">
|
||||
class="w-full py-2.5 px-4 bg-slate-900 dark:bg-blue-600 hover:bg-slate-800 dark:hover:bg-blue-500 text-white font-medium rounded-lg text-sm transition-all shadow-sm active:scale-95 cursor-pointer"
|
||||
@click=" activeTab = 'settings'">
|
||||
Edit Profile
|
||||
</button>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -81,7 +79,7 @@
|
||||
class="bg-white dark:bg-slate-900 p-4 rounded-xl shadow-sm border border-slate-200 dark:border-slate-800 text-center hover:border-slate-300 dark:hover:border-slate-700 transition-colors">
|
||||
<div class="text-2xl font-bold text-slate-900 dark:text-white">{{
|
||||
userProfile.publications.length
|
||||
}}</div>
|
||||
}}</div>
|
||||
<div
|
||||
class="text-[10px] font-bold text-slate-400 dark:text-slate-500 uppercase tracking-widest mt-1">
|
||||
Papers
|
||||
@@ -94,19 +92,22 @@
|
||||
|
||||
<div
|
||||
class="bg-white dark:bg-slate-900 p-1.5 rounded-xl border border-slate-200 dark:border-slate-800 shadow-sm flex gap-1 overflow-x-auto transition-colors">
|
||||
<button @click="activeTab = 'overview'"
|
||||
<button
|
||||
:class="activeTab === 'overview' ? 'bg-slate-100 dark:bg-slate-800 text-slate-900 dark:text-white shadow-sm ring-1 ring-black/5 dark:ring-white/5' : 'text-slate-500 dark:text-slate-400 hover:text-slate-900 dark:hover:text-white hover:bg-slate-50 dark:hover:bg-slate-800'"
|
||||
class="flex-1 min-w-[100px] py-2.5 px-4 rounded-lg text-lg font-semibold cursor-pointer transition-colors">
|
||||
class="flex-1 min-w-[100px] py-2.5 px-4 rounded-lg text-lg font-semibold cursor-pointer transition-colors"
|
||||
@click="activeTab = 'overview'">
|
||||
Overview
|
||||
</button>
|
||||
<button @click="activeTab = 'activity'"
|
||||
<button
|
||||
:class="activeTab === 'activity' ? 'bg-slate-100 dark:bg-slate-800 text-slate-900 dark:text-white shadow-sm ring-1 ring-black/5 dark:ring-white/5' : 'text-slate-500 dark:text-slate-400 hover:text-slate-900 dark:hover:text-white hover:bg-slate-50 dark:hover:bg-slate-800'"
|
||||
class="flex-1 min-w-[100px] py-2.5 px-4 rounded-lg text-lg font-medium transition-colors cursor-pointer">
|
||||
class="flex-1 min-w-[100px] py-2.5 px-4 rounded-lg text-lg font-medium transition-colors cursor-pointer"
|
||||
@click="activeTab = 'activity'">
|
||||
Activity Log
|
||||
</button>
|
||||
<button @click="activeTab = 'settings'"
|
||||
<button
|
||||
:class="activeTab === 'settings' ? 'bg-slate-100 dark:bg-slate-800 text-slate-900 dark:text-white shadow-sm ring-1 ring-black/5 dark:ring-white/5' : 'text-slate-500 dark:text-slate-400 hover:text-slate-900 dark:hover:text-white hover:bg-slate-50 dark:hover:bg-slate-800'"
|
||||
class="flex-1 min-w-[100px] py-2.5 px-4 rounded-lg text-lg font-medium transition-colors cursor-pointer">
|
||||
class="flex-1 min-w-[100px] py-2.5 px-4 rounded-lg text-lg font-medium transition-colors cursor-pointer"
|
||||
@click="activeTab = 'settings'">
|
||||
Settings
|
||||
</button>
|
||||
</div>
|
||||
@@ -143,8 +144,7 @@
|
||||
class="relative overflow-hidden rounded-2xl border-2 border-dashed border-slate-300 dark:border-slate-700 bg-slate-50 dark:bg-slate-900/50 p-12 text-center hover:border-blue-400 dark:hover:border-blue-500 transition-all duration-300 group">
|
||||
|
||||
<div
|
||||
class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-48 h-48 bg-blue-500/10 dark:bg-blue-400/10 rounded-full blur-3xl opacity-0 group-hover:opacity-100 transition-opacity duration-500 pointer-events-none">
|
||||
</div>
|
||||
class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-48 h-48 bg-blue-500/10 dark:bg-blue-400/10 rounded-full blur-3xl opacity-0 group-hover:opacity-100 transition-opacity duration-500 pointer-events-none" />
|
||||
|
||||
<div class="relative z-10 flex flex-col items-center">
|
||||
<div
|
||||
@@ -166,8 +166,8 @@
|
||||
</p>
|
||||
|
||||
<button
|
||||
@click="goToCreatePost()"
|
||||
class="inline-flex items-center gap-2 px-6 py-2.5 bg-blue-600 hover:bg-blue-700 text-white font-semibold rounded-xl shadow-lg shadow-blue-500/20 hover:shadow-blue-500/30 transform active:scale-95 transition-all duration-200 cursor-pointer">
|
||||
class="inline-flex items-center gap-2 px-6 py-2.5 bg-blue-600 hover:bg-blue-700 text-white font-semibold rounded-xl shadow-lg shadow-blue-500/20 hover:shadow-blue-500/30 transform active:scale-95 transition-all duration-200 cursor-pointer"
|
||||
@click="goToCreatePost()">
|
||||
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M12 4v16m8-8H4" />
|
||||
@@ -181,7 +181,7 @@
|
||||
class="bg-white dark:bg-slate-900 p-6 rounded-xl shadow-sm border border-slate-200 dark:border-slate-800 hover:shadow-md hover:border-blue-300 dark:hover:border-blue-700 transition-all duration-200 group relative">
|
||||
<div class="flex justify-between items-start gap-4 mb-2">
|
||||
<h3 class="text-base font-bold text-slate-900 dark:text-slate-100">{{ pub.title
|
||||
}}</h3>
|
||||
}}</h3>
|
||||
<span
|
||||
class="shrink-0 px-2.5 py-1 rounded-md bg-slate-100 dark:bg-slate-800 text-slate-600 dark:text-slate-400 text-xs font-bold border border-slate-200 dark:border-slate-700">
|
||||
{{ pub.publishedYear }}
|
||||
@@ -255,8 +255,8 @@
|
||||
<div v-else-if="activeTab === 'settings'" key="settings"
|
||||
class="bg-white dark:bg-slate-900 p-6 rounded-2xl shadow-sm border border-slate-200 dark:border-slate-800 transition-colors">
|
||||
<h2
|
||||
class="text-xs font-bold text-slate-400 dark:text-slate-500 uppercase tracking-wider mb-3">
|
||||
Settings</h2>
|
||||
class="text-xs font-bold text-slate-400 dark:text-slate-500 uppercase tracking-wider mb-3">
|
||||
Settings</h2>
|
||||
<p class="text-sm text-slate-600 dark:text-slate-400">
|
||||
Nothing here but chickens! Settings coming soon.
|
||||
</p>
|
||||
@@ -430,9 +430,9 @@ async function fetchProfileData() {
|
||||
// --- Redirects ---
|
||||
const goToCreatePost = () => {
|
||||
console.log("Navigating to create post modal...");
|
||||
router.push({
|
||||
path: '/',
|
||||
query: { openCreatePostModal: 'true' }
|
||||
router.push({
|
||||
path: '/',
|
||||
query: { openCreatePostModal: 'true' }
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user