This commit is contained in:
Akif9748 2022-08-28 21:14:07 +03:00
commit c8474694da
2 changed files with 191 additions and 187 deletions

View file

@ -1,139 +1,136 @@
:root { .title {
/* Apprentice Scheme */ color: #414141;
/* font-weight: 700;
* use `var(--col-x)` instead of directly typing the color. font-size: 36px;
*/ }
--col-0: #1C1C1C; .date{
--col-1: #AF5F5F; color: gray;
--col-2: #5F875F;
--col-3: #87875F;
--col-4: #5F87AF;
--col-5: #5F5F87;
--col-6: #5F8787;
--col-7: #6C6C6C;
--col-8: #444444;
--col-9: #FF8700;
--col-10: #87AF87;
--col-11: #FFFFAF;
--col-12: #8FAFD7;
--col-13: #8787AF;
--col-14: #5FAFAF;
--col-15: #FFFFFF;
--col-fg: #BCBCBC;
--col-bg: #262626;
} }
.thread{
max-width: 800px;
textarea { box-shadow: 0 0 5px 0 #c3c3c3;
margin: 10px auto;
font-family: monospace; padding: 20px;
border: 2px solid var(--col-8); display:flex;
color: var(--col-fg); gap:10px;
width: auto; position:relative;
height: auto;
cursor: pointer;
resize: none;
} }
.thread .left{
h1,
h2,
h3,
h4,
h5 {
margin-bottom: 0.1rem;
}
button,
input {
font-family: monospace;
background-color: var(--col-bg);
border: 2px solid var(--col-8);
color: var(--col-fg);
width: auto;
height: 30px;
}
button.big {
width: 150px;
height: 50px;
}
input {
width: 75%;
cursor: pointer;
color: var(--col-fg);
}
button:hover {
background-color: var(--col-fg);
color: var(--col-bg);
}
/* NAVBAR: */
.user {
margin: 0;
border: 1px solid var(--col-8);
}
.user h1 {
font-family: monospace;
background: #333;
color: var(--col-fg);
margin: auto;
text-align: center; text-align: center;
line-height: 1; border-right: 2px solid #d9d9d9;
color: var(--col-13);
font-size: 27px;
} }
.user img { .thread .left img{
padding: 6px 10px; width: 100px;
height: 100px;
border-radius: 50%;
margin-right: 5px;
} }
.user a { .thread .left .username{
color: var(--col-13); color: #555;
padding: 0px 5px; }
.content{
width: 70%;
}
.likes{
position:absolute;
right:20px;
bottom:20px;
display:flex;
align-items:center;
gap:10px;
}
.likes div{
display:flex;
align-items:center;
gap:5px;
padding:4px;
color: #747474;
cursor:pointer;
transition:color 0.3s ease;
}
.likes div:hover{
color: #151515;
}
.likes div i{
font-size:22px;
} }
div.message { .pagination{
border: 2px solid var(--col-8); box-shadow: 0 0 5px 0 #c3c3c3;
margin: auto; margin: 10px auto;
padding-inline: 100; padding: 8px;
display:flex;
justify-content:space-between;
align-items:center;
max-width:400px;
gap:10px;
position:relative;
}
.pagination .back ,
.pagination .after {
color:#747474;
font-size:26px;
cursor:pointer;
} }
.pagination .numbers{
/* display:flex;
***************************** align-items:center;
IMAGES gap:5px;
*****************************
*/
img.circle {
border-radius: 50%;
height: 30px;
width: 30px;
} }
.pagination .number {
img.logo { color: #747474;
width: 266px; font-size: 22px;
height: 75px; border: 0 0 5px #747474;
padding: 8px;
border-radius: 2px;
font-weight: 600;
cursor: pointer;
margin: 8px;
}
.pagination .number.active{
color: #4d18e6;
font-weight: 700;
} }
/* .dots{
***************************** position: absolute;
ADMIN TEXT right: 20px;
***************************** font-size: 22px;
*/ top: 10px;
p {font-size: 18px;} color: #747474;
cursor:pointer;
}
.dots-menu{
position: absolute;
top: 50px;
right: 0;
background-color: #e6e6e6;
padding: ;
width: 100px;
text-align: center;
display:none;
}
.dots-menu.active{
display:block;
}
.dots-menu a{
display:block;
margin:8px;
cursor:pointer;
}

View file

