Shinhati2023 commited on
Commit
9df4a46
·
verified ·
1 Parent(s): 83e9a1d

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +34 -25
templates/index.html CHANGED
@@ -6,21 +6,22 @@
6
  <title>Visual Board</title>
7
  <style>
8
  /* --- CORE STYLES --- */
9
- body { margin: 0; font-family: sans-serif; background: #fafafa; padding-top: 70px; }
10
 
11
  /* NAVBAR */
12
  nav {
13
- position: fixed; top: 0; left: 0; right: 0; height: 60px;
14
  background: white; display: flex; align-items: center; justify-content: space-between;
15
- padding: 0 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); z-index: 1000;
16
  }
17
- .logo { color: #e60023; font-weight: bold; font-size: 1.2rem; }
18
-
 
19
  /* BUTTONS */
20
- .btn { padding: 8px 16px; border-radius: 24px; border: none; font-weight: bold; cursor: pointer; }
21
  .btn-red { background: #e60023; color: white; }
22
  .btn-grey { background: #efefef; color: black; }
23
- .btn:hover { opacity: 0.9; }
24
 
25
  /* PINS / MASONRY */
26
  .gallery {
@@ -28,49 +29,56 @@
28
  }
29
  .pin {
30
  break-inside: avoid; margin-bottom: 15px; border-radius: 16px; overflow: hidden;
31
- background: white; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
32
  }
 
33
  .pin img { width: 100%; display: block; }
34
- .pin-info { padding: 8px 12px; font-size: 0.85rem; }
 
35
 
36
  /* RESPONSIVE COLUMNS */
37
  @media (max-width: 1200px) { .gallery { column-count: 4; } }
38
  @media (max-width: 900px) { .gallery { column-count: 3; } }
39
- @media (max-width: 600px) { .gallery { column-count: 2; padding: 5px; } }
40
 
41
  /* MODALS (Login/Signup) */
42
  .modal {
43
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
44
  background: rgba(0,0,0,0.5); z-index: 2000; align-items: center; justify-content: center;
 
45
  }
46
  .modal.show { display: flex; }
47
  .modal-content {
48
- background: white; padding: 30px; border-radius: 16px; width: 90%; max-width: 350px;
49
- text-align: center; box-shadow: 0 5px 20px rgba(0,0,0,0.2);
50
  }
51
  .modal input {
52
- width: 100%; padding: 12px; margin: 8px 0; border: 1px solid #ddd;
53
- border-radius: 8px; box-sizing: border-box;
54
  }
 
55
 
56
  /* ALERT BAR */
57
  .alert {
58
- background: #333; color: white; text-align: center; padding: 10px;
59
- position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
60
- border-radius: 8px; z-index: 3000; width: 80%;
 
61
  }
 
62
  </style>
63
  </head>
64
  <body>
65
 
66
  <nav>
67
  <div class="logo">📌 PinSpace</div>
68
- <div>
69
  {% if user %}
70
- <button class="btn btn-grey" onclick="openModal('uploadModal')">+ Add</button>
 
71
  <a href="/logout" style="text-decoration:none;"><button class="btn btn-red">Log Out</button></a>
72
  {% else %}
73
- <button class="btn btn-red" onclick="openModal('loginModal')">Log in</button>
74
  <button class="btn btn-grey" onclick="openModal('signupModal')">Sign up</button>
75
  {% endif %}
76
  </div>
@@ -87,8 +95,8 @@
87
  <div class="pin">
88
  <img src="{{ pin.url }}" loading="lazy" alt="Pin">
89
  <div class="pin-info">
90
- <strong>{{ pin.caption }}</strong><br>
91
- <span style="color:#777">by {{ pin.author }}</span>
92
  </div>
93
  </div>
94
  {% endfor %}
@@ -96,7 +104,7 @@
96
 
97
  <div id="loginModal" class="modal" onclick="closeModal(event, 'loginModal')">
98
  <div class="modal-content">
99
- <h2>Welcome Back</h2>
100
  <form action="/login" method="POST">
101
  <input type="text" name="username" placeholder="Username" required>
102
  <input type="password" name="password" placeholder="Password" required>
@@ -108,7 +116,7 @@
108
 
109
  <div id="signupModal" class="modal" onclick="closeModal(event, 'signupModal')">
110
  <div class="modal-content">
111
- <h2>Join PinSpace</h2>
112
  <form action="/signup" method="POST">
113
  <input type="text" name="username" placeholder="Choose Username" required>
114
  <input type="password" name="password" placeholder="Password" required>
@@ -120,13 +128,14 @@
120
 
121
  <div id="uploadModal" class="modal" onclick="closeModal(event, 'uploadModal')">
122
  <div class="modal-content">
123
- <h2>Add Image</h2>
124
  <form action="/add_pin" method="POST">
125
  <input type="text" name="img_url" placeholder="Paste Image URL here..." required>
126
  <input type="text" name="caption" placeholder="Caption / Title" required>
127
  <br><br>
128
  <button class="btn btn-grey" style="width:100%">Post Pin</button>
129
  </form>
 
130
  </div>
131
  </div>
132
 
 
6
  <title>Visual Board</title>
7
  <style>
8
  /* --- CORE STYLES --- */
9
+ body { margin: 0; font-family: sans-serif; background: #fafafa; padding-top: 80px; }
10
 
11
  /* NAVBAR */
12
  nav {
13
+ position: fixed; top: 0; left: 0; right: 0; height: 65px;
14
  background: white; display: flex; align-items: center; justify-content: space-between;
15
+ padding: 0 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); z-index: 1000;
16
  }
17
+ .logo { color: #e60023; font-weight: bold; font-size: 1.2rem; display: flex; align-items: center; gap: 5px; }
18
+ .user-greeting { margin-right: 15px; font-weight: 600; color: #333; }
19
+
20
  /* BUTTONS */
21
+ .btn { padding: 10px 16px; border-radius: 24px; border: none; font-weight: bold; cursor: pointer; font-size: 0.9rem; transition: 0.2s; }
22
  .btn-red { background: #e60023; color: white; }
23
  .btn-grey { background: #efefef; color: black; }
24
+ .btn:hover { opacity: 0.85; transform: scale(1.02); }
25
 
26
  /* PINS / MASONRY */
27
  .gallery {
 
29
  }
30
  .pin {
31
  break-inside: avoid; margin-bottom: 15px; border-radius: 16px; overflow: hidden;
32
+ background: white; box-shadow: 0 2px 8px rgba(0,0,0,0.1); transition: 0.2s;
33
  }
34
+ .pin:hover { box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
35
  .pin img { width: 100%; display: block; }
36
+ .pin-info { padding: 10px 12px; font-size: 0.85rem; }
37
+ .pin-author { color: #777; font-size: 0.8rem; margin-top: 4px; display: block; }
38
 
39
  /* RESPONSIVE COLUMNS */
40
  @media (max-width: 1200px) { .gallery { column-count: 4; } }
41
  @media (max-width: 900px) { .gallery { column-count: 3; } }
42
+ @media (max-width: 600px) { .gallery { column-count: 2; padding: 5px; } nav { padding: 0 10px; } .user-greeting { display: none; } }
43
 
44
  /* MODALS (Login/Signup) */
45
  .modal {
46
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
47
  background: rgba(0,0,0,0.5); z-index: 2000; align-items: center; justify-content: center;
48
+ backdrop-filter: blur(2px);
49
  }
50
  .modal.show { display: flex; }
51
  .modal-content {
52
+ background: white; padding: 30px; border-radius: 24px; width: 90%; max-width: 380px;
53
+ text-align: center; box-shadow: 0 10px 25px rgba(0,0,0,0.2);
54
  }
55
  .modal input {
56
+ width: 100%; padding: 12px; margin: 8px 0; border: 2px solid #ddd;
57
+ border-radius: 12px; box-sizing: border-box; font-size: 1rem;
58
  }
59
+ .modal input:focus { border-color: #e60023; outline: none; }
60
 
61
  /* ALERT BAR */
62
  .alert {
63
+ background: #333; color: white; text-align: center; padding: 12px;
64
+ position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
65
+ border-radius: 50px; z-index: 3000; min-width: 300px;
66
+ box-shadow: 0 5px 15px rgba(0,0,0,0.3); animation: popUp 0.3s ease-out;
67
  }
68
+ @keyframes popUp { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
69
  </style>
70
  </head>
71
  <body>
72
 
73
  <nav>
74
  <div class="logo">📌 PinSpace</div>
75
+ <div style="display:flex; align-items:center;">
76
  {% if user %}
77
+ <span class="user-greeting">Hi, {{ user }}</span>
78
+ <button class="btn btn-grey" onclick="openModal('uploadModal')" style="margin-right: 10px;">+ Add Pin</button>
79
  <a href="/logout" style="text-decoration:none;"><button class="btn btn-red">Log Out</button></a>
80
  {% else %}
81
+ <button class="btn btn-red" onclick="openModal('loginModal')" style="margin-right: 10px;">Log in</button>
82
  <button class="btn btn-grey" onclick="openModal('signupModal')">Sign up</button>
83
  {% endif %}
84
  </div>
 
95
  <div class="pin">
96
  <img src="{{ pin.url }}" loading="lazy" alt="Pin">
97
  <div class="pin-info">
98
+ <strong>{{ pin.caption }}</strong>
99
+ <span class="pin-author">by {{ pin.author }}</span>
100
  </div>
101
  </div>
102
  {% endfor %}
 
104
 
105
  <div id="loginModal" class="modal" onclick="closeModal(event, 'loginModal')">
106
  <div class="modal-content">
107
+ <h2 style="margin-top:0">Welcome Back</h2>
108
  <form action="/login" method="POST">
109
  <input type="text" name="username" placeholder="Username" required>
110
  <input type="password" name="password" placeholder="Password" required>
 
116
 
117
  <div id="signupModal" class="modal" onclick="closeModal(event, 'signupModal')">
118
  <div class="modal-content">
119
+ <h2 style="margin-top:0">Join PinSpace</h2>
120
  <form action="/signup" method="POST">
121
  <input type="text" name="username" placeholder="Choose Username" required>
122
  <input type="password" name="password" placeholder="Password" required>
 
128
 
129
  <div id="uploadModal" class="modal" onclick="closeModal(event, 'uploadModal')">
130
  <div class="modal-content">
131
+ <h2 style="margin-top:0">Add Image</h2>
132
  <form action="/add_pin" method="POST">
133
  <input type="text" name="img_url" placeholder="Paste Image URL here..." required>
134
  <input type="text" name="caption" placeholder="Caption / Title" required>
135
  <br><br>
136
  <button class="btn btn-grey" style="width:100%">Post Pin</button>
137
  </form>
138
+ <p style="font-size:0.8rem; color:#888; margin-bottom:0">Paste a link ending in .jpg or .png</p>
139
  </div>
140
  </div>
141