如何实现音乐光碟旋转的效果

.content image{
    width: 300rpx;
    height: 300rpx;
    border-radius: 50%;
    border: 100rpx solid rgb(46, 46, 46);
    box-shadow: 0 0 50rpx rgb(204, 202, 202);
    animation: imgplay 20s linear infinite;

}

@keyframes imgplay{
    0%{
        transform:rotate(0deg);
    }
    100%{
        transform:rotate(100deg);
    }
}

分开讲解:

  实现光碟的效果

代码: 

    width: 300rpx;
    height: 300rpx;
    border-radius: 50%;
    border: 100rpx solid rgb(46, 46, 46);

效果:

 

 让它旋转起来,需要加动画

 

    animation: imgplay 20s linear infinite;

这行代码是一个 CSS 动画的样式规则,用于给元素添加一个名为 "imgplay" 的动画效果。让我们逐个解释这行代码的各个部分:

    <
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
好的,下面是一个简单的Java程序实现DVD管理器的基本功能: ``` import java.util.ArrayList; import java.util.Scanner; public class DVDCollection { private ArrayList<DVD> collection = new ArrayList<DVD>(); private int count = 0; public void addDVD() { Scanner input = new Scanner(System.in); System.out.println("请输入DVD名称:"); String name = input.nextLine(); System.out.println("请输入DVD类型:"); String type = input.nextLine(); System.out.println("请输入DVD出版日期:"); String date = input.nextLine(); DVD dvd = new DVD(name, type, date); collection.add(dvd); count++; System.out.println("DVD添加成功!"); } public void viewDVD() { if (count == 0) { System.out.println("DVD列表为空!"); } else { for (int i = 0; i < count; i++) { System.out.println("DVD名称:" + collection.get(i).getName()); System.out.println("DVD类型:" + collection.get(i).getType()); System.out.println("DVD出版日期:" + collection.get(i).getDate()); System.out.println("DVD状态:" + collection.get(i).getStatus()); } } } public void deleteDVD() { if (count == 0) { System.out.println("DVD列表为空!"); } else { Scanner input = new Scanner(System.in); System.out.println("请输入要删除的DVD名称:"); String name = input.nextLine(); boolean flag = false; for (int i = 0; i < count; i++) { if (collection.get(i).getName().equals(name)) { collection.remove(i); count--; flag = true; System.out.println("DVD删除成功!"); break; } } if (!flag) { System.out.println("未找到该DVD!"); } } } public void borrowDVD() { if (count == 0) { System.out.println("DVD列表为空!"); } else { Scanner input = new Scanner(System.in); System.out.println("请输入要借出的DVD名称:"); String name = input.nextLine(); boolean flag = false; for (int i = 0; i < count; i++) { if (collection.get(i).getName().equals(name)) { if (collection.get(i).getStatus().equals("已借出")) { System.out.println("该DVD已被借出!"); } else { collection.get(i).setStatus("已借出"); flag = true; System.out.println("DVD借出成功!"); } break; } } if (!flag) { System.out.println("未找到该DVD!"); } } } public void returnDVD() { if (count == 0) { System.out.println("DVD列表为空!"); } else { Scanner input = new Scanner(System.in); System.out.println("请输入要归还的DVD名称:"); String name = input.nextLine(); boolean flag = false; for (int i = 0; i < count; i++) { if (collection.get(i).getName().equals(name)) { if (collection.get(i).getStatus().equals("已归还")) { System.out.println("该DVD已被归还!"); } else { collection.get(i).setStatus("已归还"); flag = true; System.out.println("DVD归还成功!"); } break; } } if (!flag) { System.out.println("未找到该DVD!"); } } } public static void main(String[] args) { DVDCollection dvdCollection = new DVDCollection(); Scanner input = new Scanner(System.in); int choice = 0; while (true) { System.out.println("1.新增DVD 2.查看DVD 3.删除DVD 4.借出DVD 5.归还DVD 6.退出"); System.out.println("请选择要执行的操作:"); choice = input.nextInt(); switch (choice) { case 1: dvdCollection.addDVD(); break; case 2: dvdCollection.viewDVD(); break; case 3: dvdCollection.deleteDVD(); break; case 4: dvdCollection.borrowDVD(); break; case 5: dvdCollection.returnDVD(); break; case 6: System.exit(0); break; default: System.out.println("输入有误,请重新输入!"); break; } } } } class DVD { private String name; private String type; private String date; private String status; public DVD(String name, String type, String date) { this.name = name; this.type = type; this.date = date; this.status = "可借"; } public String getName() { return name; } public String getType() { return type; } public String getDate() { return date; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } } ``` 在这个程序中,我们定义了一个`DVDCollection`类来管理DVD的相关操作,其中包括了新增DVD、查看DVD、删除DVD、借出DVD和归还DVD等功能。我们还定义了一个`DVD`类来表示DVD的基本信息,包括名称、类型、出版日期和状态(可借、已借出、已归还)。 在程序的主函数中,我们通过循环来接受用户的输入,并根据用户的选择来执行相应的DVD管理操作。 注意,在程序中我们使用了`ArrayList`来存储DVD的信息,并通过`count`变量来记录DVD的数量。当用户选择查看DVD、删除DVD、借出DVD或归还DVD时,程序会遍历`ArrayList`中的所有DVD对象,并根据用户输入的名称来匹配相应的DVD对象。如果找到了相应的DVD对象,则进行相应的操作,否则输出未找到该DVD的提示。 以上就是一个简单的Java程序实现DVD管理器的基本功能的示例。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

铁灵

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值