Add flex box gap polyfill

This commit is contained in:
mashirozx 2021-07-29 00:01:45 +08:00
parent 1d97b87a69
commit eba002c503
25 changed files with 1299 additions and 318 deletions

View File

@ -1,5 +1,8 @@
module.exports = { module.exports = ({ env, options }) => ({
plugins: { ...options,
autoprefixer: {}, plugins: [
}, require('autoprefixer')({}),
} // require('flex-gap-polyfill')() // bugly with vite
// require('stylelint')({}), //
],
})

1
.stylelintignore Normal file
View File

@ -0,0 +1 @@
node_modules

10
.stylelintrc.json Normal file
View File

@ -0,0 +1,10 @@
{
"plugins": [
"stylelint-scss"
],
"extends": "stylelint-config-standard",
"rules": {
"rule-empty-line-before": "never",
"indentation": 2
}
}

View File

@ -1,4 +1,5 @@
{ {
"stylelint.enable": false,
"php-docblocker.returnGap": true, "php-docblocker.returnGap": true,
"php-docblocker.qualifyClassNames": true, "php-docblocker.qualifyClassNames": true,
"php-docblocker.author": { "php-docblocker.author": {

View File

@ -5,7 +5,7 @@
define('SAKURA_VERSION', wp_get_theme()->get('Version')); define('SAKURA_VERSION', wp_get_theme()->get('Version'));
define('SAKURA_TEXT_DOMAIN', wp_get_theme()->get('TextDomain')); define('SAKURA_TEXT_DOMAIN', wp_get_theme()->get('TextDomain'));
define('SAKURA_DEVEPLOMENT', false); define('SAKURA_DEVEPLOMENT', true);
define('SAKURA_DEVEPLOMENT_HOST', 'http://127.0.0.1:9000'); define('SAKURA_DEVEPLOMENT_HOST', 'http://127.0.0.1:9000');
// PHP loaders // PHP loaders

View File

@ -69,6 +69,7 @@
"vue-router": "^4.0.10" "vue-router": "^4.0.10"
}, },
"devDependencies": { "devDependencies": {
"@amatlash/vite-plugin-stylelint": "^1.1.1",
"@formatjs/cli": "^4.2.27", "@formatjs/cli": "^4.2.27",
"@types/chroma-js": "^2.1.3", "@types/chroma-js": "^2.1.3",
"@types/crypto-js": "^4.0.1", "@types/crypto-js": "^4.0.1",
@ -92,11 +93,15 @@
"eslint-plugin-formatjs": "^2.17.1", "eslint-plugin-formatjs": "^2.17.1",
"eslint-plugin-prettier": "^3.3.1", "eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-vue": "^7.13.0", "eslint-plugin-vue": "^7.13.0",
"flex-gap-polyfill": "^4.0.6",
"jest": "^27.0.6", "jest": "^27.0.6",
"nodemon": "^2.0.12", "nodemon": "^2.0.12",
"postcss-import": "^14.0.2", "postcss-import": "^14.0.2",
"prettier": "^2.3.2", "prettier": "^2.3.2",
"resize-observer-polyfill": "^1.5.1", "resize-observer-polyfill": "^1.5.1",
"stylelint": "^13.13.1",
"stylelint-config-standard": "^22.0.0",
"stylelint-scss": "^3.20.1",
"svgo": "^2.3.1", "svgo": "^2.3.1",
"ts-jest": "^27.0.3", "ts-jest": "^27.0.3",
"type-fest": "^1.2.2", "type-fest": "^1.2.2",
@ -109,7 +114,7 @@
}, },
"engines": { "engines": {
"npm": "please-use-yarn", "npm": "please-use-yarn",
"yarn": ">= 1.22.10", "yarn": ">= 1.22.0",
"node": ">= 14.17.1" "node": ">= 14.0.0"
} }
} }

View File

@ -147,6 +147,8 @@ export default defineComponent({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@use '@/styles/mixins/polyfills';
::v-deep() { ::v-deep() {
@import 'swiper/swiper'; @import 'swiper/swiper';
} }
@ -211,9 +213,9 @@ export default defineComponent({
flex-flow: row wrap; flex-flow: row wrap;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
gap: 12px;
padding: 12px; padding: 12px;
width: calc(100% - 24px); width: calc(100% - 24px);
@include polyfills.flex-gap(12px, 'row wrap');
} }
} }
</style> </style>

