this.me 2.8.4 β†’ 2.8.5

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 CHANGED
@@ -1,66 +1,64 @@
1
1
  # This.Me
2
- <img src="./cleak_me-removebg.png" alt="SVG Image" style="width:89px;">
3
- <img src="./this.me.png" alt="SVG Image" style="width:89px;">
2
+ <img src="./docs/cleak_me-removebg.png" alt="SVG Image" style="width:89px;">
3
+ <img src="./docs/this.me.png" alt="SVG Image" style="width:89px;">
4
4
 
5
- **This.Me** defines a digital identity through a cryptographic lens. Each user is equipped with a unique **'Me'** identity, secured by public-private key cryptography, enabling robust autonomous identity verification and transactional security.
5
+ **This.Me** is a class focused on encapsulating user identity, specifically crafted to facilitate the creation of instances ready for hashing and cryptographic signature generation. It opens the door to coding and decoding through "me" signatures, offering a modular framework that prioritizes privacy and integrity in application-wide identity management.
6
6
 
7
- **This.Me** incorporates hashing for unimpeachable data integrity and digital signatures for undeniable authenticity. Users gain unparalleled control over their digital footprint, marking a shift towards a user-centric model of data management.
8
7
 
9
- In essence, **This.Me** grants users a self-sovereign digital identity, fully within their control and independent from external entities.
10
8
 
11
- ### CLI Usage:
12
- Install globally to use `this.me` as a CLI tool:
9
+ 1. **Install `this.me`:**
10
+ Open your terminal and run the following command to install the `this.me` package:
13
11
 
14
- ```js
15
- npm install -g this.me
16
- ```
12
+ ```js
13
+ npm install this.me
14
+ ```
17
15
 
18
- Then, interact with `this.me` directly from your command line.
16
+ 2. **Import `Me` in Your Project:**
17
+ In the JavaScript file where you want to use `this.me`, import the `Me` class.
19
18
 
19
+ ```js
20
+ import Me from 'this.me';
21
+ ```
20
22
 
21
- ### Usage in Node.js:
23
+ 3. **Create an Instance of `Me`:**
24
+ Instantiate the `Me` class with the required user details.
22
25
 
23
- ## Installation
26
+ ```js
27
+ const user = new Me('John', 'Doe', '1990-01-01', 'password123', '1234');
28
+ ```
24
29
 
25
- ```bash
26
- npm install this.me
27
- ```
30
+ 4. **Validate and Use the Instance:**
31
+ Utilize the instance for user data validation and preparation for cryptographic actions.
28
32
 
29
- ```js
30
- const ThisMe = require('this.me');
31
- // Create a new user identity
32
- const user = new ThisMe('John', 'Doe', '1990-01-01', 'mypassword123', '1234');
33
- // Retrieve the user's identity object
34
- const identityObject = user.getIdentityObject();
35
- ```
33
+ ```js
34
+ try {
35
+ const identity = user.getMe();
36
+ // Ready for hashing and cryptographic signatures
37
+ } catch (error) {
38
+ console.error(error.message);
39
+ // Error handling for missing fields
40
+ }
41
+ ```
36
42
 
37
- ## Core Principles
43
+ This quick start guide provides a straightforward path to incorporating `this.me` into your project, enabling you to manage user identities and prepare them for secure cryptographic processes efficiently.
38
44
 
39
- - The `Me` class encapsulates personal information:
45
+ -----
40
46
 
41
- name,
42
- last name,
43
- birthday,
44
- password,
45
- PIN
47
+ # What is All.This?
48
+ **This.me** serves as the **identity representation** in our system.
46
49
 
47
- This serves as the identity representation in our system.
50
+ The `[all.this](https://www.neurons.me/what-is-all-this)` collection of packages, along with the proposed `cleaker` functionality, is an approach to create a modular system where each module (like `this.text`, `this.video`, `this.img`, etc.) (all.this family) represents a distinct data structure or class. These modules, when combined with `cleaker`, generate unique **public and private key pairs**, essentially giving each instance its cryptographic identity.
48
51
 
49
- The `all.this` collection of packages, along with the proposed `cleaker` functionality, is an approach to create a modular system where each module (like `this.text`, `this.video`, `this.img`, etc.) (all.this family) represents a distinct data structure or class. These modules, when combined with `cleaker`, generate unique **public and private key pairs**, essentially giving each instance its cryptographic identity.
50
-
51
- ### Hashing and Digital Signatures
52
-
53
- **This.Me** leverages hashing to protect data integrity, with each transaction generating a unique, tamper-proof hash. Digital signatures, created using private keys, provide a layer of authenticity and non-repudiation, linking data unmistakably to its owner.
54
52
 
