Skip to content

Commit

Permalink
Quantization
Browse files Browse the repository at this point in the history
  • Loading branch information
vipertechofficial committed Aug 2, 2024
1 parent b323e31 commit f05e324
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 237 deletions.
2 changes: 1 addition & 1 deletion client/chunk_10.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_12.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_15.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_16.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_20.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ var LOAD_FILES_USEFUL = ["/src/fonts/normative/index.css"].concat(["illusion.jpg
var LOAD_FILES_STATIC = ["sfx/md/hero_decorative-celebration-02", "sfx/md/navigation_selection-complete-celebration", "sfx/md/navigation_transition-left", "sfx/md/state-change_confirm-down", "sfx/md/ui_lock", "sfx/md/ui_unlock", "sfx/md/ui_scan", "sfx/md/alert_high-intensity", "sfx/md/navigation_transition-right", "voice/cn/accessing_memory", "voice/cn/complete", "voice/cn/please_wait", "voice/cn/data_upload", "voice/cn/processing", "voice/cn/enhanced", "voice/cn/rewriting_deep_layer_protocols", "voice/cn/vision_activated", "voice/cn/vision_deactivated", "voice/cn/filtering", "music/redeclipse/track_09"].map(F_SND).concat(["presentation", "tutorial", "create", "enhanced", "pixelated", "upload", "share1", "joke1", "create", "enhanced", "pixelated", "presentation", "presentation2", "sponsors", "tutorial", "upload", "labintro", "share2", "share3", "share4", "share5", "share6", "share7", "joke2", "joke3", "joke4", "joke5", "joke6", "joke7", "joke8", "joke9", "joke10", "joke11"].map(F_VID));

// Cache names
var REQUIRED_CACHE = "unless-update-cache-v1075-required";
var USEFUL_CACHE = "unless-update-cache-v1075-useful";
var STATIC_CACHE = "unless-update-cache-v1075-static";
var OTHER_CACHE = "unless-update-cache-v1075-other";
var REQUIRED_CACHE = "unless-update-cache-v1076-required";
var USEFUL_CACHE = "unless-update-cache-v1076-useful";
var STATIC_CACHE = "unless-update-cache-v1076-static";
var OTHER_CACHE = "unless-update-cache-v1076-other";

// Regular expressions for chunk matching
var MAIN_CHILD_CHUNK_REGEX = /chunk_(main_[a-z0-9]+)\.min\.js$/i;
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/canvaspixels/CanvasPixels.js
Original file line number Diff line number Diff line change
Expand Up @@ -2919,7 +2919,7 @@ class CanvasPixels extends React.PureComponent {
), intensity, false, false);
}

pxl_colors = colors.slice_uint32(0, length);
pxl_colors = colors.subarray_uint32(0, length);
return [pxls, pxl_colors, alpha, beta];
};

