@sugarat/theme 0.5.12-beta.0 → 0.5.12-beta.1

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.
Files changed (39) hide show
  1. package/node.js +1 -1
  2. package/node.mjs +1 -1
  3. package/package.json +1 -2
  4. package/src/components/Alert.vue +123 -162
  5. package/src/components/Avatar.vue +7 -8
  6. package/src/components/BlogAlert.vue +5 -5
  7. package/src/components/BlogApp.vue +1 -8
  8. package/src/components/BlogArticleAnalyze.vue +41 -46
  9. package/src/components/BlogAuthor.vue +13 -15
  10. package/src/components/BlogBackToTop.vue +21 -24
  11. package/src/components/BlogButtonAfterArticle.vue +9 -12
  12. package/src/components/BlogCommentWrapper.vue +34 -41
  13. package/src/components/BlogDocCover.vue +1 -1
  14. package/src/components/BlogFooter.vue +26 -32
  15. package/src/components/BlogFriendLink.vue +38 -47
  16. package/src/components/BlogHomeBanner.vue +25 -31
  17. package/src/components/BlogHomeHeaderAvatar.vue +16 -23
  18. package/src/components/BlogHomeInfo.vue +1 -1
  19. package/src/components/BlogHomeOverview.vue +12 -15
  20. package/src/components/BlogHomeTags.vue +14 -17
  21. package/src/components/BlogHotArticle.vue +66 -77
  22. package/src/components/BlogItem.vue +14 -23
  23. package/src/components/BlogList.vue +12 -15
  24. package/src/components/BlogRecommendArticle.vue +53 -69
  25. package/src/components/BlogSidebar.vue +1 -1
  26. package/src/components/Button.vue +69 -84
  27. package/src/components/Carousel.vue +22 -27
  28. package/src/components/CarouselItem.vue +11 -26
  29. package/src/components/CommentArtalk.vue +1 -1
  30. package/src/components/Image.vue +8 -9
  31. package/src/components/ImageViewer.vue +54 -53
  32. package/src/components/Pagination.vue +148 -176
  33. package/src/components/Tag.vue +72 -91
  34. package/src/components/UserWorks.vue +115 -155
  35. package/src/index.ts +1 -1
  36. package/src/styles/{index.scss → index.css} +56 -91
  37. package/src/styles/scss/algolia.scss +0 -231
  38. package/src/styles/scss/global.scss +0 -156
  39. package/src/styles/scss/highlight.scss +0 -12
