New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

carouselable

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

carouselable

A 3D Carousel

latest
Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

3D 旋转木马 轮播图

example

example

用法:

Vanilla:

<body>
  <div id="carousel">
    <div class="carousel-item"></div>
    <div class="carousel-item"></div>
    <div class="carousel-item"></div>
  </div>
</body>

<script type="module">
  import { initCarousel } from "./carousel.js";
  initCarousel({
    xRadius: 350,
    yRadius: 35,
    farScale: 0.7,
    speed: 4,
    itemClass: "carousel-item",
    handle: document.getElementById("carousel"),
  });
</script>

VueJS:

<script setup lang="ts">
import { onMounted } from "vue";
import { initCarousel } from "carouselable";
onMounted(() => {
  const carousel = document.getElementById("carousel");
  if (carousel) {
    initCarousel({
      itemClass: "carousel-item",
      handle: carousel,
      xRadius: 350,
      yRadius: 55,
      farScale: 0.7,
      speed: 4,
    });
  }
});
</script>

<template>
  <div class="container">
    <div id="carousel">
      <div class="carousel-item" style="background-color: rgba(127, 255, 212, 0.3)">
        <div style="width: 100%;height: 100%;display: flex;justify-content: center;align-items: center;font-size: 100px;">👻</div>
      </div>
      <div class="carousel-item" style="background-color: rgb(127, 150, 255, 0.3)">
        <div style="width: 100%;height: 100%;display: flex;justify-content: center;align-items: center;font-size: 100px;">🥰</div>
      </div>
      <div class="carousel-item" style="background-color: rgba(255, 127, 249, 0.3)">
        <div style="width: 100%;height: 100%;display: flex;justify-content: center;align-items: center;font-size: 100px;">😎</div>
      </div>
      <div class="carousel-item" style="background-color: rgba(127, 129, 255, 0.3)">
        <div style="width: 100%;height: 100%;display: flex;justify-content: center;align-items: center;font-size: 100px;">😘</div>
      </div>
      <div class="carousel-item" style="background-color: rgba(242, 255, 127, 0.3)">
        <div style="width: 100%;height: 100%;display: flex;justify-content: center;align-items: center;font-size: 100px;">🤷‍♂️</div>
      </div>
      <div class="carousel-item" style="background-color: rgba(255, 168, 127, 0.3)">
        <div style="width: 100%;height: 100%;display: flex;justify-content: center;align-items: center;font-size: 100px;">😡</div>
      </div>
    </div>
  </div>
</template>

编译:

npm build

如果你正在编译Vanilla, 请在tsconfig.json中将"module": "CommonJS"注释掉。

FAQs

Package last updated on 22 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts