js+css实现可拖拽有进度提示的文字幻灯片代码

代码语言:html

所属分类:幻灯片

代码描述:js+css实现可拖拽有进度提示的文字幻灯片代码

代码标签: js css 拖拽 进度 提示 文字 幻灯片 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
   <style>
       * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent
}

body {
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
    background: linear-gradient(135deg,#f5f7fa 0,#c3cfe2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px
}

.carousel-container {
    width: 100%;
    max-width: 400px;
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    background: white
}

.carousel {
    display: flex;
    transition: transform .5s cubic-bezier(0.25,0.46,0.45,0.94);
    height: 250px
}

.carousel-item {
    flex: 0 0 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden
}

.carousel-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1
}

.carousel-content {
    position: relative;
    z-index: 2;
    max-width: 80%
}

.carousel-item h3 {
    font-size: 22px;
    margin-bottom: 10px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3)
}

.carousel-item p {
    font-size: 14px;
    opacity: .9;
    line-height: 1.5;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3)
}

.carousel-item:nth-child(1) {
    background: linear-gradient(135deg,#667eea 0,#764ba2 100%)
}

.carousel-item:nth-child(2) {
    background: linear-gradient(135deg,#f093fb 0,#f5576c 100%)
}

.carousel-item:nth-child(3) {
    background: linear-gradient(135deg,#4facfe 0,#00f2fe 100%)
}

.carousel-item:nth-child(4) {
    background: linear-gradient(135deg,#43e97b 0,#38f9d7 100%)
}

.carousel-item:nth-child(5) {
    background: linear-gradient(135deg,#fa709a 0,#fee140 100%)
}

.indicators {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 10
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.5);
    cursor: poi.........完整代码请登录后点击上方下载按钮下载查看

网友评论0