55
53
  ## Contextual Environment
56
-
57
54
  **This.Me** adapts to various environments, enabling `.me` objects to function both locally and within a network. A `.me` object authenticated on a network accesses data beyond the local scope, while unauthenticated instances are confined to local data. This dual functionality ensures seamless interoperability and heightened security.
58
55
 
59
56
  ## Setting up your Context. πŸ‘‹πŸ»πŸ‘‹πŸΌπŸ‘‹πŸ½πŸ‘‹πŸΎπŸ‘‹πŸΏ
60
-
61
57
  Defining the **environment** and context in which your code runs, especially when you're interacting with intelligent agents or services likeΒ **me.**
62
58
 
63
59
  Having a clear declaration of the environment and the context can have a series of implications for security, interoperability, and clarity. The codebase is often vast, dynamic, and continually evolving. Given the dynamic nature of such environments, ensuring the integrity of the code and data becomes paramount. You wouldn't want an agent to execute or rely on code that has been tampered with or is different from the expected version. This is where hashing comes into play.
64
60
 
65
61
  `.me` objects to serve as both a local identity on the user's host machine and as an identity within a larger network. When a `.me` object is authenticated on a network, it can access data not only on the local host but also from other nodes within that network. Conversely, if it's not authenticated or recognized by the network, it should only access local data.
66
62
 
63
+
64
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "this.me",
3
- "version": "2.8.4",
3
+ "version": "2.8.5",
4
4
  "description": "User-Centric.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -24,6 +24,7 @@
24
24
  "author": "suiGn",
25
25
  "license": "MIT",
26
26
  "repoType": "NPM Package",
