Skip to content

Commit

Permalink
add xui
Browse files Browse the repository at this point in the history
  • Loading branch information
kagol committed Apr 8, 2024
1 parent 4ea8560 commit ebe8884
Show file tree
Hide file tree
Showing 16 changed files with 39 additions and 69 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ yarn create vite vite-demo --template vue-ts

安装`Carousel`
```
yarn add vue-devui-carousel
yarn add @kagol/vue-carousel
```

`main.ts`中引入`Carousel`
```
import Carousel from 'vue-devui-carousel'
import 'vue-devui-carousel/dist/style.css'
import Carousel from '@kagol/vue-carousel'
import '@kagol/vue-carousel/dist/style.css'
createApp(App)
.use(Carousel)
Expand Down
16 changes: 8 additions & 8 deletions carousel/src/carousel.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.devui-carousel {
.xui-carousel {
position: relative;
overflow: hidden;

.devui-carousel-indicator {
.xui-carousel-indicator {
position: absolute;
}
}

.devui-carousel-item-container {
.xui-carousel-item-container {
display: flex;
position: relative;
transition: left 500ms ease 0s; // 内容切换时的动效
Expand All @@ -17,22 +17,22 @@
}
}

.devui-arrow {
.xui-arrow {
position: absolute;
top: 50%;
margin-top: -18px;
cursor: pointer;
width: 36px;
height: 36px;
border-radius: 18px;
background: var(--devui-highlight-overlay, rgba(255, 255, 255, .8));
box-shadow: var(--devui-shadow-length-hover, 0 4px 16px 0) var(--devui-light-shadow, rgba(0, 0, 0, .1));
background: var(--xui-highlight-overlay, rgba(255, 255, 255, .8));
box-shadow: var(--xui-shadow-length-hover, 0 4px 16px 0) var(--xui-light-shadow, rgba(0, 0, 0, .1));
display: inline-flex;
align-items: center;
justify-content: center;
transition: background-color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1));
transition: background-color var(--xui-animation-duration-slow, .3s) var(--xui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1));

&:hover {
background: var(--devui-area, #f8f8f8);
background: var(--xui-area, #f8f8f8);
}
}
4 changes: 2 additions & 2 deletions carousel/src/carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ export default defineComponent({

return () => {
return (
<div class="devui-carousel">
<div class="xui-carousel">
<div
class="devui-carousel-item-container"
class="xui-carousel-item-container"
style={{
width: count * 100 + '%',
left: -(formattedPageIndex.value - 1) * 100 + '%',
Expand Down
10 changes: 5 additions & 5 deletions carousel/src/components/carousel-indicator.scss
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
.devui-carousel-indicator {
.xui-carousel-indicator {
display: flex;
position: relative;
bottom: 12px;
justify-content: center;
width: 100%;

.devui-carousel-indicator-item {
.xui-carousel-indicator-item {
cursor: pointer;
width: 6px;
height: 6px;
border-radius: 3px;
margin-right: 8px;
background: var(--devui-icon-fill, #d3d5d9);
background: var(--xui-icon-fill, #d3d5d9);

&.active {
width: 24px;
background: var(--devui-list-item-active-bg, #5e7ce0);
transition: all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1));
background: var(--xui-list-item-active-bg, #5e7ce0);
transition: all var(--xui-animation-duration-slow, .3s) var(--xui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1));
}
}
}
4 changes: 2 additions & 2 deletions carousel/src/components/carousel-indicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ export default defineComponent({
})

return () => {
return <div class="devui-carousel-indicator">
return <div class="xui-carousel-indicator">
{
slots.default
? slots.default({
pageIndex: pageIndex.value,
setPageIndex
})
: indicatorArr.map((item, index) => {
return <div class={`devui-carousel-indicator-item${pageIndex.value === index+1 ? ' active' : ''}`} onClick={() => setPageIndex(index + 1)}></div>
return <div class={`xui-carousel-indicator-item${pageIndex.value === index+1 ? ' active' : ''}`} onClick={() => setPageIndex(index + 1)}></div>
})
}
</div>
Expand Down
2 changes: 1 addition & 1 deletion carousel/src/components/carousel-next.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.devui-arrow-right {
.xui-arrow-right {
right: 20px;
}
2 changes: 1 addition & 1 deletion carousel/src/components/carousel-next.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default defineComponent({
slots.default
? renderSlot(slots, 'default')
: <>
<div class="devui-arrow devui-arrow-right" {...attrs}>
<div class="xui-arrow xui-arrow-right" {...attrs}>
<DArrowRight />
</div>
</>
Expand Down
2 changes: 1 addition & 1 deletion carousel/src/components/carousel-prev.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.devui-arrow-left {
.xui-arrow-left {
left: 20px;
}
2 changes: 1 addition & 1 deletion carousel/src/components/carousel-prev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default defineComponent({
slots.default
? renderSlot(slots, 'default')
: <>
<div class="devui-arrow devui-arrow-left" {...attrs}>
<div class="xui-arrow xui-arrow-left" {...attrs}>
<DArrowLeft />
</div>
</>
Expand Down
6 changes: 3 additions & 3 deletions docs/.vitepress/dist/assets/index.md.81baa307.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/.vitepress/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
</head>
<body>
<div id="app"><!--[--><div class="theme"><header class="nav-bar" data-v-675d8756><div class="sidebar-button" data-v-675d8756><svg class="icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z" class></path></svg></div><a class="nav-bar-title" href="/vue-carousel/" aria-label="Vue Carousel, back to home" data-v-675d8756 data-v-cc01ef16><img class="logo" src="/vue-carousel/assets/logo.svg" alt="Logo" data-v-cc01ef16> Vue Carousel</a><div class="flex-grow" data-v-675d8756></div><div class="nav" data-v-675d8756><nav class="nav-links" data-v-675d8756 data-v-eab3edfe><!--[--><div class="item" data-v-eab3edfe><div class="nav-link" data-v-eab3edfe data-v-b8818f8c><a class="item isExternal" href="https://github.com/kagol/vue-carousel" target="_blank" rel="noopener noreferrer" data-v-b8818f8c>Github <svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-b8818f8c><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div></div><!--]--><!----><!----></nav></div><!--[--><!--]--></header><aside class="sidebar" data-v-83e92a68><nav class="nav-links nav" data-v-83e92a68 data-v-eab3edfe><!--[--><div class="item" data-v-eab3edfe><div class="nav-link" data-v-eab3edfe data-v-b8818f8c><a class="item isExternal" href="https://github.com/kagol/vue-carousel" target="_blank" rel="noopener noreferrer" data-v-b8818f8c>Github <svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-b8818f8c><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div></div><!--]--><!----><!----></nav><!--[--><!--]--><ul class="sidebar-links" data-v-83e92a68><!--[--><li class="sidebar-link"><a class="sidebar-link-item active" href="/vue-carousel/">快速开始</a><!----></li><li class="sidebar-link"><p class="sidebar-link-item">特性</p><ul class="sidebar-links"><li class="sidebar-link"><a class="sidebar-link-item" href="/vue-carousel/features/basic/">基本用法</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/vue-carousel/features/autoplay/">自动播放</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/vue-carousel/features/juejin-events/">掘金活动</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/vue-carousel/features/indicator-position/">指示器位置</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/vue-carousel/features/custom-indicator/">自定义指示器</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/vue-carousel/features/pagination-position/">分页器位置</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/vue-carousel/features/custom-pagination/">自定义分页器</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/vue-carousel/features/collapse-card/">手风琴式折叠卡片</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/vue-carousel/features/huawei-events/">华为</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/vue-carousel/features/bilibili-events/">B站</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/vue-carousel/features/qqmusic/">QQ音乐</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/vue-carousel/features/leetcode-card/">LeetCode</a><!----></li></ul></li><!--]--></ul><!--[--><!--]--></aside><div class="sidebar-mask"></div><main class="page" data-v-7eddb2c4><div class="container" data-v-7eddb2c4><!--[--><!--]--><div style="position:relative;" class="content" data-v-7eddb2c4><div><h1 id="快速开始" tabindex="-1">快速开始 <a class="header-anchor" href="#快速开始" aria-hidden="true">#</a></h1><p>创建一个vite工程:</p><div class="language-"><pre><code>yarn create vite vite-demo --template vue-ts
</code></pre></div><p>安装<code>Carousel</code></p><div class="language-"><pre><code>yarn add vue-devui-carousel
</code></pre></div><p><code>main.ts</code>中引入<code>Carousel</code></p><div class="language-"><pre><code>import Carousel from &#39;vue-devui-carousel&#39;
import &#39;vue-devui-carousel/dist/style.css&#39;
</code></pre></div><p>安装<code>Carousel</code></p><div class="language-"><pre><code>yarn add @kagol/vue-carousel
</code></pre></div><p><code>main.ts</code>中引入<code>Carousel</code></p><div class="language-"><pre><code>import Carousel from &#39;@kagol/vue-carousel&#39;
import &#39;@kagol/vue-carousel/dist/style.css&#39;

createApp(App)
.use(Carousel)
Expand Down
30 changes: 0 additions & 30 deletions docs/assets/logo.svg

This file was deleted.

2 changes: 1 addition & 1 deletion docs/features/custom-indicator/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default defineComponent({
height: 8px;
margin: 4px;
border-radius: 50%;
background-color: var(--devui-icon-fill, #d3d5d9);
background-color: var(--xui-icon-fill, #d3d5d9);
overflow: hidden;
cursor: pointer;
}
Expand Down
2 changes: 1 addition & 1 deletion docs/features/huawei-events/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
width: 100px;
height: 3px;
margin: 0 8px;
background: var(--devui-icon-fill, #d3d5d9);
background: var(--xui-icon-fill, #d3d5d9);
cursor: pointer;
}
Expand Down
8 changes: 4 additions & 4 deletions docs/features/leetcode-card/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
width: 258px;
border-radius: 8px;
&:hover .devui-carousel-indicator {
&:hover .xui-carousel-indicator {
transform: scale(1.6);
}
.devui-carousel-indicator {
.xui-carousel-indicator {
transition: all 0.3s ease 0s;
}
Expand Down Expand Up @@ -75,11 +75,11 @@
width: 490px;
border-radius: 8px;
&:hover .devui-carousel-indicator {
&:hover .xui-carousel-indicator {
transform: scale(1.6);
}
.devui-carousel-indicator {
.xui-carousel-indicator {
transition: all 0.3s ease 0s;
}
Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ yarn create vite vite-demo --template vue-ts

安装`Carousel`
```
yarn add vue-devui-carousel
yarn add @kagol/vue-carousel
```

`main.ts`中引入`Carousel`
```
import Carousel from 'vue-devui-carousel'
import 'vue-devui-carousel/dist/style.css'
import Carousel from '@kagol/vue-carousel'
import '@kagol/vue-carousel/dist/style.css'
createApp(App)
.use(Carousel)
Expand Down

0 comments on commit ebe8884

Please sign in to comment.