Expand Down
7 changes: 4 additions & 3 deletions src/js/components/canvaspixels/utils/SuperMasterMeta.js
Original file line number Diff line number Diff line change
Expand Up @@ -771,10 +771,11 @@ const SuperMasterMeta = {
_notify_position_change (position, date) {
"use strict";
date = date || Date.now();
const frametime = 30;
const _notified_position_at = meta.super_state.get_notified_pos_at() | 0;
const now = Date.now() | 0;

if (((now - _notified_position_at|0) >= 100 && date == null) || (date|0) > (_notified_position_at|0) && (now - date|0) >= 100) {
if (((now - _notified_position_at|0) >= frametime && date == null) || (date|0) > (_notified_position_at|0) && (now - date|0) >= frametime) {

position = {
x: typeof position.x == "undefined" ? -1 : position.x,
Expand All @@ -785,9 +786,9 @@ const SuperMasterMeta = {
meta.super_state.set_state({_notified_position_at: now}).then(function () {
notifiers.position(position, meta.sraf.get_state().previous_cpaf_fps);
});
} else if ((now|0) < (date + 100|0)) {
} else if ((now|0) < (date + frametime|0)) {

setTimeout(this._notify_position_change, 100-(date-now|0)|0, {x: position.x, y: position.y}, now|0);
setTimeout(this._notify_position_change, frametime-(date-now|0)|0, {x: position.x, y: position.y}, now|0);
}
},
_handle_canvas_mouse_up() {
Expand Down
33 changes: 16 additions & 17 deletions src/js/pages/Pixel.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import FileImportIcon from "../icons/FileImport";
window.mobileAndTabletCheck = function() {
let check = false;
(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);
return check;
};

import {UJS} from "../utils/ujs";
import JSLoader from "../utils/JSLoader";
let is_mobile_or_tablet = window.mobileAndTabletCheck();
import React, { Suspense } from "react";
import JOYSON from "joyson";
import dispatcher from "../dispatcher";
Expand Down Expand Up @@ -644,6 +637,7 @@ class Pixel extends React.PureComponent {
constructor(props) {
super(props);
this.st4te = {
is_mobile_or_tablet: Boolean((/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(navigator.userAgent||navigator.vendor||window.opera)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent||navigator.vendor||window.opera.substr(0,4)))),
classes: props.classes,
load_with: props.load_with + "",
_history: HISTORY,
Expand Down Expand Up @@ -673,8 +667,6 @@ class Pixel extends React.PureComponent {
_slider_value_width: 192,
_slider_value_height: 96,
_game_ended: false,
_tool: is_mobile_or_tablet ? "MOVE": "PENCIL",
_memory_tool: is_mobile_or_tablet ? "MOVE": "PENCIL",
_previous_tool_timestamp: 1/0,
_select_mode: "REPLACE",
_pencil_mirror_mode: "NONE",
Expand Down Expand Up @@ -716,8 +708,13 @@ class Pixel extends React.PureComponent {
_time_ago_initiated: false,
_fps_el: {},
_xy_el: {},
_settings: JOYSON.unpack(props.settings)
_settings: JOYSON.unpack(props.settings),
_tool: "MOVE",
_memory_tool: "MOVE"
};

this.st4te._tool = this.st4te.is_mobile_or_tablet ? "MOVE": "PENCIL";
this.st4te._memory_tool = this.st4te.is_mobile_or_tablet ? "MOVE": "PENCIL";
this.sraf = Object.create(SmartRequestAnimationFrame).init();
};

Expand Down Expand Up @@ -902,9 +899,9 @@ class Pixel extends React.PureComponent {

actions.trigger_voice("data_upload");

const max_original_size = is_mobile_or_tablet ? Math.sqrt(1280 * 720): Math.sqrt(1920 * 1080);
const max_size = is_mobile_or_tablet ? Math.sqrt(512 * 512): Math.sqrt(512 * 512);
let min_size = is_mobile_or_tablet ? 512: 1024;
const max_original_size = this.st4te.is_mobile_or_tablet ? Math.sqrt(1280 * 720): Math.sqrt(1920 * 1080);
const max_size = this.st4te.is_mobile_or_tablet ? Math.sqrt(512 * 512): Math.sqrt(512 * 512);
let min_size = this.st4te.is_mobile_or_tablet ? 512: 1024;
const resize_original_to = parseInt(max_original_size * max_original_size);
const resize_to_before = Math.min(parseInt(max_size * max_size), Math.max(parseInt(_import_size * _import_size), parseInt(min_size * min_size)));
const resize_to_finally = Math.min(parseInt(max_size * max_size), parseInt(_import_size * _import_size));
Expand Down Expand Up @@ -1899,9 +1896,9 @@ class Pixel extends React.PureComponent {
const { _import_colorize, _import_size } = this.st4te;
const { set_canvas_from_image } = this.st4te._canvas;

const max_original_size = is_mobile_or_tablet ? Math.sqrt(540 * 720) : Math.sqrt(720 * 1080);
const max_size = is_mobile_or_tablet ? Math.sqrt(512 * 512) : Math.sqrt(512 * 512);
let min_size = is_mobile_or_tablet ? 512 : 1024;
const max_original_size = this.st4te.is_mobile_or_tablet ? Math.sqrt(540 * 720) : Math.sqrt(720 * 1080);
const max_size = this.st4te.is_mobile_or_tablet ? Math.sqrt(512 * 512) : Math.sqrt(512 * 512);
let min_size = this.st4te.is_mobile_or_tablet ? 512 : 1024;
const resize_original_to = parseInt(max_original_size * max_original_size);
const resize_to_before = Math.min(parseInt(max_size * max_size), Math.max(parseInt(_import_size * _import_size), parseInt(min_size * min_size)));
const resize_to_finally = Math.min(parseInt(max_size * max_size), parseInt(_import_size * _import_size));
Expand Down Expand Up @@ -2854,6 +2851,7 @@ class Pixel extends React.PureComponent {
_less_than_1280w,
_slider_value_width,
_slider_value_height,
is_mobile_or_tablet
} = this.st4te;

_menu_data.pos_x = _menu_data.pos_x === -1 ? "out": _menu_data.pos_x;
Expand Down Expand Up @@ -3141,7 +3139,8 @@ class Pixel extends React.PureComponent {
_time_ago_initiated,
_settings,
_text_dialog_open,
_drag_file
_drag_file,
is_mobile_or_tablet
} = this.st4te;

_menu_data.pos_x = _menu_data.pos_x === -1 ? "out": _menu_data.pos_x;
Expand Down
Loading

0 comments on commit f05e324

Please sign in to comment.