Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
570d370c97 | |||
73552ad80f | |||
537902aa53 | |||
e033bfa5b3 |
9
package-lock.json
generated
9
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@designestate/dees-domtools",
|
||||
"version": "1.0.40",
|
||||
"version": "1.0.42",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@ -1548,10 +1548,9 @@
|
||||
}
|
||||
},
|
||||
"@pushrocks/smartdelay": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartdelay/-/smartdelay-2.0.6.tgz",
|
||||
"integrity": "sha512-4wUnzWNhRPODpaaL5GuRaje/C5dg+TMhBxmr57PKc2fqYpy6azWJwonf/s5xpcbJLCPJRbj1x8M5MqgCFq2uvg==",
|
||||
"dev": true,
|
||||
"version": "2.0.10",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartdelay/-/smartdelay-2.0.10.tgz",
|
||||
"integrity": "sha512-JOFpEfYiKnqcQYoUrL/jDyBDZUmlgJNm5U30MQQ3f+yci+rlFnMY5VvBBEYn5WgoX0ilwU+E15mtpDWhXcmhzg==",
|
||||
"requires": {
|
||||
"@pushrocks/smartpromise": "^3.0.6"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@designestate/dees-domtools",
|
||||
"version": "1.0.40",
|
||||
"version": "1.0.42",
|
||||
"private": false,
|
||||
"description": "tools to simplify complex css structures",
|
||||
"main": "dist_ts/index.js",
|
||||
@ -24,6 +24,7 @@
|
||||
"dependencies": {
|
||||
"@apiglobal/typedrequest": "^1.0.41",
|
||||
"@pushrocks/lik": "^4.0.17",
|
||||
"@pushrocks/smartdelay": "^2.0.10",
|
||||
"@pushrocks/smartpromise": "^3.0.6",
|
||||
"@pushrocks/smartrouter": "^1.0.4",
|
||||
"@pushrocks/smartstate": "^1.0.17",
|
||||
|
@ -4,6 +4,8 @@ import { FastMap } from '@pushrocks/lik/dist_ts/lik.fastmap';
|
||||
import { TViewport } from './domtools.breakpoints';
|
||||
|
||||
import { Scroller } from './domtools.classes.scroller';
|
||||
import { delayForRandom } from '@pushrocks/smartdelay';
|
||||
import { setupGlobalTheme } from './domtools.css.theme';
|
||||
|
||||
export interface IDomToolsState {
|
||||
virtualViewport: TViewport;
|
||||
@ -21,6 +23,10 @@ export class DomTools {
|
||||
if (!globalThis.deesDomTools) {
|
||||
globalThis.deesDomTools = new DomTools();
|
||||
domToolsInstance = globalThis.deesDomTools;
|
||||
|
||||
// lets setup theming
|
||||
setupGlobalTheme(domToolsInstance);
|
||||
|
||||
// lets make sure the dom is ready
|
||||
const readyStateChangedFunc = () => {
|
||||
if (document.readyState === 'interactive' || document.readyState === 'complete') {
|
||||
@ -70,6 +76,10 @@ export class DomTools {
|
||||
debug: false,
|
||||
});
|
||||
|
||||
public convenience = {
|
||||
smartdelay: plugins.smartdelay
|
||||
};
|
||||
|
||||
public scroller: plugins.SweetScroll;
|
||||
|
||||
private actionSetVirtualViewport = this.domToolsStatePart.createAction<TViewport>(
|
||||
|
27
ts/domtools.css.theme.ts
Normal file
27
ts/domtools.css.theme.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import { DomTools } from "./domtools.classes.domtools";
|
||||
|
||||
export const setupGlobalTheme = (domToolsInstance: DomTools) => {
|
||||
const styles = `
|
||||
/* width */
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
}
|
||||
|
||||
/* Track */
|
||||
::-webkit-scrollbar-track {
|
||||
background: #111;
|
||||
}
|
||||
|
||||
/* Handle */
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: #666;
|
||||
}
|
||||
|
||||
/* Handle on hover */
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #777;
|
||||
}
|
||||
`;
|
||||
|
||||
domToolsInstance.setGlobalStyles(styles);
|
||||
};
|
@ -4,13 +4,14 @@ import * as typedrequest from '@apiglobal/typedrequest';
|
||||
export { typedrequest };
|
||||
|
||||
// pushrocks scope
|
||||
import * as smartdelay from '@pushrocks/smartdelay';
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
import * as smartrouter from '@pushrocks/smartrouter';
|
||||
import * as smartstate from '@pushrocks/smartstate';
|
||||
import * as webrequest from '@pushrocks/webrequest';
|
||||
import * as websetup from '@pushrocks/websetup';
|
||||
|
||||
export { smartpromise, smartrouter, smartstate, webrequest, websetup };
|
||||
export { smartdelay, smartpromise, smartrouter, smartstate, webrequest, websetup };
|
||||
|
||||
// third party scope
|
||||
import SweetScroll from 'sweet-scroll';
|
||||
|
Reference in New Issue
Block a user