Преглед на файлове

Switch to fontawesome icons

tags/v0.0.3
Fen Dweller преди 5 години
родител
ревизия
22ac7cdd4c
променени са 5 файла, в които са добавени 63 реда и са изтрити 34 реда
  1. +41
    -20
      constants.js
  2. +15
    -7
      gorge.css
  3. +1
    -0
      gorge.html
  4. +6
    -6
      gorge.js
  5. +0
    -1
      images/buildings/micro.svg

+ 41
- 20
constants.js Целия файл

@@ -11,133 +11,152 @@ const buildings = {
"plural": "Micros", "plural": "Micros",
"desc": "A tasty, squirmy treat.", "desc": "A tasty, squirmy treat.",
"cost": 1e1, "cost": 1e1,
"prod": 1e-1/1
"prod": 1e-1/1,
"icon": "fa-universal-access"
}, },
"anthro": { "anthro": {
"name": "Anthro", "name": "Anthro",
"plural": "Anthros", "plural": "Anthros",
"desc": "Something more substantial to sate your hunger.", "desc": "Something more substantial to sate your hunger.",
"cost": 1e2, "cost": 1e2,
"prod": 1e0/1.1
"prod": 1e0/1.1,
"icon": "fa-male"
}, },
"car": { "car": {
"name": "Car", "name": "Car",
"plural": "Cars", "plural": "Cars",
"desc": "Crunchy shell, tasty center.", "desc": "Crunchy shell, tasty center.",
"cost": 1.2e3, "cost": 1.2e3,
"prod": 1e1/1.2
"prod": 1e1/1.2,
"icon": "fa-car"
}, },
"bus": { "bus": {
"name": "Bus", "name": "Bus",
"plural": "Buses", "plural": "Buses",
"desc": "Probably the worst place to be when a macro is aroud.", "desc": "Probably the worst place to be when a macro is aroud.",
"cost": 1.4e4, "cost": 1.4e4,
"prod": 1e2/1.3
"prod": 1e2/1.3,
"icon": "fa-bus"
}, },
"house": { "house": {
"name": "House", "name": "House",
"plural": "Houses", "plural": "Houses",
"desc": "Home sweet home - but it doesn't taste sweet?", "desc": "Home sweet home - but it doesn't taste sweet?",
"cost": 1.6e5, "cost": 1.6e5,
"prod": 1e3/1.4
"prod": 1e3/1.4,
"icon": "fa-home"
}, },
"apartment": { "apartment": {
"name": "Apartment", "name": "Apartment",
"plural": "Apartments", "plural": "Apartments",
"desc": "More snacks, less packaging.", "desc": "More snacks, less packaging.",
"cost": 1.8e6, "cost": 1.8e6,
"prod": 1e4/1.5
"prod": 1e4/1.5,
"icon": "fa-building"
}, },
"block": { "block": {
"name": "Block", "name": "Block",
"plural": "Blocks", "plural": "Blocks",
"desc": "A whole pile of buildings.", "desc": "A whole pile of buildings.",
"cost": 2e7, "cost": 2e7,
"prod": 1e5/1.6
"prod": 1e5/1.6,
"icon": "fa-warehouse"
}, },
"town": { "town": {
"name": "Town", "name": "Town",
"plural": "Towns", "plural": "Towns",
"desc": "'Tourist trap' has never been this literal.", "desc": "'Tourist trap' has never been this literal.",
"cost": 2.2e8, "cost": 2.2e8,
"prod": 1e6/1.7
"prod": 1e6/1.7,
"icon": "fa-building"
}, },
"city": { "city": {
"name": "City", "name": "City",
"plural": "Cities", "plural": "Cities",
"desc": "Please no sitty on our city.", "desc": "Please no sitty on our city.",
"cost": 2.4e9, "cost": 2.4e9,
"prod": 1e7/1.8
"prod": 1e7/1.8,
"icon": "fa-city"
}, },
"metro": { "metro": {
"name": "Metropolis", "name": "Metropolis",
"plural": "Metropolises", "plural": "Metropolises",
"desc": "A big ol' city. Tasty, too.", "desc": "A big ol' city. Tasty, too.",
"cost": 2.6e10, "cost": 2.6e10,
"prod": 1e8/1.9
"prod": 1e8/1.9,
"icon": "fa-landmark"
}, },
"county": { "county": {
"name": "County", "name": "County",
"plural": "Counties", "plural": "Counties",
"desc": "Why salt the land when you can slurp it?", "desc": "Why salt the land when you can slurp it?",
"cost": 2.8e11, "cost": 2.8e11,
"prod": 1e9/2
"prod": 1e9/2,
"icon": "fa-map"
}, },
"state": { "state": {
"name": "State", "name": "State",
"plural": "States", "plural": "States",
"desc": "The United States is made up of...43 states - no, 42...", "desc": "The United States is made up of...43 states - no, 42...",
"cost": 3e12, "cost": 3e12,
"prod": 1e10/2.1
"prod": 1e10/2.1,
"icon": "fa-map-signs"
}, },
"country": { "country": {
"name": "Country", "name": "Country",
"plural": "Countries", "plural": "Countries",
"desc": "One nation, under paw.", "desc": "One nation, under paw.",
"cost": 3.2e13, "cost": 3.2e13,
"prod": 1e11/2.2
"prod": 1e11/2.2,
"icon": "fa-flag"
}, },
"continent": { "continent": {
"name": "Continent", "name": "Continent",
"plural": "Continents", "plural": "Continents",
"desc": "Earth-shattering appetite!", "desc": "Earth-shattering appetite!",
"cost": 3.4e14, "cost": 3.4e14,
"prod": 1e12/2.3
"prod": 1e12/2.3,
"icon": "fa-mountain"
}, },
"planet": { "planet": {
"name": "Planet", "name": "Planet",
"plural": "Planets", "plural": "Planets",
"desc": "Earth appetite!", "desc": "Earth appetite!",
"cost": 3.6e15, "cost": 3.6e15,
"prod": 1e13/2.4
"prod": 1e13/2.4,
"icon": "fa-globe-europe"
}, },
"solar-system": { "solar-system": {
"name": "Solar System", "name": "Solar System",
"plural": "Solar Systems", "plural": "Solar Systems",
"desc": "Earths appetite!", "desc": "Earths appetite!",
"cost": 3.8e16, "cost": 3.8e16,
"prod": 1e14/2.5
"prod": 1e14/2.5,
"icon": "fa-meteor"
}, },
"galaxy": { "galaxy": {
"name": "Galaxy", "name": "Galaxy",
"plural": "Galaxy", "plural": "Galaxy",
"desc": "In a galaxy far, far down your gullet...", "desc": "In a galaxy far, far down your gullet...",
"cost": 4.0e17, "cost": 4.0e17,
"prod": 1e15/2.6
"prod": 1e15/2.6,
"icon": "fa-sun"
}, },
"universe": { "universe": {
"name": "Universe", "name": "Universe",
"plural": "Universes", "plural": "Universes",
"desc": "Into the you-verse.", "desc": "Into the you-verse.",
"cost": 4.2e18, "cost": 4.2e18,
"prod": 1e16/2.7
"prod": 1e16/2.7,
"icon": "fa-asterisk"
}, },
"multiverse": { "multiverse": {
"name": "Multiverse", "name": "Multiverse",
"plural": "Multiverses", "plural": "Multiverses",
"desc": "This is getting very silly.", "desc": "This is getting very silly.",
"cost": 4.4e19, "cost": 4.4e19,
"prod": 1e17/2.8
"prod": 1e17/2.8,
"icon": "fa-infinity"
} }
} }


