Vue3 + Pinia + Vite5 仿抖音,完全度90% . Vue3 + Pinia + Vite5 imitate TikTok with 90% completeness
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

652 lines
14 KiB

@import "../../assets/scss/index";
.fade1-enter-active,
.fade1-leave-active {
transition: all 0.3s ease;
}
.fade1-enter-from,
.fade1-leave-to {
transform: translateY(10px);
opacity: 0;
}
.FromBottomDialog {
left: inherit;
}
#Uploader {
position: fixed;
background: @main-bg;
height: 100%;
width: 100%;
font-size: 1.4rem;
.preview-img {
z-index: 3;
position: fixed;
bottom: 0;
top: 0;
background: black;
display: flex;
align-items: center;
justify-content: center;
.resource {
width: 100vw;
max-height: 100vw;
}
.download {
position: absolute;
bottom: 2rem;
right: 2rem;
padding: .3rem;
background: @second-btn-color-tran;
width: 2rem;
}
}
.mask {
background: #0000004f;
position: absolute;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 3;
}
.scroll {
.notice {
font-size: 1.2rem;
height: 4rem;
color: @second-text-color;
display: flex;
justify-content: center;
align-items: center;
img {
height: 1.2rem;
margin-right: .5rem;
}
}
.collect {
padding: .7rem;
.video {
background: @active-main-bg;
border-radius: .5rem;
padding: 1rem;
margin-bottom: .7rem;
.top {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
.left {
display: flex;
align-items: center;
color: gainsboro;
img {
height: 2rem;
margin-right: .5rem;
}
}
.right {
display: flex;
align-items: center;
color: @second-text-color;
}
}
.list {
display: grid;
grid-template-columns: 33.33% 33.33% 33.33%;
.item {
height: calc(33.33vw * 1.3);
padding: .2rem;
overflow: hidden;
position: relative;
.poster {
border-radius: .4rem;
width: 100%;
height: 100%;
display: block;
}
.num {
color: white;
position: absolute;
bottom: .5rem;
left: .5rem;
display: flex;
align-items: center;
font-size: 1.4rem;
.love {
width: 1.4rem;
height: 1.4rem;
margin-right: .5rem;
}
}
}
}
}
.audio {
background: @active-main-bg;
border-radius: .5rem;
padding: 1rem;
.top {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
.left {
display: flex;
align-items: center;
color: gainsboro;
img {
height: 1.5rem;
margin-right: .5rem;
}
}
.right {
display: flex;
align-items: center;
color: @second-text-color;
}
}
.list {
display: grid;
grid-template-columns: 33.33% 33.33% 33.33%;
.item {
padding: .2rem;
overflow: hidden;
position: relative;
.poster {
border-radius: .4rem;
width: 100%;
height: calc((100vw - 3.4rem) / 3);
display: block;
}
.title {
margin-top: .5rem;
color: @second-text-color;
}
}
}
}
}
}
.float {
position: fixed;
box-sizing: border-box;
width: 100vw;
z-index: 2;
display: flex;
justify-content: space-between;
align-items: center;
height: 4.6rem;
padding: 0 1.5rem;
background: transparent;
transition: all .2s;
.center {
left: 50%;
transform: translateX(-50%);
position: absolute;
color: white;
}
&.fixed {
background: @main-bg;
img {
background: @main-bg !important;
}
}
.left {
img {
transform: rotate(180deg);
border-radius: 50%;
background: rgba(82, 80, 80, 0.5);
padding: .6rem;
width: 1.8rem;
}
}
.follow-btn {
color: white;
position: absolute;
font-size: 1.2rem;
padding: .3rem 1.2rem;
border-radius: .2rem;
right: 6rem;
background: @primary-btn-color;
&.followed {
background: @second-btn-color;
}
}
.right {
display: flex;
color: white;
align-items: center;
position: relative;
.request {
font-size: 1.2rem;
height: 2.6rem;
display: flex;
padding-right: 1.3rem;
padding-left: .5rem;
align-items: center;
border-radius: 2rem;
background: rgba(82, 80, 80, 0.5);
img {
padding: .6rem;
width: 1.8rem;
}
}
.menu {
margin-left: 1.5rem;
border-radius: 50%;
background: rgba(82, 80, 80, 0.5);
padding: .6rem;
width: 1.8rem;
}
}
}
.desc {
header {
color: white;
height: 12rem;
background-image: url('../../assets/img/header-bg.png');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
box-sizing: border-box;
}
.detail {
transform: translateY(-1rem);
background: @main-bg;
border-radius: 1rem 1rem 0 0;
.detail-wrapper {
padding: 0 2rem 1.5rem 2rem;
.head {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
transform: translateY(-2rem);
.head-image {
background: black;
padding: 2px;
border-radius: 50%;
width: 8rem;
height: 8rem;
}
.heat {
margin-top: 1rem;
width: calc(100% - 12rem);
color: @second-text-color;
display: flex;
align-items: center;
justify-content: space-between;
.num {
margin-top: .5rem;
color: white;
font-size: 1.6rem;
font-weight: bold;
margin-right: 3px;
}
.text {
font-size: 1.2rem;
margin-right: 10px;
display: flex;
align-items: center;
flex-direction: column;
}
}
}
.description {
font-size: 1.2rem;
color: white;
transform: translateY(-2rem);
.number {
color: @second-text-color;
padding-bottom: 2rem;
border-bottom: 1px solid @line-color;
display: flex;
align-items: center;
img {
width: 1.6rem;
margin-left: .5rem;
}
}
}
.signature {
color: white;
display: flex;
align-items: center;
margin-bottom: .5rem;
img {
height: 1.2rem;
margin-left: .6rem;
}
}
.more {
color: @second-text-color;
display: flex;
.item {
padding: .2rem .5rem;
border-radius: .2rem;
background: @second-btn-color-tran;
font-size: 1rem;
display: flex;
align-items: center;
margin-right: .5rem;
img {
height: 1rem;
margin-right: .2rem;
}
}
}
.other {
display: flex;
margin-bottom: 2rem;
.item {
margin-right: 2.5rem;
display: flex;
img {
margin-right: .8rem;
border-radius: .4rem;
background: @second-btn-color-tran;
padding: .8rem;
height: 2.2rem;
}
.right {
display: flex;
justify-content: space-between;
flex-direction: column;
.top {
color: white;
font-size: 1.4rem;
}
.bottom {
color: @second-text-color;
font-size: 1.2rem;
}
}
}
}
.my-buttons {
margin-top: 2rem;
overflow: hidden;
display: flex;
justify-content: flex-end;
align-items: center;
@width: 3.6rem;
.follow-display {
flex: 1;
overflow: hidden;
.follow-wrapper {
width: 200%;
display: flex;
flex-wrap: nowrap;
transition: all .3s ease;
&.follow-wrapper-followed {
transform: translate3d(-50%, 0, 0);
}
.no-follow {
width: calc(100% - 0.5rem);
color: white;
border-radius: .2rem;
background: @primary-btn-color;
height: @width;
display: flex;
align-items: center;
justify-content: center;
margin-right: .5rem;
box-sizing: border-box;
span {
margin-left: .2rem;
}
}
.followed {
width: 100%;
display: flex;
justify-content: space-around;
align-items: center;
.l-button {
color: white;
border-radius: .2rem;
background: @second-btn-color;
height: @width;
width: 50%;
margin-right: .5rem;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
span {
margin-left: .2rem;
}
img {
transform: rotate(180deg);
}
}
}
}
img {
@width: 1.4rem;
width: @width;
height: @width;
}
}
.option {
position: relative;
width: @width;
height: @width;
font-size: 1.2rem;
display: flex;
align-items: center;
justify-content: center;
border-radius: .2rem;
background: @second-btn-color;
color: white;
&.option-recommend {
.arrow {
transform: rotate(0deg);
}
}
}
.loading {
@width: 1.2rem;
width: @width;
height: @width;
animation: rotate .6s linear infinite;
@keyframes rotate {
from {
transform: rotate(0deg)
}
to {
transform: rotate(360deg)
}
}
}
.arrow {
transition: transform .3s ease;
transform: rotate(180deg);
@width: 1.6rem;
width: @width;
height: @width;
}
}
}
.recommend {
transition: all .3s ease;
height: 22rem;
overflow: hidden;
&.hidden {
height: 0;
}
.title {
padding: 0 2rem 0 2rem;
font-size: 1.2rem;
color: @second-text-color;
display: flex;
justify-content: space-between;
.left {
display: flex;
align-items: center;
}
img {
margin-left: .3rem;
width: 1.3rem;
height: 1.3rem;
}
.right {
display: flex;
align-items: center;
}
}
.friends {
padding-left: 2rem;
margin-top: 1rem;
display: flex;
overflow-x: scroll;
.friend {
position: relative;
background: @second-btn-color-tran;
margin-right: 1rem;
padding: 1rem;
display: flex;
flex-direction: column;
align-items: center;
.avatar {
@width: 10rem;
border-radius: 50%;
width: @width;
height: @width;
}
.name {
margin-top: 1rem;
font-size: 1.2rem;
color: white;
}
.tips {
margin-top: .5rem;
font-size: 1.2rem;
color: @second-text-color;
}
.button {
margin-top: 1rem;
width: 15rem;
height: 2.6rem;
font-size: 1.2rem;
}
.close {
position: absolute;
top: .2rem;
right: .2rem;
}
}
.more {
.notice {
width: 10rem;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: @second-text-color;
}
}
}
}
}
}
}