소스 검색

Allow the button to be let go of anywhere. Move version to the side

tags/v0.1.0
Fen Dweller 5 년 전
부모
커밋
388528bbb5
No known key found for this signature in database GPG 키 ID: E80B35A6F11C3656
3개의 변경된 파일35개의 추가작업 그리고 10개의 파일을 삭제
  1. +12
    -2
      gorge.css
  2. +1
    -2
      gorge.html
  3. +22
    -6
      gorge.js

+ 12
- 2
gorge.css 파일 보기

@@ -55,6 +55,7 @@ button {
left: 0%;
text-align: center;
margin: auto;
padding-top: 1vh;
}

#top-bar > button {
@@ -257,6 +258,10 @@ button {
left: 5%;
}

body .news-banner {
top: 8%;
left: 22.5%;
}
body .news-text {
top: 12%;
left: 22.5%;
@@ -585,6 +590,7 @@ div::-webkit-scrollbar-corner {
font-size: 24pt;
color: #eee;
}

.news-text {
text-align: center;
position: fixed;
@@ -701,14 +707,18 @@ div::-webkit-scrollbar-corner {
}


#changelog-link a {
#changelog-link {
position: fixed;
left: 0%;
top: 0%;
height: 10vh;
z-index: 2;
font-size: 36px;
}

#changelog-link div {
font-size: 24px;
color: gray;
}

#discord-link img {
@@ -721,7 +731,7 @@ div::-webkit-scrollbar-corner {


@media (max-aspect-ratio: 1/1) {
body #changelog-link a {
body #changelog-link {
top: auto;
bottom: 0%;
z-index: 2;


+ 1
- 2
gorge.html 파일 보기

@@ -24,13 +24,12 @@
<body class="dark">
<div id="changelog-link">
<a href="https://crux.sexy/changelog#gorge">Changelog</a>
<div>Gorge v0.0.7a</div>
</div>
<div id="discord-link">
<a href="https://discord.gg/vqcKVV6"><img src="images/discord.svg"></a>
</div>
<div id="top-bar">
Gorge v0.0.7a
<br>
<button id="save">Save</button>
<button id="reset">Reset saved data</button>
<button id="numbers">Number mode???</button>


+ 22
- 6
gorge.js 파일 보기

@@ -48,6 +48,8 @@ let newsRemoveTimer;

const newsDelay = 8000;

let buttonClicked = false;

const state = {
ownedUpgrades: ownedUpgrades,
resources: resources,
@@ -687,14 +689,28 @@ function initializeData() {
});
}

function handleButton(e) {
const add = eatPrey();
const text = "+" + render(round(add, 1), 3) + " food";
const gulp = "*glp*";
clickPopup(text, "food", [e.clientX, e.clientY]);
clickPopup(gulp, "gulp", [e.clientX, e.clientY]);
stats.clicks += 1;
}

function registerListeners() {
document.addEventListener("mouseup", (e) => {
if (buttonClicked) {
buttonClicked = false;
handleButton(e);
return false;
} else {
return true;
}
});

document.querySelector("#tasty-micro").addEventListener("mousedown", (e) => {
const add = eatPrey();
const text = "+" + render(round(add, 1), 3) + " food";
const gulp = "*glp*";
clickPopup(text, "food", [e.clientX, e.clientY]);
clickPopup(gulp, "gulp", [e.clientX, e.clientY]);
stats.clicks += 1;
buttonClicked = true;
});

document.querySelector("#save").addEventListener("click", save);


불러오는 중...
취소
저장