create-fesd-app 1.0.1 → 1.0.3

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.
@@ -81,6 +81,21 @@ $typeFull-content-padding_rwd: 20px
81
81
  $pagination-TB-gap: 20px
82
82
  $pagination-TB-gap_rwd: 10px
83
83
 
84
+ // 表格與其他物件上下間的距離
85
+ $table-TB-gap: 20px
86
+ $table-TB-gap_rwd: 20px
87
+
88
+ // 表格最小寬度
89
+ $table-min-width: 180px
90
+ $freeze-table-height: 500px
91
+
92
+ // 表格間距
93
+ $table-padding: 15px 30px
94
+ $table-padding_rwd: 10px 15px
95
+
96
+ // 引言與其他物件上下間的距離
97
+ $quote-TB-gap: 20px
98
+
84
99
  /////////////////////////////////////////////
85
100
  ////////////////// [ 內容 ] /////////////////
86
101
  /////////////////////////////////////////////
@@ -203,6 +218,8 @@ $pagination-TB-gap_rwd: 10px
203
218
  width: 100%
204
219
  // 以下可修改
205
220
  font-size: 14px
221
+ font-weight: 400
222
+ line-height: 1.5
206
223
  +rwdmax($basic_rwd)
207
224
  // 以下可修改
208
225
  font-size: 12px
@@ -301,3 +318,283 @@ $pagination-TB-gap_rwd: 10px
301
318
  transform: translate(0, -50%) rotate(45deg)
302
319
  border-left: 2px solid #000
303
320
  border-bottom: 2px solid #000
