slicejs-web-framework 1.0.19 → 1.0.21
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/Slice/Components/Structural/Debugger/Debugger.js +3 -3
- package/Slice/Slice.js +2 -1
- package/package.json +1 -1
- package/src/Components/AppComponents/HomePage/HomePage.css +203 -0
- package/src/Components/AppComponents/HomePage/HomePage.html +49 -0
- package/src/Components/AppComponents/HomePage/HomePage.js +196 -0
- package/src/Components/AppComponents/Playground/Playground.js +0 -15
- package/src/Components/components.js +2 -24
- package/src/routes.js +4 -86
- package/src/sliceConfig.json +0 -3
- package/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.css +0 -16
- package/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.html +0 -22
- package/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.js +0 -102
- package/src/Components/AppComponents/CardDocumentation/CardDocumentation.css +0 -15
- package/src/Components/AppComponents/CardDocumentation/CardDocumentation.html +0 -38
- package/src/Components/AppComponents/CardDocumentation/CardDocumentation.js +0 -113
- package/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.css +0 -21
- package/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.html +0 -35
- package/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.js +0 -103
- package/src/Components/AppComponents/Documentation/Documentation.css +0 -0
- package/src/Components/AppComponents/Documentation/Documentation.html +0 -30
- package/src/Components/AppComponents/Documentation/Documentation.js +0 -75
- package/src/Components/AppComponents/DocumentationPage/DocumentationPage.css +0 -62
- package/src/Components/AppComponents/DocumentationPage/DocumentationPage.html +0 -0
- package/src/Components/AppComponents/DocumentationPage/DocumentationPage.js +0 -283
- package/src/Components/AppComponents/InputDocumentation/InputDocumentation.css +0 -41
- package/src/Components/AppComponents/InputDocumentation/InputDocumentation.html +0 -95
- package/src/Components/AppComponents/InputDocumentation/InputDocumentation.js +0 -315
- package/src/Components/AppComponents/Installation/Installation.css +0 -185
- package/src/Components/AppComponents/Installation/Installation.html +0 -102
- package/src/Components/AppComponents/Installation/Installation.js +0 -61
- package/src/Components/AppComponents/LandingMenu/LandingMenu.css +0 -108
- package/src/Components/AppComponents/LandingMenu/LandingMenu.html +0 -16
- package/src/Components/AppComponents/LandingMenu/LandingMenu.js +0 -33
- package/src/Components/AppComponents/LandingPage/LandingPage.css +0 -14
- package/src/Components/AppComponents/LandingPage/LandingPage.html +0 -0
- package/src/Components/AppComponents/LandingPage/LandingPage.js +0 -53
- package/src/Components/AppComponents/MainMenu/MainMenu.css +0 -80
- package/src/Components/AppComponents/MainMenu/MainMenu.html +0 -39
- package/src/Components/AppComponents/MainMenu/MainMenu.js +0 -42
- package/src/Components/AppComponents/MyLayout/MyLayout.css +0 -0
- package/src/Components/AppComponents/MyLayout/MyLayout.html +0 -0
- package/src/Components/AppComponents/MyLayout/MyLayout.js +0 -13
- package/src/Components/AppComponents/MyNavigation/MyNavigation.css +0 -49
- package/src/Components/AppComponents/MyNavigation/MyNavigation.html +0 -1
- package/src/Components/AppComponents/MyNavigation/MyNavigation.js +0 -60
- package/src/Components/AppComponents/RoutingDocumentation/RoutingDocumentation.css +0 -89
- package/src/Components/AppComponents/RoutingDocumentation/RoutingDocumentation.html +0 -108
- package/src/Components/AppComponents/RoutingDocumentation/RoutingDocumentation.js +0 -177
- package/src/Components/AppComponents/ServiceDocumentation/ServiceDocumentation.css +0 -82
- package/src/Components/AppComponents/ServiceDocumentation/ServiceDocumentation.html +0 -74
- package/src/Components/AppComponents/ServiceDocumentation/ServiceDocumentation.js +0 -416
- package/src/Components/AppComponents/SliceStylesDocumentation/SliceStylesDocumentation.css +0 -56
- package/src/Components/AppComponents/SliceStylesDocumentation/SliceStylesDocumentation.html +0 -28
- package/src/Components/AppComponents/SliceStylesDocumentation/SliceStylesDocumentation.js +0 -134
- package/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.css +0 -104
- package/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.html +0 -12
- package/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.js +0 -74
- package/src/Components/AppComponents/StructuralDocumentation/StructuralDocumentation.css +0 -72
- package/src/Components/AppComponents/StructuralDocumentation/StructuralDocumentation.html +0 -98
- package/src/Components/AppComponents/StructuralDocumentation/StructuralDocumentation.js +0 -219
- package/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.css +0 -21
- package/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.html +0 -35
- package/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.js +0 -103
- package/src/Components/AppComponents/TheBuildMethod/TheBuildMethod.css +0 -296
- package/src/Components/AppComponents/TheBuildMethod/TheBuildMethod.html +0 -89
- package/src/Components/AppComponents/TheBuildMethod/TheBuildMethod.js +0 -86
- package/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.css +0 -208
- package/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.html +0 -18
- package/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.js +0 -111
- package/src/Components/AppComponents/ThemesDocumentation/ThemesDocumentation.css +0 -61
- package/src/Components/AppComponents/ThemesDocumentation/ThemesDocumentation.html +0 -80
- package/src/Components/AppComponents/ThemesDocumentation/ThemesDocumentation.js +0 -149
- package/src/Components/AppComponents/VisualDocumentation/VisualDocumentation.css +0 -70
- package/src/Components/AppComponents/VisualDocumentation/VisualDocumentation.html +0 -67
- package/src/Components/AppComponents/VisualDocumentation/VisualDocumentation.js +0 -193
- package/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.css +0 -475
- package/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.html +0 -389
- package/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.js +0 -95
- /package/src/Components/{AppComponents → Visual}/CodeVisualizer/CodeVisualizer.css +0 -0
- /package/src/Components/{AppComponents → Visual}/CodeVisualizer/CodeVisualizer.html +0 -0
- /package/src/Components/{AppComponents → Visual}/CodeVisualizer/CodeVisualizer.js +0 -0
|
@@ -1,389 +0,0 @@
|
|
|
1
|
-
<div class="whatisslice-container">
|
|
2
|
-
<h1 id="title">What is Slice.js?</h1>
|
|
3
|
-
|
|
4
|
-
<div class="intro-section">
|
|
5
|
-
<div class="intro-text">
|
|
6
|
-
<p>Slice.js is a lightweight, component-based web framework built on vanilla JavaScript that embraces modern web standards. It provides a modular approach to building web applications with reusable components while maintaining the simplicity and performance of native browser technologies.</p>
|
|
7
|
-
<p>Designed for developers who appreciate clean architecture and minimal dependencies, Slice.js offers powerful features without introducing unnecessary complexity or bloat.</p>
|
|
8
|
-
</div>
|
|
9
|
-
<div class="intro-image">
|
|
10
|
-
<div class="slice-logo-container">
|
|
11
|
-
<img src="/images/Slice.js-logo.png" alt="Slice.js Logo" class="slice-logo">
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
|
|
16
|
-
<div class="tabs-container">
|
|
17
|
-
<div class="tabs">
|
|
18
|
-
<div class="tab active" data-tab="overview">Overview</div>
|
|
19
|
-
<div class="tab" data-tab="architecture">Architecture</div>
|
|
20
|
-
<div class="tab" data-tab="components">Components</div>
|
|
21
|
-
<div class="tab" data-tab="examples">Examples</div>
|
|
22
|
-
<div class="tab" data-tab="benefits">Benefits</div>
|
|
23
|
-
</div>
|
|
24
|
-
|
|
25
|
-
<div class="tab-contents">
|
|
26
|
-
<!-- Overview Tab -->
|
|
27
|
-
<div class="tab-content active" data-tab="overview">
|
|
28
|
-
<h2>Core Principles</h2>
|
|
29
|
-
<div class="principles-grid">
|
|
30
|
-
<div class="principle">
|
|
31
|
-
<h3>Component-Based</h3>
|
|
32
|
-
<p>Build your application with reusable, encapsulated components that combine HTML, CSS, and JavaScript.</p>
|
|
33
|
-
</div>
|
|
34
|
-
<div class="principle">
|
|
35
|
-
<h3>Native Web Standards</h3>
|
|
36
|
-
<p>Built on Web Components and other standard browser APIs without requiring transpilation or complex build steps.</p>
|
|
37
|
-
</div>
|
|
38
|
-
<div class="principle">
|
|
39
|
-
<h3>Modular Architecture</h3>
|
|
40
|
-
<p>Organize your code into logical modules with clear separation of concerns between visual elements, services, and structure.</p>
|
|
41
|
-
</div>
|
|
42
|
-
<div class="principle">
|
|
43
|
-
<h3>Developer Experience</h3>
|
|
44
|
-
<p>Simple, intuitive API with built-in debugging tools and clear documentation to accelerate development.</p>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
|
|
48
|
-
<h2>Key Features</h2>
|
|
49
|
-
<ul class="features-list">
|
|
50
|
-
<li><span class="feature-highlight">Slice.build</span>: Create and manage component instances with a simple API</li>
|
|
51
|
-
<li><span class="feature-highlight">Component Lifecycle</span>: Control component behavior with initialization and update methods</li>
|
|
52
|
-
<li><span class="feature-highlight">Theming System</span>: Switch between themes with built-in theme manager</li>
|
|
53
|
-
<li><span class="feature-highlight">Routing</span>: Simple yet powerful routing for single-page applications</li>
|
|
54
|
-
<li><span class="feature-highlight">Visual Components Library</span>: Pre-built UI components ready to use</li>
|
|
55
|
-
<li><span class="feature-highlight">Service Components</span>: Handle business logic and external integrations</li>
|
|
56
|
-
<li><span class="feature-highlight">Development Tools</span>: Built-in debugging and component inspection</li>
|
|
57
|
-
</ul>
|
|
58
|
-
</div>
|
|
59
|
-
|
|
60
|
-
<!-- Architecture Tab -->
|
|
61
|
-
<div class="tab-content" data-tab="architecture">
|
|
62
|
-
<h2>Slice.js Architecture</h2>
|
|
63
|
-
<p>Slice.js is built on a three-layered architecture that separates concerns and promotes maintainable code:</p>
|
|
64
|
-
|
|
65
|
-
<div class="architecture-diagram">
|
|
66
|
-
<div class="component-box visual" data-type="visual">
|
|
67
|
-
<h3>Visual Components</h3>
|
|
68
|
-
<p>UI Elements</p>
|
|
69
|
-
</div>
|
|
70
|
-
<div class="component-box structural" data-type="structural">
|
|
71
|
-
<h3>Structural Components</h3>
|
|
72
|
-
<p>Core Framework</p>
|
|
73
|
-
</div>
|
|
74
|
-
<div class="component-box service" data-type="service">
|
|
75
|
-
<h3>Service Components</h3>
|
|
76
|
-
<p>Business Logic</p>
|
|
77
|
-
</div>
|
|
78
|
-
|
|
79
|
-
<div class="component-description" data-type="visual">
|
|
80
|
-
<h4>Visual Components</h4>
|
|
81
|
-
<p>Build the user interface of your application. These components render HTML, handle user interactions, and manage UI state. Examples include buttons, inputs, cards, and navigation elements.</p>
|
|
82
|
-
<code>Button.js, Card.js, Input.js</code>
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
<div class="component-description" data-type="structural">
|
|
86
|
-
<h4>Structural Components</h4>
|
|
87
|
-
<p>Form the backbone of the framework. These components manage the application lifecycle, routing, component registration, and other core functionality. They're mostly internal but can be customized if needed.</p>
|
|
88
|
-
<code>Router.js, Controller.js, StylesManager.js</code>
|
|
89
|
-
</div>
|
|
90
|
-
|
|
91
|
-
<div class="component-description" data-type="service">
|
|
92
|
-
<h4>Service Components</h4>
|
|
93
|
-
<p>Handle business logic, data processing, and external integrations. These components provide services to visual components and often interact with APIs, databases, or browser APIs.</p>
|
|
94
|
-
<code>FetchManager.js, IndexedDbManager.js, LocalStorageManager.js</code>
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
|
|
98
|
-
<h3>Data Flow</h3>
|
|
99
|
-
<p>Data in Slice.js flows in a predictable manner:</p>
|
|
100
|
-
<ol class="data-flow">
|
|
101
|
-
<li>User interacts with Visual Components</li>
|
|
102
|
-
<li>Visual Components call Service Components for data or business logic</li>
|
|
103
|
-
<li>Service Components process data and return results</li>
|
|
104
|
-
<li>Visual Components update the UI based on the results</li>
|
|
105
|
-
<li>Structural Components manage the lifecycle and coordination</li>
|
|
106
|
-
</ol>
|
|
107
|
-
</div>
|
|
108
|
-
|
|
109
|
-
<!-- Components Tab -->
|
|
110
|
-
<div class="tab-content" data-tab="components">
|
|
111
|
-
<h2>Component Types</h2>
|
|
112
|
-
|
|
113
|
-
<div class="component-section">
|
|
114
|
-
<h3>Visual Components</h3>
|
|
115
|
-
<p>These components build your user interface and extend the <code>HTMLElement</code> class, leveraging the Web Components standard.</p>
|
|
116
|
-
|
|
117
|
-
<div class="code-example">
|
|
118
|
-
<pre><code class="language-javascript">export default class Button extends HTMLElement {
|
|
119
|
-
constructor(props) {
|
|
120
|
-
super();
|
|
121
|
-
slice.attachTemplate(this);
|
|
122
|
-
this.$value = this.querySelector('.slice_button_value');
|
|
123
|
-
|
|
124
|
-
slice.controller.setComponentProps(this, props);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
get value() {
|
|
128
|
-
return this._value;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
set value(value) {
|
|
132
|
-
this._value = value;
|
|
133
|
-
this.$value.textContent = value;
|
|
134
|
-
}
|
|
135
|
-
}</code></pre>
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
138
|
-
|
|
139
|
-
<div class="component-section">
|
|
140
|
-
<h3>Service Components</h3>
|
|
141
|
-
<p>These components handle business logic, data processing, and external integrations.</p>
|
|
142
|
-
|
|
143
|
-
<div class="code-example">
|
|
144
|
-
<pre><code class="language-javascript">export default class FetchManager {
|
|
145
|
-
constructor(props) {
|
|
146
|
-
const { baseUrl, timeout } = props;
|
|
147
|
-
this.baseUrl = baseUrl;
|
|
148
|
-
this.timeout = timeout || 10000;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
async request(method, data, endpoint, onSuccess, onError) {
|
|
152
|
-
// Implementation details
|
|
153
|
-
}
|
|
154
|
-
}</code></pre>
|
|
155
|
-
</div>
|
|
156
|
-
</div>
|
|
157
|
-
|
|
158
|
-
<div class="component-section">
|
|
159
|
-
<h3>Component Lifecycle</h3>
|
|
160
|
-
<p>Slice.js components have a simple lifecycle that gives you control over their behavior:</p>
|
|
161
|
-
|
|
162
|
-
<ul class="lifecycle-list">
|
|
163
|
-
<li><strong>constructor</strong>: Initialize properties and set up event listeners</li>
|
|
164
|
-
<li><strong>init</strong>: Called after the component is created, good for async operations</li>
|
|
165
|
-
<li><strong>render</strong> (optional): Update the component's DOM based on props</li>
|
|
166
|
-
<li><strong>update</strong> (optional): Refresh the component when props change</li>
|
|
167
|
-
</ul>
|
|
168
|
-
</div>
|
|
169
|
-
</div>
|
|
170
|
-
|
|
171
|
-
<!-- Examples Tab -->
|
|
172
|
-
<div class="tab-content" data-tab="examples">
|
|
173
|
-
<h2>Getting Started with Slice.js</h2>
|
|
174
|
-
|
|
175
|
-
<div class="example-section">
|
|
176
|
-
<h3>Creating a Component</h3>
|
|
177
|
-
<p>Here's how to create a simple counter component in Slice.js:</p>
|
|
178
|
-
|
|
179
|
-
<div class="code-files">
|
|
180
|
-
<div class="code-file">
|
|
181
|
-
<h4>Counter.js</h4>
|
|
182
|
-
<pre><code class="language-javascript">export default class Counter extends HTMLElement {
|
|
183
|
-
constructor(props) {
|
|
184
|
-
super();
|
|
185
|
-
slice.attachTemplate(this);
|
|
186
|
-
|
|
187
|
-
this.$count = this.querySelector('.count');
|
|
188
|
-
this.$increment = this.querySelector('.increment');
|
|
189
|
-
this.$decrement = this.querySelector('.decrement');
|
|
190
|
-
|
|
191
|
-
this.$increment.addEventListener('click', () => this.increment());
|
|
192
|
-
this.$decrement.addEventListener('click', () => this.decrement());
|
|
193
|
-
|
|
194
|
-
slice.controller.setComponentProps(this, props);
|
|
195
|
-
this.debuggerProps = ['count'];
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
init() {
|
|
199
|
-
if (this._count === undefined) {
|
|
200
|
-
this.count = 0;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
get count() {
|
|
205
|
-
return this._count;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
set count(value) {
|
|
209
|
-
this._count = value;
|
|
210
|
-
this.$count.textContent = value;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
increment() {
|
|
214
|
-
this.count++;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
decrement() {
|
|
218
|
-
this.count--;
|
|
219
|
-
}
|
|
220
|
-
}</code></pre>
|
|
221
|
-
</div>
|
|
222
|
-
|
|
223
|
-
<div class="code-file">
|
|
224
|
-
<h4>Counter.html</h4>
|
|
225
|
-
<pre><code class="language-html"><div class="counter-container">
|
|
226
|
-
<button class="decrement">-</button>
|
|
227
|
-
<span class="count">0</span>
|
|
228
|
-
<button class="increment">+</button>
|
|
229
|
-
</div></code></pre>
|
|
230
|
-
</div>
|
|
231
|
-
|
|
232
|
-
<div class="code-file">
|
|
233
|
-
<h4>Counter.css</h4>
|
|
234
|
-
<pre><code class="language-css">slice-counter .counter-container {
|
|
235
|
-
display: flex;
|
|
236
|
-
align-items: center;
|
|
237
|
-
gap: 15px;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
slice-counter button {
|
|
241
|
-
background-color: var(--primary-color);
|
|
242
|
-
color: var(--primary-color-contrast);
|
|
243
|
-
border: none;
|
|
244
|
-
border-radius: var(--border-radius-slice);
|
|
245
|
-
width: 40px;
|
|
246
|
-
height: 40px;
|
|
247
|
-
font-size: 20px;
|
|
248
|
-
cursor: pointer;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
slice-counter .count {
|
|
252
|
-
font-size: 24px;
|
|
253
|
-
min-width: 40px;
|
|
254
|
-
text-align: center;
|
|
255
|
-
}</code></pre>
|
|
256
|
-
</div>
|
|
257
|
-
</div>
|
|
258
|
-
</div>
|
|
259
|
-
|
|
260
|
-
<div class="example-section">
|
|
261
|
-
<h3>Using the Component</h3>
|
|
262
|
-
<p>Once defined, you can use your component like this:</p>
|
|
263
|
-
|
|
264
|
-
<div class="code-example">
|
|
265
|
-
<pre><code class="language-javascript">// Create an instance of the counter
|
|
266
|
-
const counter = await slice.build('Counter', {
|
|
267
|
-
count: 5 // Initial value
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
// Add it to a parent component or container
|
|
271
|
-
const container = slice.getComponent('MainContainer');
|
|
272
|
-
container.appendChild(counter);
|
|
273
|
-
|
|
274
|
-
// Or use it in another component's template
|
|
275
|
-
const mySection = this.querySelector('.my-section');
|
|
276
|
-
mySection.appendChild(counter);
|
|
277
|
-
|
|
278
|
-
// Later, you can access or modify properties
|
|
279
|
-
console.log(counter.count); // 5
|
|
280
|
-
counter.count = 10;</code></pre>
|
|
281
|
-
</div>
|
|
282
|
-
</div>
|
|
283
|
-
</div>
|
|
284
|
-
|
|
285
|
-
<!-- Benefits Tab -->
|
|
286
|
-
<div class="tab-content" data-tab="benefits">
|
|
287
|
-
<h2>Why Choose Slice.js?</h2>
|
|
288
|
-
|
|
289
|
-
<div class="benefits-grid">
|
|
290
|
-
<div class="benefit">
|
|
291
|
-
<h3>Lightweight</h3>
|
|
292
|
-
<p>Minimal footprint without the bloat of larger frameworks, leading to faster load times and better performance.</p>
|
|
293
|
-
</div>
|
|
294
|
-
|
|
295
|
-
<div class="benefit">
|
|
296
|
-
<h3>No Build Step</h3>
|
|
297
|
-
<p>Develop directly with vanilla JavaScript, HTML, and CSS without requiring transpilers, bundlers, or complex build systems.</p>
|
|
298
|
-
</div>
|
|
299
|
-
|
|
300
|
-
<div class="benefit">
|
|
301
|
-
<h3>Easy Learning Curve</h3>
|
|
302
|
-
<p>If you know basic HTML, CSS, and JavaScript, you can start building with Slice.js right away. No new template syntax to learn.</p>
|
|
303
|
-
</div>
|
|
304
|
-
|
|
305
|
-
<div class="benefit">
|
|
306
|
-
<h3>Standards-Based</h3>
|
|
307
|
-
<p>Built on Web Components and other modern browser standards, ensuring compatibility and future-proofing your applications.</p>
|
|
308
|
-
</div>
|
|
309
|
-
|
|
310
|
-
<div class="benefit">
|
|
311
|
-
<h3>Component Library</h3>
|
|
312
|
-
<p>Comes with pre-built, customizable UI components to accelerate development and maintain consistency.</p>
|
|
313
|
-
</div>
|
|
314
|
-
|
|
315
|
-
<div class="benefit">
|
|
316
|
-
<h3>Debugging Tools</h3>
|
|
317
|
-
<p>Built-in tools for inspecting and debugging components, making development easier and more efficient.</p>
|
|
318
|
-
</div>
|
|
319
|
-
</div>
|
|
320
|
-
|
|
321
|
-
<div class="comparison-section">
|
|
322
|
-
<h3>Comparison with Other Frameworks</h3>
|
|
323
|
-
<p>See how Slice.js compares to other popular frameworks:</p>
|
|
324
|
-
|
|
325
|
-
<div class="comparison-table">
|
|
326
|
-
<table>
|
|
327
|
-
<thead>
|
|
328
|
-
<tr>
|
|
329
|
-
<th>Feature</th>
|
|
330
|
-
<th>Slice.js</th>
|
|
331
|
-
<th>React</th>
|
|
332
|
-
<th>Vue</th>
|
|
333
|
-
<th>Angular</th>
|
|
334
|
-
</tr>
|
|
335
|
-
</thead>
|
|
336
|
-
<tbody>
|
|
337
|
-
<tr>
|
|
338
|
-
<td>Build Step Required</td>
|
|
339
|
-
<td>No</td>
|
|
340
|
-
<td>Yes</td>
|
|
341
|
-
<td>Yes</td>
|
|
342
|
-
<td>Yes</td>
|
|
343
|
-
</tr>
|
|
344
|
-
<tr>
|
|
345
|
-
<td>Bundle Size</td>
|
|
346
|
-
<td>Small</td>
|
|
347
|
-
<td>Medium</td>
|
|
348
|
-
<td>Small-Medium</td>
|
|
349
|
-
<td>Large</td>
|
|
350
|
-
</tr>
|
|
351
|
-
<tr>
|
|
352
|
-
<td>Learning Curve</td>
|
|
353
|
-
<td>Low</td>
|
|
354
|
-
<td>Medium</td>
|
|
355
|
-
<td>Low-Medium</td>
|
|
356
|
-
<td>High</td>
|
|
357
|
-
</tr>
|
|
358
|
-
<tr>
|
|
359
|
-
<td>Web Standards Based</td>
|
|
360
|
-
<td>Yes</td>
|
|
361
|
-
<td>Partial</td>
|
|
362
|
-
<td>Partial</td>
|
|
363
|
-
<td>Partial</td>
|
|
364
|
-
</tr>
|
|
365
|
-
<tr>
|
|
366
|
-
<td>Component Encapsulation</td>
|
|
367
|
-
<td>Full (Shadow DOM)</td>
|
|
368
|
-
<td>Partial</td>
|
|
369
|
-
<td>Optional</td>
|
|
370
|
-
<td>Full</td>
|
|
371
|
-
</tr>
|
|
372
|
-
</tbody>
|
|
373
|
-
</table>
|
|
374
|
-
</div>
|
|
375
|
-
</div>
|
|
376
|
-
</div>
|
|
377
|
-
</div>
|
|
378
|
-
</div>
|
|
379
|
-
|
|
380
|
-
<div class="get-started-section">
|
|
381
|
-
<h2>Ready to Get Started?</h2>
|
|
382
|
-
<p>Explore the documentation, install the framework, and build your first Slice.js application:</p>
|
|
383
|
-
<div class="action-buttons">
|
|
384
|
-
<button class="action-button installation-button">Installation Guide</button>
|
|
385
|
-
<button class="action-button components-button">Component Library</button>
|
|
386
|
-
<a href="https://github.com/VKneider/slice.js" target="_blank" class="action-button github">GitHub Repository</a>
|
|
387
|
-
</div>
|
|
388
|
-
</div>
|
|
389
|
-
</div>
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
export default class WhatIsSlice extends HTMLElement {
|
|
2
|
-
constructor(props) {
|
|
3
|
-
super();
|
|
4
|
-
slice.attachTemplate(this);
|
|
5
|
-
|
|
6
|
-
this.$tabs = this.querySelectorAll('.tab');
|
|
7
|
-
this.$tabContents = this.querySelectorAll('.tab-content');
|
|
8
|
-
|
|
9
|
-
// Set up tab switching functionality
|
|
10
|
-
this.$tabs.forEach(tab => {
|
|
11
|
-
tab.addEventListener('click', () => {
|
|
12
|
-
const tabId = tab.getAttribute('data-tab');
|
|
13
|
-
this.switchTab(tabId);
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
// Set up navigation buttons with Slice Router
|
|
18
|
-
this.setupNavigationButtons();
|
|
19
|
-
|
|
20
|
-
slice.controller.setComponentProps(this, props);
|
|
21
|
-
this.debuggerProps = [];
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
async init() {
|
|
25
|
-
// Set the first tab as active by default
|
|
26
|
-
this.switchTab('overview');
|
|
27
|
-
|
|
28
|
-
// Add animation to code samples for better readability
|
|
29
|
-
this.highlightCode();
|
|
30
|
-
|
|
31
|
-
// Setup diagram interactions
|
|
32
|
-
this.setupDiagramInteractions();
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
setupNavigationButtons() {
|
|
36
|
-
// Set up the Installation Guide button
|
|
37
|
-
const installationButton = this.querySelector('.installation-button');
|
|
38
|
-
if (installationButton) {
|
|
39
|
-
installationButton.addEventListener('click', (event) => {
|
|
40
|
-
event.preventDefault();
|
|
41
|
-
slice.router.navigate('/Documentation/Installation');
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Set up the Component Library button
|
|
46
|
-
const componentsButton = this.querySelector('.components-button');
|
|
47
|
-
if (componentsButton) {
|
|
48
|
-
componentsButton.addEventListener('click', (event) => {
|
|
49
|
-
event.preventDefault();
|
|
50
|
-
slice.router.navigate('/Documentation/Components');
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
switchTab(tabId) {
|
|
56
|
-
// Remove active class from all tabs and tab contents
|
|
57
|
-
this.$tabs.forEach(tab => tab.classList.remove('active'));
|
|
58
|
-
this.$tabContents.forEach(content => content.classList.remove('active'));
|
|
59
|
-
|
|
60
|
-
// Add active class to the selected tab and content
|
|
61
|
-
this.querySelector(`.tab[data-tab="${tabId}"]`).classList.add('active');
|
|
62
|
-
this.querySelector(`.tab-content[data-tab="${tabId}"]`).classList.add('active');
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
highlightCode() {
|
|
66
|
-
// Check if Prism is available (for syntax highlighting)
|
|
67
|
-
if (typeof Prism !== 'undefined') {
|
|
68
|
-
Prism.highlightAllUnder(this);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
setupDiagramInteractions() {
|
|
73
|
-
const components = this.querySelectorAll('.component-box');
|
|
74
|
-
|
|
75
|
-
components.forEach(component => {
|
|
76
|
-
component.addEventListener('mouseenter', () => {
|
|
77
|
-
const type = component.getAttribute('data-type');
|
|
78
|
-
const description = this.querySelector(`.component-description[data-type="${type}"]`);
|
|
79
|
-
if (description) {
|
|
80
|
-
description.classList.add('visible');
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
component.addEventListener('mouseleave', () => {
|
|
85
|
-
const type = component.getAttribute('data-type');
|
|
86
|
-
const description = this.querySelector(`.component-description[data-type="${type}"]`);
|
|
87
|
-
if (description) {
|
|
88
|
-
description.classList.remove('visible');
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
customElements.define("slice-whatisslice", WhatIsSlice);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|