Migrate break_infinity.js and @antimatter-dimensions/notations to npm, add Blobs notation

This commit is contained in:
Andrei Andreev 2022-01-25 00:54:48 +03:00
parent 3a613dcb75
commit b781d5c8e1
11 changed files with 48 additions and 1482 deletions

View File

@ -1,3 +1,6 @@
import Decimal from "break_infinity.js";
window.Decimal = Decimal;
Array.prototype.distinct = function() {
return this.filter(function (value, index, self) {
return self.indexOf(value) === index;

View File

@ -1,3 +1,5 @@
import * as ADNotations from "@antimatter-dimensions/notations";
export const Notation = (function() {
const N = ADNotations;
const notation = type => {
@ -17,7 +19,7 @@ export const Notation = (function() {
engineering: notation(N.EngineeringNotation),
letters: notation(N.LettersNotation),
standard: painful(notation(N.StandardNotation)),
cancer: painful(notation(N.CancerNotation)),
emoji: painful(notation(N.EmojiNotation)),
mixedScientific: notation(N.MixedScientificNotation),
mixedEngineering: notation(N.MixedEngineeringNotation),
logarithm: notation(N.LogarithmNotation),
@ -33,13 +35,14 @@ export const Notation = (function() {
bar: painful(notation(N.BarNotation)),
shi: painful(notation(N.ShiNotation)),
blind: painful(notation(N.BlindNotation)),
blobs: painful(notation(N.BlobsNotation)),
all: painful(notation(N.AllNotation))
};
}());
Notation.cancer.setAsCurrent = (silent = false) => {
player.options.notation = Notation.cancer.name;
ui.notationName = Notation.cancer.name;
Notation.emoji.setAsCurrent = (silent = false) => {
player.options.notation = Notation.emoji.name;
ui.notationName = Notation.emoji.name;
if (!silent) GameUI.notify.success("😂😂😂");
};
@ -50,7 +53,7 @@ export const Notations = {
Notation.engineering,
Notation.letters,
Notation.standard,
Notation.cancer,
Notation.emoji,
Notation.mixedScientific,
Notation.mixedEngineering,
Notation.logarithm,
@ -66,6 +69,7 @@ export const Notations = {
Notation.bar,
Notation.shi,
Notation.blind,
Notation.blobs,
Notation.all,
],
find: name => {

View File

@ -1,3 +1,5 @@
import * as ADNotations from "@antimatter-dimensions/notations";
export const GameStorage = {
currentSlot: 0,
saves: {

27
package-lock.json generated
View File

@ -2,6 +2,15 @@
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"@antimatter-dimensions/notations": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/@antimatter-dimensions/notations/-/notations-2.2.0.tgz",
"integrity": "sha512-EGXWMQer0Bvb1kujon6rvZdj+3k533SlfLtgoz+y35hMhsvQNoduURpZ0j+apFSpC0vpeEvVUjXqq6eUmQrJZQ==",
"requires": {
"break_infinity.js": "^1.2.0",
"tslib": "^2.0.0"
}
},
"@babel/code-frame": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz",
@ -4470,6 +4479,14 @@
"concat-map": "0.0.1"
}
},
"break_infinity.js": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/break_infinity.js/-/break_infinity.js-1.3.0.tgz",
"integrity": "sha512-fuBYhRnzOL9U0naaC6ThKbicbqImKVVZmnqCHfNCopWqU2X6vcSf/T1gUn8yD1feGaxl4bgWWImMFYSX62iDsw==",
"requires": {
"pad-end": "^1.0.2"
}
},
"browserslist": {
"version": "4.18.0",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.18.0.tgz",
@ -8432,6 +8449,11 @@
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"dev": true
},
"pad-end": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/pad-end/-/pad-end-1.0.2.tgz",
"integrity": "sha1-a0GkL9t+/6VYWLt32t5S7uOI5sw="
},
"param-case": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz",
@ -10041,6 +10063,11 @@
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=",
"dev": true
},
"tslib": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
},
"type-check": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",

View File

@ -6,6 +6,8 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"@antimatter-dimensions/notations": "^2.2.0",
"break_infinity.js": "^1.3.0",
"core-js": "^3.6.5",
"vue": "^2.6.11"
},

View File

@ -67,7 +67,6 @@
<script type="text/javascript" src="lib/vue.js"></script>
<script type="text/javascript" src="lib/v-tooltip.min.js"></script>
<script type="text/javascript" src="lib/mousetrap.min.js"></script>
<script type="text/javascript" src="lib/break_infinity.min.js"></script>
<script type="text/javascript" src="lib/lz-string.min.js"></script>
<script type="text/javascript" src="lib/vis-network.min.js"></script>
<script type="text/javascript" src="lib/sha512.min.js"></script>
@ -84,7 +83,6 @@
<script type="text/javascript" src="lib/lint.js"></script>
<script type="text/javascript" src="lib/active-line.js"></script>
<script type="text/javascript" src="lib/closebrackets.js"></script>
<script type="text/javascript" src="lib/ad-notations.min.js"></script>
<script type="text/javascript" src="lib/svg-pan-zoom.min.js"></script>
<script type="text/javascript" src="lib/pako.min.js"></script>
<script type="text/javascript" src="lib/base64-binary.js"></script>

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -234,6 +234,11 @@ body {
src: url('fa-solid-900.ttf');
}
@font-face {
font-family: Typewriter;
src: url('blob_font_bold.ttf'), url('MonospaceTypewriter.ttf');
}
/* Background for s6 and s10 is not displayed by default */
#stars {
display: none;