@@ -153,15 +153,13 @@ onUnmounted(() => {
153
153
  </div>
154
154
  </template>
155
155
 
156
- <style lang="scss" scoped>
156
+ <style scoped>
157
157
  .sugar-carousel {
158
158
  position: relative;
159
- overflow: hidden; // simplified
160
- &:hover {
161
- .sugar-carousel__arrow {
162
- display: inline-flex;
163
- }
164
- }
159
+ overflow: hidden;
160
+ }
161
+ .sugar-carousel:hover .sugar-carousel__arrow {
162
+ display: inline-flex;
165
163
  }
166
164
 
167
165
  .sugar-carousel__container {
@@ -186,10 +184,9 @@ onUnmounted(() => {
186
184
  background-color: transparent;
187
185
  padding: 12px 4px;
188
186
  cursor: pointer;
189
-
190
- &.is-active button {
191
- opacity: 1;
192
- }
187
+ }
188
+ .sugar-carousel__indicator.is-active button {
189
+ opacity: 1;
193
190
  }
194
191
 
195
192
  .sugar-carousel__button {
@@ -197,13 +194,13 @@ onUnmounted(() => {
197
194
  opacity: 0.48;
198
195
  width: 30px;
199
196
  height: 2px;
200
- background-color: #d3dce6; // element-plus default like
197
+ background-color: #d3dce6;
201
198
  border: none;
202
199
  outline: none;
203
200
  padding: 0;
204
201
  margin: 0;
205
202
  cursor: pointer;
206
- transition: .3s;
203
+ transition: 0.3s;
207
204
  }
208
205
 
209
206
  .sugar-carousel__arrow {
@@ -214,9 +211,9 @@ onUnmounted(() => {
214
211
  height: 36px;
215
212
  width: 36px;
216
213
  cursor: pointer;
217
- transition: .3s;
214
+ transition: 0.3s;
218
215
  border-radius: 50%;
219
- background-color: rgba(31, 45, 61, .11);
216
+ background-color: rgba(31, 45, 61, 0.11);
220
217
  color: #fff;
221
218
  position: absolute;
222
219
  top: 50%;
@@ -227,19 +224,17 @@ onUnmounted(() => {
227
224
  display: inline-flex;
228
225
  justify-content: center;
229
226
  align-items: center;
230
-
231
- &:hover {
232
- background-color: rgba(31, 45, 61, .23);
233
- }
234
-
235
- &--left {
236
- left: 16px;
237
- }
238
-
239
- &--right {
240
- right: 16px;
241
- }
242
227
  }
228
+ .sugar-carousel__arrow:hover {
229
+ background-color: rgba(31, 45, 61, 0.23);
230
+ }
231
+ .sugar-carousel__arrow--left {
232
+ left: 16px;
233
+ }
234
+ .sugar-carousel__arrow--right {
235
+ right: 16px;
236
+ }
237
+
243
238
  .carousel-arrow-left-enter-from,
244
239
  .carousel-arrow-left-leave-to {
245
240
  opacity: 0;
@@ -107,7 +107,7 @@ onUnmounted(() => {
107
107
  </div>
108
108
  </template>
109
109
 
110
- <style lang="scss" scoped>
110
+ <style scoped>
111
111
  .sugar-carousel__item {
112
112
  position: absolute;
113
113
  top: 0;
@@ -118,37 +118,22 @@ onUnmounted(() => {
118
118
  overflow: hidden;
119
119
  z-index: 0;
120
120
  transition: transform 0.4s ease-in-out;
121
- background-color: transparent; // Default
121
+ background-color: transparent;
122
122
  }
123
123
 
124
124
  .sugar-carousel__item--card {
125
125
  width: 50%;
126
- left: 25%; // Center it initially?
127
- // Actually if we use translateX 50% or -50%, it's relative to item width.
128
- // Element Plus Card:
129
- // Item width is 50%.
130
- // Active item is at translateX(containerWidth/4).
131
- // Prev item at translateX(0).
132
- // Next item at translateX(containerWidth/2).
133
-
134
- // My simplified CSS logic:
135
- // left: 25% (centers the 50% width item in container)
136
- // active: translate(0) -> centered
137
- // prev: translate(-50% of item) -> -25% of container? No, -50% of 50% is -25% width.
138
- // left 25% - 25% = 0% (Left aligned)
139
- // next: translate(50% of item) -> +25% of container.
140
- // left 25% + 25% = 50% (Right aligned)
141
- // This works!
126
+ left: 25%;
142
127
  }
143
128
 
144
129
  .sugar-carousel__mask {
145
- position: absolute;
146
- width: 100%;
147
- height: 100%;
148
- top: 0;
149
- left: 0;
150
- background-color: #fff;
151
- opacity: 0.24;
152
- transition: .2s;
130
+ position: absolute;
131
+ width: 100%;
132
+ height: 100%;
133
+ top: 0;
134
+ left: 0;
135
+ background-color: #fff;
136
+ opacity: 0.24;
137
+ transition: 0.2s;
153
138
  }
154
139
  </style>
@@ -69,7 +69,7 @@ watch(isDark, () => {
69
69
  <div v-if="open" ref="el" class="artalk-container" />
70
70
  </template>
71
71
 
72
- <style lang="scss" scoped>
72
+ <style scoped>
73
73
  .artalk-container {
74
74
  --at-color-main: var(--vp-c-brand-2);
75
75
  }
@@ -17,18 +17,17 @@ defineProps({
17
17
  </div>
18
18
  </template>
19
19
 
20
- <style lang="scss" scoped>
20
+ <style scoped>
21
21
  .sugar-image {
22
22
  position: relative;
23
23
  display: inline-block;
24
24
  overflow: hidden;
25
-
26
- &__inner {
27
- width: 100%;
28
- height: 100%;
29
- vertical-align: top;
30
- object-fit: inherit;
31
- cursor: pointer;
32
- }
25
+ }
26
+ .sugar-image__inner {
27
+ width: 100%;
28
+ height: 100%;
29
+ vertical-align: top;
30
+ object-fit: inherit;
31
+ cursor: pointer;
33
32
  }
34
33
  </style>
@@ -249,7 +249,7 @@ function handleKeydown(e: KeyboardEvent) {
249
249
  </Teleport>
250
250
  </template>
251
251
 
252
- <style lang="scss" scoped>
252
+ <style scoped>
253
253
  .sugar-image-viewer__wrapper {
254
254
  position: fixed;
255
255
  top: 0;
@@ -268,7 +268,7 @@ function handleKeydown(e: KeyboardEvent) {
268
268
  height: 100%;
269
269
  top: 0;
270
270
  left: 0;
271
- opacity: .5;
271
+ opacity: 0.5;
272
272
  background: #000;
273
273
  }
274
274
 
@@ -279,7 +279,7 @@ function handleKeydown(e: KeyboardEvent) {
279
279
  align-items: center;
280
280
  justify-content: center;
281
281
  border-radius: 50%;
282
- opacity: .8;
282
+ opacity: 0.8;
283
283
  cursor: pointer;
284
284
  box-sizing: border-box;
285
285
  user-select: none;
@@ -288,17 +288,15 @@ function handleKeydown(e: KeyboardEvent) {
288
288
  width: 44px;
289
289
  height: 44px;
290
290
  font-size: 24px;
291
-
292
- &:hover {
293
- border-color: #fff;
294
- background-color: #909399;
295
- }
296
-
297
- &.is-disabled {
298
- cursor: not-allowed;
299
- opacity: .3;
300
- background-color: #606266;
301
- }
291
+ }
292
+ .sugar-image-viewer__btn:hover {
293
+ border-color: #fff;
294
+ background-color: #909399;
295
+ }
296
+ .sugar-image-viewer__btn.is-disabled {
297
+ cursor: not-allowed;
298
+ opacity: 0.3;
299
+ background-color: #606266;
302
300
  }
303
301
 
304
302
  .sugar-image-viewer__close {
@@ -333,35 +331,32 @@ function handleKeydown(e: KeyboardEvent) {
333
331
  display: flex;
334
332
  align-items: center;
335
333
  justify-content: center;
336
- opacity: .8;
334
+ opacity: 0.8;
337
335
  box-sizing: border-box;
338
336
  user-select: none;
339
-
340
- &__inner {
341
- width: 100%;
342
- height: 100%;
343
- text-align: justify;
344
- cursor: default;
345
- font-size: 23px;
346
- color: #fff;
347
- display: flex;
348
- align-items: center;
349
- justify-content: space-around;
350
- gap: 12px;
351
-
352
- svg {
353
- cursor: pointer;
354
- }
355
- }
356
-
357
- &__divider {
358
- display: inline-block;
359
- width: 1px;
360
- height: 18px;
361
- margin: 0 10px;
362
- background: hsla(0,0%,100%,.5);
363
- vertical-align: middle;
364
- }
337
+ }
338
+ .sugar-image-viewer__actions__inner {
339
+ width: 100%;
340
+ height: 100%;
341
+ text-align: justify;
342
+ cursor: default;
343
+ font-size: 23px;
344
+ color: #fff;
345
+ display: flex;
346
+ align-items: center;
347
+ justify-content: space-around;
348
+ gap: 12px;
349
+ }
350
+ .sugar-image-viewer__actions__inner svg {
351
+ cursor: pointer;
352
+ }
353
+ .sugar-image-viewer__actions__divider {
354
+ display: inline-block;
355
+ width: 1px;
356
+ height: 18px;
357
+ margin: 0 10px;
358
+ background: hsla(0, 0%, 100%, 0.5);
359
+ vertical-align: middle;
365
360
  }
366
361
 
367
362
  .sugar-image-viewer__canvas {
@@ -379,28 +374,34 @@ function handleKeydown(e: KeyboardEvent) {
379
374
  user-select: none;
380
375
  pointer-events: auto;
381
376
  cursor: grab;
382
- transition: transform .3s;
383
-
384
- &:active {
385
- cursor: grabbing;
386
- }
377
+ transition: transform 0.3s;
378
+ }
379
+ .sugar-image-viewer__img:active {
380
+ cursor: grabbing;
387
381
  }
388
382
 
389
383
  .viewer-fade-enter-active {
390
- animation: viewer-fade-in .3s;
384
+ animation: viewer-fade-in 0.3s;
391
385
  }
392
386
 
393
387
  .viewer-fade-leave-active {
394
- animation: viewer-fade-out .3s;
388
+ animation: viewer-fade-out 0.3s;
395
389
  }
396
390
 
397
391
  @keyframes viewer-fade-in {
398
- 0% { opacity: 0; }
399
- 100% { opacity: 1; }
392
+ 0% {
393
+ opacity: 0;
394
+ }
395
+ 100% {
396
+ opacity: 1;
397
+ }
400
398
  }
401
-
402
399
  @keyframes viewer-fade-out {
403
- 0% { opacity: 1; }
404
- 100% { opacity: 0; }
400
+ 0% {
401
+ opacity: 1;
402
+ }
403
+ 100% {
404
+ opacity: 0;
405
+ }
405
406
  }
406
407
  </style>