321
+
322
+
323
+ // 20250528 新增
324
+ %quote
325
+ ._quote
326
+ // 顯示符號
327
+ quotes: '“' '”' '"' '"' "'" "'"
328
+ // 以下可修改
329
+ font-size: px(20)
330
+ line-height: 1.8
331
+ font-weight: 600
332
+ &::before
333
+ margin-right: 10px
334
+ &:after
335
+ margin-left: 10px
336
+
337
+ %table
338
+ // @extend %table_solid_single
339
+ // @extend %table_solid_striped
340
+ // @extend %table_border_rows
341
+ // @extend %table_border_full
342
+ @extend %table_solidSingle_borderColumn
343
+ table
344
+ th, td
345
+ // text-align: left
346
+ background: #fff
347
+ // 以下可修改
348
+ span
349
+ display: block
350
+ font-size: 14px
351
+ line-height: 1.8
352
+ thead
353
+ th
354
+ span
355
+ display: block
356
+ // 以下可修改
357
+ font-size: 16px
358
+ font-weight: 600
359
+
360
+ %table_tipText
361
+ // 以下可修改
362
+ gap: 10px
363
+ font-size: 14px
364
+ font-weight: 500
365
+ line-height: 1.5
366
+ letter-spacing: 0.5px
367
+ i.icon-drag
368
+ font-size: px(20)
369
+
370
+ %table_navigation
371
+ gap: 20px
372
+ display: flex
373
+ justify-content: center
374
+ align-items: center
375
+ .table-nav-left,
376
+ .table-nav-right
377
+ position: relative
378
+ cursor: pointer
379
+ &.disabled
380
+ pointer-events: none
381
+ opacity: .3
382
+ &::after
383
+ content: ''
384
+ display: block
385
+ width: 40px
386
+ height: 40px
387
+ border: 1px solid rgba(#000,.5)
388
+ border-radius: 5px
389
+ &::before
390
+ content: ''
391
+ width: 10px
392
+ height: 10px
393
+ position: absolute
394
+ top: 50%
395
+ left: 50%
396
+ .table-nav-left
397
+ &::before
398
+ border-left: 2px solid #000
399
+ border-bottom: 2px solid #000
400
+ transform: translate(-25%, -50%) rotate(45deg)
401
+ .table-nav-right
402
+ &::before
403
+ border-right: 2px solid #000
404
+ border-top: 2px solid #000
405
+ transform: translate(-75%, -50%) rotate(45deg)
406
+
407
+ // 以下可修改 - 可新增 / 自訂表格樣式
408
+ // 表格內框線樣式建議使用 偽元素製作以避免凍結合併時出錯
409
+ %table_solid_single
410
+ ._table
411
+ border-bottom: 5px solid #6AA8FF
412
+ &:not(:has(thead))
413
+ border-top: 5px solid #6AA8FF
414
+ table
415
+ thead
416
+ th
417
+ color: #fff
418
+ background-color: #6AA8FF
419
+ tbody
420
+ tr:nth-child(even)
421
+ td
422
+ background-color: #F2F2F2
423
+ %table_solid_striped
424
+ ._table
425
+ border-bottom: 5px solid #6AA8FF
426
+ &:not(:has(thead))
427
+ border-top: 5px solid #6AA8FF
428
+ table
429
+ thead
430
+ color: #fff
431
+ th:nth-child(odd)
432
+ background-color: #6AA8FF
433
+ th:nth-child(even)
434
+ background-color: #3287FF
435
+ tbody
436
+ tr:nth-child(even)
437
+ td
438
+ background-color: #F2F2F2
439
+ %table_border_rows
440
+ ._table
441
+ border-bottom: 2px solid #000
442
+ &:not(:has(thead))
443
+ border-top: 2px solid #000
444
+ table
445
+ thead
446
+ th
447
+ color: #00C5B1
448
+ position: relative
449
+ &::before
450
+ content: ''
451
+ position: absolute
452
+ width: 100%
453
+ height: 2px
454
+ left: 0
455
+ top: 0
456
+ background: #000
457
+ tr:last-child
458
+ th::after
459
+ content: ''
460
+ position: absolute
461
+ width: 100%
462
+ height: 2px
463
+ bottom: 0
464
+ left: 0
465
+ background: #000
466
+ tbody
467
+ tr:not(:first-child)
468
+ td
469
+ position: relative
470
+ &::after
471
+ content: ''
472
+ position: absolute
473
+ width: 100%
474
+ height: 1px
475
+ top: 0
476
+ left: 0
477
+ background-color: rgba(#000, .2)
478
+ %table_border_full
479
+ ._table
480
+ border-bottom: 2px solid #000
481
+ &:not(:has(thead))
482
+ border-top: 2px solid #000
483
+ table
484
+ thead
485
+ th
486
+ position: relative
487
+ &::before
488
+ content: ''
489
+ position: absolute
490
+ width: 100%
491
+ height: 2px
492
+ bottom: 0
493
+ left: 0
494
+ background-color: #000
495
+ z-index: 5
496
+ &:not(:last-child)
497
+ &:after
498
+ content: ''
499
+ position: absolute
500
+ top: 50%
501
+ right: 0
502
+ width: 1px
503
+ height: 20px
504
+ transform: translate3d(50%, -50%, 0)
505
+ background-color: #000
506
+ tbody
507
+ td
508
+ position: relative
509
+ tr:not(:first-child)
510
+ td
511
+ &::after
512
+ content: ''
513
+ position: absolute
514
+ width: 100%
515
+ height: 1px
516
+ top: 0
517
+ left: 0
518
+ background-color: rgba(#000, .2)
519
+ tr
520
+ td
521
+ &:not(:last-child)
522
+ &::before
523
+ content: ''
524
+ position: absolute
525
+ width: 1px
526
+ height: 100%
527
+ top: 0
528
+ right: 0
529
+ background-color: rgba(#000, .2)
530
+ %table_solidSingle_borderColumn
531
+ @extend %table_solid_single
532
+ table
533
+ thead
534
+ th
535
+ &:not(:last-child)
536
+ position: relative
537
+ &:after
538
+ content: ''
539
+ position: absolute
540
+ top: 50%
541
+ right: 0
542
+ width: 1px
543
+ height: 100%
544
+ z-index: 3
545
+ transform: translate3d(50%, -50%, 0)
546
+ background-color: #fff
547
+ tbody
548
+ td:not(:last-child)
549
+ position: relative
550
+ &::after
551
+ content: ''
552
+ position: absolute
553
+ top: 0
554
+ right: 0
555
+ width: 1px
556
+ height: 100%
557
+ background-color: rgba(#000, .2)
558
+
559
+ // markdown文字樣式
560
+ %table_markdown_style
561
+ [data-center]
562
+ text-align: center
563
+ ol
564
+ list-style: decimal
565
+ ul
566
+ list-style: disc
567
+ ol, ul
568
+ padding-left: 16px
569
+ li
570
+ line-height: 1.2
571
+ &:not(:first-child)
572
+ margin-top: 10px
573
+ h1
574
+ font-size: 28px
575
+ line-height: 1.2
576
+ h2
577
+ font-size: 26px
578
+ line-height: 1.2
579
+ h3
580
+ font-size: 24px
581
+ line-height: 1.2
582
+ h4
583
+ font-size: 22px
584
+ line-height: 1.2
585
+ h5
586
+ font-size: 20px
587
+ line-height: 1.2
588
+ h6
589
+ font-size: 18px
590
+ line-height: 1.2
591
+ p
592
+ font-size: 16px
593
+ line-height: 1.2
594
+ white-space: pre-wrap
595
+ em
596
+ font-style: italic
597
+ a
598
+ color: #004cc5
599
+
600
+
@@ -82,7 +82,7 @@
82
82
  &[data-align='left']
83
83
  .txtBox
84
84
  margin-right: auto
85
-
85
+
86
86
  // 麵包屑
87
87
  .breadCrumbs
88
88
  width: 100%
@@ -5,7 +5,7 @@ $(async () => {
5
5
  // common Init
6
6
  common.inits()
7
7
  // pluginInit
8
- new Article4('._articleBlock')
8
+ const article4 = new Article4('._articleBlock')
9
9
  // coding...
10
10
  methods.noContentCheck();
11
- })
11
+ })
@@ -0,0 +1,154 @@
1
+ //- ========================
2
+ //- mixin: article
3
+ //- ========================
4
+ mixin article(data, HTag='h4', subHTag='h5')
5
+ - const complexTypes = ['base', 'typeSL', 'typeSR', 'typeU', 'typeUL', 'typeUR', 'typeD', 'typeDL', 'typeDR']
6
+ - const isComplex = complexTypes.includes(data.articleType)
7
+
8
+ article(class=`_article ${data.articleType || ''}`)&attributes(data.attributes || {})
9
+ ._contentWrap
10
+ if isComplex && data.H
11
+ +dynamicHeading(HTag , '_H', data.H)
12
+ +backgroundWrap(data.backgroundPC, data.backgroundMobile)
13
+ +imgSwiperBlock(data.SwiperImg)
14
+ +imgCoverBlock(data.img)
15
+ +wordBlock(data, isComplex, HTag, subHTag)
16
+ +quoteBlock(data)
17
+ +tableBlock(d, data.tableData, HTag)
18
+ if block
19
+ block
20
+
21
+
22
+ //- ========================
23
+ //- mixin: dynamicHeading
24
+ //- ========================
25
+ mixin dynamicHeading(tag, className, content)
26
+ - const validTags = ['h2', 'h3', 'h4', 'h5', 'h6']
27
+ - const seoTag = validTags.includes(tag) ? tag : 'h4'
28
+ if seoTag === 'h2'
29
+ h2(class=className) !{content}
30
+ else if seoTag === 'h3'
31
+ h3(class=className) !{content}
32
+ else if seoTag === 'h4'
33
+ h4(class=className) !{content}
34
+ else if seoTag === 'h5'
35
+ h5(class=className) !{content}
36
+ else if seoTag === 'h6'
37
+ h6(class=className) !{content}
38
+ else
39
+ p(class=className) !{content}
40
+
41
+ //- ========================
42
+ //- mixin: backgroundWrap
43
+ //- ========================
44
+ mixin backgroundWrap(backgroundPC, backgroundMobile)
45
+ if backgroundPC || backgroundMobile
46
+ ._backgroundWrap
47
+ if backgroundPC
48
+ ._pc(style=`background-image: url(${backgroundPC})`)
49
+ if backgroundMobile
50
+ ._mobile(style=`background-image: url(${backgroundMobile})`)
51
+
52
+ //- ========================
53
+ //- mixin: imgSwiperBlock
54
+ //- ========================
55
+ mixin imgSwiperBlock(images)
56
+ if Array.isArray(images) && images.length
57
+ ._imgCover
58
+ .swiper
59
+ .swiper-wrapper
60
+ each img in images
61
+ ._cover.swiper-slide
62
+ ._photo&attributes(img.videoAttributes || {})
63
+ if img.img
64
+ img(src=img.img alt='')
65
+ if img.description
66
+ p._description= img.description
67
+ .swiper-button-cover
68
+
69
+ //- ========================
70
+ //- mixin: imgCoverBlock
71
+ //- ========================
72
+ mixin imgCoverBlock(images)
73
+ if Array.isArray(images) && images.length
74
+ ._imgCover
75
+ each img in images
76
+ ._cover
77
+ ._photo&attributes(img.videoAttributes || {})
78
+ if img.img
79
+ img(src=img.img alt='')
80
+ if img.description
81
+ p._description= img.description
82
+
83
+ //- ========================
84
+ //- mixin: wordBlock
85
+ //- ========================
86
+ mixin wordBlock(d, isComplex, HTag, subHTag)
87
+ - const isFloat = d.articleType === 'typeLR' || d.articleType === 'typeRR'
88
+ if isFloat
89
+ if d.H
90
+ +dynamicHeading(HTag, '_H', d.H)
91
+ if d.subH
92
+ +dynamicHeading(subHTag, '_subH', d.subH)
93
+ if d.P
94
+ ._P
95
+ p !{d.P}
96
+ if d.button
97
+ span._buttonCover
98
+ a._button(href='javascript:;')= d.button
99
+ else
100
+ if (!isComplex && d.H) || d.subH || d.P
101
+ ._wordCover
102
+ if !isComplex && d.H
103
+ +dynamicHeading(d.titleTag || 'h4', '_H', d.H)
104
+ if d.subH
105
+ +dynamicHeading(d.subTitleTag || 'h5', '_subH', d.subH)
106
+ if d.P
107
+ ._P
108
+ p !{d.P}
109
+ if d.button
110
+ span._buttonCover
111
+ a._button(href='javascript:;')= d.button
112
+
113
+ //- ========================
114
+ //- mixin: quoteBlock
115
+ //- ========================
116
+ mixin quoteBlock(d)
117
+ if d.quote
118
+ q._quote !{d.quote}
119
+ if d.quoteP
120
+ ._P
121
+ p !{d.quoteP}
122
+
123
+
124
+ //- ========================
125
+ //- mixin: tableBlock
126
+ //- ========================
127
+ mixin tableBlock(d,tableData)
128
+ if tableData
129
+ if tableData.H
130
+ +dynamicHeading(HTag, '_H', tableData.H)
131
+ ._tableCover
132
+ p._tipText
133
+ i.icon-drag
134
+ span !{tableData.tipText ? tableData.tipText : '左右托拉查看表格資訊'}
135
+ if tableData.table
136
+ ._table
137
+ table
138
+ thead
139
+ each head in tableData.table.head
140
+ tr
141
+ each th in head
142
+ th
143
+ p=th
144
+ tbody
145
+ each body in tableData.table.body
146
+ tr
147
+ each td in body
148
+ td
149
+ p=td
150
+ else if block
151
+ ._table
152
+ block
153
+ ._P
154
+ p !{tableData.paragraph}