Merge remote-tracking branch 'refs/remotes/origin/main'

test
This commit is contained in:
Bruno Rybársky 2024-06-05 20:09:08 +02:00
commit 87f2129652
5 changed files with 32 additions and 16 deletions

@ -202,6 +202,13 @@ async function togglearticlecreate() {
articleContainerElement.classList.toggle("hidden"); articleContainerElement.classList.toggle("hidden");
} }
async function togglememecreate() {
"use strict";
let memeContainerElement = document.getElementById("memecreatecontainer");
memeContainerElement.classList.toggle("hidden");
}
async function renderarticles() { async function renderarticles() {
"use strict"; "use strict";
let template = document.querySelector('template[data-template-name="article"]').innerHTML; let template = document.querySelector('template[data-template-name="article"]').innerHTML;
@ -613,6 +620,7 @@ async function addMeme() {
meme_image_id: memeImageElement.value meme_image_id: memeImageElement.value
}, "Meme bol zmazaný", "Nastala chyba pri mazaní meme-u", false); }, "Meme bol zmazaný", "Nastala chyba pri mazaní meme-u", false);
memeFormElement.reset(); memeFormElement.reset();
await togglememecreate();
} }
async function deleteMeme(memeId) { async function deleteMeme(memeId) {

@ -294,7 +294,7 @@ span#ye-span:hover + body{
} }
#articlecreate { #articlecreate, #memecreate {
border: 5px solid var(--pico-primary); border: 5px solid var(--pico-primary);
z-index: 5; z-index: 5;
margin: auto; margin: auto;
@ -311,15 +311,15 @@ span#ye-span:hover + body{
display: none; display: none;
} }
#articlecreatecontainer{ #articlecreatecontainer, #memecreatecontainer{
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
position: fixed; position: fixed;
top: 0; top: 12vh;
left: 0; left: 0;
width: 100vw; width: 100vw;
height: 100vh; height: 88vh;
z-index: 4; z-index: 4;
backdrop-filter: blur(2px); backdrop-filter: blur(2px);
} }

@ -1,9 +1,15 @@
<form id="memeAddForm"> <div id="memecreatecontainer" class="hidden">
<label for="meme_title_input">Názov meme-u: </label> <div id="memecreate">
<input type="text" id="meme_title_input"/> <label for="meme_title_input">Názov meme-u: </label>
<label for="meme_text_input">Text meme-u: </label> <input type="text" id="meme_title_input" placeholder="Názov meme-u"/>
<input type="text" id="meme_text_input"/>
<label for="meme_image_input">Obrázok meme-u</label> <label for="meme_text_input">Text meme-u: </label>
<select id="meme_image_input"></select> <input type="text" id="meme_text_input" placeholder="Text meme-u"/>
<input type="button" value="Pridať meme" onclick="addMeme()"/>
</form> <label for="meme_image_input">Obrázok meme-u</label>
<select id="meme_image_input"></select>
<button id="memecreatebutton" onclick="addMeme()"><i class="ri-add-circle-line"></i></button>
<button id="memecreateclose" onclick="togglememecreate()"><i class="ri-close-line"></i></button>
</div>
</div>

@ -1,6 +1,7 @@
<header> <header>
<h1 class="title">Adlerka Memes</h1> <h1 class="title">Adlerka Memes</h1>
<p>Skoro, ako <a href="https://reddit.com/r/adlerka" target="_blank">r/adlerka</a>, ale lepšie.</p> <p>Skoro, ako <a href="https://reddit.com/r/adlerka" target="_blank">r/adlerka</a>, ale lepšie.</p>
<button id="memecreateopen" onclick="togglememecreate()"><i class="ri-add-circle-line"></i></button>
<hr> <hr>
</header> </header>
<main> <main>

@ -16,8 +16,9 @@
<div id="articlecreate"> <div id="articlecreate">
<input type="text" placeholder="Article Title" id="articletitleinput"><br> <input type="text" placeholder="Article Title" id="articletitleinput"><br>
<textarea id="articlebodyinput" placeholder="Article Body" rows="10" cols="80"></textarea><br> <textarea id="articlebodyinput" placeholder="Article Body" rows="10" cols="80"></textarea><br>
<label for="articleprivilegeinput">Oprávnenie na pozretie článku:</label><br> <label for="articleprivilegeinput">Oprávnenie na pozretie článku:</label>
<input type="number" id="articleprivilegeinput" min="1" value="1" step="1"><br> <input type="number" id="articleprivilegeinput" min="1" value="1" step="1">
<button id="articlesubmit" onclick="submitarticle()">Add</button> <button id="articlesubmit" onclick="submitarticle()"><i class="ri-add-circle-line"></i></button>
<button id="articlecreateclose" onclick="togglearticlecreate()"><i class="ri-close-line"></i></button>
</div> </div>
</div> </div>