27
+ "category": "dataformatter",
27
28
  "dependencies": {
28
29
  "commander": "^11.1.0",
29
30
  "inquirer": "^9.2.12"
package/src/me.html CHANGED
@@ -1,8 +1,390 @@
1
- <html>
2
- <head>
3
- <title>.me</title>
4
- </head>
5
- <body>
6
- Hello, me!
7
- </body>
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Neurons Gateway</title>
7
+ <style>
8
+ body, html {
9
+ height: 100%;
10
+ margin: 0;
11
+ font-family: Arial, sans-serif;
12
+ background: #e8e8e8;
13
+ display: flex;
14
+ justify-content: center;
15
+ align-items: center;
16
+ text-align: center;
17
+ }
18
+ .circle-container {
19
+ position: relative;
20
+ }
21
+ .button-circle {
22
+ border: none;
23
+ outline: none;
24
+ width: 300px;
25
+ height: 300px;
26
+ border-radius: 50%;
27
+ background: linear-gradient(145deg, #cacaca, #f0f0f0);
28
+ box-shadow: 20px 20px 60px #bebebe,
29
+ -20px -20px 60px #ffffff;
30
+ font-size: 5rem;
31
+ color: #555;
32
+ display: flex;
33
+ justify-content: center;
34
+ align-items: center;
35
+ cursor: pointer;
36
+ transition: background 0.3s ease-in-out;
37
+ position: relative; /* Needed for absolute positioning of child elements */
38
+ }
39
+ .button-circle:hover {
40
+ background: linear-gradient(145deg, #f0f0f0, #cacaca);
41
+ }
42
+ .button-circle:active {
43
+ background: #e0e0e0;
44
+ }
45
+ .plus-icon {
46
+ position: absolute;
47
+ top: -10px; /* Adjust to position the plus icon */
48
+ right: -10px; /* Adjust to position the plus icon */
49
+ width: 40px; /* Size of the plus icon */
50
+ height: 40px; /* Size of the plus icon */
51
+ background: #555;
52
+ color: white;
53
+ display: flex;
54
+ justify-content: center;
55
+ align-items: center;
56
+ border-radius: 50%;
57
+ font-size: 2rem;
58
+ cursor: pointer;
59
+ }
60
+ .plus-icon:before {
61
+ content: '+';
62
+ font-weight: bold;
63
+ }
64
+
65
+ /* The Modal (background) */
66
+ .modal-overlay {
67
+ display: none; /* Hidden by default */
68
+ position: fixed; /* Stay in place */
69
+ z-index: 2; /* Sit on top */
70
+ left: 0;
71
+ top: 0;
72
+ width: 100%; /* Full width */
73
+ height: 100%; /* Full height */
74
+ display: flex;
75
+ justify-content: center;
76
+ align-items: center;
77
+ background-color: transparent; /* No background color */
78
+ }
79
+
80
+ .modal-content {
81
+ background-color: #ffffff;
82
+ margin: auto; /* Centered in the viewport */
83
+ padding: 1rem 1rem;
84
+ border-radius: 8px; /* Rounded corners */
85
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
86
+ width: 20%; /* More compact width */
87
+ position: relative; /* For absolute positioning of children */
88
+ transform: translate(-50%, -50%);
89
+ top: 50%;
90
+ left: 50%;
91
+ text-align: left; /* Align text to the left */
92
+ }
93
+
94
+ .close-button {
95
+ color: #000000;
96
+ position: absolute;
97
+ top: 0.5rem;
98
+ right: 0.5rem;
99
+ font-size: 24px;
100
+ font-weight: bold;
101
+ }
102
+
103
+ .close-button:hover,
104
+ .close-button:focus {
105
+ color: #555;
106
+ text-decoration: none;
107
+ cursor: pointer;
108
+ }
109
+
110
+ .form-group {
111
+ margin-bottom: 0.5rem;
112
+ }
113
+
114
+ .form-group label {
115
+ display: block;
116
+ margin-bottom: 0.25rem; /* Less space between label and input */
117
+ color: #333;
118
+ font-weight: 600;
119
+ }
120
+
121
+ .form-group input {
122
+ width: 100%;
123
+ padding: 0.4rem; /* Less padding for a more compact look */
124
+ border: 1px solid #ccc;
125
+ border-radius: 4px; /* Slightly less rounded corners for a sharper look */
126
+ }
127
+
128
+ .form-group button {
129
+ width: 100%;
130
+ padding: 0.5rem;
131
+ background: #03354e; /* Updated button color */
132
+ color: white;
133
+ border: none;
134
+ border-radius: 4px; /* Consistent with input fields */
135
+ cursor: pointer;
136
+ font-weight: 600;
137
+ margin-top: 0.5rem; /* Added margin for spacing */
138
+ }
139
+
140
+ .form-group button:hover {
141
+ background-color: #36A166; /* Darker shade on hover */
142
+ }
143
+
144
+ .form-container {
145
+ display: flex;
146
+ justify-content: center;
147
+ align-items: center;
148
+ text-align: center;
149
+ border-radius: 50%; /* Make it circular */
150
+ overflow: hidden; /* Ensure contents respect the circle shape */
151
+ background: white; /* Match your circle background */
152
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Add some shadow if you like */
153
+ }
154
+
155
+ /* Style the form inside the expanded circle */
156
+ .circle-form {
157
+ display: flex;
158
+ flex-direction: column;
159
+ width: 80%; /* Set a max width for the form */
160
+ margin: auto; /* Center the form */
161
+ }
162
+
163
+ .circle-form input,
164
+ .circle-form button {
165
+ margin: 10px;
166
+ padding: 10px;
167
+ width: 80%; /* Adjust width to not touch the border */
168
+ border: 1px solid #ccc;
169
+ border-radius: 20px; /* Rounded corners */
170
+ }
171
+ /* Add styles for the content inside the small circle */
172
+ .circle-content {
173
+ display: flex;
174
+ justify-content: center;
175
+ align-items: center;
176
+ height: 100%;
177
+ }
178
+
179
+ .circle-form button {
180
+ background: #03354e; /* Updated button color */
181
+ color: white;
182
+ border: none;
183
+ cursor: pointer;
184
+ font-weight: 600;
185
+ }
186
+
187
+ /* When collapsed, you want the small-circle to go back to original size */
188
+ .small-circle:not(.expanded-circle) {
189
+ transition: transform 0.5s ease-in-out, z-index 0s, width 0.5s, height 0.5s;
190
+ }
191
+
192
+ /* small circle */
193
+ .small-circle {
194
+ position: absolute;
195
+ bottom: -15px; /* Adjust to stick to the circumference */
196
+ right: -15px; /* Adjust to stick to the circumference */
197
+ width: 80px; /* Size of the small circle */
198
+ height: 80px; /* Size of the small circle */
199
+ border-radius: 50%;
200
+ background: #FFF;
201
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
202
+ display: flex;
203
+ justify-content: center;
204
+ align-items: center;
205
+ font-size: 1rem;
206
+ color: #555;
207
+ cursor: pointer;
208
+ transform-origin: center; /* Ensures scaling is centered */
209
+ z-index: 10; /* Ensure it's above other content but below the modal overlay */
210
+ transition: transform 0.3s ease, width 0.3s ease, height 0.3s ease;
211
+ overflow: hidden; /* Hide the overflow during transition */
212
+ }
213
+
214
+
215
+ /* Style adjustments for the hover effect on the small circle */
216
+ .small-circle:hover {
217
+ background: #f2f2f2;
218
+ }
219
+
220
+ .expanded-circle {
221
+ position: fixed;
222
+ top: 50%;
223
+ left: 50%;
224
+ width: 300px;
225
+ height: 300px;
226
+ border-radius: 150px; /* Half of width and height to maintain circle shape */
227
+ z-index: 20; /* Above small-circle z-index */
228
+ /* Rest of your styles */
229
+ }
230
+ /* Overlay to close the expanded circle */
231
+ .circle-overlay {
232
+ display: none;
233
+ position: fixed;
234
+ z-index: 15; /* Between the small circle and the expanded circle */
235
+ top: 0;
236
+ left: 0;
237
+ width: 100%;
238
+ height: 100%;
239
+ background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
240
+ }
241
+
242
+ /* Define a CSS class for the expanded state */
243
+ .small-circle.expanded {
244
+ width: 300px; /* New width for the expanded state */
245
+ height: 300px; /* New height for the expanded state */
246
+ border-radius: 50%;
247
+ position: absolute;
248
+ transform: translate(-50%, -50%) scale(1); /* Adjust the scale as needed */
249
+ top: 50%; /* Center vertically */
250
+ left: 50%; /* Center horizontally */
251
+ }
252
+
253
+ /* Adjustments for smaller screens */
254
+ @media (max-width: 768px) {
255
+ .button-circle {
256
+ width: 200px;
257
+ height: 200px;
258
+ font-size: 3rem;
259
+ }
260
+ .plus-icon {
261
+ width: 30px;
262
+ height: 30px;
263
+ font-size: 1.5rem;
264
+ }
265
+ .modal-content {
266
+ width: 90%;
267
+ }
268
+
269
+ }
270
+
271
+ </style>
272
+ </head>
273
+ <body>
274
+ <div class="circle-container">
275
+ <button class="button-circle">.me</button>
276
+ <div class="plus-icon" onclick="showModal('modal_add_me')"></div>
277
+ <div class="small-circle" id="001">.me</div> <!-- Small circle -->
278
+ <div class="small-circle" id="002">.me</div> <!-- Small circle -->
279
+ <div class="small-circle" id="004" onclick="toggleCircle(this)">
280
+ <div class="circle-content">.me</div>
281
+ </div>
282
+ </div>
283
+
284
+ <div id="modal_add_me" class="modal-overlay" style="display:none;">
285
+ <div class="modal-content">
286
+ <span class="close-button" onclick="closeModal('modal_add_me')">&times;</span>
287
+ <h2>Add .me</h2>
288
+ <form id="loginForm">
289
+ <div class="form-group">
290
+ <input type="text" id="username" name="username" placeholder="Username" required>
291
+ </div>
292
+ <div class="form-group">
293
+ <input type="password" id="password" name="password" placeholder="Password" required>
294
+ </div>
295
+ <div class="form-group">
296
+ <input type="text" inputmode="numeric" pattern="[0-9]*" id="pin" name="pin" placeholder="PIN" required>
297
+ </div>
298
+ <div class="form-group">
299
+ <button type="submit">Submit</button>
300
+ </div>
301
+ </form>
302
+ </div>
303
+ </div>
304
+
305
+ <script>
306
+
307
+ // Add the overlay to the HTML
308
+ document.body.insertAdjacentHTML('beforeend', '<div class="circle-overlay" onclick="collapseAllCircles()"></div>');
309
+ // Function to collapse all circles when overlay is clicked
310
+ function collapseAllCircles() {
311
+ document.querySelectorAll('.small-circle.expanded-circle').forEach(collapseCircle);
312
+ hideOverlay();
313
+ }
314
+
315
+ // MODALS
316
+ function showModal(modalID) {
317
+ document.getElementById(modalID).style.display = "block";
318
+ }
319
+
320
+ function closeModal(modalID) {
321
+ document.getElementById(modalID).style.display = "none";
322
+ }
323
+
324
+ // When the User Clicks Anywhere in the Window.
325
+ window.onclick = function(event) {
326
+ var modal = document.getElementById('modal_add_me');
327
+ if (event.target == modal) {
328
+ closeModal();
329
+ }
330
+ }
331
+ // Add event listener for form submission
332
+ document.getElementById('loginForm').addEventListener('submit', function(event) {
333
+ event.preventDefault(); // Prevent the default form submit action
334
+ // Collect the form data
335
+ var username = document.getElementById('username').value;
336
+ var password = document.getElementById('password').value;
337
+ var pin = document.getElementById('pin').value;
338
+ // TODO: Implement your logic to handle the login data, like sending it to a server
339
+ console.log('Form Submitted!', { username, password, pin });
340
+ // Optionally close the modal after form submission
341
+ closeModal();
342
+ });
343
+
344
+ // Function to position small circles
345
+ function positionSmallCircles() {
346
+ const bigCircle = document.querySelector('.button-circle');
347
+ const radius = bigCircle.offsetWidth / 2; // Radius of the big circle
348
+ const smallCircles = document.querySelectorAll('.small-circle');
349
+ smallCircles.forEach((circle, index) => {
350
+ const total = smallCircles.length;
351
+ const angle = (index / total) * (2 * Math.PI); // Angle in radians
352
+ const circleRadius = circle.offsetWidth / 2; // Radius of the small circle
353
+ // Cartesian coordinates
354
+ const x = radius + radius * Math.cos(angle) - circleRadius;
355
+ const y = radius + radius * Math.sin(angle) - circleRadius;
356
+ // Apply the position
357
+ circle.style.right = 'auto';
358
+ circle.style.bottom = 'auto';
359
+ circle.style.left = `${x}px`;
360
+ circle.style.top = `${y}px`;
361
+ });
362
+ }
363
+
364
+
365
+ // Function to toggle the expanded state of the circle
366
+ function toggleCircle(circle) {
367
+ var isExpanded = circle.classList.contains('expanded');
368
+ if (isExpanded) {
369
+ // Collapse the circle
370
+ circle.classList.remove('expanded');
371
+ circle.innerHTML = '<div class="circle-content">.me</div>';
372
+ } else {
373
+ // Expand the circle
374
+ circle.classList.add('expanded');
375
+ circle.innerHTML = `
376
+ <form class="circle-form" onsubmit="submitForm(event, this)">
377
+ <input type="text" id="username" placeholder="Username" required />
378
+ <input type="password" id="password" placeholder="Password" required />
379
+ <input type="text" id="pin" placeholder="PIN" required />
380
+ <button type="submit">Submit</button>
381
+ </form>
382
+ `;
383
+ }
384
+ }
385
+
386
+ // Call this function on load to position small circles correctly
387
+ positionSmallCircles();
388
+ </script>
389
+ </body>
8
390
  </html>
package/nino.js DELETED
@@ -1,2 +0,0 @@
1
-
2
-
@@ -1,31 +0,0 @@
1
- /**
2
- * Filters and displays images based on the user's search input.
3
- * It searches through the filenames of the images in each gallery.
4
- * The function is case-insensitive and matches any part of the filename.
5
- *
6
- * @example
7
- * // Assuming there's an input field with id 'searchInput' and images in galleries.
8
- * // User types 'example' in the search input.
9
- * searchImages();
10
- * // Images with 'example' in their filenames will be displayed.
11
- */
12
- function searchImages() {
13
- var input, filter, gallery, img, src, i;
14
- input = document.getElementById("searchInput");
15
- filter = input.value.toUpperCase();
16
- gallery = document.getElementsByClassName("gallery");
17
-
18
- for (var g = 0; g < gallery.length; g++) {
19
- img = gallery[g].getElementsByTagName("img");
20
-
21
- for (i = 0; i < img.length; i++) {
22
- src = img[i].src;
23
- var fileName = src.substring(src.lastIndexOf('/') + 1);
24
- if (fileName.toUpperCase().indexOf(filter) > -1) {
25
- img[i].style.display = "";
26
- } else {
27
- img[i].style.display = "none";
28
- }
29
- }
30
- }
31
- }