Skip to content

Commit

Permalink
7.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomPerson3465 committed Sep 1, 2024
1 parent 6eab66c commit d4c33b7
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 22 deletions.
17 changes: 14 additions & 3 deletions counter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const LCEDIT = {
saveVersion: 6,
versionName: "7.1",
saveVersion: 7,
versionName: "7.1.3",
util: {
clamp: (input, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) => {
if (isNaN(input)) input = 0;
Expand Down Expand Up @@ -143,6 +143,13 @@ const LCEDIT = {
el.style.display = 'none';
}
},
setVisibleKeepSpace: (el, visible) => {
if (visible) {
el.style.visibility = 'visible';
} else {
el.style.visibility = 'hidden';
}
},
removePrivateData: data => {
let d = JSON.parse(JSON.stringify(data));
d.allowHTML = false;
Expand Down Expand Up @@ -170,6 +177,8 @@ let defaultCounter = {
bannerURL: "",
bgColor: "#000000",
chartColor: "#ff0000",
chartCreditsEnabled: false,
chartGridColor: "#bdbdbd",
count: 0,
counterColor: "#000000",
customRate: "",
Expand All @@ -195,6 +204,7 @@ let defaultCounter = {
reverseAnimation: false,
showBanner: false,
showChart: false,
showChartGrid: false,
showFooter: false,
showImage: true,
stdevRate: 0,
Expand Down Expand Up @@ -343,7 +353,8 @@ class Save {
leeway: 10,
updater: 0
},
this.project = "livecountsedit"
this.project = "livecountsedit",
this.isFullScreen = false
}
}

Expand Down
7 changes: 6 additions & 1 deletion livecountsedit/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ body {
width: 15%;
height: 100%;
border-radius: 15px;
overflow-y: auto;
}

.tab-link {
Expand Down Expand Up @@ -126,7 +127,11 @@ body {
}

.page-footer {
text-align: center
text-align: center;
bottom: 5px;
left: 0;
right: 0;
position: absolute;
}

.fa.fa-info-circle {
Expand Down
2 changes: 1 addition & 1 deletion livecountsedit/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
</div>
</div>
<div class="page-footer">
<span>Version 7.1 - <a href="../index.html">Back to main page</a> - <a href="https://github.com/livecountsedit/livecountsedit.github.io/wiki/New-Updates-Not-Working%3F">Not working?</a> - <a href="../about/discord.html">Join the Livecountsedit Discord Server.</a> This site is a parody of popular realtime counters.</span>
<span>Version 7.1.3 - <a href="../index.html">Back to main page</a> - <a href="https://github.com/livecountsedit/livecountsedit.github.io/wiki/New-Updates-Not-Working%3F">Not working?</a> - <a href="../about/discord.html">Join the Livecountsedit Discord Server.</a> This site is a parody of popular realtime counters. <button class="btn btn-secondary" onclick="toggleFullScreen()">Toggle Full Screen</button></span>
</div>
<script src="../odometer/odometer.js"></script>
<script src="../highstock.js"></script>
Expand Down
63 changes: 52 additions & 11 deletions livecountsedit/lcedit.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ const saveType = 1;
defaultCounter = Object.assign(defaultCounter, {
bannerURL: "https://lcedit.com/default_banner.png",
bgColor: "#222233",
chartCreditsEnabled: true,
counterColor: "#ffffff",
downColor: "#ffffff",
footer: "Subscribers",
footerColor: "#ffffff",
imageURL: "https://lcedit.com/default.png",
showBanner: true,
showChart: true,
showChartGrid: true,
showFooter: true,
titleColor: "#ffffff",
upColor: "#ffffff"
Expand Down Expand Up @@ -157,13 +159,15 @@ function updateStuff() {
document.querySelector('#counter-footer').style.color = counter.settings.footerColor;
document.querySelector('#counter-counter').innerText = counter.getApparentCount();
document.querySelector('.counter-container').style.color = counter.settings.counterColor;
document.querySelector('.counter-content').style.backgroundColor = counter.settings.bgColor;
document.querySelector('.counter-area').style.backgroundColor = counter.settings.bgColor;
LCEDIT.util.setVisible(document.querySelector('#counter-banner'), counter.settings.showBanner)
LCEDIT.util.setVisibleKeepSpace(document.querySelector('#counter-banner'), counter.settings.showBanner)
LCEDIT.util.setVisible(document.querySelector('#counter-avatar'), counter.settings.showImage, 'inline-block')
LCEDIT.util.setVisible(document.querySelector('#counter-chart'), counter.settings.showChart)
LCEDIT.util.setVisible(document.querySelector('#counter-footer'), counter.settings.showFooter)
document.querySelector('#counter-banner').style.filter = `blur(${counter.settings.bannerBlur}px)`
loadMyFont();
toggleFullScreen(saveData.isFullScreen);
if (counter.settings.showChart) chart.update(getChartOptions());
updateCounter();
if (!saveData.paused) saveData.updater = setInterval(updateCounter, saveData.updateInterval * 1000)
Expand All @@ -187,26 +191,43 @@ function getChartOptions() {
},
xAxis: {
type: "datetime",
gridLineColor: "#bdbdbd",
lineColor: "#000000",
minorGridLineColor: "#bdbdbd",
tickColor: "#000000",
visible: counter.settings.showChartGrid,
gridLineColor: counter.settings.chartGridColor,
lineColor: counter.settings.chartGridColor,
minorGridLineColor: counter.settings.chartGridColor,
minorTickColor: counter.settings.chartGridColor,
tickColor: counter.settings.chartGridColor,
title: {
text: ""
},
labels: {
style: {
color: counter.settings.chartGridColor
}
}
},
yAxis: {
grindLineColor: "#bdbdbd",
lineColor: "#000000",
minorGridLineColor: "#bdbdbd",
tickColor: "#000000",
gridLineColor: counter.settings.chartGridColor,
visible: counter.settings.showChartGrid,
lineColor: counter.settings.chartGridColor,
minorGridLineColor: counter.settings.chartGridColor,
minorTickColor: counter.settings.chartGridColor,
tickColor: counter.settings.chartGridColor,
title: {
text: ""
},
labels: {
style: {
color: counter.settings.chartGridColor
}
}
},
credits: {
enabled: true,
text: "lcedit.com"
enabled: counter.settings.chartCreditsEnabled,
text: "lcedit.com",
style: {
color: counter.settings.chartGridColor
}
},
series: [{
showInLegend: false,
Expand Down Expand Up @@ -385,6 +406,26 @@ function importFromJSON(data, bypass=false) {
}
}

function toggleFullScreen(value) {
if (value !== undefined) {
saveData.isFullScreen = value;
} else {
saveData.isFullScreen = !saveData.isFullScreen;
}
LCEDIT.util.setVisible(document.querySelector(".tabs"), !saveData.isFullScreen);
LCEDIT.util.setVisible(document.querySelector(".tab-stuff"), !saveData.isFullScreen);
if (saveData.isFullScreen) {
document.querySelector(".counter-content").style.width = "100%";
document.querySelector(".counter-content").style.border = "none";
document.body.style.backgroundColor = counter.settings.bgColor;
} else {
document.querySelector(".counter-content").style.width = "50%";
document.querySelector(".counter-content").style.border = "1px solid var(--border-color, #ddd)";
document.body.style.backgroundColor = "var(--bg-color, #1a1a20)";
}
if (chart) chart.reflow();
}

function saveInBrowser() {
saveData.lastSaved = Date.now();
localStorage.setItem('lcedit-lcedit', saveToJSON(true));
Expand Down
32 changes: 32 additions & 0 deletions livecountsedit/lcedit.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,18 @@
}
]
},
{
"type": "section",
"elements": [
{
"label": "Chart grid and label color",
"id": "chartGridColor",
"type": "option",
"tag": "input",
"inputType": "color"
}
]
},
{
"type": "section",
"elements": [
Expand Down Expand Up @@ -428,6 +440,26 @@
}
]
},
{
"type": "checkbox",
"elements": [
{
"label": "Show chart grid and labels",
"id": "showChartGrid",
"type": "checkbox"
}
]
},
{
"type": "checkbox",
"elements": [
{
"label": "Show \"lcedit.com\" chart credits",
"id": "chartCreditsEnabled",
"type": "checkbox"
}
]
},
{
"type": "checkbox",
"elements": [
Expand Down
2 changes: 1 addition & 1 deletion livecountsnet/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ <h5 id="lcnet-byline" class="lcnet-item">by @ColleensCuber</h5>
<input type="number" placeholder="Count" id="lcnet-input-count">
<button onclick="setCountManually()">Set</button>
</div>
Version 7.1 • Disclaimer: We are not affilated with the real livecounts.net • <a href="/">Back to main page</a>
Version 7.1.3 • Disclaimer: We are not affilated with the real livecounts.net • <a href="/">Back to main page</a>
<i class="fa fa-bars" data-bs-toggle="modal" data-bs-target="#lcnet-settings-modal"></i>
</div>
</div>
Expand Down
6 changes: 1 addition & 5 deletions livecountsnet/lcnet.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,7 @@ function updateStuff() {
document.querySelector('.counter-container').style.color = counter.settings.counterColor;
document.querySelector('.counter-container-2').style.color = counter.settings.counterColor;
document.body.style.backgroundColor = counter.settings.bgColor;
if (counter.settings.showImage) {
document.querySelector('#lcnet-avatar').style.visibility = "none";
} else {
document.querySelector('#lcnet-avatar').style.visibility = "visible";
}
LCEDIT.util.setVisibleKeepSpace(document.querySelector('#lcnet-avatar'), counter.settings.showImage)
loadMyFont();
updateCounter();
document.querySelector('#lcnet-update-text').innerText = `updated every ${saveData.updateInterval} second${saveData.updateInterval === 1 ? "" : "s"}`;
Expand Down

0 comments on commit d4c33b7

Please sign in to comment.