分类目录归档:编程

mysql – 启动错误InnoDB: mmap(XXXX bytes) failed; errno 12

本文转载:http://blog.lihuanliang.com/?p=46
mysql – 启动错误InnoDB: mmap(XXXX bytes) failed; errno 12
重启错误提示

[root@XXXXXXX/]# /etc/init.d/mysqld start

Starting MySQL. ERROR! The server quit without updating PID file (/var/mysql/data/XXXX.pid).

[root@XXXXXXX/]# /etc/init.d/mysqld restart

ERROR! MySQL server PID file could not be found!

Starting MySQL. ERROR! The server quit without updating PID file (/var/mysql/data/XXXX.pid).

mysql要占用内存的时候 物理内存不够用导致的 所有 vim /etc/my.cnf

[inonodb]
innodb_buffer_pool_size=64MB #把这个数值改小 高版本的默认是128MB


————————————————

原文链接:https://blog.csdn.net/lihuanliang765142602/article/details/78029340

记一次centos服务器满空间清理

过程记录:

[root@iZ8vb4m3j60ueayf2rziv8Z ~]# df -h   //查看空间使用情况
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        40G   38G     0 100% /
devtmpfs        1.9G     0  1.9G   0% /dev
tmpfs           1.9G     0  1.9G   0% /dev/shm
tmpfs           1.9G  436K  1.9G   1% /run
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
tmpfs           380M     0  380M   0% /run/user/0
[root@iZ8vb4m3j60ueayf2rziv8Z ~]# cd /    //跳转根目录
[root@iZ8vb4m3j60ueayf2rziv8Z /]# du -sh *     //查看各目录情况
0       bin
218M    boot
4.0K    data
0       dev
38M     etc
466M    home
0       lib
0       lib64
16K     lost+found
4.0K    media
4.0K    mnt
4.0K    mysql.sql
213M    opt
du: cannot access ‘proc/5646/task/5646/fd/4’: No such file or directory
du: cannot access ‘proc/5646/task/5646/fdinfo/4’: No such file or directory
du: cannot access ‘proc/5646/fd/4’: No such file or directory
du: cannot access ‘proc/5646/fdinfo/4’: No such file or directory
0       proc
220K    root
468K    run
0       sbin
4.0K    srv
0       sys
7.8M    tmp
14G     usr
23G     var
[root@iZ8vb4m3j60ueayf2rziv8Z /]# cd /usr
[root@iZ8vb4m3j60ueayf2rziv8Z usr]# du -sh *
306M    bin
4.0K    etc
4.0K    games
28M     include
340M    java
670M    lib
410M    lib64
63M     libexec
11G     local
443M    sbin
368M    share
350M    src
0       tmp
[root@iZ8vb4m3j60ueayf2rziv8Z usr]# cd local
[root@iZ8vb4m3j60ueayf2rziv8Z local]# du -sh *
351M    aegis
12M     bin
4.0K    etc
4.0K    games
4.0K    include
4.0K    lib
4.0K    lib64
4.0K    libexec
11G     php
4.0K    sbin
92K     share
65M     src
58M     svnRepo
[root@iZ8vb4m3j60ueayf2rziv8Z local]# cd php
[root@iZ8vb4m3j60ueayf2rziv8Z php]# du -sh *
116M    bin
112K    etc
5.0M    include
9.3M    lib
2.4M    log
92K     php
3.4M    phpredis
39M     sbin
10G     var
[root@iZ8vb4m3j60ueayf2rziv8Z php]# cd /var
[root@iZ8vb4m3j60ueayf2rziv8Z var]# du -sh *
4.0K    adm
9.9G    cache
4.0K    crash
28K     db
8.0K    empty
4.0K    games
4.0K    gopher
12K     kerberos
2.5G    lib
4.0K    local
0       lock
3.9G    log
0       mail
4.0K    nis
4.0K    opt
4.0K    preserve
0       run
4.7G    spool
179M    svn
20K     tmp
1.9G    www
4.0K    yp
[root@iZ8vb4m3j60ueayf2rziv8Z var]# cd log
[root@iZ8vb4m3j60ueayf2rziv8Z log]# du -sh *
40K     aliyun-util.log
4.0K    anaconda
39M     audit
0       boot.log
0       boot.log-20211228
0       boot.log-20211229
0       boot.log-20211230
0       boot.log-20211231
0       boot.log-20220101
0       boot.log-20220102
0       boot.log-20220103
18M     btmp
9.2M    btmp-20220101
476M    caigo
4.0K    caigo-error
4.0K    chrony
216K    cron
704K    cron-20211212
984K    cron-20211220
708K    cron-20211226
856K    cron-20220102
36K     dmesg
36K     dmesg.old
12K     firewalld
8.0K    grubby
4.0K    grubby_prune_debug
3.4G    journal
16K     lastlog
0       maillog
0       maillog-20211212
0       maillog-20211220
0       maillog-20211226
0       maillog-20220102
284K    messages
912K    messages-20211212
1.3M    messages-20211220
916K    messages-20211226
1.1M    messages-20220102
28K     mysqld.log
4.0M    mysql.log20200419before
2.7M    nginx
48K     ntp.log
4.0K    ntpstats
8.0K    php-fpm
4.0K    ppp
4.0K    repair.log
4.0K    rhsm
18M     sa
16M     secure
8.2M    secure-20211212
208K    secure-20211220
4.0K    secure-20211226
4.0K    secure-20220102
0       spooler
0       spooler-20211212
0       spooler-20211220
0       spooler-20211226
0       spooler-20220102
0       tallylog
28K     tuned
276K    wtmp
0       yum.log
40K     yum.log-20180101
4.0K    yum.log-20190101
4.0K    yum.log-20200420
[root@iZ8vb4m3j60ueayf2rziv8Z log]# cd journal/
[root@iZ8vb4m3j60ueayf2rziv8Z journal]# du -sh *
3.4G    a9fe31fd96c841a5a16f9c54110b66cc
[root@iZ8vb4m3j60ueayf2rziv8Z journal]# journalctl --disk-usage
Archived and active journals take up 3.3G on disk.
[root@iZ8vb4m3j60ueayf2rziv8Z journal]# journalctl --vacuum-time=30d   只留30天
Deleted archived journal /var/log/journal/a9fe31fd96c841a5a16f9c54110b66cc/system@a04c2e13fe6a4e0b8a6d7aa2908722cb-0000000000000001-0005a3abfd744d0e.journal (64.0M).
Deleted archived journal 
……
Deleted archived journal /var/log/journal/a9fe31fd96c841a5a16f9c54110b66cc/system@a04c2e13fe6a4e0b8a6d7aa2908722cb-00000000002498c0-0005d24fc91bef19.journal (8.0M).
Vacuuming done, freed 2.8G of archived journals on disk.
[root@iZ8vb4m3j60ueayf2rziv8Z journal]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        40G   36G  1.9G  96% /
devtmpfs        1.9G     0  1.9G   0% /dev
tmpfs           1.9G     0  1.9G   0% /dev/shm
tmpfs           1.9G  436K  1.9G   1% /run
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
tmpfs           380M     0  380M   0% /run/user/0
[root@iZ8vb4m3j60ueayf2rziv8Z journal]# cd /
[root@iZ8vb4m3j60ueayf2rziv8Z /]# cd var
[root@iZ8vb4m3j60ueayf2rziv8Z var]# du -sh *
4.0K    adm
9.9G    cache
4.0K    crash
28K     db
8.0K    empty
4.0K    games
4.0K    gopher
12K     kerberos
1.5G    lib
4.0K    local
0       lock
1.1G    log
0       mail
4.0K    nis
4.0K    opt
4.0K    preserve
0       run
4.7G    spool
179M    svn
20K     tmp
1.9G    www
4.0K    yp
[root@iZ8vb4m3j60ueayf2rziv8Z var]# cd cache/
[root@iZ8vb4m3j60ueayf2rziv8Z cache]# du -sh *
24K     fontconfig
32K     ldconfig
1.8M    man
9.9G    yum
[root@iZ8vb4m3j60ueayf2rziv8Z cache]# yum clean packages
Loaded plugins: fastestmirror, priorities
Cleaning repos: base epel extras mysql-connectors-community mysql-tools-community mysql57-community remi-safe updates webtatic
2227 package files removed
[root@iZ8vb4m3j60ueayf2rziv8Z cache]# yum clean headers
Loaded plugins: fastestmirror, priorities
Cleaning repos: base epel extras mysql-connectors-community mysql-tools-community mysql57-community remi-safe updates webtatic
0 header files removed
[root@iZ8vb4m3j60ueayf2rziv8Z cache]# yum clean oldheaders
Loaded plugins: fastestmirror, priorities
Error: invalid clean argument: 'oldheaders'
 Mini usage:
clean [headers|packages|metadata|dbcache|plugins|expire-cache|all]
Remove cached data
[root@iZ8vb4m3j60ueayf2rziv8Z cache]# du -sh *
24K     fontconfig
32K     ldconfig
1.8M    man
436M    yum
[root@iZ8vb4m3j60ueayf2rziv8Z cache]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        40G   25G   14G  66% /
devtmpfs        1.9G     0  1.9G   0% /dev
tmpfs           1.9G     0  1.9G   0% /dev/shm
tmpfs           1.9G  436K  1.9G   1% /run
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
tmpfs           380M     0  380M   0% /run/user/0

Point 1:centos清理/dev/vda1系统盘:

df   -h   检查一台服务器磁盘使用空间,发现磁盘已经使用了100%

思路是:

1、cd /usr   当然这里不一定是/usr目录,最好是cd到 根目录再执行下一步

2、du -sh * 看哪个目录占用空间大

3、重复前两步,根据实际情况删除或者移走

4、日志的话可以运行cat /dev/null > file.log清空

5、软件包的可以rpm -e 卸载或者rm -rf dir

即:

具体:可以通过下面的方法进行清理:

使用如下命令查找大于100M的大文件,发现有几个日志文件及临时文件比较大,使用rm –rf删除即可。

    find / -size +100M -exec ls -lh {} \;

    也可以使用 du -h –max-depth=1  /路径  查询文件夹占用显示该目录占用空间的总和

     譬如:du -h –max-depth=1  /var

    删除文件时,要小心,不要删除系统文件了 :)

Point 2:Linux yum清除var下目录缓存

Linux下yum发音(丫目)。

yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器。提供软件查找、安装、删除某一个或一组甚至全部软件包的命令,而且命令简洁而又好记。

yum的命令形式如下:

yum [options] [command] [package …]

常用的命令包括:

#安装软件 yum install packages

#更新软件 yum update packages

#删除软件 yum remove packages

#清除缓存 yum clean packages

重点介绍:

通常,yum 把下载的header和软件 包 都存储在cache中,而不会自动删除。如果你觉得它们占用了大量磁盘空间,可以使用yum clean指令进行清除,更精确 的用法是yum clean headers清除header,yum clean packages清除下载的rpm包,yum clean all全部干掉。

1.清除缓存目录(/var/cache/yum)下的软件 包

命令:yum clean packages

2.清除缓存目录(/var/cache/yum)下的 headers

命令:yum clean headers

3.清除缓存目录(/var/cache/yum)下旧的 headers

命令:yum clean oldheaders

4.清除缓存目录(/var/cache/yum)下的软件 包及旧的headers

Point 3: var/log/journal日志清理:

Linux log日志清理
检查当前journal使用磁盘量

journalctl –disk-usage

清理方法可以采用按照日期清理,或者按照允许保留的容量清理,只保存2天的日志,最大500M

journalctl –vacuum-time=2d
journalctl –vacuum-size=500M

如果要手工删除日志文件,则在删除前需要先轮转一次journal日志

systemctl kill –kill-who=main –signal=SIGUSR2 systemd-journald.service

要启用日志限制持久化配置,可以修改 /etc/systemd/journald.conf

SystemMaxUse=16M
ForwardToSyslog=no

然后重启

systemctl restart systemd-journald.service

检查journal是否运行正常以及日志文件是否完整无损坏

journalctl –verify
————————————————————————————————————————————————————

参考:centos 磁盘清理 /dev/vda1系统盘满了

linux yum清除var目录下缓存的方法

/var/log/journal日志清理

centos7mysql安装

首先查看centos7上有没有安装过mysql ,一定要卸载干净残留,不然会安装或启动失败。

yum list installed mysql*
列出后如果有就删除
  • 删除mysql
sudo yum remove mysql-community-*
rm -rf /var/lib/mysql
rm /etc/my.cnf
  • 安装yum源
wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
sudo yum instal   mysql80-community-release-el7-1.noarch.rpm
  • 查看是否安装成功

sudo yum repolist all|grep mysql

  • 配置要安装的mysql版本

sudo vim /etc/yum.repos.d/mysql-community.repo

enabled 为1表示启用,将要安装的版本的enabled改为1后保存

配置repo

  • 安装启动mysql
    sudo yum install mysql-community-server.x86_64

等待安装好后启动mysql

sudo service mysqld start      //启动mysql
sudo service mysqld status   //查看mysql状态
sudo systemctl enable mysqld //配置开机启动
  • 管理账户

mysql安装完成之后,在/var/log/mysqld.log文件中给root生成了一个默认密码。通过下面的方式找到root默认密码,然后登录mysql进行修改:

grep 'temporary password' /var/log/mysqld.log  //找到默认密码
mysql -uroot -p 
set password for 'root'@'localhost'=password('NEWPASSWORD'); 或者ALTER USER 'root'@'localhost' IDENTIFIED BY 'NEWPASSWORD';  // 修改密码,注意密码要复杂一些,否则会不能通过。
  • 添加远程用户(mysql 8.0以后必须要先创建用户再设置)
create user 'miroot'@'%' identified by 'Hadoop3!';
grant all privileges on *.* to 'miroot'@'%';
  • 查看并修改编码

mysql -u root -p
show variables like '%char%;
看到有的编码不是 utf8
更改配置文件
vim /etc/my.cnf
[mysqld]下面添加以下两句

character_set_server=utf8
collation-server=utf8_general_ci
[client]下面添加
default-character-set=utf8

注意修改后只会对以后创建的数据库生效。

原文:https://www.jianshu.com/p/a04bd6348fa3

参考:mysql8.0无法给用户授权或提示You are not allowed to create a user with GRANT的问题

PHP Mysql support: 是mysql 还是mysqlnd?

您正在使用其中一个备用存储库安装现代版本的php,突然间您遇到了一个令人困惑的选择。你想在php程序中支持mysql(mysqli或PDO-mysql)。你会怎么选择?

首先,您可能应该使用PDO。与mysqli相比,它只是一个更干净的数据库界面,如果你使用像Doctrine2这样的ORM,它也往往是支持的选项。

但是你可能已经发现安装PDO软件包并不能让你支持MySQL。

那么这2个套餐是什么?一旦我们将webtatic设置为回购,那么让我们看看Centos下的yum向我们展示了什么:

  • webtatic:us-east.repo.webtatic.com
    ====================================== ========
    php56w-mysql.x86_64:用于使用MySQL数据库的 PHP应用程序
    的模块php56w-mysqlnd.x86_64:用于使用MySQL数据库的PHP应用程序的模块

简而言之,mysql扩展即mysql库是引用Oracle / mysql

…通用客户端库
名为libmysql。

这是支持mysql的原始php方法。MySQL提供了一个客户端api库,并使用该c库,创建了一个php扩展,它依赖于libmysql实现着名的mysql_函数,允许php与mysql通信。

mysqlnd包(其中nd代表“本机驱动程序”)是一个项目的成果,它使mysql在php语言中最佳地工作。再次引用mysql网站:

mysqlnd库经过高度优化,可以与PHP紧密集成。MySQL客户端库无法提供相同的优化,因为它是一个通用的客户端库。

mysqlnd库使用PHP内部C基础架构无缝集成到PHP中。此外,它还使用PHP内存管理,PHP Streams(I / O抽象)和PHP字符串处理例程。例如,mysqlnd使用PHP内存管理可以通过使用只读变量(写入时复制)来节省内存,并使mysqlnd适用于PHP内存限制。

除了这些好处之外,还有一些有趣的增强功能和对插件的支持,这些插件可能是您作为开发人员或系统管理员特别感兴趣的。

一般情况下,你的代码不应该破坏,因为api在mysqlnd下应该和旧的mysql库一样。

结论

总之,您希望现在和将来使用mysqlnd。
————————————————

原文链接:https://blog.csdn.net/qq_40338373/article/details/94385423

Nginx 403 error:directory index of “xxx“ is forbidden

现象:
在部署好Nginx服务器后,输入IP地址和端口号,返回403 Forbiddent。查看日志nginx/logs/error.log,发现报错信息为:directory index of “xxx” is forbidden。
其中,xxx是在/etc/nginx/nginx.conf中指定的root目录。

报错原因:
直接使用IP地址和端口号访问时,需要指定index,如果未指定,就会出现该报错。

解决方法:
在/etc/nginx/nginx.conf中做如下修改:

#在nginx.conf文件中指定index,例如:
index index.html index.htm index.php
#或者在nginx.conf文件中添加自动索引
#但是
autoindex on;    #自动索引

原文:https://www.jianshu.com/p/e837e63ff511

