@shulya/liquid-glass 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/dist/core.cjs +17 -10
- package/dist/core.mjs +17 -10
- package/package.json +2 -11
- package/example/README.md +0 -37
- package/example/index.html +0 -15
- package/example/package.json +0 -27
- package/example/src/App.jsx +0 -353
- package/example/src/main.jsx +0 -10
- package/example/src/styles.css +0 -155
- package/example/vite.config.js +0 -22
- package/screen.png +0 -0
- package/src/angular.js +0 -76
- package/src/core.js +0 -1119
- package/src/index.js +0 -15
- package/src/react.js +0 -106
- package/src/solid.js +0 -80
- package/src/svelte.js +0 -27
- package/src/tables.js +0 -14
- package/src/vue.js +0 -92
- package/tables/optical_calibration_matrix.csv +0 -257
- package/tables/optical_calibration_matrix.xlsx +0 -0
package/example/src/styles.css
DELETED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
*,
|
|
2
|
-
*::before,
|
|
3
|
-
*::after {
|
|
4
|
-
box-sizing: border-box;
|
|
5
|
-
margin: 0;
|
|
6
|
-
padding: 0;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
html,
|
|
10
|
-
body,
|
|
11
|
-
#root {
|
|
12
|
-
width: 100%;
|
|
13
|
-
height: 100%;
|
|
14
|
-
overflow: hidden;
|
|
15
|
-
background: #ebedf2;
|
|
16
|
-
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif;
|
|
17
|
-
user-select: none;
|
|
18
|
-
-webkit-user-select: none;
|
|
19
|
-
touch-action: none;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.stage-canvas {
|
|
23
|
-
position: fixed;
|
|
24
|
-
inset: 0;
|
|
25
|
-
width: 100vw;
|
|
26
|
-
height: 100vh;
|
|
27
|
-
display: block;
|
|
28
|
-
z-index: 1;
|
|
29
|
-
pointer-events: none;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/* Interactive Draggable LiquidGlass Elements */
|
|
33
|
-
.glass-body {
|
|
34
|
-
position: fixed;
|
|
35
|
-
top: 0;
|
|
36
|
-
left: 0;
|
|
37
|
-
z-index: 20;
|
|
38
|
-
cursor: grab;
|
|
39
|
-
touch-action: none;
|
|
40
|
-
will-change: left, top;
|
|
41
|
-
box-shadow: 2px 10px 18px rgba(0, 0, 0, 0.12);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.glass-body:active {
|
|
45
|
-
cursor: grabbing;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/* Bottom Control Shelf */
|
|
49
|
-
.shelf-bar {
|
|
50
|
-
position: fixed;
|
|
51
|
-
bottom: 20px;
|
|
52
|
-
left: 50%;
|
|
53
|
-
transform: translateX(-50%);
|
|
54
|
-
z-index: 60;
|
|
55
|
-
display: flex;
|
|
56
|
-
align-items: center;
|
|
57
|
-
gap: 18px;
|
|
58
|
-
padding: 10px 20px;
|
|
59
|
-
border-radius: 999px;
|
|
60
|
-
background: rgba(255, 255, 255, 0.8);
|
|
61
|
-
backdrop-filter: blur(20px) saturate(180%);
|
|
62
|
-
-webkit-backdrop-filter: blur(20px) saturate(180%);
|
|
63
|
-
border: 1px solid rgba(255, 255, 255, 0.9);
|
|
64
|
-
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07), 0 2px 6px rgba(0, 0, 0, 0.03);
|
|
65
|
-
color: #1c1c1e;
|
|
66
|
-
flex-wrap: wrap;
|
|
67
|
-
justify-content: center;
|
|
68
|
-
max-width: 95vw;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.ctrl {
|
|
72
|
-
display: flex;
|
|
73
|
-
flex-direction: column;
|
|
74
|
-
gap: 4px;
|
|
75
|
-
min-width: 110px;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.ctrl-head {
|
|
79
|
-
display: flex;
|
|
80
|
-
justify-content: space-between;
|
|
81
|
-
font-size: 10.5px;
|
|
82
|
-
font-weight: 600;
|
|
83
|
-
color: #636366;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.ctrl-val {
|
|
87
|
-
color: #007aff;
|
|
88
|
-
font-variant-numeric: tabular-nums;
|
|
89
|
-
font-weight: 700;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
input[type="range"] {
|
|
93
|
-
-webkit-appearance: none;
|
|
94
|
-
appearance: none;
|
|
95
|
-
width: 100%;
|
|
96
|
-
height: 4px;
|
|
97
|
-
border-radius: 999px;
|
|
98
|
-
background: rgba(0, 0, 0, 0.1);
|
|
99
|
-
outline: none;
|
|
100
|
-
cursor: pointer;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
input[type="range"]::-webkit-slider-thumb {
|
|
104
|
-
-webkit-appearance: none;
|
|
105
|
-
appearance: none;
|
|
106
|
-
width: 14px;
|
|
107
|
-
height: 14px;
|
|
108
|
-
border-radius: 50%;
|
|
109
|
-
background: #ffffff;
|
|
110
|
-
border: 1.5px solid rgba(0, 122, 255, 0.6);
|
|
111
|
-
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.ctrl-toggle {
|
|
115
|
-
display: flex;
|
|
116
|
-
align-items: center;
|
|
117
|
-
gap: 6px;
|
|
118
|
-
font-size: 11px;
|
|
119
|
-
font-weight: 600;
|
|
120
|
-
color: #3a3a3c;
|
|
121
|
-
cursor: pointer;
|
|
122
|
-
padding: 4px 10px;
|
|
123
|
-
border-radius: 999px;
|
|
124
|
-
background: rgba(0, 0, 0, 0.04);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.ctrl-toggle input {
|
|
128
|
-
accent-color: #007aff;
|
|
129
|
-
width: 13px;
|
|
130
|
-
height: 13px;
|
|
131
|
-
cursor: pointer;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.fps-tag {
|
|
135
|
-
font-size: 10.5px;
|
|
136
|
-
font-weight: 700;
|
|
137
|
-
color: #30d158;
|
|
138
|
-
background: rgba(48, 209, 88, 0.12);
|
|
139
|
-
padding: 4px 10px;
|
|
140
|
-
border-radius: 999px;
|
|
141
|
-
font-variant-numeric: tabular-nums;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
@media (max-width: 720px) {
|
|
145
|
-
.shelf-bar {
|
|
146
|
-
gap: 10px;
|
|
147
|
-
padding: 10px 14px;
|
|
148
|
-
border-radius: 20px;
|
|
149
|
-
bottom: 12px;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.ctrl {
|
|
153
|
-
min-width: 96px;
|
|
154
|
-
}
|
|
155
|
-
}
|
package/example/vite.config.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite';
|
|
2
|
-
import react from '@vitejs/plugin-react';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
|
-
|
|
6
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
-
|
|
8
|
-
export default defineConfig({
|
|
9
|
-
plugins: [react()],
|
|
10
|
-
resolve: {
|
|
11
|
-
alias: {
|
|
12
|
-
'@shulya/liquid-glass/react': path.resolve(__dirname, '../dist/react.mjs'),
|
|
13
|
-
'@shulya/liquid-glass': path.resolve(__dirname, '../dist/index.mjs'),
|
|
14
|
-
'liquid-glass-ui/react': path.resolve(__dirname, '../dist/react.mjs'),
|
|
15
|
-
'liquid-glass-ui': path.resolve(__dirname, '../dist/index.mjs')
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
server: {
|
|
19
|
-
port: 5173,
|
|
20
|
-
open: false
|
|
21
|
-
}
|
|
22
|
-
});
|
package/screen.png
DELETED
|
Binary file
|
package/src/angular.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Angular Adapter for Liquid Glass UI
|
|
3
|
-
*/
|
|
4
|
-
import { LiquidGlassController, OPTICAL_DEFAULTS, OPTICAL_LIMITS } from './core.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Framework-agnostic Angular Directive Controller Class
|
|
8
|
-
* Can be used directly with Angular's @Directive({ selector: '[liquidGlass]', standalone: true })
|
|
9
|
-
* or instantiated via ElementRef in any Angular component.
|
|
10
|
-
*/
|
|
11
|
-
export class LiquidGlassDirective {
|
|
12
|
-
/**
|
|
13
|
-
* @param {{ nativeElement: HTMLElement } | HTMLElement} elementRef
|
|
14
|
-
*/
|
|
15
|
-
constructor(elementRef) {
|
|
16
|
-
this.el = elementRef && elementRef.nativeElement ? elementRef.nativeElement : elementRef;
|
|
17
|
-
this.rim = OPTICAL_DEFAULTS.rim;
|
|
18
|
-
this.ior = OPTICAL_DEFAULTS.ior;
|
|
19
|
-
this.height = OPTICAL_DEFAULTS.height;
|
|
20
|
-
this.frosted = OPTICAL_DEFAULTS.frosted;
|
|
21
|
-
this.fusion = OPTICAL_DEFAULTS.fusion;
|
|
22
|
-
this.borderRadius = null;
|
|
23
|
-
this.liquidGlass = null;
|
|
24
|
-
this._controller = null;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
ngOnInit() {
|
|
28
|
-
const opts =
|
|
29
|
-
typeof this.liquidGlass === 'object' && this.liquidGlass !== null
|
|
30
|
-
? this.liquidGlass
|
|
31
|
-
: {
|
|
32
|
-
rim: this.rim,
|
|
33
|
-
ior: this.ior,
|
|
34
|
-
height: this.height,
|
|
35
|
-
frosted: this.frosted,
|
|
36
|
-
fusion: this.fusion,
|
|
37
|
-
borderRadius: this.borderRadius
|
|
38
|
-
};
|
|
39
|
-
this._controller = new LiquidGlassController(this.el, opts);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
ngOnChanges() {
|
|
43
|
-
if (this._controller) {
|
|
44
|
-
const opts =
|
|
45
|
-
typeof this.liquidGlass === 'object' && this.liquidGlass !== null
|
|
46
|
-
? this.liquidGlass
|
|
47
|
-
: {
|
|
48
|
-
rim: this.rim,
|
|
49
|
-
ior: this.ior,
|
|
50
|
-
height: this.height,
|
|
51
|
-
frosted: this.frosted,
|
|
52
|
-
fusion: this.fusion,
|
|
53
|
-
borderRadius: this.borderRadius
|
|
54
|
-
};
|
|
55
|
-
this._controller.update(opts);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
ngOnDestroy() {
|
|
60
|
-
if (this._controller) {
|
|
61
|
-
this._controller.destroy();
|
|
62
|
-
this._controller = null;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Helper to attach LiquidGlass directly inside Angular ngAfterViewInit
|
|
69
|
-
*/
|
|
70
|
-
export function attachAngularLiquidGlass(elementRef, options = {}) {
|
|
71
|
-
const el = elementRef && elementRef.nativeElement ? elementRef.nativeElement : elementRef;
|
|
72
|
-
return new LiquidGlassController(el, options);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export { LiquidGlassController, OPTICAL_DEFAULTS, OPTICAL_LIMITS };
|
|
76
|
-
export default LiquidGlassDirective;
|