SpreadSheets commited on
Commit
11eca68
·
1 Parent(s): 1fb0a63

feat: add note sharing template with copy link functionality and enhanced UI

Browse files
Files changed (1) hide show
  1. app/templates/note_share.html +66 -0
app/templates/note_share.html ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% extends "base.html" %}
2
+
3
+ {% block content %}
4
+ <div class="max-w-7xl mx-auto px-4 sm:px-6">
5
+ <div class="min-h-[60vh] flex flex-col justify-center">
6
+ <div class="text-center mb-12">
7
+ <h1 class="font-display text-6xl font-bold tracking-tight mb-4">
8
+ <span class="bg-gradient-to-r from-blue-400 to-purple-500 bg-clip-text text-transparent">
9
+ Share Note
10
+ </span>
11
+ </h1>
12
+ <p class="font-mono text-gray-400">Copy the link below to share with others</p>
13
+ </div>
14
+
15
+ <div class="glass p-8 rounded-2xl mb-8">
16
+ <h2 class="font-display text-2xl font-bold mb-2">{{ note.title }}</h2>
17
+ <div class="flex justify-center gap-2 mb-6">
18
+ <span class="px-2 py-0.5 bg-blue-500/20 border border-blue-500/50 rounded-md font-mono text-[10px] text-blue-300">
19
+ {{ note.subject.name }}
20
+ </span>
21
+ <span class="px-2 py-0.5 bg-purple-500/20 border border-purple-500/50 rounded-md font-mono text-[10px] text-purple-300">
22
+ {{ note.note_type.name }}
23
+ </span>
24
+ </div>
25
+
26
+ <div class="bg-white/5 border border-white/10 rounded-xl p-4 mb-4">
27
+ <input type="text" id="share-url" value="{{ share_url }}" readonly
28
+ class="w-full bg-transparent font-mono text-sm text-blue-400 focus:outline-none">
29
+ </div>
30
+
31
+ <button onclick="copyToClipboard()" class="w-full btn-magnetic glass px-6 py-4 rounded-xl font-mono font-semibold border-2 border-blue-500/50 hover:border-blue-400 animate-glow">
32
+ Copy Link
33
+ </button>
34
+ </div>
35
+
36
+ <div class="flex gap-4 justify-center">
37
+ <a href="{{ url_for('notes.preview', id=note.id) }}" class="font-mono text-sm text-gray-400 hover:text-blue-400 transition">
38
+ Back to Preview
39
+ </a>
40
+ <span class="text-gray-600">•</span>
41
+ <a href="{{ url_for('notes.list') }}" class="font-mono text-sm text-gray-400 hover:text-blue-400 transition">
42
+ All Notes
43
+ </a>
44
+ </div>
45
+ </div>
46
+ </div>
47
+
48
+ <script>
49
+ function copyToClipboard() {
50
+ const shareUrl = document.getElementById('share-url');
51
+ shareUrl.select();
52
+ shareUrl.setSelectionRange(0, 99999);
53
+ document.execCommand('copy');
54
+
55
+ const btn = event.target;
56
+ const originalText = btn.textContent;
57
+ btn.textContent = 'Copied!';
58
+ btn.classList.add('bg-green-500/20', 'border-green-500/50');
59
+
60
+ setTimeout(() => {
61
+ btn.textContent = originalText;
62
+ btn.classList.remove('bg-green-500/20', 'border-green-500/50');
63
+ }, 2000);
64
+ }
65
+ </script>
66
+ {% endblock %}