Centos7 升级php版本到php7

一、首先查看是否有老版本

yum list installed | grep php

二、如果安装的有

yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64

三、老版本清理干净之后,进行升级

1、由于linux的yum源不存在php7.x,所以我们要更改yum源:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

CentOS7yum安装PHP7.2
CentOS7yum安装PHP7.2

2、查看yum源中有没有php7.x

yum search php7

看到下图,证明php已经存在yum源中

CentOS7yum安装PHP7.2
CentOS7yum安装PHP7.2

3、yum 安装php72w和各种拓展,选自己需要的即可:

yum -y install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml

CentOS7yum安装PHP7.2

安装完成

4、查看php版本

php -v

CentOS7yum安装PHP7.2

5、启动php-fpm systemctl start php-fpm

注意注释掉nginx.conf里的sock设置
添加:fastcgi_pass 127.0.0.1:9000;#php-fpm的默认端口是9000


原文:https://jingyan.baidu.com/article/870c6fc3460834b03fe4be06.html
参考:PHP Mysql support: 是mysql 还是mysqlnd?

vsftpd: refusing to run with writable root inside chroot ()错误

centos install vsftpd常见的错误:

vsftpd:500 OOPS: vsftpd: refusing to run with writable root inside chroot ()错误
 vsftpd:500 OOPS: vsftpd: refusing to run with writable root inside chroot ()错误
原因是因为从2.3.5之后,vsftpd增强了安全检查,如果用户被限定在了其主目录下,则该用户的主目录不能再具有写权限了!如果检查发现还有写权限,就会报该错误。
 解决这个错误的方法,可以用命令chmod a-w /home/test去除用户主目录的写权限,注意把目录替换成你自己的。

或者你可以在vsftpd的配置文件中增加下列两项中的一项:allow_writeable_chroot=YES

cobal语言简介

/*************cobal语言资料****************/

COBOL
英文缩写: COBOL (Common business Oriented Language)

中文译名: COBOL语言

解 释: 一种适合于商业及数据处理的类似英语的程序设计语言。这种语言可使商业数据处理过程精确表达。

COBOL(面向商业的通用语言,又称为企业管理语言、数据处理语言等,Common Business Oriented Langauge)是最早的高级编程语言之一,是世界上第一个商用语言。

1 COBOL的历史

1959年5月,五角大楼委托格雷斯·霍波(G.Hopper)博士领导一个委员会并由Rear Admiral Grace Hopper公司主持开发,并于1961年由美国数据系统语言协会公布。正式发布于1960年4月,称为Cobol-60,现在最新的版本是Cobol-2002。

1963年,美国国家标准研究所(ANSI)进行了标准化,但是ANSI标准很少被遵循;因此,COBOL程序只是部分可移植的。

2 COBOL的重要性

经过40多年的不断修改、丰富完善和标准化,COBOL已发展为多种版本的庞大语言,在财会工作、统计报表、计划编制、情报检索、人事管理等数据管理及商业数据处理领域,都有着广泛的应用。

COBOL的重要性可以用这句话来描述:世界上70%的数据都是用COBOL语言处理的,并且90%的ATM事务处理用的都是COBOL语言。每天在线处理的COBOL事务有300亿次。500强中有492家(包括全部的100强)使用了COBOL语言,目前在COBOL方面的投资已经超过3万亿美元,,据称用COBOL书写的程序超过了1000亿行,并且以每年大约50亿行代码的速度在增长。

由于COBOL在商业领域的雄厚基础,而且COBOL主要是应用于银行、金融和会计行业等非常重要的商业数据处理领域。所以,即使对于具有相当经验的IT公司来说,重新编写COBOL语言的可靠的应用软件也是不实际或是从商业角度上并不可行的,而且还要花上很长的时间,只要大型机存在,COBOL就不会消失,即使是对电脑界产生巨大影响的“千年虫”(Y2K)也没有改变COBOL的命运。


3 COBOL的特点

COBOL是一种面向数据处理的、面向文件的、面向过程(POL)的高级编程语言,是一种功能很强而又极为冗长的语言。

COBOL适合于具有循环处理周期的环境(例如打印工资支票)以及数据操纵量相当大的环境。COBOL主要应用于商业数据处理领域,对各种类型的数据进行收集、存储、传送、分类、排序、计算及打印报表、输出图象是它的强项。

COBOL语法与英文很接近,即使不懂电脑的人也能看懂程序。

强大的文件处理功能,大量的数据通常以文件的形式存储在磁盘上。

仅提供了加、减、乘、除及乘方这五种简单的算术运算,因而不适于进行科学计算。

未来的COBOL将支持XML等Web时代的新技术。

4 COBOL的程序结构

COBOL程序由4部(DIVISION)组成:IDENTIFICATION DIVISION.(标识部)、ENVIRONMENT DIVISION.(环境部)、DATA DIVISION.(数据部)、PROCEDURE DIVISION.(过程部),而每个部又由若干节 (SECTION)组成。

/*************end cobal语言资料****************/

原文:https://blog.csdn.net/luke_hu/article/details/3788809

自行翻书特效,纯CSS+HTML

效果见下:

代码:

<!DOCTYPE html>
<html>

<head>

  <meta charset="UTF-8">
    <style>

::before,
::after {
	content: "";
}

.component{
	background: #deebef;
	color: #34495e;
	font-family: 'Lato', 'Arial', sans-serif;
	font-weight: 400;
	line-height: 1.2;
}

ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

a {
	color: #2c3e50;
	text-decoration: none;
}

.btn {
	display: inline-block;
	text-transform: uppercase;
	border: 2px solid #2c3e50;
	margin-top: 100px; 
	font-size: 0.7em;
	font-weight: 700;
	padding: 0.1em 0.4em;
	text-align: center;
	-webkit-transition: color 0.3s, border-color 0.3s;
	-moz-transition: color 0.3s, border-color 0.3s;
	transition: color 0.3s, border-color 0.3s;
}

.btn:hover {
	border-color: #16a085;
	color: #16a085;
}

/* basic grid, only for this demo */

.align {
	clear: both;
	margin: 90px auto 20px;
	width: 100%;
	max-width: 1170px;
	text-align: center;
}

.align > li {
	width: 500px;
	min-height: 300px;
	display: inline-block;
	margin: 30px 20px 30px 30px;
	padding: 0 0 0 60px;
	vertical-align: top;
}

/* ///////////////////////////////////////////////////

HARDCOVER
Table of Contents

1. container
2. background & color
3. opening cover, back cover and pages
4. position, transform y transition
5. events
6. Bonus
	- Cover design
	- Ribbon
	- Figcaption
7. mini-reset

/////////////////////////////////////////////////////*/

/*
	1. container
*/

.book {
	position: relative;
	width: 160px; 
	height: 220px;
	-webkit-perspective: 1000px;
	-moz-perspective: 1000px;
	perspective: 1000px;
	-webkit-transform-style: preserve-3d;
	-moz-transform-style: preserve-3d;
	transform-style: preserve-3d;
}

/*
	2. background & color
*/

/* HARDCOVER FRONT */
.hardcover_front li:first-child {
	background-color: #eee;
	-webkit-backface-visibility: hidden;
	-moz-backface-visibility: hidden;
	backface-visibility: hidden;
}

/* reverse */
.hardcover_front li:last-child {
	background: #fffbec;
}

/* HARDCOVER BACK */
.hardcover_back li:first-child {
	background: #fffbec;
}

/* reverse */
.hardcover_back li:last-child {
	background: #fffbec;
}

.book_spine li:first-child {
	background: #eee;
}
.book_spine li:last-child {
	background: #333;
}

/* thickness of cover */

.hardcover_front li:first-child:after,
.hardcover_front li:first-child:before,
.hardcover_front li:last-child:after,
.hardcover_front li:last-child:before,
.hardcover_back li:first-child:after,
.hardcover_back li:first-child:before,
.hardcover_back li:last-child:after,
.hardcover_back li:last-child:before,
.book_spine li:first-child:after,
.book_spine li:first-child:before,
.book_spine li:last-child:after,
.book_spine li:last-child:before {
	background: #999;
}

/* page */