@ -4,88 +4,95 @@
<%- include("extra/meta", {title: "Thread list!" }) %> <%- include("extra/meta", {title: "Thread list!" }) %>
<body style="text-align: center;"> <body>
<%- include("extra/navbar") %> <%- include("extra/navbar") %>
<link href='https://unpkg.com/boxicons@2.1.2/css/boxicons.min.css' rel='stylesheet'>
<link rel="stylesheet" href="/css/thread.css" /> <link rel="stylesheet" href="/css/thread.css" />
<% if (user){ %> <% if (user){ %>
<script type="module" src="/js/thread.js"></script> <script type="module" src="/js/thread.js"></script>
<% }%> <% }%>
<div style="text-align:center;padding:8px">
<div class="title">İlk Forum</div>
<div class="date">
20/04/2000
</div>
</div>
<div class="thread">
<div class="left">
<img src="https://renk.gen.tr/images/acik-mavi-renk.jpg"/>
<div class="username">Tokmak</div>
<div class="date">
20/04/2000
</div>
</div>
<h1 style="font-size: 35px;color: #4d18e6;" ><%= thread.title %></h1> <div class="content">
<h3 >View count: <%= thread.views %></h1> Merhaba ! Bu benim ilk yazım Merhaba ! Bu benim ilk yazım
Merhaba ! Bu benim ilk yazım
Merhaba ! Bu benim ilk yazım
Merhaba ! Bu benim ilk yazım
Merhaba ! Bu benim ilk yazım
Merhaba ! Bu benim ilk yazım
Merhaba ! Bu benim ilk yazım
</div>
<div class="dots" onclick="dots()">
<i class='bx bx-dots-horizontal-rounded' ></i>
</div>
<div class="dots-menu">
<a>Delete</a>
<a>Edit</a>
</div>
<h2 style="display:inline;">By <a href="<%='/users/' + thread.author.id %>"> <%= thread.author.name %></a>
<img class="circle" src="<%=thread.author.avatar %>">
</h2>
<% if (user && !thread.deleted){ %>
<a onclick="delete_thread('<%= thread.id %>' )" value=style="display:inline;" >DELETE</a>
<a onclick="edit_thread('<%= thread.id %>')" style="display:inline;" >EDIT</a>
<% } else if (thread.deleted) { %>
<h3 style="display:inline;">This thread has been deleted</h3>
<a onclick="undelete_thread('<%= thread.id %>')" style="display:inline;" >UNDELETE</a>
<% }; %>
<hr>
<div id="messages" value="<%= thread.id %>">
<% messages.filter(Boolean).forEach(message=>{ %>
<div class="message" id="message-<%= message.id %>">
<h3 style="float:right;"><%= new Date(message.time).toLocaleString() %> </h3> <div class="likes">
<div>
<h2> <i class='bx bx-like'></i> 5
<img class="circle" src="<%= message.author.avatar %>"> </div>
<a href="/users/<%=message.author.id %>"><%=message.author.name %></a>: <div>
</h2> <i class='bx bx-dislike'></i> 30
</div>
<p><%= message.content%></p><br> </div>
<div id="message-delete-<%=message.id %>"> </div>
<% if (!message.deleted){ %>
<a onclick="delete_message('<%=message.id %>');">DELETE</a>
<a onclick="edit_message('<%=message.id %>');">EDIT</a>
<% }else{ %>
<h3 style="display:inline;">This message has been deleted</h3>
<a onclick="undelete_message('<%=message.id %>');">UNDELETE</a>
<% } %>
</div> <div class="pagination">
<div style="float: right;"> <div class="back">
<h3 id="count<%=message.id %>" style="display:inline;"><%=message.reactCount %></h3> <i class='bx bxs-chevron-left'></i>
<a onclick="react('<%=message.id %>', 'like');">+🔼</a> </div>
<a onclick="react('<%=message.id %>', 'dislike');">-🔽</a> <div class="numbers">
</div> <a class="number active" href="/deneme">1</a>
</div> <a class="number" href="/deneme">2</a>
<% }); %> <a class="number" href="/deneme">3</a>
<a class="number" href="/deneme">4</a>
<a class="number" href="/deneme">5</a>
<a class="number" href="/deneme">6</a>
</div>
</div>
<hr> <div class="after">
<i class='bx bxs-chevron-right'></i>
</div>
</div>
<form id="send"> <!-- ==== Dots Event ==== -->
<textarea rows="4" cols="133" name="content"></textarea>
<input name="threadID" type="hidden" value="<%= thread.id %>"></input>
<br>
<% if (user){ %>
<button type="submit">Send!</button>
<%} else {%>
<button disabled>Login for send</button>
<% }%>
</form> <script>
function dots(){
var box= document.getElementsByClassName("dots-menu")[0];
box.classList.toggle("active")
}
</script>
<script> <script>
document.getElementById("message-<%= scroll %>").scrollIntoView(); document.getElementById("message-<%= scroll %>").scrollIntoView();
@ -94,4 +101,4 @@
<!-- BURAYA Bİ İLERİ BİR GERİ SAYFA BUTONU GELMEZ Mİ BE--> <!-- BURAYA Bİ İLERİ BİR GERİ SAYFA BUTONU GELMEZ Mİ BE-->
</body> </body>
</html> </html>