Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weow omg color picking! - Completed by Silent #112

Merged
merged 1 commit into from
Dec 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
![LJ Inventory](https://user-images.githubusercontent.com/91661118/146313051-665337bf-ed92-4ed0-bbb9-6ee9613f670d.png)

## Color Picking Added!

Join my Discord for updates, support, and special early testing!
<br>
https://discord.gg/projectsloth
Expand Down
19 changes: 19 additions & 0 deletions html/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,18 @@ body {
font-weight: 300;
font-family: 'Roboto', sans-serif !important;
}
.inv-option-item > label {
color: white;
text-align: center;
line-height: 48px;
text-transform: normal;
font-size: 1.5vh;
font-weight: 300;
font-family: 'Roboto', sans-serif !important;
margin-right: 10px;
margin-bottom: auto;
margin-top: auto;
}

.inv-option-item {
margin-top: 3%;
Expand Down Expand Up @@ -1125,3 +1137,10 @@ body {
.weapon-attachments-back:hover {
background-color: rgb(18, 18, 18);
}

.color-picker-container {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
20 changes: 20 additions & 0 deletions html/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,26 @@ $(document).on("click", ".weapon-attachments-back", function(e) {
AttachmentScreenActive = false;
});

function changeInventoryColor(color) {
$( ".player-inventory-bg" ).css( "background-color", color);
$( ".other-inventory-bg" ).css( "background-color", color);
$( ".inv-options" ).css( "background-color", color);
localStorage.setItem('lj-inventory-color', color);
}

const savedColor = localStorage.getItem('lj-inventory-color');

if (savedColor) {
changeInventoryColor(savedColor)
}

$('#favcolor').change(function(){
let color = $(this).val();
let hexOpacity = "CC";
let finalColor = color+hexOpacity;
changeInventoryColor(finalColor);
});

function FormatAttachmentInfo(data) {
$.post(
"https://lj-inventory/GetWeaponData",
Expand Down
8 changes: 7 additions & 1 deletion html/ui.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@
<div class="inv-options">
<div class="inv-options-list">
<img class="brand-logo" src="./images/lj-symbol.svg"></img>
<input type="number" id="item-amount" class="inv-option-item" min=1 max="10000" placeholder="Amount" pattern="[0-9]" onfocus="this.value=''" placeholder="" oninput="validity.valid||(value='');"></input> <div class="inv-option-item" id="item-use"><p>Use</p></div>
<div class="inv-option-item color-picker-container">
<label for="favcolor">Color:</label>
<input type="color" id="favcolor" name="favcolor" value="#ff0000">
</div>
<input type="number" id="item-amount" class="inv-option-item" min=1 max="10000" placeholder="Amount"
pattern="[0-9]" onfocus="this.value=''" placeholder="" oninput="validity.valid||(value='');"></input>
<div class="inv-option-item" id="item-use"><p>Use</p></div>
<!-- <img class="inv-option-hand" id= "item-use" src="images/hand-1.png"> -->
<div class="inv-option-item" id="item-give"><p>Give</p></div>
<div class="inv-option-item" id="inv-close"><p>Close</p></div>
Expand Down