.page > li {
	background: -webkit-linear-gradient(left, #e1ddd8 0%, #fffbf6 100%);
	background: -moz-linear-gradient(left, #e1ddd8 0%, #fffbf6 100%);
	background: -ms-linear-gradient(left, #e1ddd8 0%, #fffbf6 100%);
	background: linear-gradient(left, #e1ddd8 0%, #fffbf6 100%);
	box-shadow: inset 0px -1px 2px rgba(50, 50, 50, 0.1), inset -1px 0px 1px rgba(150, 150, 150, 0.2);
	border-radius: 0px 5px 5px 0px;
}

/*
	3. opening cover, back cover and pages
*/

.hardcover_front {
	-webkit-transform: rotateY(-34deg) translateZ(8px);
	-moz-transform: rotateY(-34deg) translateZ(8px);
	transform: rotateY(-34deg) translateZ(8px);
	z-index: 100;
}

.hardcover_back {
	-webkit-transform: rotateY(-15deg) translateZ(-8px);
	-moz-transform: rotateY(-15deg) translateZ(-8px);
	transform: rotateY(-15deg) translateZ(-8px);
}

.page li:nth-child(1) {
	-webkit-transform: rotateY(-28deg);
	-moz-transform: rotateY(-28deg);
	transform: rotateY(-28deg);
}

.page li:nth-child(2) {
	-webkit-transform: rotateY(-30deg);
	-moz-transform: rotateY(-30deg);
	transform: rotateY(-30deg);
}

.page li:nth-child(3) {
	-webkit-transform: rotateY(-32deg);
	-moz-transform: rotateY(-32deg);
	transform: rotateY(-32deg);
}

.page li:nth-child(4) {
	-webkit-transform: rotateY(-34deg);
	-moz-transform: rotateY(-34deg);
	transform: rotateY(-34deg);
}

.page li:nth-child(5) {
	-webkit-transform: rotateY(-36deg);
	-moz-transform: rotateY(-36deg);
	transform: rotateY(-36deg);
}

/*
	4. position, transform & transition
*/

.hardcover_front,
.hardcover_back,
.book_spine,
.hardcover_front li,
.hardcover_back li,
.book_spine li {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	-webkit-transform-style: preserve-3d;
	-moz-transform-style: preserve-3d;
	transform-style: preserve-3d;
}

.hardcover_front,
.hardcover_back {
	-webkit-transform-origin: 0% 100%;
	-moz-transform-origin: 0% 100%;
	transform-origin: 0% 100%;
}

.hardcover_front {
	-webkit-transition: all 0.8s ease, z-index 0.6s;
	-moz-transition: all 0.8s ease, z-index 0.6s;
	transition: all 0.8s ease, z-index 0.6s;
}

/* HARDCOVER front */
.hardcover_front li:first-child {
	cursor: default;
	-webkit-user-select: none;
	-moz-user-select: none;
	user-select: none;
	-webkit-transform: translateZ(2px);
	-moz-transform: translateZ(2px);
	transform: translateZ(2px);
}

.hardcover_front li:last-child {
	-webkit-transform: rotateY(180deg) translateZ(2px);
	-moz-transform: rotateY(180deg) translateZ(2px);
	transform: rotateY(180deg) translateZ(2px);
}

/* HARDCOVER back */
.hardcover_back li:first-child {
	-webkit-transform: translateZ(2px);
	-moz-transform: translateZ(2px);
	transform: translateZ(2px);
}

.hardcover_back li:last-child {
	-webkit-transform: translateZ(-2px);
	-moz-transform: translateZ(-2px);
	transform: translateZ(-2px);
}

/* thickness of cover */
.hardcover_front li:first-child:after,
.hardcover_front li:first-child:before,
.hardcover_front li:last-child:after,
.hardcover_front li:last-child:before,
.hardcover_back li:first-child:after,
.hardcover_back li:first-child:before,
.hardcover_back li:last-child:after,
.hardcover_back li:last-child:before,
.book_spine li:first-child:after,
.book_spine li:first-child:before,
.book_spine li:last-child:after,
.book_spine li:last-child:before {
	position: absolute;
	top: 0;
	left: 0;
}

/* HARDCOVER front */
.hardcover_front li:first-child:after,
.hardcover_front li:first-child:before {
	width: 4px;
	height: 100%;
}

.hardcover_front li:first-child:after {
	-webkit-transform: rotateY(90deg) translateZ(-2px) translateX(2px);
	-moz-transform: rotateY(90deg) translateZ(-2px) translateX(2px);
	transform: rotateY(90deg) translateZ(-2px) translateX(2px);
}

.hardcover_front li:first-child:before {
	-webkit-transform: rotateY(90deg) translateZ(158px) translateX(2px);
	-moz-transform: rotateY(90deg) translateZ(158px) translateX(2px);
	transform: rotateY(90deg) translateZ(158px) translateX(2px);
}

.hardcover_front li:last-child:after,
.hardcover_front li:last-child:before {
	width: 4px;
	height: 160px;
}

.hardcover_front li:last-child:after {
	-webkit-transform: rotateX(90deg) rotateZ(90deg) translateZ(80px) translateX(-2px) translateY(-78px);
	-moz-transform: rotateX(90deg) rotateZ(90deg) translateZ(80px) translateX(-2px) translateY(-78px);
	transform: rotateX(90deg) rotateZ(90deg) translateZ(80px) translateX(-2px) translateY(-78px);
}
.hardcover_front li:last-child:before {
	box-shadow: 0px 0px 30px 5px #333;
	-webkit-transform: rotateX(90deg) rotateZ(90deg) translateZ(-140px) translateX(-2px) translateY(-78px);
	-moz-transform: rotateX(90deg) rotateZ(90deg) translateZ(-140px) translateX(-2px) translateY(-78px);
	transform: rotateX(90deg) rotateZ(90deg) translateZ(-140px) translateX(-2px) translateY(-78px);
}

/* thickness of cover */

.hardcover_back li:first-child:after,
.hardcover_back li:first-child:before {
	width: 4px;
	height: 100%;
}

.hardcover_back li:first-child:after {
	-webkit-transform: rotateY(90deg) translateZ(-2px) translateX(2px);
	-moz-transform: rotateY(90deg) translateZ(-2px) translateX(2px);
	transform: rotateY(90deg) translateZ(-2px) translateX(2px);
}
.hardcover_back li:first-child:before {
	-webkit-transform: rotateY(90deg) translateZ(158px) translateX(2px);
	-moz-transform: rotateY(90deg) translateZ(158px) translateX(2px);
	transform: rotateY(90deg) translateZ(158px) translateX(2px);
}

.hardcover_back li:last-child:after,
.hardcover_back li:last-child:before {
	width: 4px;
	height: 160px;
}

.hardcover_back li:last-child:after {
	-webkit-transform: rotateX(90deg) rotateZ(90deg) translateZ(80px) translateX(2px) translateY(-78px);
	-moz-transform: rotateX(90deg) rotateZ(90deg) translateZ(80px) translateX(2px) translateY(-78px);
	transform: rotateX(90deg) rotateZ(90deg) translateZ(80px) translateX(2px) translateY(-78px);
}

.hardcover_back li:last-child:before {
	box-shadow: 10px -1px 80px 20px #666;
	-webkit-transform: rotateX(90deg) rotateZ(90deg) translateZ(-140px) translateX(2px) translateY(-78px);
	-moz-transform: rotateX(90deg) rotateZ(90deg) translateZ(-140px) translateX(2px) translateY(-78px);
	transform: rotateX(90deg) rotateZ(90deg) translateZ(-140px) translateX(2px) translateY(-78px);
}

/* BOOK SPINE */
.book_spine {
	-webkit-transform: rotateY(60deg) translateX(-5px) translateZ(-12px);
	-moz-transform: rotateY(60deg) translateX(-5px) translateZ(-12px);
	transform: rotateY(60deg) translateX(-5px) translateZ(-12px);
	width: 16px;
	z-index: 0;
}

.book_spine li:first-child {
	-webkit-transform: translateZ(2px);
	-moz-transform: translateZ(2px);
	transform: translateZ(2px);
}

.book_spine li:last-child {
	-webkit-transform: translateZ(-2px);
	-moz-transform: translateZ(-2px);
	transform: translateZ(-2px);
}

/* thickness of book spine */
.book_spine li:first-child:after,
.book_spine li:first-child:before {
	width: 4px;
	height: 100%;
}

.book_spine li:first-child:after {
	-webkit-transform: rotateY(90deg) translateZ(-2px) translateX(2px);
	-moz-transform: rotateY(90deg) translateZ(-2px) translateX(2px);
	transform: rotateY(90deg) translateZ(-2px) translateX(2px);
}

.book_spine li:first-child:before {
	-webkit-transform: rotateY(-90deg) translateZ(-12px);
	-moz-transform: rotateY(-90deg) translateZ(-12px);
	transform: rotateY(-90deg) translateZ(-12px);
}

.book_spine li:last-child:after,
.book_spine li:last-child:before {
	width: 4px;
	height: 16px;
}

.book_spine li:last-child:after {
	-webkit-transform: rotateX(90deg) rotateZ(90deg) translateZ(8px) translateX(2px) translateY(-6px);
	-moz-transform: rotateX(90deg) rotateZ(90deg) translateZ(8px) translateX(2px) translateY(-6px);
	transform: rotateX(90deg) rotateZ(90deg) translateZ(8px) translateX(2px) translateY(-6px);
}

.book_spine li:last-child:before {
	box-shadow: 5px -1px 100px 40px rgba(0, 0, 0, 0.2);
	-webkit-transform: rotateX(90deg) rotateZ(90deg) translateZ(-210px) translateX(2px) translateY(-6px);
	-moz-transform: rotateX(90deg) rotateZ(90deg) translateZ(-210px) translateX(2px) translateY(-6px);
	transform: rotateX(90deg) rotateZ(90deg) translateZ(-210px) translateX(2px) translateY(-6px);
}

.page,
.page > li {
	position: absolute;
	top: 0;
	left: 0;
	-webkit-transform-style: preserve-3d;
	-moz-transform-style: preserve-3d;
	transform-style: preserve-3d;
}

.page {
	width: 100%;
	height: 98%;
	top: 1%;
	left: 3%;
	z-index: 10;
}

.page > li {
	width: 100%;
	height: 100%;
	-webkit-transform-origin: left center;
	-moz-transform-origin: left center;
	transform-origin: left center;
	-webkit-transition-property: transform;
	-moz-transition-property: transform;
	transition-property: transform;
	-webkit-transition-timing-function: ease;
	-moz-transition-timing-function: ease;
	transition-timing-function: ease;
}

.page > li:nth-child(1) {
	-webkit-transition-duration: 0.6s;
	-moz-transition-duration: 0.6s;
	transition-duration: 0.6s;
}

.page > li:nth-child(2) {
	-webkit-transition-duration: 0.6s;
	-moz-transition-duration: 0.6s;
	transition-duration: 0.6s;
}

.page > li:nth-child(3) {
	-webkit-transition-duration: 0.4s;
	-moz-transition-duration: 0.4s;
	transition-duration: 0.4s;
}

.page > li:nth-child(4) {
	-webkit-transition-duration: 0.5s;
	-moz-transition-duration: 0.5s;
	transition-duration: 0.5s;
}

.page > li:nth-child(5) {
	-webkit-transition-duration: 0.6s;
	-moz-transition-duration: 0.6s;
	transition-duration: 0.6s;
}

/*
	5. events
*/

.book:hover > .hardcover_front {
	-webkit-transform: rotateY(-145deg) translateZ(0);
	-moz-transform: rotateY(-145deg) translateZ(0);
	transform: rotateY(-145deg) translateZ(0);
	z-index: 0;
}

.book:hover > .page li:nth-child(1) {
	-webkit-transform: rotateY(-30deg);
	-moz-transform: rotateY(-30deg);
	transform: rotateY(-30deg);
	-webkit-transition-duration: 1.5s;
	-moz-transition-duration: 1.5s;
	transition-duration: 1.5s;
}

.book:hover > .page li:nth-child(2) {
	-webkit-transform: rotateY(-35deg);
	-moz-transform: rotateY(-35deg);
	transform: rotateY(-35deg);
	-webkit-transition-duration: 1.8s;
	-moz-transition-duration: 1.8s;
	transition-duration: 1.8s;
}

.book:hover > .page li:nth-child(3) {
	-webkit-transform: rotateY(-118deg);
	-moz-transform: rotateY(-118deg);
	transform: rotateY(-118deg);
	-webkit-transition-duration: 1.6s;
	-moz-transition-duration: 1.6s;
	transition-duration: 1.6s;
}

.book:hover > .page li:nth-child(4) {
	-webkit-transform: rotateY(-130deg);
	-moz-transform: rotateY(-130deg);
	transform: rotateY(-130deg);
	-webkit-transition-duration: 1.4s;
	-moz-transition-duration: 1.4s;
	transition-duration: 1.4s;
}

.book:hover > .page li:nth-child(5) {
	-webkit-transform: rotateY(-140deg);
	-moz-transform: rotateY(-140deg);
	transform: rotateY(-140deg);
	-webkit-transition-duration: 1.2s;
	-moz-transition-duration: 1.2s;
	transition-duration: 1.2s;
}

/*
	6. Bonus
*/

/* cover CSS */

.coverDesign {
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	right: 0;
	overflow: hidden;
	-webkit-backface-visibility: hidden;
	-moz-backface-visibility: hidden;
	backface-visibility: hidden;
}

.coverDesign::after {
	background-image: -webkit-linear-gradient( -135deg, rgba(255, 255, 255, 0.45) 0%, transparent 100%);
	background-image: -moz-linear-gradient( -135deg, rgba(255, 255, 255, 0.45) 0%, transparent 100%);
	background-image: linear-gradient( -135deg, rgba(255, 255, 255, 0.45) 0%, transparent 100%);
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	right: 0;
}

.coverDesign h1 {
	color: #fff;
	font-size: 2.2em;
	letter-spacing: 0.05em;
	text-align: center;
	margin: 54% 0 0 0;
	text-shadow: -1px -1px 0 rgba(0,0,0,0.1);
}

.coverDesign p {
	color: #f8f8f8;
	font-size: 1em;
	text-align: center;
	text-shadow: -1px -1px 0 rgba(0,0,0,0.1);
}

.yellow {
	background-color: #f1c40f;
	background-image: -webkit-linear-gradient(top, #f1c40f 58%, #e7ba07 0%);
	background-image: -moz-linear-gradient(top, #f1c40f 58%, #e7ba07 0%);
	background-image: linear-gradient(top, #f1c40f 58%, #e7ba07 0%);
}

.blue {
	background-color: #3498db;
	background-image: -webkit-linear-gradient(top, #3498db 58%, #2a90d4 0%);
	background-image: -moz-linear-gradient(top, #3498db 58%, #2a90d4 0%);
	background-image: linear-gradient(top, #3498db 58%, #2a90d4 0%);
}

.grey {
	background-color: #f8e9d1;
	background-image: -webkit-linear-gradient(top, #f8e9d1 58%, #e7d5b7 0%);
	background-image: -moz-linear-gradient(top, #f8e9d1 58%, #e7d5b7 0%);
	background-image: linear-gradient(top, #f8e9d1 58%, #e7d5b7 0%);
}

/* Basic ribbon */

.ribbon {
	background: #c0392b;
	color: #fff;
	display: block;
	font-size: 0.7em;
	position: absolute;
	top: 11px;
	right: 1px;
	width: 40px;
	height: 20px;
	line-height: 20px;
	letter-spacing: 0.15em; 
	text-align: center;
	-webkit-transform: rotateZ(45deg) translateZ(1px);
	-moz-transform: rotateZ(45deg) translateZ(1px);
	transform: rotateZ(45deg) translateZ(1px);
	-webkit-backface-visibility: hidden;
	-moz-backface-visibility: hidden;
	backface-visibility: hidden;
	z-index: 10;
}

.ribbon::before,
.ribbon::after{
	position: absolute;
	top: -20px;
	width: 0;
	height: 0;
	border-bottom: 20px solid #c0392b;
	border-top: 20px solid transparent;
}

.ribbon::before{
	left: -20px;
	border-left: 20px solid transparent;
}

.ribbon::after{
	right: -20px;
	border-right: 20px solid transparent;
}

/* figcaption */

figcaption {
	padding-left: 40px;
	text-align: left;
	position: absolute;
	top: 0%;
	left: 160px;
	width: 310px;
}

figcaption h1 {
	margin: 0;
}

figcaption span {
	color: #16a085;
	padding: 0.6em 0 1em 0;
	display: block;
}

figcaption p {
	color: #63707d;
	line-height: 1.3;
}

/* Media Queries */
@media screen and (max-width: 37.8125em) {
	.align > li {
		width: 100%;
		min-height: 440px;
		height: auto;
		padding: 0;
		margin: 0 0 30px 0;
	}

	.book {
		margin: 0 auto;
	}

	figcaption {
		text-align: center;
		width: 320px;
		top: 250px;
		padding-left: 0;
		left: -80px;
		font-size: 90%;
	}
}

</style>

</head>

<body>

  <div class="component">
				<ul class="align">
					<li>
						<figure class='book'>

							<!-- Front -->

							<ul class='hardcover_front'>
								<li>
									<div class="coverDesign blue">
										<h1>Felicity</h1>
										<p>cool</p>
									</div>
								</li>
								<li></li>
							</ul>

							<!-- Pages -->

							<ul class='page'>
								<li></li>
								<li>
									<a class="btn"  >你在闲逛</a>
								</li>
								<li></li>
								<li></li>
								<li></li>
							</ul>

							<!-- Back -->

							<ul class='hardcover_back'>
								<li></li>
								<li></li>
							</ul>
							<ul class='book_spine'>
								<li></li>
								<li></li>
							</ul>
							 
						</figure>
					</li>
				</ul>
			</div>
<div style="text-align:center;clear:both"></div>
</body>

</html>

参考原文:www.html5tricks.com

首页蜡烛代码

老版(无数字):

<!doctype html>
<html>
<head>
<meta charset="utf-8">

<style>
.outerme {
  width: 10vw;
  height: 5px;
  margin-left: 0;
  margin-top: 10px;  
  margin-bottom: 150px;
  /*background:#de38a0;*/
  transform: scale(0.7, 0.7);
  -ms-transform: scale(0.7, 0.7);    /* IE 9 */
  -webkit-transform: scale(0.7, 0.7);      /* Safari and Chrome */
}

.thefloor {
  /*position: absolute;*/
  left: 50%;
  top: 50%;
  width: 280px;
  height: 5px;
  background: #673C63;
  transform: translate(0, -50%);
  box-shadow: 0px 2px 5px #111;
  z-index: 2;
}

.candles {
  /*position: absolute;*/
  left: 50%;
  top: 50%;
  width: 250px;
  height: 150px;
  transform: translate(0, 0);
  z-index: 1;
  /*background-color:#fff;
  animation: change-background 3s infinite linear;*/
}

.candle1 {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 35px;
  height: 100px;
  background: #fff;
  border: 3px solid #673C63;
  border-bottom: 0px;
  border-radius: 3px;
  transform-origin: center right;
  transform: translate(60%, -25%);
  box-shadow: -2px 0px 0px #95c6f2 inset;
  animation: expand-body 3s infinite linear;
}

.candle1__stick, .candle2__stick {
  position: absolute;
  left: 50%;
  top: 0%;
  width: 3px;
  height: 15px;
  background: #673C63;
  border-radius: 8px;
  transform: translate(-50%, -100%);
}

.candle2__stick {
  height: 12px;
  transform-origin: bottom center;
  animation: stick-animation 3s infinite linear;
}

.candle1__eyes, .candle2__eyes {
  position: absolute;
  left: 50%;
  top: 0%;
  width: 35px;
  height: 30px;
  transform: translate(-50%, 0%);
}

.candle1__eyes-one {
  position: absolute;
  left: 30%;
  top: 20%;
  width: 5px;
  height: 5px;
  border-radius: 100%;
  background: #673C63;
  transform: translate(-70%, 0%);
  animation: blink-eyes 3s infinite linear;
}

.candle1__eyes-two {
  position: absolute;
  left: 70%;
  top: 20%;
  width: 5px;
  height: 5px;
  border-radius: 100%;
  background: #673C63;
  transform: translate(-70%, 0%);
  animation: blink-eyes 3s infinite linear;
}

.candle1__mouth {
  position: absolute;
  left: 40%;
  top: 20%;
  width: 0px;
  height: 0px;
  border-radius: 20px;
  background: #673C63;
  transform: translate(-50%, -50%);
  animation: uff 3s infinite linear;
}

.candle__smoke-one {
  position: absolute;
  left: 30%;
  top: 50%;
  width: 30px;
  height: 3px;
  background: grey;
  transform: translate(-50%, -50%);
  animation: move-left 3s infinite linear;
}

.candle__smoke-two {
  position: absolute;
  left: 30%;
  top: 40%;
  width: 10px;
  height: 10px;
  border-radius: 10px;
  background: grey;
  transform: translate(-50%, -50%);
  animation: move-top 3s infinite linear;
}

.candle2 {
  position: absolute;
  left: 20%;
  top: 65%;
  width: 42px;
  height: 60px;
  background: #fff;
  border: 3px solid #673C63;
  border-bottom: 0px;
  border-radius: 3px;
  transform: translate(60%, -15%);
  transform-origin: center right;
  box-shadow: -2px 0px 0px #95c6f2 inset;
  animation: shake-left 3s infinite linear;
}

.candle2__eyes-one {
  position: absolute;
  left: 30%;
  top: 50%;
  width: 5px;
  height: 5px;
  display: inline-block;
  border: 0px solid #673C63;
  border-radius: 100%;
  float: left;
  background: #673C63;
  transform: translate(-80%, 0%);
  animation: changeto-lower 3s infinite linear;
}

.candle2__eyes-two {
  position: absolute;
  left: 70%;
  top: 50%;
  width: 5px;
  height: 5px;
  display: inline-block;
  border: 0px solid #673C63;
  border-radius: 100%;
  float: left;
  background: #673C63;
  transform: translate(-80%, 0%);
  animation: changeto-greater 3s infinite linear;
}

.light__wave {
  position: absolute;
  top: 35%;
  left: 35%;
  width: 75px;
  height: 75px;
  border-radius: 100%;
  z-index: 0;
  transform: translate(-25%, -50%) scale(2.5, 2.5);
  border: 2px solid rgba(255, 255, 255, 0.2);
  animation: expand-light 3s infinite linear;
}

.candle2__fire {
  position: absolute;
  top: 50%;
  left: 40%;
  display: block;
  width: 16px;
  height: 20px;
  background-color: red;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: #FF9800;
  transform: translate(-50%, -50%);
  animation: dance-fire 3s infinite linear;
}

@keyframes blink-eyes {
  0%,35% {
    opacity: 1;
    transform: translate(-70%, 0%);
  }
  36%,39% {
    opacity: 0;
    transform: translate(-70%, 0%);
  }
  40% {
    opacity: 1;
    transform: translate(-70%, 0%);
  }
  50%,65% {
    transform: translate(-140%, 0%);
  }
  66% {
    transform: translate(-70%, 0%);
  }
}
@keyframes expand-body {
  0%,40% {
    transform: scale(1, 1) translate(60%, -25%);
  }
  45%,55% {
    transform: scale(1.1, 1.1) translate(60%, -28%);
  }
  60% {
    transform: scale(0.89, 0.89) translate(60%, -25%);
  }
  65% {
    transform: scale(1, 1) translate(60%, -25%);
  }
  70% {
    transform: scale(0.95, 0.95) translate(60%, -25%);
  }
  75% {
    transform: scale(1, 1) translate(60%, -25%);
  }
}
@keyframes uff {
  0%,40% {
    width: 0px;
    height: 0px;
  }
  50%,54% {
    width: 15px;
    height: 15px;
    left: 30%;
  }
  59% {
    width: 5px;
    height: 5px;
    left: 20%;
  }
  62% {
    width: 2px;
    height: 2px;
    left: 20%;
  }
  67% {
    width: 0px;
    height: 0px;
    left: 30%;
  }
}
@keyframes change-background{
  0%,59%,98%,100% {
    background: #fff;
  }
  61%,97% {
    background: #b3afcc;   /* 原色:f8ae39 */
  }
}
@keyframes move-left {
  0%,59%,100% {
    width: 0px;
    left: 40%;
  }
  60% {
    width: 30px;
    left: 30%;
  }
  68% {
    width: 0px;
    left: 20%;
  }
}
@keyframes move-top {
  0%,64%,100% {
    width: 0px;
    height: 0px;
    top: 0%;
  }
  65% {
    width: 10px;
    height: 10px;
    top: 40%;
    left: 40%;
  }
  80% {
    width: 0px;
    height: 0px;
    top: 20%;
  }
}
@keyframes shake-left {
  0%,40% {
    left: 20%;
    transform: translate(60%, -15%);
  }
  50%,54% {
    left: 20%;
    transform: translate(60%, -15%);
  }
  59% {
    left: 20%;
    transform: translate(60%, -15%);
  }
  62% {
    left: 18%;
    transform: translate(60%, -15%);
  }
  65% {
    left: 21%;
    transform: translate(60%, -15%);
  }
  67% {
    left: 20%;
    transform: translate(60%, -15%);
  }
  75% {
    left: 20%;
    transform: scale(1.15, 0.85) translate(60%, -15%);
    background: #fff;
    border-color: #673C63;
  }
  91% {
    left: 20%;
    transform: scale(1.18, 0.82) translate(60%, -10%);
    background: #F44336;
    border-color: #F44336;
    box-shadow: -2px 0px 0px #F44336 inset;
  }
  92% {
    left: 20%;
    transform: scale(0.85, 1.15) translate(60%, -15%);
  }
  95% {
    left: 20%;
    transform: scale(1.05, 0.95) translate(60%, -15%);
  }
  97% {
    left: 20%;
    transform: scale(1, 1) translate(60%, -15%);
  }
}
@keyframes stick-animation {
  0%,40% {
    left: 50%;
    top: 0%;
    transform: translate(-50%, -100%);
  }
  50%,54% {
    left: 50%;
    top: 0%;
    transform: translate(-50%, -100%);
  }
  59% {
    left: 50%;
    top: 0%;
    transform: translate(-50%, -100%);
  }
  62% {
    left: 50%;
    top: 0%;
    transform: rotateZ(-15deg) translate(-50%, -100%);
  }
  65% {
    left: 50%;
    top: 0%;
    transform: rotateZ(15deg) translate(-50%, -100%);
  }
  70% {
    left: 50%;
    top: 0%;
    transform: rotateZ(-5deg) translate(-50%, -100%);
  }
  72% {
    left: 50%;
    top: 0%;
    transform: rotateZ(5deg) translate(-50%, -100%);
  }
  74%,84% {
    left: 50%;
    top: 0%;
    transform: rotateZ(0deg) translate(-50%, -100%);
  }
  85% {
    transform: rotateZ(180deg) translate(0%, 120%);
  }
  92% {
    left: 50%;
    top: 0%;
    transform: translate(-50%, -100%);
  }
}
@keyframes expand-light {
  10%,29%,59%,89% {
    transform: translate(-25%, -50%) scale(0, 0);
    border: 2px solid rgba(255, 255, 191, 0);
  }
  90%,20%,50% {
    transform: translate(-25%, -50%) scale(1, 1);
  }
  95%,96%,26%,27%,56%,57% {
    transform: translate(-25%, -50%) scale(2, 2);
    border: 2px solid rgba(255, 255,191, 0.5);
  }
  0%,28%,58%,100% {
    transform: translate(-25%, -50%) scale(2.5, 2.5);
    border: 2px solid rgba(255, 255, 191, 0.2);
  }
}
@keyframes dance-fire {
  59%,89% {
    left: 40%;
    width: 0px;
    height: 0px;
  }
  90%,0%,7%,15%,23%,31%,39%,47%,55% {
    left: 40.8%;
    width: 16px;
    height: 20px;
    background: #FFC107;
  }
  94%,3%,11%,19%,27%,35%,43%,51%,58% {
    left: 41.2%;
    width: 16px;
    height: 20px;
    background: #FF9800;
  }
}
@keyframes changeto-lower {
  0%,70%,90% {
    padding: 0px;
    display: inline-block;
    border-radius: 100%;
    background: #673C63;
    border-width: 0 0 0 0;
    border: 0px solid #673C63;
    transform: translate(-90%, 0%);
  }
  71%,89% {
    background: none;
    border: solid #673C63;
    border-radius: 0px;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 1px;
    float: left;
    transform-origin: bottom left;
    transform: rotate(-45deg) translate(-50%, -65%);
    -webkit-transform: rotate(-45deg) translate(-50%, -65%);
  }
}
@keyframes changeto-greater {
  0%,70%,90% {
    top: 50%;
    padding: 0px;
    display: inline-block;
    border-radius: 100%;
    background: #673C63;
    border-width: 0 0 0 0;
    border: 0px solid #673C63;
    transform: translate(-80%, 0%);
  }
  71%,89% {
    top: 30%;
    background: none;
    border: solid #673C63;
    border-radius: 0px;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 1px;
    float: left;
    transform-origin: bottom left;
    transform: rotate(135deg) translate(-80%, 20%);
    -webkit-transform: rotate(135deg) translate(-80%, 20%);
  }
}
</style>

</head>
<body>

<div  class="outerme">
  <div class="candles">
    <div class="light__wave"></div>
    <div class="candle1">
      <div class="candle1__body">
        <div class="candle1__eyes">
          <span class="candle1__eyes-one"></span>
          <span class="candle1__eyes-two"></span>
        </div>
        <div class="candle1__mouth"></div>
      </div>
      <div class="candle1__stick"></div>
    </div>
    
    <div class="candle2">
      <div class="candle2__body">
        <div class="candle2__eyes">
          <div class="candle2__eyes-one"></div>
          <div class="candle2__eyes-two"></div>
        </div>
      </div>
      <div class="candle2__stick"></div>
    </div>
    <div class="candle2__fire"></div>
    <div class="sparkles-one"></div>
    <div class="sparkles-two"></div>
    <div class="candle__smoke-one">

    </div>
    <div class="candle__smoke-two">

    </div>
    
  </div>
  <div class="thefloor">
  </div>

</div>


</body>
</html>

新版(有数字):

<!doctype html>
<html>
<head>
<meta charset="utf-8">

<style>
.outerme {
  width: 10vw;
  height: 5px;
  margin-left: 0;
  margin-top: 10px;  
  margin-bottom: 150px;
  /*background:#de38a0;*/
  transform: scale(0.7, 0.7);
  -ms-transform: scale(0.7, 0.7);    /* IE 9 */
  -webkit-transform: scale(0.7, 0.7);      /* Safari and Chrome */
}

.thefloor {
  /*position: absolute;*/
  left: 50%;
  top: 50%;
  width: 280px;
  height: 5px;
  background: #673C63;
  transform: translate(0, -50%);
  box-shadow: 0px 2px 5px #111;
  z-index: 2;
}

.candles {
  /*position: absolute;*/
  left: 50%;
  top: 50%;
  width: 250px;
  height: 150px;
  transform: translate(-5%, 0);
  z-index: 1;
  /*background-color:#fff;
  animation: change-background 3s infinite linear;*/
}

.candle-text {
  position: absolute;
  left: 72%;
  bottom: -13%;
  width: 50px;
  /*background: #ddd;*/
  transform-origin: center right;
  transform: translate(70%,0);
  text-align: center;
  font-size: 28pt;
  color: #673C63;
  font-family: "Helvetica", Serif,  "Times New Roman";
}

.candle1 {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 35px;
  height: 100px;
  background: #fff;
  border: 3px solid #673C63;
  border-bottom: 0px;
  border-radius: 3px;
  transform-origin: center right;
  transform: translate(60%, -25%);
  box-shadow: -2px 0px 0px #95c6f2 inset;
  animation: expand-body 3s infinite linear;
}

.candle1__stick, .candle2__stick {
  position: absolute;
  left: 50%;
  top: 0%;
  width: 3px;
  height: 15px;
  background: #673C63;
  border-radius: 8px;
  transform: translate(-50%, -100%);
}

.candle2__stick {
  height: 12px;
  transform-origin: bottom center;
  animation: stick-animation 3s infinite linear;
}

.candle1__eyes, .candle2__eyes {
  position: absolute;
  left: 50%;
  top: 0%;
  width: 35px;
  height: 30px;
  transform: translate(-50%, 0%);
}

.candle1__eyes-one {
  position: absolute;
  left: 30%;
  top: 20%;
  width: 5px;
  height: 5px;
  border-radius: 100%;
  background: #673C63;
  transform: translate(-70%, 0%);
  animation: blink-eyes 3s infinite linear;
}

.candle1__eyes-two {
  position: absolute;
  left: 70%;
  top: 20%;
  width: 5px;
  height: 5px;
  border-radius: 100%;
  background: #673C63;
  transform: translate(-70%, 0%);
  animation: blink-eyes 3s infinite linear;
}

.candle1__mouth {
  position: absolute;
  left: 40%;
  top: 20%;
  width: 0px;
  height: 0px;
  border-radius: 20px;
  background: #673C63;
  transform: translate(-50%, -50%);
  animation: uff 3s infinite linear;
}

.candle__smoke-one {
  position: absolute;
  left: 30%;
  top: 50%;
  width: 30px;
  height: 3px;
  background: grey;
  transform: translate(-50%, -50%);
  animation: move-left 3s infinite linear;
}

.candle__smoke-two {
  position: absolute;
  left: 30%;
  top: 40%;
  width: 10px;
  height: 10px;
  border-radius: 10px;
  background: grey;
  transform: translate(-50%, -50%);
  animation: move-top 3s infinite linear;
}

.candle2 {
  position: absolute;
  left: 20%;
  top: 65%;
  width: 42px;
  height: 60px;
  background: #fff;
  border: 3px solid #673C63;
  border-bottom: 0px;
  border-radius: 3px;
  transform: translate(60%, -15%);
  transform-origin: center right;
  box-shadow: -2px 0px 0px #95c6f2 inset;
  animation: shake-left 3s infinite linear;
}

.candle2__eyes-one {
  position: absolute;
  left: 30%;
  top: 50%;
  width: 5px;
  height: 5px;
  display: inline-block;
  border: 0px solid #673C63;
  border-radius: 100%;
  float: left;
  background: #673C63;
  transform: translate(-80%, 0%);
  animation: changeto-lower 3s infinite linear;
}

.candle2__eyes-two {
  position: absolute;
  left: 70%;
  top: 50%;
  width: 5px;
  height: 5px;
  display: inline-block;
  border: 0px solid #673C63;
  border-radius: 100%;
  float: left;
  background: #673C63;
  transform: translate(-80%, 0%);
  animation: changeto-greater 3s infinite linear;
}

.light__wave {
  position: absolute;
  top: 35%;
  left: 35%;
  width: 75px;
  height: 75px;
  border-radius: 100%;
  z-index: 0;
  transform: translate(-25%, -50%) scale(2.5, 2.5);
  border: 2px solid rgba(255, 255, 255, 0.2);
  animation: expand-light 3s infinite linear;
}

.candle2__fire {
  position: absolute;
  top: 50%;
  left: 40%;
  display: block;
  width: 16px;
  height: 20px;
  background-color: red;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: #FF9800;
  transform: translate(-50%, -50%);
  animation: dance-fire 3s infinite linear;
}

@keyframes blink-eyes {
  0%,35% {
    opacity: 1;
    transform: translate(-70%, 0%);
  }
  36%,39% {
    opacity: 0;
    transform: translate(-70%, 0%);
  }
  40% {
    opacity: 1;
    transform: translate(-70%, 0%);
  }
  50%,65% {
    transform: translate(-140%, 0%);
  }
  66% {
    transform: translate(-70%, 0%);
  }
}
@keyframes expand-body {
  0%,40% {
    transform: scale(1, 1) translate(60%, -25%);
  }
  45%,55% {
    transform: scale(1.1, 1.1) translate(60%, -28%);
  }
  60% {
    transform: scale(0.89, 0.89) translate(60%, -25%);
  }
  65% {
    transform: scale(1, 1) translate(60%, -25%);
  }
  70% {
    transform: scale(0.95, 0.95) translate(60%, -25%);
  }
  75% {
    transform: scale(1, 1) translate(60%, -25%);
  }
}
@keyframes uff {
  0%,40% {
    width: 0px;
    height: 0px;
  }
  50%,54% {
    width: 15px;
    height: 15px;
    left: 30%;
  }
  59% {
    width: 5px;
    height: 5px;
    left: 20%;
  }
  62% {
    width: 2px;
    height: 2px;
    left: 20%;
  }
  67% {
    width: 0px;
    height: 0px;
    left: 30%;
  }
}
@keyframes change-background{
  0%,59%,98%,100% {
    background: #fff;
  }
  61%,97% {
    background: #b3afcc;   /* 原色:f8ae39 */
  }
}
@keyframes move-left {
  0%,59%,100% {
    width: 0px;
    left: 40%;
  }
  60% {
    width: 30px;
    left: 30%;
  }
  68% {
    width: 0px;
    left: 20%;
  }
}
@keyframes move-top {
  0%,64%,100% {
    width: 0px;
    height: 0px;
    top: 0%;
  }
  65% {
    width: 10px;
    height: 10px;
    top: 40%;
    left: 40%;
  }
  80% {
    width: 0px;
    height: 0px;
    top: 20%;
  }
}
@keyframes shake-left {
  0%,40% {
    left: 20%;
    transform: translate(60%, -15%);
  }
  50%,54% {
    left: 20%;
    transform: translate(60%, -15%);
  }
  59% {
    left: 20%;
    transform: translate(60%, -15%);
  }
  62% {
    left: 18%;
    transform: translate(60%, -15%);
  }
  65% {
    left: 21%;
    transform: translate(60%, -15%);
  }
  67% {
    left: 20%;
    transform: translate(60%, -15%);
  }
  75% {
    left: 20%;
    transform: scale(1.15, 0.85) translate(60%, -15%);
    background: #fff;
    border-color: #673C63;
  }
  91% {
    left: 20%;
    transform: scale(1.18, 0.82) translate(60%, -10%);
    background: #F44336;
    border-color: #F44336;
    box-shadow: -2px 0px 0px #F44336 inset;
  }
  92% {
    left: 20%;
    transform: scale(0.85, 1.15) translate(60%, -15%);
  }
  95% {
    left: 20%;
    transform: scale(1.05, 0.95) translate(60%, -15%);
  }
  97% {
    left: 20%;
    transform: scale(1, 1) translate(60%, -15%);
  }
}
@keyframes stick-animation {
  0%,40% {
    left: 50%;
    top: 0%;
    transform: translate(-50%, -100%);
  }
  50%,54% {
    left: 50%;
    top: 0%;
    transform: translate(-50%, -100%);
  }
  59% {
    left: 50%;
    top: 0%;
    transform: translate(-50%, -100%);
  }
  62% {
    left: 50%;
    top: 0%;
    transform: rotateZ(-15deg) translate(-50%, -100%);
  }
  65% {
    left: 50%;
    top: 0%;
    transform: rotateZ(15deg) translate(-50%, -100%);
  }
  70% {
    left: 50%;
    top: 0%;
    transform: rotateZ(-5deg) translate(-50%, -100%);
  }
  72% {
    left: 50%;
    top: 0%;
    transform: rotateZ(5deg) translate(-50%, -100%);
  }
  74%,84% {
    left: 50%;
    top: 0%;
    transform: rotateZ(0deg) translate(-50%, -100%);
  }
  85% {
    transform: rotateZ(180deg) translate(0%, 120%);
  }
  92% {
    left: 50%;
    top: 0%;
    transform: translate(-50%, -100%);
  }
}
@keyframes expand-light {
  10%,29%,59%,89% {
    transform: translate(-25%, -50%) scale(0, 0);
    border: 2px solid rgba(255, 255, 191, 0);
  }
  90%,20%,50% {
    transform: translate(-25%, -50%) scale(1, 1);
  }
  95%,96%,26%,27%,56%,57% {
    transform: translate(-25%, -50%) scale(2, 2);
    border: 2px solid rgba(255, 255,191, 0.5);
  }
  0%,28%,58%,100% {
    transform: translate(-25%, -50%) scale(2.5, 2.5);
    border: 2px solid rgba(255, 255, 191, 0.2);
  }
}
@keyframes dance-fire {
  59%,89% {
    left: 40%;
    width: 0px;
    height: 0px;
  }
  90%,0%,7%,15%,23%,31%,39%,47%,55% {
    left: 40.8%;
    width: 16px;
    height: 20px;
    background: #FFC107;
  }
  94%,3%,11%,19%,27%,35%,43%,51%,58% {
    left: 41.2%;
    width: 16px;
    height: 20px;
    background: #FF9800;
  }
}
@keyframes changeto-lower {
  0%,70%,90% {
    padding: 0px;
    display: inline-block;
    border-radius: 100%;
    background: #673C63;
    border-width: 0 0 0 0;
    border: 0px solid #673C63;
    transform: translate(-90%, 0%);
  }
  71%,89% {
    background: none;
    border: solid #673C63;
    border-radius: 0px;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 1px;
    float: left;
    transform-origin: bottom left;
    transform: rotate(-45deg) translate(-50%, -65%);
    -webkit-transform: rotate(-45deg) translate(-50%, -65%);
  }
}
@keyframes changeto-greater {
  0%,70%,90% {
    top: 50%;
    padding: 0px;
    display: inline-block;
    border-radius: 100%;
    background: #673C63;
    border-width: 0 0 0 0;
    border: 0px solid #673C63;
    transform: translate(-80%, 0%);
  }
  71%,89% {
    top: 30%;
    background: none;
    border: solid #673C63;
    border-radius: 0px;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 1px;
    float: left;
    transform-origin: bottom left;
    transform: rotate(135deg) translate(-80%, 20%);
    -webkit-transform: rotate(135deg) translate(-80%, 20%);
  }
}
</style>

</head>
<body>

<div  class="outerme">
  <div class="candles">
    <div class="light__wave"></div>
    <div class="candle1">
      <div class="candle1__body">
        <div class="candle1__eyes">
          <span class="candle1__eyes-one"></span>
          <span class="candle1__eyes-two"></span>
        </div>
        <div class="candle1__mouth"></div>
      </div>
      <div class="candle1__stick"></div>
    </div>
		   <!-- 在这里改数字 -->
    <div class="candle-text"> 0 </div>
    
    <div class="candle2">
      <div class="candle2__body">
        <div class="candle2__eyes">
          <div class="candle2__eyes-one"></div>
          <div class="candle2__eyes-two"></div>
        </div>
      </div>
      <div class="candle2__stick"></div>
    </div>
    <div class="candle2__fire"></div>
    <div class="sparkles-one"></div>
    <div class="sparkles-two"></div>
    <div class="candle__smoke-one">

    </div>
    <div class="candle__smoke-two">

    </div>
    
  </div>
  <div class="thefloor">
  </div>

</div>


</body>
</html>