View File

@ -1,5 +1,6 @@
<template> <template>
<div class="picker__container"> <div class="picker__container">
<div class="flex-box">
<div class="row__wrapper--input"> <div class="row__wrapper--input">
<div class="input__wrapper"> <div class="input__wrapper">
<OutlinedInput v-model:content="userInput" label="Input remote URL here"></OutlinedInput> <OutlinedInput v-model:content="userInput" label="Input remote URL here"></OutlinedInput>
@ -11,6 +12,8 @@
<NormalButton icon="fas fa-box-open" context="Pick" :contained="true"></NormalButton> <NormalButton icon="fas fa-box-open" context="Pick" :contained="true"></NormalButton>
</div> </div>
</div> </div>
</div>
<div class="flex-box">
<div class="row__wrapper--preview"> <div class="row__wrapper--preview">
<div class="image__box" v-for="(item, index) in selection" :key="index"> <div class="image__box" v-for="(item, index) in selection" :key="index">
<div class="image__wrapper"> <div class="image__wrapper">
@ -22,6 +25,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -150,23 +154,24 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
@use '../variables'; @use '../variables';
@use '@/styles/mixins/polyfills';
.picker__container { .picker__container {
width: 100%; width: 100%;
display: flex; display: flex;
flex-flow: column nowrap; flex-flow: column nowrap;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
gap: 12px; @include polyfills.flex-gap(12px, 'column nowrap');
> * { > * {
width: 100%; width: 100%;
} }
> .row__wrapper { > .flex-box > .row__wrapper {
&--input { &--input {
display: flex; display: flex;
flex-flow: row nowrap; flex-flow: row nowrap;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
gap: 12px; @include polyfills.flex-gap(12px, 'row nowrap');
> .input__wrapper { > .input__wrapper {
flex: 1 1 auto; flex: 1 1 auto;
width: 100%; width: 100%;
@ -177,6 +182,7 @@ export default defineComponent({
@media screen and (max-width: variables.$small-mobile-max-width) { @media screen and (max-width: variables.$small-mobile-max-width) {
flex-flow: row wrap; flex-flow: row wrap;
justify-content: flex-start; justify-content: flex-start;
@include polyfills.flex-gap(12px, 'row wrap');
> .input__wrapper { > .input__wrapper {
flex: 0 0 auto; flex: 0 0 auto;
} }
@ -187,7 +193,7 @@ export default defineComponent({
flex-flow: row wrap; flex-flow: row wrap;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
gap: 12px; @include polyfills.flex-gap(12px, 'row wrap');
> .image__box { > .image__box {
position: relative; position: relative;
overflow: hidden; overflow: hidden;

View File

@ -5,32 +5,32 @@
<div class="thumbnail__wrapper" @click="handleViewPostDetailEvent"> <div class="thumbnail__wrapper" @click="handleViewPostDetailEvent">
<Image <Image
class="image" class="image"
:src="data.featureImage.thumbnail" :src="$props.data.featureImage.thumbnail"
:alt="data.title" :alt="$props.data.title"
placeholder="https://via.placeholder.com/1024x768" placeholder="https://via.placeholder.com/1024x768"
:draggable="false" :draggable="false"
/> />
</div> </div>
<div class="details__wrapper"> <div class="details__wrapper">
<div class="row__wrapper--date"> <div class="row__wrapper--date">
<span><i class="far fa-clock"></i> {{ data.publistTime }}</span> <span><i class="far fa-clock"></i> {{ $props.data.publistTime }}</span>
</div> </div>
<div class="row__wrapper--title" @click="handleViewPostDetailEvent"> <div class="row__wrapper--title" @click="handleViewPostDetailEvent">
<span>{{ data.title }}</span> <span>{{ $props.data.title }}</span>
</div> </div>
<div class="row__wrapper--info"> <div class="row__wrapper--info">
<div class="column__wrapper--read_count"> <div class="column__wrapper--read_count">
<span><i class="fab fa-hotjar"></i> {{ data.readCount }}</span> <span><i class="fab fa-hotjar"></i> {{ $props.data.readCount }}</span>
</div> </div>
<div class="column__wrapper--comment_count"> <div class="column__wrapper--comment_count">
<span> <i class="far fa-comment-dots"></i> {{ data.commentCount }}</span> <span> <i class="far fa-comment-dots"></i> {{ $props.data.commentCount }}</span>
</div> </div>
<div class="column__wrapper--word_count"> <div class="column__wrapper--word_count">
<span><i class="fas fa-pen-nib"></i> {{ data.wordCount }}</span> <span><i class="fas fa-pen-nib"></i> {{ $props.data.wordCount }}</span>
</div> </div>
</div> </div>
<div class="row__wrapper--abstruct"> <div class="row__wrapper--abstruct">
<span>{{ data.excerpt }} </span> <span>{{ $props.data.excerpt }} </span>
</div> </div>
<!-- <div class="row__wrapper--tags"> <!-- <div class="row__wrapper--tags">
<div class="tags__container"> <div class="tags__container">
@ -76,16 +76,11 @@ export default defineComponent({
defaultMessage: 'Read More', defaultMessage: 'Read More',
}) })
const data = props.data
const handleViewPostDetailEvent = () => { const handleViewPostDetailEvent = () => {
if (data) { linkHandler.handleClickLink({ url: props.data?.link ?? '', router, target: '_blank' })
linkHandler.handleClickLink({ url: data.value?.link ?? '', router, target: '_blank' })
}
} }
return { return {
data,
buttonContext, buttonContext,
handleViewPostDetailEvent, handleViewPostDetailEvent,
setContentRef, setContentRef,
@ -98,6 +93,7 @@ export default defineComponent({
@use '@/styles/mixins/text'; @use '@/styles/mixins/text';
@use '@/styles/mixins/tags'; @use '@/styles/mixins/tags';
// @use '@/styles/mixins/skeleton'; // @use '@/styles/mixins/skeleton';
@use '@/styles/mixins/polyfills';
.card__container { .card__container {
// TODO: sizing in parent // TODO: sizing in parent
@ -189,25 +185,25 @@ export default defineComponent({
@include text.line-number-limit(3); @include text.line-number-limit(3);
} }
} }
// &--tags { &--tags {
// max-height: 16px; max-height: 16px;
// overflow: hidden; overflow: hidden;
// align-items: flex-start; align-items: flex-start;
// .tags__container { .tags__container {
// display: flex; display: flex;
// flex-flow: row wrap; flex-flow: row wrap;
// justify-content: flex-start; justify-content: flex-start;
// align-items: center; align-items: center;
// gap: 12px; @include polyfills.flex-gap(12px, 'row wrap');
// .tag__wrapper { .tag__wrapper {
// display: flex; display: flex;
// flex-flow: row nowrap; flex-flow: row nowrap;
// justify-content: flex-start; justify-content: flex-start;
// align-items: center; align-items: center;
// @include tags.tag-style; @include tags.tag-style;
// } }
// } }
// } }
&--button { &--button {
justify-content: flex-end; justify-content: flex-end;
.button__wrapper { .button__wrapper {

View File

@ -1,6 +1,6 @@
<template> <template>
<PostThumbCardMobile v-if="isMobile" :data="data" :type="$props.type"></PostThumbCardMobile> <PostThumbCardMobile v-if="isMobile" :data="data" :type="$props.type"></PostThumbCardMobile>
<PostThumbCardClassic v-else :data="data"></PostThumbCardClassic> <PostThumbCardClassic v-else :data="data" :type="$props.type"></PostThumbCardClassic>
</template> </template>
<script lang="ts"> <script lang="ts">

View File

@ -1,30 +1,30 @@
<template> <template>
<div class="card__container"> <div class="card__container">
<div class="row__wrapper--thumbnail"> <div class="row__wrapper--thumbnail" @click="handleViewPostDetailEvent">
<Image <Image
class="image" class="image"
:src="data.featureImage.thumbnail" :src="$props.data.featureImage.thumbnail"
:alt="data.title" :alt="$props.data.title"
placeholder="https://via.placeholder.com/1024x768" placeholder="https://via.placeholder.com/1024x768"
:draggable="false" :draggable="false"
/> />
</div> </div>
<div class="row__wrapper--title"> <div class="row__wrapper--title" @click="handleViewPostDetailEvent">
<span>{{ data.title }}</span> <span>{{ $props.data.title }}</span>
</div> </div>
<div class="row__wrapper--statistics"> <div class="row__wrapper--statistics">
<div class="column__wrapper--read_count"> <div class="column__wrapper--read_count">
<span><i class="fab fa-hotjar"></i> {{ data.readCount }}</span> <span><i class="fab fa-hotjar"></i> {{ $props.data.readCount }}</span>
</div> </div>
<div class="column__wrapper--comment_count"> <div class="column__wrapper--comment_count">
<span> <i class="far fa-comment-dots"></i> {{ data.commentCount }}</span> <span> <i class="far fa-comment-dots"></i> {{ $props.data.commentCount }}</span>
</div> </div>
<div class="column__wrapper--word_count"> <div class="column__wrapper--word_count">
<span><i class="fas fa-pen-nib"></i> {{ data.wordCount }}</span> <span><i class="fas fa-pen-nib"></i> {{ $props.data.wordCount }}</span>
</div> </div>
</div> </div>
<div class="row__wrapper--abstract"> <div class="row__wrapper--abstract">
<span>{{ data.excerpt }} </span> <span>{{ $props.data.excerpt }} </span>
</div> </div>
<div class="row__wrapper--tags"> <div class="row__wrapper--tags">
<div class="tags__container"> <div class="tags__container">
@ -63,16 +63,11 @@ export default defineComponent({
defaultMessage: 'Read More', defaultMessage: 'Read More',
}) })
const data = props.data
const handleViewPostDetailEvent = () => { const handleViewPostDetailEvent = () => {
if (data) { linkHandler.handleClickLink({ url: props.data?.link ?? '', router, target: '_blank' })
linkHandler.handleClickLink({ url: data.value?.link ?? '', router, target: '_blank' })
}
} }
return { return {
data,
buttonContext, buttonContext,
handleViewPostDetailEvent, handleViewPostDetailEvent,
} }
@ -83,6 +78,7 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
@use '@/styles/mixins/text'; @use '@/styles/mixins/text';
@use '@/styles/mixins/tags'; @use '@/styles/mixins/tags';
@use '@/styles/mixins/polyfills';
.card__container { .card__container {
width: 100%; width: 100%;
@ -90,7 +86,7 @@ export default defineComponent({
flex-flow: column nowrap; flex-flow: column nowrap;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
gap: 12px; @include polyfills.flex-gap(12px, 'column nowrap');
> * { > * {
width: calc(100% - 24px); width: calc(100% - 24px);
} }
@ -107,7 +103,7 @@ export default defineComponent({
flex-flow: row wrap; flex-flow: row wrap;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
gap: 12px; @include polyfills.flex-gap(12px, 'row wrap');
.tag__wrapper { .tag__wrapper {
display: flex; display: flex;
flex-flow: row nowrap; flex-flow: row nowrap;

View File

@ -13,28 +13,40 @@
<span>{{ $props.data.title }}</span> <span>{{ $props.data.title }}</span>
</div> </div>
<div class="row__wrapper--info"> <div class="row__wrapper--info">
<div class="flex-box">
<div class="column__wrapper--avatar"> <div class="column__wrapper--avatar">
<div class="image__wrapper">
<Image <Image
:src="$props.data.author.avatar['96']" :src="$props.data.author.avatar['96']"
:avatar="true" :avatar="true"
:alt="$props.data.author.nickname" :alt="$props.data.author.nickname"
></Image> ></Image>
</div> </div>
</div>
</div>
<div class="flex-box">
<div class="column__wrapper--author"> <div class="column__wrapper--author">
<span>{{ $props.data.author.nickname }}</span> <span>{{ $props.data.author.nickname }}</span>
</div> </div>
</div>
<div class="flex-box">
<div class="column__wrapper--publish"> <div class="column__wrapper--publish">
<span>{{ $props.data.publistTime }}</span> <span>{{ $props.data.publistTime }}</span>
</div> </div>
</div>
<div class="flex-box">
<div class="column__wrapper--words"> <div class="column__wrapper--words">
<span>{{ $props.data.wordCount }}</span> <span>{{ $props.data.wordCount }}</span>
</div> </div>
</div>
<div class="flex-box">
<div class="column__wrapper--reads"> <div class="column__wrapper--reads">
<span>{{ $props.data.readCount }}</span> <span>{{ $props.data.readCount }}</span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -62,6 +74,7 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
@use '@/styles/mixins/text'; @use '@/styles/mixins/text';
@use '@/styles/mixins/polyfills';
.feature-image__container { .feature-image__container {
width: 100%; width: 100%;
height: 400px; height: 400px;
@ -103,8 +116,8 @@ export default defineComponent({
line-height: 48px; line-height: 48px;
font-size: xx-large; font-size: xx-large;
color: #ffffff; color: #ffffff;
@include text.line-number-limit(1); // @include text.line-number-limit(1);
@include text.text-shadow-offset; // @include text.text-shadow-offset;
} }
} }
&--info { &--info {
@ -113,22 +126,16 @@ export default defineComponent({
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
padding-top: 12px; padding-top: 12px;
gap: 6px; @include polyfills.flex-gap(6px, 'row nowrap');
> .flex-box {
> * { > * {
flex: 1 1 auto; flex: 1 1 auto;
display: flex; display: flex;
flex-flow: row nowrap; flex-flow: row nowrap;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
gap: 6px;
&:not(:first-child):not(:last-child) { @include polyfills.flex-gap(6px, 'row nowrap');
&::after {
content: '·';
line-height: 20px;
font-size: medium;
color: #ffffff;
}
}
span { span {
line-height: 20px; line-height: 20px;
font-size: medium; font-size: medium;
@ -136,19 +143,26 @@ export default defineComponent({
text-transform: lowercase; text-transform: lowercase;
} }
} }
&:not(:first-child):not(:last-child) {
> * {
&::after {
content: '·';
line-height: 20px;
font-size: medium;
color: #ffffff;
}
}
}
.column__wrapper { .column__wrapper {
&--avatar { &--avatar {
flex: 0 0 auto; flex: 0 0 auto;
> .image__wrapper {
width: 36px; width: 36px;
height: 36px; height: 36px;
border-radius: 50%; border-radius: 50%;
overflow: hidden; overflow: hidden;
margin-right: 6px; margin-right: 6px;
// .avatar { }
// width: 100%;
// height: 100%;
// object-fit: cover;
// }
} }
&--author { &--author {
} }
@ -162,5 +176,6 @@ export default defineComponent({
} }
} }
} }
}
} }
</style> </style>

View File

@ -51,6 +51,7 @@ export default defineComponent({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@use '@/styles/mixins/polyfills';
@use '@/styles/markdown/github'; @use '@/styles/markdown/github';
.item__container { .item__container {
width: 100%; width: 100%;
@ -105,7 +106,7 @@ export default defineComponent({
font-size: small; font-size: small;
display: flex; display: flex;
flex-flow: row wrap; flex-flow: row wrap;
gap: 12px; @include polyfills.flex-gap(12px, 'row wrap');
} }
} }
} }

View File

@ -138,6 +138,7 @@ export default defineComponent({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@use '@/styles/mixins/polyfills';
.composer__container { .composer__container {
--mdc-theme-primary: orange; --mdc-theme-primary: orange;
width: 100%; width: 100%;
@ -167,7 +168,7 @@ export default defineComponent({
flex-flow: row nowrap; flex-flow: row nowrap;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
gap: 12px; @include polyfills.flex-gap(12px, 'row nowrap');
.column__wrapper { .column__wrapper {
&--avatar { &--avatar {
flex: 0 0 auto; flex: 0 0 auto;

View File

@ -27,15 +27,16 @@ export default defineComponent({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@use '@/styles/mixins/polyfills';
.loader__container { .loader__container {
width: 100%; width: 100%;
height: 200px; height: 200px;
min-width: 200px; min-width: 200px;
display: flex; display: flex;
flex-direction: column; flex-flow: column nowrap;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
gap: 12px; @include polyfills.flex-gap(12px, 'column nowrap');
.text { .text {
text-align: center; text-align: center;
color: #6c7486; color: #6c7486;

View File

@ -1,8 +1,9 @@
<template> <template>
<div class="item__container mdc-card mdc-card--outlined"> <div class="item__container mdc-card mdc-card--outlined" :type="$props.message.type">
<div class="item__content"> <div class="item__content">
<div class="flex-box">
<div class="column__wrapper--icon"> <div class="column__wrapper--icon">
<span><i class="fas fa-info-circle"></i></span> <span><i :class="icon"></i></span>
</div> </div>
<div class="column__wrapper--content"> <div class="column__wrapper--content">
<div class="row__wrapper--title"> <div class="row__wrapper--title">
@ -34,6 +35,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -62,6 +64,21 @@ export default defineComponent({
}), }),
} }
const icon = computed(() => {
switch (props.message?.type) {
case 'success':
return 'fas fa-check-circle'
case 'warning':
return 'fas fa-exclamation-circle'
case 'info':
return 'fas fa-info-circle'
case 'error':
return 'fas fa-exclamation-triangle'
default:
return 'fas fa-info-circle'
}
})
const { messageList, removeMessage } = useInjector(messages) const { messageList, removeMessage } = useInjector(messages)
const handleCloseMessageEvent = () => { const handleCloseMessageEvent = () => {
@ -83,6 +100,7 @@ export default defineComponent({
return { return {
msg, msg,
icon,
handleCloseMessageEvent, handleCloseMessageEvent,
shouldShowDetail, shouldShowDetail,
handleShowDetailClick, handleShowDetailClick,
@ -95,24 +113,41 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
@use "sass:color"; @use "sass:color";
@use '@/styles/mixins/polyfills';
.item__container { .item__container {
--text-color: #3c434a;
--text-color-lighter-30: color.adjust(#3c434a, $lightness: 30%);
--background-color: #ffffff;
&[type='success'] {
--highlight-color: #00b74a;
}
&[type='warning'] {
--highlight-color: #ffa900;
}
&[type='info'] {
--highlight-color: #39c0ed;
}
&[type='error'] {
--highlight-color: #f93154; // danger
}
width: var(--width); width: var(--width);
background: #ffffff; background: var(--background-color);
border-left: 3px solid #34d058; border-left: 3px solid var(--highlight-color, #757575);
> .item__content { > .item__content {
width: calc(100% - 24px); width: calc(100% - 24px);
padding: 12px; padding: 12px;
> .flex-box {
display: flex; display: flex;
flex-flow: row nowrap; flex-flow: row nowrap;
align-items: space-between; align-items: space-between;
align-items: flex-start; align-items: flex-start;
gap: 12px; @include polyfills.flex-gap(12px, 'row nowrap');
> .column__wrapper { > .column__wrapper {
&--icon { &--icon {
flex: 0 0 auto; flex: 0 0 auto;
span { span {
color: #34d058; color: var(--highlight-color, #757575);
font-size: medium; font-size: medium;
} }
} }
@ -129,7 +164,7 @@ export default defineComponent({
flex-flow: row nowrap; flex-flow: row nowrap;
justify-content: space-between; justify-content: space-between;
align-items: flex-start; align-items: flex-start;
gap: 12px; @include polyfills.flex-gap(12px, 'row nowrap');
> * span { > * span {
line-height: 16px; line-height: 16px;
} }
@ -139,7 +174,7 @@ export default defineComponent({
width: 100%; width: 100%;
> .title { > .title {
span { span {
color: #3c434a; color: var(--text-color);
} }
} }
> .detailed { > .detailed {
@ -156,7 +191,7 @@ export default defineComponent({
transform: scaleY(1); transform: scaleY(1);
} }
span { span {
color: color.adjust(#3c434a, $lightness: 30%); color: var(--text-color-lighter-30);
} }
} }
} }
@ -181,5 +216,6 @@ export default defineComponent({
} }
} }
} }
}
} }
</style> </style>

View File

@ -104,13 +104,14 @@ export default defineComponent({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@use '@/styles/mixins/polyfills';
.pagination__container { .pagination__container {
width: 100%; width: 100%;
display: flex; display: flex;
flex-flow: row wrap; flex-flow: row wrap;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
gap: 6px; @include polyfills.flex-gap(6px, 'row wrap');
.items__wrapper { .items__wrapper {
.item__wrapper { .item__wrapper {
--mdc-typography-button-font-size: 13px; --mdc-typography-button-font-size: 13px;

View File

@ -33,6 +33,7 @@
</span> </span>
</div> </div>
<div class="social-media__wrapper"> <div class="social-media__wrapper">
<div class="social-media__content">
<div <div
class="social-media-item__wrapper" class="social-media-item__wrapper"
v-for="(item, index) in socialMedia" v-for="(item, index) in socialMedia"
@ -44,6 +45,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="mask__layer"></div> <div class="mask__layer"></div>
</div> </div>
</template> </template>
@ -154,6 +156,7 @@ export default defineComponent({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@use '@/styles/mixins/polyfills';
$mobile-view-max-width: 800px; $mobile-view-max-width: 800px;
.cover__container { .cover__container {
width: 100%; width: 100%;
@ -267,12 +270,14 @@ $mobile-view-max-width: 800px;
} }
.social-media__wrapper { .social-media__wrapper {
margin-top: 6px; margin-top: 6px;
width: 100%;
.social-media__content {
width: 100%; width: 100%;
display: flex; display: flex;
flex-flow: row wrap; flex-flow: row wrap;
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;
gap: 20px; @include polyfills.flex-gap(20px, 'row wrap');
.social-media-item__wrapper { .social-media-item__wrapper {
width: 24px; width: 24px;
height: 24px; height: 24px;
@ -284,6 +289,7 @@ $mobile-view-max-width: 800px;
} }
} }
} }
}
.mask__layer { .mask__layer {
position: absolute; position: absolute;
top: 0; top: 0;

View File

@ -1,5 +1,6 @@
<template> <template>
<div class="footer__container"> <div class="footer__container">
<div class="footer__content">
<div class="row__wrapper"> <div class="row__wrapper">
<div class="sakura-icon__wrapper fa-spin"> <div class="sakura-icon__wrapper fa-spin">
<ui-icon name="ic.sakura"></ui-icon> <ui-icon name="ic.sakura"></ui-icon>
@ -12,6 +13,7 @@
<span v-html="$props.footer2"></span> <span v-html="$props.footer2"></span>
</div> </div>
</div> </div>
</div>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -33,14 +35,17 @@ export default defineComponent({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@use '@/styles/mixins/polyfills';
.footer__container { .footer__container {
width: 100%; width: 100%;
padding: 36px 0 24px 0; padding: 36px 0 24px 0;
> .footer__content {
width: 100%;
display: flex; display: flex;
flex-direction: column; flex-flow: column nowrap;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
gap: 12px; @include polyfills.flex-gap(12px, 'column nowrap');
.sakura-icon__wrapper { .sakura-icon__wrapper {
width: 30px; width: 30px;
height: 30px; height: 30px;
@ -48,5 +53,6 @@ export default defineComponent({
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
}
} }
</style> </style>

View File

@ -36,7 +36,7 @@ export default defineComponent({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
// @use 'sass:math'; @use '@/styles/mixins/polyfills';
.nav__container { .nav__container {
position: relative; position: relative;
width: 100%; width: 100%;
@ -121,7 +121,7 @@ export default defineComponent({
flex-flow: row-reverse nowrap; flex-flow: row-reverse nowrap;
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;
gap: 12px; @include polyfills.flex-gap(12px, 'row-reverse nowrap');
> .logo__wrapper { > .logo__wrapper {
flex: 0 0 auto; flex: 0 0 auto;
display: flex; display: flex;

View File

@ -2,6 +2,7 @@
<div class="drawer__container" :ref="setScrollContainerRef"> <div class="drawer__container" :ref="setScrollContainerRef">
<div class="drawer__content"> <div class="drawer__content">
<div class="row__wrapper--avatar"> <div class="row__wrapper--avatar">
<div class="image__wrapper">
<Image <Image
src="https://view.moezx.cc/images/2021/06/13/d6b010a378d392d4633008b915f98ab1.md.png" src="https://view.moezx.cc/images/2021/06/13/d6b010a378d392d4633008b915f98ab1.md.png"
placeholder="" placeholder=""
@ -10,6 +11,7 @@
:draggable="false" :draggable="false"
></Image> ></Image>
</div> </div>
</div>
<div class="row__wrapper--signature">Hello world...</div> <div class="row__wrapper--signature">Hello world...</div>
<div class="row__wrapper--social"> social</div> <div class="row__wrapper--social"> social</div>
<div class="row__wrapper--search"> <div class="row__wrapper--search">
@ -115,6 +117,7 @@ export default defineComponent({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@use '@/styles/mixins/polyfills';
.drawer__container { .drawer__container {
position: relative; position: relative;
width: 100%; width: 100%;
@ -125,15 +128,18 @@ export default defineComponent({
flex-flow: column nowrap; flex-flow: column nowrap;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
gap: 24px; @include polyfills.flex-gap(24px, 'column nowrap');
> .row__wrapper { > .row__wrapper {
&--avatar { &--avatar {
flex: 0 0 auto;
.image__wrapper {
margin-top: 50px; margin-top: 50px;
width: 90px; width: 90px;
height: 90px; height: 90px;
border-radius: 50%; border-radius: 50%;
overflow: hidden; overflow: hidden;
} }
}
&--signature { &--signature {
text-align: center; text-align: center;
color: #333333; color: #333333;

View File

@ -16,7 +16,7 @@ export interface Message {
export interface MessageOptions extends Omit<Message, 'id'> {} export interface MessageOptions extends Omit<Message, 'id'> {}
export default function msg(): object { export default function msg(): object {
const [messageList, setMessageList]: [Ref<Message[]>, (arg: Message[]) => void] = useState([]) const [messageList, setMessageList] = useState([] as Message[])
const addMessage = (state: typeof messageList, options: MessageOptions) => { const addMessage = (state: typeof messageList, options: MessageOptions) => {
const id = `message_${uniqueHash()}` const id = `message_${uniqueHash()}`

View File

@ -0,0 +1,37 @@
@use 'sass:math';
@mixin _flex-gap($gap, $row: true) {
$margin: math.div($gap, 2);
$transform: -$margin;
@if $row {
margin-left: $transform;
margin-right: $transform;
} @else {
margin-top: $transform;
margin-bottom: $transform;
}
> * {
@if $row {
margin-left: $margin;
margin-right: $margin;
} @else {
margin-top: $margin;
margin-bottom: $margin;
}
}
}
@mixin flex-gap($gap, $flex-flow: 'row nowrap') {
@if $flex-flow== 'row nowrap' or $flex-flow== 'row-reverse nowrap' {
@include _flex-gap($gap, true);
} @else if $flex-flow== 'column nowrap' or $flex-flow== 'column-reverse nowrap' {
@include _flex-gap($gap, false);
} @else if $flex-flow== 'row wrap' or $flex-flow== 'row-reverse wrap' {
@include _flex-gap($gap, true);
@include _flex-gap($gap, false);
} @else if $flex-flow== 'column wrap' or $flex-flow== 'column-reverse wrap' {
@include _flex-gap($gap, true);
@include _flex-gap($gap, false);
} @else {
@error "The second paramater $flex-flow is set to be '#{$flex-flow}', which is illegal.";
}
}

View File

@ -3,6 +3,7 @@ import vue from '@vitejs/plugin-vue'
// import legacy from '@vitejs/plugin-legacy' // import legacy from '@vitejs/plugin-legacy'
import path from 'path' import path from 'path'
import svgicon from 'vite-plugin-svgicon' import svgicon from 'vite-plugin-svgicon'
// import viteStylelint from '@amatlash/vite-plugin-stylelint'
const target = process.env.APP_TARGET const target = process.env.APP_TARGET
@ -23,6 +24,7 @@ export default defineConfig({
// legacy({ // legacy({
// targets: ['defaults', 'not IE 11'], // targets: ['defaults', 'not IE 11'],
// }), // }),
// viteStylelint(), // bugly
], ],
server: { server: {
host: '0.0.0.0', host: '0.0.0.0',
@ -46,6 +48,7 @@ export default defineConfig({
sourcemap: true, sourcemap: true,
outDir: target === 'main' ? 'app/assets/main' : 'app/assets/admin', outDir: target === 'main' ? 'app/assets/main' : 'app/assets/admin',
chunkSizeWarningLimit: 2048, chunkSizeWarningLimit: 2048,
// minify: false, // set false if use flex-gap-polyfill
rollupOptions: { rollupOptions: {
// external: ['vue'], // external: ['vue'],
input: [path.resolve(__dirname, target === 'main' ? 'src/main.ts' : 'src/admin/main.ts')], input: [path.resolve(__dirname, target === 'main' ? 'src/main.ts' : 'src/admin/main.ts')],
@ -59,7 +62,14 @@ export default defineConfig({
}, },
}, },
optimizeDeps: { optimizeDeps: {
include: ['gsap', 'marked', 'gsap/ScrollTrigger', 'highlight.js', '@vueuse/core'], include: [
'gsap',
'marked',
'gsap/ScrollTrigger',
'highlight.js',
'@vueuse/core',
'perfect-scrollbar',
],
}, },
css: { css: {
preprocessorOptions: { preprocessorOptions: {

899
yarn.lock

File diff suppressed because it is too large Load Diff