<script src="https://kit.fontawesome.com/a076d05399.js" crossorigin="anonymous"></script>
<div class="container flex">
<article class="card">
<center>
<div style="width:70%; box-shadow:0 0 5px #bbb; padding:5px 10px 5px 10px">
<p class="myclass" style="font-size:0.7em; margin-left:-2px; margin-top:3px; text-align:left; color:#444; font-weight:500">Benjamin Pelletier</p>
<container class="mySlides AASJ"> <!-- added class as per option name -->
<img src="https://deviceconsole.desinic8.repl.co/aa-offline.png" class="screenimg" preload="none" width="90%" id="myImage">
<container id="divMsg" style="background-color: transparent; color: #ffffff; height: auto; width: auto; text-align: center">
<center>
<div style="display:none; background-color:transparent; padding:5px; margin-bottom:2px">
</div>
</center>
</container>
</container>
</div>
</center>
<button class="thumbtack">Pin</button>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<input type="image" src="eye.png" title="Not yet released" disabled style="display:none; cursor:not-allowed; width:16px" onclick="#">
<input type="image" src="unlock.png" title="Release" style="width:16px; margin-right:3px" onclick="before();">
<input type="image" src="lock.png" title="Lock" style="width:16px; margin-right:3px" onclick="afterr();">
<input type="image" src="heart.png" title="Report self-harm" style="width:16px; margin-right:3px" onclick="reportHarm();">
</article>
<article class="card">
<center>
<div style="width:70%; box-shadow:0 0 5px #bbb; padding:5px 10px 5px 10px">
<p class="myclass" style="font-size:0.7em; margin-left:-2px; margin-top:3px; text-align:left; color:#444; font-weight:500">Darryn Hanson
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"></p>
<container class="mySlides AASJ"> <!-- added class as per option name -->
<img src="https://deviceconsole.desinic8.repl.co/aa-offline.png" class="screenimg" preload="none" width="90%" id="myImage1">
<container id="divMsg" style="background-color: transparent; color: #ffffff; height: auto; width: auto; text-align: center">
<center>
<div style="display:none; background-color:transparent; padding:5px; margin-bottom:2px">
</div>
</center>
</container>
</container>
</div>
</center>
<button class="thumbtack">Pin</button>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<input type="image" src="eye.png" title="Not yet released" disabled style="display:none; cursor:not-allowed; width:16px" onclick="#">
<input type="image" src="unlock.png" title="Release" style="width:16px; margin-right:3px" onclick="before1();">
<input type="image" src="lock.png" title="Lock" style="width:16px; margin-right:3px" onclick="afterr1();">
<input type="image" src="heart.png" title="Report self-harm" style="width:16px; margin-right:3px" onclick="reportHarm();">
</article>
<article class="card">
<center>
<div style="width:70%; box-shadow:0 0 5px #bbb; padding:5px 10px 5px 10px">
<p style="font-size:0.7em; margin-left:-2px; margin-top:3px; text-align:left; color:#444; font-weight:500">
Nicole Bradley
</p>
<container class="mySlides AASJ"> <!-- added class as per option name -->
<img src="https://deviceconsole.desinic8.repl.co/profile-student.png" class="screenimg" preload="none" width="90%" id="myImage2">
<container id="divMsg2" style="background-color: transparent; color: #ffffff; height: auto; width: auto; text-align: center; display:none">
<center>
<div style="display:none; background-color:#4d525e; padding:5px; width:70%; border-bottom-left-radius:8px; border-bottom-right-radius:8px">
</div>
</center>
</container>
</container>
</div>
</center>
<button class="thumbtack">Pin</button>
<input type="image" src="unlock.png" title="Release" style="width:16px; margin-right:3px" onclick="before2();">
<input type="image" src="lock.png" title="Lock" style="width:16px; margin-right:3px" onclick="afterr2();">
<input type="image" src="heart.png" title="Report self-harm" style="width:16px; margin-right:3px" onclick="reportHarm();">
</article>
</div>
<style>
.flex {
display: flex;
justify-content: center;
flex-wrap: wrap;
gap: 2rem;
}
.card {
width: 340px;
}
.order-1 {
order: -1;
}
.order-1 > .thumbtack {
color: #1095c1;
}
/* reset some picocss styles */
.thumbtack {
all: unset;
color: #666;
text-align: center;
padding:2px 4px;
border-left:1px solid #bbb;
border-right:1px solid #bbb;
border-top:1px solid #bbb;
border-bottom:1px solid #bbb;
background-color:white;
cursor: pointer;
}
</style>
<script>
const buttons = document.querySelectorAll(".thumbtack");
const cards = document.querySelectorAll(".card");
buttons.forEach((button) => {
button.addEventListener("click", ({ target }) => {
target.parentElement.classList.toggle("order-1");
target.textContent = target.textContent === "Pin" ? "Pinned" : "Pin";
target.blur();
});
});
</script>
I’ve separated the code so it should be pretty easy. I’ve tried just placing the button where I want it and it won’t pin. I would like it to look like this: