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,208 +0,0 @@
|
|
|
1
|
-
.slice_team {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
align-items: center;
|
|
5
|
-
width: 100%;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.slice_team_hero {
|
|
9
|
-
position: relative;
|
|
10
|
-
width: 100%;
|
|
11
|
-
height: 300px;
|
|
12
|
-
display: flex;
|
|
13
|
-
flex-direction: column;
|
|
14
|
-
justify-content: center;
|
|
15
|
-
align-items: center;
|
|
16
|
-
margin-top: 60px;
|
|
17
|
-
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
|
|
18
|
-
color: var(--primary-color-contrast);
|
|
19
|
-
text-align: center;
|
|
20
|
-
overflow: hidden;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.hero_overlay {
|
|
24
|
-
position: absolute;
|
|
25
|
-
top: 0;
|
|
26
|
-
left: 0;
|
|
27
|
-
width: 100%;
|
|
28
|
-
height: 100%;
|
|
29
|
-
background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
|
|
30
|
-
opacity: 0.3;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.slice_team_hero h1 {
|
|
34
|
-
font-size: 2.5rem;
|
|
35
|
-
margin-bottom: 1rem;
|
|
36
|
-
z-index: 1;
|
|
37
|
-
text-shadow: 0 2px 4px rgba(0,0,0,0.2);
|
|
38
|
-
animation: fadeIn 1s ease-in-out;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.slice_team_hero p {
|
|
42
|
-
font-size: 1.2rem;
|
|
43
|
-
z-index: 1;
|
|
44
|
-
max-width: 600px;
|
|
45
|
-
animation: fadeIn 1s ease-in-out 0.3s both;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.slice_team_content {
|
|
49
|
-
display: flex;
|
|
50
|
-
flex-direction: column;
|
|
51
|
-
align-items: center;
|
|
52
|
-
padding: 2rem;
|
|
53
|
-
width: 100%;
|
|
54
|
-
max-width: 1200px;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.slice_team_title {
|
|
58
|
-
font-size: 2rem;
|
|
59
|
-
color: var(--font-primary-color);
|
|
60
|
-
margin: 2rem 0;
|
|
61
|
-
text-align: center;
|
|
62
|
-
position: relative;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.slice_team_title::after {
|
|
66
|
-
content: '';
|
|
67
|
-
position: absolute;
|
|
68
|
-
width: 50px;
|
|
69
|
-
height: 3px;
|
|
70
|
-
background-color: var(--primary-color);
|
|
71
|
-
bottom: -10px;
|
|
72
|
-
left: 50%;
|
|
73
|
-
transform: translateX(-50%);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.slice_team_container {
|
|
77
|
-
display: flex;
|
|
78
|
-
flex-direction: column;
|
|
79
|
-
align-items: center;
|
|
80
|
-
gap: 2rem;
|
|
81
|
-
width: 100%;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
slice-team-card {
|
|
85
|
-
opacity: 0;
|
|
86
|
-
animation: fadeInUp 0.8s ease-out forwards;
|
|
87
|
-
animation-delay: calc(var(--animation-order, 0) * 0.2s);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.slice_special_thanks {
|
|
91
|
-
margin: 4rem 0;
|
|
92
|
-
padding: 2rem;
|
|
93
|
-
background-color: var(--secondary-background-color);
|
|
94
|
-
border-radius: 10px;
|
|
95
|
-
width: 90%;
|
|
96
|
-
max-width: 800px;
|
|
97
|
-
box-shadow: 0 8px 20px rgba(0,0,0,0.1);
|
|
98
|
-
transform: translateY(20px);
|
|
99
|
-
opacity: 0;
|
|
100
|
-
animation: fadeInUp 0.8s ease-out forwards;
|
|
101
|
-
animation-delay: 0.6s;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.special_thanks_content {
|
|
105
|
-
text-align: center;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.special_thanks_content h3 {
|
|
109
|
-
font-size: 1.8rem;
|
|
110
|
-
color: var(--primary-color);
|
|
111
|
-
margin-bottom: 1.5rem;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.special_thanks_content p {
|
|
115
|
-
color: var(--font-primary-color);
|
|
116
|
-
line-height: 1.7;
|
|
117
|
-
text-align: center;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.special_thanks_content strong {
|
|
121
|
-
color: var(--primary-color);
|
|
122
|
-
font-weight: bold;
|
|
123
|
-
position: relative;
|
|
124
|
-
display: inline-block;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.special_thanks_content strong::after {
|
|
128
|
-
content: '';
|
|
129
|
-
position: absolute;
|
|
130
|
-
width: 100%;
|
|
131
|
-
height: 2px;
|
|
132
|
-
background-color: var(--primary-color);
|
|
133
|
-
bottom: -2px;
|
|
134
|
-
left: 0;
|
|
135
|
-
transform: scaleX(0);
|
|
136
|
-
transform-origin: left;
|
|
137
|
-
transition: transform 0.3s ease;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.special_thanks_content:hover strong::after {
|
|
141
|
-
transform: scaleX(1);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.slice_team_footer {
|
|
145
|
-
margin-top: 2rem;
|
|
146
|
-
text-align: center;
|
|
147
|
-
padding: 1rem;
|
|
148
|
-
width: 100%;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.slice_team_footer a {
|
|
152
|
-
color: var(--primary-color);
|
|
153
|
-
text-decoration: none;
|
|
154
|
-
font-weight: bold;
|
|
155
|
-
transition: color 0.3s ease;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.slice_team_footer a:hover {
|
|
159
|
-
text-decoration: underline;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
@keyframes fadeIn {
|
|
163
|
-
from {
|
|
164
|
-
opacity: 0;
|
|
165
|
-
}
|
|
166
|
-
to {
|
|
167
|
-
opacity: 1;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
@keyframes fadeInUp {
|
|
172
|
-
from {
|
|
173
|
-
opacity: 0;
|
|
174
|
-
transform: translateY(30px);
|
|
175
|
-
}
|
|
176
|
-
to {
|
|
177
|
-
opacity: 1;
|
|
178
|
-
transform: translateY(0);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/* Responsive styling */
|
|
183
|
-
@media only screen and (min-width: 768px) {
|
|
184
|
-
.slice_team_container {
|
|
185
|
-
flex-direction: row;
|
|
186
|
-
flex-wrap: wrap;
|
|
187
|
-
justify-content: center;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
slice-team-card {
|
|
191
|
-
width: 45%;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
@media only screen and (max-width: 767px) {
|
|
196
|
-
.slice_team_hero {
|
|
197
|
-
height: 250px;
|
|
198
|
-
padding: 1rem;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.slice_team_hero h1 {
|
|
202
|
-
font-size: 2rem;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
.slice_special_thanks {
|
|
206
|
-
padding: 1.5rem;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<div class="slice_team">
|
|
2
|
-
<div class="slice_team_hero">
|
|
3
|
-
<div class="hero_overlay"></div>
|
|
4
|
-
<h1>The Minds Behind Slice.js</h1>
|
|
5
|
-
<p>Meet the passionate developers who created this framework</p>
|
|
6
|
-
</div>
|
|
7
|
-
|
|
8
|
-
<div class="slice_team_content">
|
|
9
|
-
<h2 class="slice_team_title">Our Team</h2>
|
|
10
|
-
<div class="slice_team_container"></div>
|
|
11
|
-
|
|
12
|
-
<div class="slice_special_thanks"></div>
|
|
13
|
-
|
|
14
|
-
<div class="slice_team_footer">
|
|
15
|
-
<p>Want to contribute? Join us on <a href="https://github.com/VKneider/slice.js" target="_blank">GitHub</a></p>
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
export default class TheSliceTeam extends HTMLElement {
|
|
2
|
-
constructor(props) {
|
|
3
|
-
super();
|
|
4
|
-
slice.attachTemplate(this);
|
|
5
|
-
|
|
6
|
-
this.$container = this.querySelector('.slice_team_container');
|
|
7
|
-
this.$title = this.querySelector('.slice_team_title');
|
|
8
|
-
this.$specialThanks = this.querySelector('.slice_special_thanks');
|
|
9
|
-
|
|
10
|
-
slice.controller.setComponentProps(this, props);
|
|
11
|
-
this.debuggerProps = ['members'];
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
async init() {
|
|
15
|
-
const navBar = await slice.build('Navbar', {
|
|
16
|
-
position: 'fixed',
|
|
17
|
-
logo: {
|
|
18
|
-
src: '/images/Slice.js-logo.png',
|
|
19
|
-
path: '/',
|
|
20
|
-
},
|
|
21
|
-
items: [
|
|
22
|
-
{ text: 'Home', path: '/' },
|
|
23
|
-
{ text: 'Documentation', path: '/Documentation' },
|
|
24
|
-
{ text: 'Playground', path: '/Playground' },
|
|
25
|
-
{ text: 'Our Team', path: '/Team' }
|
|
26
|
-
],
|
|
27
|
-
buttons: [{
|
|
28
|
-
value: 'Change Theme',
|
|
29
|
-
onClickCallback: async () => {
|
|
30
|
-
let theme = slice.stylesManager.themeManager.currentTheme;
|
|
31
|
-
if (theme === 'Slice') await slice.setTheme('Light');
|
|
32
|
-
else if (theme === 'Light') await slice.setTheme('Dark');
|
|
33
|
-
else if (theme === 'Dark') await slice.setTheme('Slice');
|
|
34
|
-
},
|
|
35
|
-
}],
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
this.appendChild(navBar);
|
|
39
|
-
|
|
40
|
-
// Team members data
|
|
41
|
-
const Victor = {
|
|
42
|
-
name: "Victor Kneider",
|
|
43
|
-
role: "Founder. Lead Developer. Software Architect.",
|
|
44
|
-
image: "https://avatars.githubusercontent.com/u/103617388?v=4",
|
|
45
|
-
description: "Computer Engineer and the principal creator of Slice.js. Victor architected the core framework, developed the structural components, implemented the router system, and designed the component lifecycle. He also created the documentation and maintains the repository, laying the groundwork for the entire framework ecosystem.",
|
|
46
|
-
links: [
|
|
47
|
-
{label: "Github", href: "https://github.com/VKneider" },
|
|
48
|
-
{label: "Linkedin", href: "https://www.linkedin.com/in/vkneider/"}
|
|
49
|
-
]
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
const Julio = {
|
|
53
|
-
name: "Julio Graterol",
|
|
54
|
-
role: "Frontend Developer. Visual Components Library Creator and Designer",
|
|
55
|
-
image: "https://avatars.githubusercontent.com/u/99130732?v=4",
|
|
56
|
-
description: "Frontend Developer and Designer. He is the creator of the Visual Components Library and the designer of the Slice.js logo and website.",
|
|
57
|
-
links: [
|
|
58
|
-
{label: "Github", href: "https://github.com/juliograterol"},
|
|
59
|
-
{label: "Linkedin", href: "https://www.linkedin.com/in/julio-graterol-187589289/"}
|
|
60
|
-
]
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const members = [Victor, Julio];
|
|
64
|
-
await this.addMembers(members);
|
|
65
|
-
|
|
66
|
-
// Add special thanks section with animation
|
|
67
|
-
this.renderSpecialThanks();
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
async addMembers(members) {
|
|
71
|
-
for (let i = 0; i < members.length; i++) {
|
|
72
|
-
await this.addMember(members[i]);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
async addMember(member) {
|
|
77
|
-
const card = await slice.build('SliceTeamCard', {
|
|
78
|
-
name: member.name,
|
|
79
|
-
role: member.role,
|
|
80
|
-
image: member.image,
|
|
81
|
-
description: member.description,
|
|
82
|
-
links: member.links
|
|
83
|
-
});
|
|
84
|
-
this.$container.appendChild(card);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
renderSpecialThanks() {
|
|
88
|
-
const specialThanksContent = document.createElement('div');
|
|
89
|
-
specialThanksContent.className = 'special_thanks_content';
|
|
90
|
-
specialThanksContent.innerHTML = `
|
|
91
|
-
<h3>Special Thanks</h3>
|
|
92
|
-
<p>
|
|
93
|
-
Victor Kneider would like to express his deepest gratitude to <strong>Jubert Pérez</strong>
|
|
94
|
-
for being a constant source of motivation, support, and encouragement throughout
|
|
95
|
-
the development of the Slice.js framework. Your belief in this project and guidance
|
|
96
|
-
have been invaluable to its creation.
|
|
97
|
-
</p>
|
|
98
|
-
`;
|
|
99
|
-
this.$specialThanks.appendChild(specialThanksContent);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
get members() {
|
|
103
|
-
return this._members;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
set members(values) {
|
|
107
|
-
this._members = values;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
window.customElements.define('slice-team', TheSliceTeam);
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
slice-themesdocumentation {
|
|
2
|
-
color: var(--font-primary-color);
|
|
3
|
-
font-family: var(--font-family);
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
slice-themesdocumentation .theme-samples {
|
|
7
|
-
margin: 20px 0;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
slice-themesdocumentation .theme-sample {
|
|
11
|
-
padding: 20px;
|
|
12
|
-
margin: 10px;
|
|
13
|
-
border-radius: var(--border-radius-slice);
|
|
14
|
-
border: 2px solid;
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
align-items: center;
|
|
18
|
-
justify-content: center;
|
|
19
|
-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
20
|
-
transition: transform 0.3s ease;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
slice-themesdocumentation .theme-sample:hover {
|
|
24
|
-
transform: translateY(-5px);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
slice-themesdocumentation .theme-sample h3 {
|
|
28
|
-
margin-top: 0;
|
|
29
|
-
margin-bottom: 15px;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
slice-themesdocumentation code {
|
|
33
|
-
background-color: var(--secondary-background-color);
|
|
34
|
-
padding: 2px 5px;
|
|
35
|
-
border-radius: 3px;
|
|
36
|
-
font-family: monospace;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
slice-themesdocumentation .theme-config-example,
|
|
40
|
-
slice-themesdocumentation .theme-apply-example,
|
|
41
|
-
slice-themesdocumentation .css-vars-example,
|
|
42
|
-
slice-themesdocumentation .custom-theme-example {
|
|
43
|
-
margin: 20px 0;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
slice-themesdocumentation ul li {
|
|
47
|
-
margin-bottom: 10px;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
slice-themesdocumentation h2 {
|
|
51
|
-
margin-top: 30px;
|
|
52
|
-
border-bottom: 1px solid var(--primary-color-shade);
|
|
53
|
-
padding-bottom: 8px;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
slice-themesdocumentation .theme-transition-example {
|
|
57
|
-
background-color: var(--secondary-background-color);
|
|
58
|
-
padding: 15px;
|
|
59
|
-
border-radius: var(--border-radius-slice);
|
|
60
|
-
margin: 20px 0;
|
|
61
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
<h1 id="themes">Themes in Slice.js</h1>
|
|
2
|
-
<p>
|
|
3
|
-
Slice.js includes a powerful theming system that allows you to easily customize the appearance of your entire application.
|
|
4
|
-
Slice.js themes are based on CSS variables that control colors, fonts, borders, and other visual styles.
|
|
5
|
-
</p>
|
|
6
|
-
|
|
7
|
-
<h2 id="theme-system">How the Theme System Works</h2>
|
|
8
|
-
<p>
|
|
9
|
-
The Slice.js theme system uses the ThemeManager, a structural component that manages the application
|
|
10
|
-
and runtime theme switching. Themes are defined as separate CSS files located in the
|
|
11
|
-
<code>/src/Themes/</code> folder.
|
|
12
|
-
</p>
|
|
13
|
-
|
|
14
|
-
<h2 id="default-themes">Default Themes</h2>
|
|
15
|
-
<p>
|
|
16
|
-
Slice.js comes with three built-in themes:
|
|
17
|
-
</p>
|
|
18
|
-
<ul>
|
|
19
|
-
<li><strong>Light</strong>: A light theme with blue as the primary color.</li>
|
|
20
|
-
<li><strong>Dark</strong>: A dark theme that reduces eye strain.</li>
|
|
21
|
-
<li><strong>Slice</strong>: The default Slice.js theme.</li>
|
|
22
|
-
</ul>
|
|
23
|
-
|
|
24
|
-
<div class="theme-samples"></div>
|
|
25
|
-
|
|
26
|
-
<h2 id="theme-configuration">Theme Configuration</h2>
|
|
27
|
-
<p>
|
|
28
|
-
You can configure the theme behavior in the <code>sliceConfig.json</code> file:
|
|
29
|
-
</p>
|
|
30
|
-
<div class="theme-config-example"></div>
|
|
31
|
-
|
|
32
|
-
<p>The configuration options are:</p>
|
|
33
|
-
<ul>
|
|
34
|
-
<li><strong>enabled</strong>: Enables or disables the theme system.</li>
|
|
35
|
-
<li><strong>defaultTheme</strong>: Sets the default theme to be applied when the application starts.</li>
|
|
36
|
-
<li><strong>saveThemeLocally</strong>: If enabled, saves the user's theme preference in localStorage.</li>
|
|
37
|
-
<li><strong>useBrowserTheme</strong>: If enabled, uses the user's system preference (light/dark).</li>
|
|
38
|
-
</ul>
|
|
39
|
-
|
|
40
|
-
<h2 id="using-themes">Changing Themes at Runtime</h2>
|
|
41
|
-
<p>
|
|
42
|
-
Slice.js allows you to change themes dynamically at runtime through its API:
|
|
43
|
-
</p>
|
|
44
|
-
<div class="theme-apply-example"></div>
|
|
45
|
-
|
|
46
|
-
<h2 id="theme-variables">CSS Variables Used in Themes</h2>
|
|
47
|
-
<p>
|
|
48
|
-
Slice.js themes use a consistent set of CSS variables to control appearance.
|
|
49
|
-
These are some of the main variables:
|
|
50
|
-
</p>
|
|
51
|
-
<div class="css-vars-example"></div>
|
|
52
|
-
|
|
53
|
-
<h2 id="custom-themes">Creating Custom Themes</h2>
|
|
54
|
-
<p>
|
|
55
|
-
To create your own custom theme, simply create a new CSS file in the <code>/src/Themes/</code> folder
|
|
56
|
-
and define the necessary CSS variables. For example:
|
|
57
|
-
</p>
|
|
58
|
-
<div class="custom-theme-example"></div>
|
|
59
|
-
|
|
60
|
-
<h2 id="theme-best-practices">Best Practices for Using Themes</h2>
|
|
61
|
-
<p>
|
|
62
|
-
When developing components for Slice.js, follow these practices to ensure they work correctly with the theme system:
|
|
63
|
-
</p>
|
|
64
|
-
<ul>
|
|
65
|
-
<li>Always use the CSS variables defined in the themes instead of hardcoded colors.</li>
|
|
66
|
-
<li>For elements with different states (hover, active, etc.), create CSS rules that respect the theme's color scheme.</li>
|
|
67
|
-
<li>Test your components with different themes to ensure they look good in all of them.</li>
|
|
68
|
-
<li>If your component needs specific styles based on the current theme, you can add classes based on the current theme.</li>
|
|
69
|
-
</ul>
|
|
70
|
-
|
|
71
|
-
<h2 id="theme-transitions">Theme Transitions</h2>
|
|
72
|
-
<p>
|
|
73
|
-
When changing from one theme to another, styles are updated immediately. If you want to add smooth transitions
|
|
74
|
-
when changing themes, you can add CSS transition rules to your elements:
|
|
75
|
-
</p>
|
|
76
|
-
<div class="theme-transition-example">
|
|
77
|
-
<pre><code class="language-css">* {
|
|
78
|
-
transition: background-color 0.3s ease, color 0.3s ease;
|
|
79
|
-
}</code></pre>
|
|
80
|
-
</div>
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
export default class ThemesDocumentation extends HTMLElement {
|
|
2
|
-
constructor(props) {
|
|
3
|
-
super();
|
|
4
|
-
slice.attachTemplate(this);
|
|
5
|
-
|
|
6
|
-
slice.controller.setComponentProps(this, props);
|
|
7
|
-
this.debuggerProps = [];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
async init() {
|
|
11
|
-
// Code examples to show in the documentation
|
|
12
|
-
const themeConfigExample = await slice.build("CodeVisualizer", {
|
|
13
|
-
language: "json",
|
|
14
|
-
value: `{
|
|
15
|
-
"themeManager": {
|
|
16
|
-
"enabled": true,
|
|
17
|
-
"defaultTheme": "Slice",
|
|
18
|
-
"saveThemeLocally": true,
|
|
19
|
-
"useBrowserTheme": false
|
|
20
|
-
}
|
|
21
|
-
}`
|
|
22
|
-
});
|
|
23
|
-
this.querySelector(".theme-config-example").appendChild(themeConfigExample);
|
|
24
|
-
|
|
25
|
-
const themeApplyExample = await slice.build("CodeVisualizer", {
|
|
26
|
-
language: "javascript",
|
|
27
|
-
value: `// Change to a specific theme
|
|
28
|
-
await slice.setTheme("Dark");
|
|
29
|
-
|
|
30
|
-
// Get current theme
|
|
31
|
-
const currentTheme = slice.theme; // Returns theme name, e.g. "Dark"
|
|
32
|
-
|
|
33
|
-
// In a button or switch to toggle themes
|
|
34
|
-
const themeToggleButton = await slice.build("Button", {
|
|
35
|
-
value: "Change Theme",
|
|
36
|
-
onClickCallback: async () => {
|
|
37
|
-
if (slice.theme === "Light") {
|
|
38
|
-
await slice.setTheme("Dark");
|
|
39
|
-
} else {
|
|
40
|
-
await slice.setTheme("Light");
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
});`
|
|
44
|
-
});
|
|
45
|
-
this.querySelector(".theme-apply-example").appendChild(themeApplyExample);
|
|
46
|
-
|
|
47
|
-
const cssVarsExample = await slice.build("CodeVisualizer", {
|
|
48
|
-
language: "css",
|
|
49
|
-
value: `:root {
|
|
50
|
-
/* Main colors */
|
|
51
|
-
--primary-color: #0066ff;
|
|
52
|
-
--primary-color-rgb: rgb(0, 102, 255);
|
|
53
|
-
--primary-background-color: #fff;
|
|
54
|
-
--primary-color-contrast: #fff;
|
|
55
|
-
--primary-color-shade: #ddd;
|
|
56
|
-
|
|
57
|
-
/* Secondary colors */
|
|
58
|
-
--secondary-color: #63ccfd;
|
|
59
|
-
--secondary-background-color: #ddd;
|
|
60
|
-
--secondary-color-contrast: #fff;
|
|
61
|
-
|
|
62
|
-
/* State colors */
|
|
63
|
-
--success-color: #00ff40;
|
|
64
|
-
--warning-color: #ffff40;
|
|
65
|
-
--danger-color: #ff0000;
|
|
66
|
-
|
|
67
|
-
/* Typography */
|
|
68
|
-
--font-primary-color: #000;
|
|
69
|
-
--font-secondary-color: #474747;
|
|
70
|
-
|
|
71
|
-
/* Other styles */
|
|
72
|
-
--border-radius-slice: 5px;
|
|
73
|
-
--slice-border: 1px;
|
|
74
|
-
--font-family: system-ui, sans-serif;
|
|
75
|
-
}`
|
|
76
|
-
});
|
|
77
|
-
this.querySelector(".css-vars-example").appendChild(cssVarsExample);
|
|
78
|
-
|
|
79
|
-
const customThemeExample = await slice.build("CodeVisualizer", {
|
|
80
|
-
language: "css",
|
|
81
|
-
value: `/* src/Themes/MyCustomTheme.css */
|
|
82
|
-
:root {
|
|
83
|
-
/* Custom corporate theme */
|
|
84
|
-
--primary-color: #8e44ad; /* Corporate purple */
|
|
85
|
-
--primary-color-rgb: rgb(142, 68, 173);
|
|
86
|
-
--primary-background-color: #f9f9f9; /* Light background */
|
|
87
|
-
--primary-color-contrast: #ffffff; /* White text on purple */
|
|
88
|
-
--primary-color-shade: #7d3c98; /* Darker purple for shadows */
|
|
89
|
-
|
|
90
|
-
--secondary-color: #2ecc71; /* Secondary green */
|
|
91
|
-
--secondary-background-color: #eee;
|
|
92
|
-
--secondary-color-contrast: #ffffff;
|
|
93
|
-
|
|
94
|
-
--success-color: #27ae60;
|
|
95
|
-
--warning-color: #f39c12;
|
|
96
|
-
--danger-color: #e74c3c;
|
|
97
|
-
|
|
98
|
-
--font-primary-color: #333333;
|
|
99
|
-
--font-secondary-color: #666666;
|
|
100
|
-
}`
|
|
101
|
-
});
|
|
102
|
-
this.querySelector(".custom-theme-example").appendChild(customThemeExample);
|
|
103
|
-
|
|
104
|
-
// Create visual theme examples
|
|
105
|
-
const themeGrid = await slice.build("Grid", {
|
|
106
|
-
columns: 3,
|
|
107
|
-
rows: 1
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
// Create color samples for themes
|
|
111
|
-
const createThemeSample = async (themeName, primaryColor, bgColor, textColor) => {
|
|
112
|
-
const sample = document.createElement("div");
|
|
113
|
-
sample.classList.add("theme-sample");
|
|
114
|
-
sample.style.backgroundColor = bgColor;
|
|
115
|
-
sample.style.color = textColor;
|
|
116
|
-
sample.style.borderColor = primaryColor;
|
|
117
|
-
|
|
118
|
-
const title = document.createElement("h3");
|
|
119
|
-
title.textContent = themeName;
|
|
120
|
-
|
|
121
|
-
const button = await slice.build("Button", {
|
|
122
|
-
value: "Example Button",
|
|
123
|
-
customColor: {
|
|
124
|
-
button: primaryColor,
|
|
125
|
-
label: textColor
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
sample.appendChild(title);
|
|
130
|
-
sample.appendChild(button);
|
|
131
|
-
|
|
132
|
-
return sample;
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
const lightSample = await createThemeSample("Light Theme", "#0066ff", "#ffffff", "#000000");
|
|
136
|
-
const darkSample = await createThemeSample("Dark Theme", "#0066ff", "#282828", "#ffffff");
|
|
137
|
-
const sliceSample = await createThemeSample("Slice Theme", "#A31D1D", "#FEF9E1", "#6D2323");
|
|
138
|
-
|
|
139
|
-
await themeGrid.setItem(lightSample);
|
|
140
|
-
await themeGrid.setItem(darkSample);
|
|
141
|
-
await themeGrid.setItem(sliceSample);
|
|
142
|
-
|
|
143
|
-
this.querySelector(".theme-samples").appendChild(themeGrid);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
customElements.define("slice-themesdocumentation", ThemesDocumentation);
|
|
148
|
-
|
|
149
|
-
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
slice-visualdocumentation {
|
|
2
|
-
color: var(--font-primary-color);
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
slice-visualdocumentation h1,
|
|
6
|
-
slice-visualdocumentation h2,
|
|
7
|
-
slice-visualdocumentation h3 {
|
|
8
|
-
margin-top: 1.5em;
|
|
9
|
-
margin-bottom: 0.5em;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
slice-visualdocumentation p {
|
|
13
|
-
line-height: 1.6;
|
|
14
|
-
margin: 1em 0;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
slice-visualdocumentation ul,
|
|
18
|
-
slice-visualdocumentation ol {
|
|
19
|
-
margin: 1em 0;
|
|
20
|
-
padding-left: 2em;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
slice-visualdocumentation li {
|
|
24
|
-
margin-bottom: 0.5em;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
slice-visualdocumentation code {
|
|
28
|
-
font-family: monospace;
|
|
29
|
-
background-color: var(--secondary-background-color);
|
|
30
|
-
padding: 0.2em 0.4em;
|
|
31
|
-
border-radius: 3px;
|
|
32
|
-
font-size: 0.9em;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
slice-visualdocumentation .visual-build-example,
|
|
36
|
-
slice-visualdocumentation .visual-lifecycle-example,
|
|
37
|
-
slice-visualdocumentation .nested-components-example,
|
|
38
|
-
slice-visualdocumentation .nested-components-usage {
|
|
39
|
-
margin: 1.5em 0;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
slice-visualdocumentation strong {
|
|
43
|
-
color: var(--primary-color);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
slice-visualdocumentation .faq-section {
|
|
47
|
-
margin: 2em 0;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
slice-visualdocumentation .faq-section slice-details {
|
|
51
|
-
margin-bottom: 1em;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
slice-visualdocumentation table {
|
|
55
|
-
width: 100%;
|
|
56
|
-
border-collapse: collapse;
|
|
57
|
-
margin: 1.5em 0;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
slice-visualdocumentation th,
|
|
61
|
-
slice-visualdocumentation td {
|
|
62
|
-
padding: 0.75em;
|
|
63
|
-
text-align: left;
|
|
64
|
-
border-bottom: 1px solid var(--primary-color-shade);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
slice-visualdocumentation th {
|
|
68
|
-
background-color: var(--primary-color);
|
|
69
|
-
color: var(--primary-color-contrast);
|
|
70
|
-
}
|