Main Page/styles.css: Difference between revisions

From Center of NeuroWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:
}
}
.text-container {
.text-container {
    position: relative;
    width: 200px; /* 可以根据需要调整 */
    height: 50px; /* 可以根据需要调整 */
    margin: 0 auto; /* 居中对齐 */
    overflow: hidden;
}
.text-slide {
    position: absolute;
     width: 100%;
     width: 100%;
     overflow: hidden;
     height: 100%;
     white-space: nowrap;
     top: 0;
     margin: 0 auto;
    left: 0;
     position: relative;
     opacity: 0;
     animation: slide-animation 6s infinite;
}
 
.text-slide:nth-child(1) {
    animation-delay: 0s;
}
 
.text-slide:nth-child(2) {
    animation-delay: 2s;
}
}


.text {
.text-slide:nth-child(3) {
    display: inline-block;
     animation-delay: 4s;
    font-size: 24px;
    padding: 0 10px;
    box-sizing: border-box;
     animation: scroll 9s infinite;
}
}


@keyframes scroll {
@keyframes slide-animation {
     0%, 11.11% {
     0%, 20% {
        opacity: 0;
         transform: translateX(0);
         transform: translateX(0);
     }
     }
     22.22%, 33.33% {
     25%, 45% {
         transform: translateX(-100%);
        opacity: 1;
         transform: translateX(-1px);
     }
     }
     44.44%, 55.55% {
     30%, 40% {
         transform: translateX(-200%);
         transform: translateX(1px);
     }
     }
     66.66%, 77.77% {
     50%, 100% {
         transform: translateX(-300%);
        opacity: 0;
         transform: translateX(0);
     }
     }
}
}

Revision as of 00:03, 25 October 2024

.mainpage-title{
	font-size:1.6em;
	font-weight: bold;
}
.text-container {
    position: relative;
    width: 200px; /* 可以根据需要调整 */
    height: 50px; /* 可以根据需要调整 */
    margin: 0 auto; /* 居中对齐 */
    overflow: hidden;
}

.text-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    animation: slide-animation 6s infinite;
}

.text-slide:nth-child(1) {
    animation-delay: 0s;
}

.text-slide:nth-child(2) {
    animation-delay: 2s;
}

.text-slide:nth-child(3) {
    animation-delay: 4s;
}

@keyframes slide-animation {
    0%, 20% {
        opacity: 0;
        transform: translateX(0);
    }
    25%, 45% {
        opacity: 1;
        transform: translateX(-1px);
    }
    30%, 40% {
        transform: translateX(1px);
    }
    50%, 100% {
        opacity: 0;
        transform: translateX(0);
    }
}