@@ -220,7 +239,7 @@ function createProdUpgrades() {
upgrades[prefix + counter] = { upgrades[prefix + counter] = {
"name": contents.name, "name": contents.name,
"desc": contents.desc, "desc": contents.desc,
"icon": "buildings/" + key,
"icon": buildings[key].icon,
"cost": { "cost": {
"food": buildings[key].cost * 5 * Math.pow(10,counter - 1) "food": buildings[key].cost * 5 * Math.pow(10,counter - 1)
}, },
@@ -257,6 +276,7 @@ function createProdAllUpgrades() {
upgrades[prefix + counter] = { upgrades[prefix + counter] = {
"name": contents.name, "name": contents.name,
"desc": contents.desc, "desc": contents.desc,
"icon": "fa-cogs",
"cost": { "cost": {
"food": 5 * Math.pow(10, counter+1) "food": 5 * Math.pow(10, counter+1)
}, },
@@ -292,6 +312,7 @@ function createClickUpgrades() {
upgrades[prefix + counter] = { upgrades[prefix + counter] = {
name: contents.name, name: contents.name,
desc: contents.desc, desc: contents.desc,
icon: "fa-hand-pointer",
cost: { cost: {
food: Math.pow(10, (counter*2)+1) food: Math.pow(10, (counter*2)+1)
}, },


+ 15
- 7
gorge.css Целия файл

@@ -134,13 +134,17 @@ button {
border: 5px; border: 5px;
border-color: #666; border-color: #666;
border-style: solid; border-style: solid;
user-select: none;
user-select: none;;
} }


.building-button > .building-icon {
.building-button > .fas {
text-align: center;
width: 100%;
height: 100%;
left: 25%;
transform: translate(0, 5px);
position: absolute; position: absolute;
right: 0%;
height: 75px;
font-size: 60px;
} }


.building-button-disabled { .building-button-disabled {
@@ -282,11 +286,11 @@ button {
transition: 0.2s; transition: 0.2s;
} }


.upgrade-button > .upgrade-icon {
.upgrade-button > .fas {
width: 100px; width: 100px;
height: 100px; height: 100px;
position: relative;
top: -50px;
font-size: 75px;
transform: translate(12.5%, -37.5%);
opacity: 0.5; opacity: 0.5;
} }


@@ -299,6 +303,10 @@ button {
width: 13vw; width: 13vw;
height: 13vw; height: 13vw;
} }

.upgrade-button > .fas {
font-size: 10vw;
}
} }


.upgrade-button-inactive { .upgrade-button-inactive {


+ 1
- 0
gorge.html Целия файл

@@ -16,6 +16,7 @@
<meta property="og:description" content="An idle game about eating people" /> <meta property="og:description" content="An idle game about eating people" />
<meta property="og:image" content="https://crux.sexy/images/gorge.png" /> <meta property="og:image" content="https://crux.sexy/images/gorge.png" />
<link rel="icon" href="https://crux.sexy/images/gorge.ico"> <link rel="icon" href="https://crux.sexy/images/gorge.ico">
<script src="https://kit.fontawesome.com/10a16c6083.js" crossorigin="anonymous"></script>
</head> </head>


<body class="dark"> <body class="dark">


+ 6
- 6
gorge.js Целия файл

@@ -391,9 +391,9 @@ function createBuildings() {
let buttonCost = document.createElement("div"); let buttonCost = document.createElement("div");
buttonCost.classList.add("building-button-cost"); buttonCost.classList.add("building-button-cost");


let buildingIcon = document.createElement("img");
buildingIcon.classList.add("building-icon");
buildingIcon.src = "images/buildings/" + key + ".svg";
let buildingIcon = document.createElement("i");
buildingIcon.classList.add("fas");
buildingIcon.classList.add(value.icon);


button.appendChild(buttonName); button.appendChild(buttonName);
button.appendChild(buttonCost); button.appendChild(buttonCost);
@@ -483,9 +483,9 @@ function createUpgrades() {
buttonName.classList.add("upgrade-button-name"); buttonName.classList.add("upgrade-button-name");
buttonName.innerText = value.name; buttonName.innerText = value.name;


let upgradeIcon = document.createElement("img");
upgradeIcon.src = "images/" + value.icon + ".svg";
upgradeIcon.classList.add("upgrade-icon");
let upgradeIcon = document.createElement("i");
upgradeIcon.classList.add("fas");
upgradeIcon.classList.add(value.icon);
button.appendChild(buttonName); button.appendChild(buttonName);
button.appendChild(upgradeIcon); button.appendChild(upgradeIcon);


+ 0
- 1
images/buildings/micro.svg Целия файл

@@ -1 +0,0 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><defs><style>.cls-1{fill:#bdccd4;}</style></defs><title>micro</title><polygon class="cls-1" points="114.69 475.44 256 37.69 397.31 475.44 114.69 475.44"/><path d="M256,39.32,396.63,474.94H115.37L256,39.32m0-3.26L114,475.94H398L256,36.06Z"/></svg>

Loading…
Отказ
Запис