明月几时有?把酒问青天。不知天上宫阙,今夕是何年? 我欲乘风归去,又恐琼楼玉宇,高处不胜寒!起舞弄清影,何似在人间? 转朱阁,低绮户,照无眠。不应有恨,何事长向别时圆? 人有悲欢离合,月有阴晴圆缺,此事古难全。但愿人长久,千里共婵娟。
花间一壶酒,独酌无相亲。举杯邀明月,对影成三人。 月既不解饮,影徒随我身。暂伴月将影,行乐须及春。 我歌月徘徊,我舞影零乱。醒时同交欢,醉后各分散。 永结无情游,相期邈云汉。
辛弃疾:太常引 一轮秋影转金波,飞镜又重磨。把酒问姮娥:被白发欺人奈何! 乘风好去,长空万里,直下看山河。斫去桂婆娑。人道是清光
云母屏风烛影深,长河渐落晓星沉。嫦娥应悔偷灵药,碧海青天夜夜心。
暮云收尽溢清寒,银汉无声转玉盘,此生此夜不长好,明月明年何处看。
天将今夜月,一遍洗寰瀛。暑退九霄净,秋澄万景清。 星辰让光彩,风露发晶英。能变人间世,攸然是玉京。
过节往往最能代表一个民族的文化面貌. 中秋节,作为中国人的专属节日,它已出现约2000年,自古是祈求团圆的象征,用以期盼美好之意。它虽然是传统文化的传承,但随着时代的变迁,中秋节也融入了大量的流行特质,从月饼种类的多样性,到法定假期的施行,令中秋节绽放出更加时尚的风貌。在中秋佳节之际,特以制作此专辑,带您过一个不同以往的中秋
效果图:
代码实现
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>月球可拖动title>
<style>
* {
margin: 0;
padding: 0;
list-style: none;
}
html,
body {
width: 100%;
height: 100%;
}
#neko {
width: 100px;
height: 100px;
background: #ddd;
position: fixed;
cursor: move;
box-sizing: border-box;
border-radius: 50%;
background: url('https://thisuseravatar.oss-cn-guangzhou.aliyuncs.com/s2/1.jpg') no-repeat center center;
background-size: 100% 100%;
overflow: hidden;
}
.fillIn-box::before{
content: ' ';
position: fixed;
z-index: -1;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: #FFFFFF;
background-size: 100% auto;
background: url('https://thisuseravatar.oss-cn-guangzhou.aliyuncs.com/s2/22.jpg') no-repeat center center;
background-size: 100% 100%;
}
style>
head>
<body class="fillIn-box">
<h3 style="padding: 20px;color:#fff;">请将月球拖动到浏览器边缘,查看效果h3>
<div id="neko">
div>
<script>
var neko = document.querySelector('#neko');
var nekoW = neko.offsetWidth;
var nekoH = neko.offsetHeight;
var cuntW = 0;
var cuntH = 0;
neko.style.left = parseInt(Math.random() * (document.body.offsetWidth - nekoW)) + 'px';
neko.style.top = parseInt(Math.random() * (document.body.offsetHeight - nekoH)) + 'px';
function move(obj, w, h) {
if (obj.direction === 'left') {
obj.style.left = 0 - w + 'px';
} else if (obj.direction === 'right') {
obj.style.left = document.body.offsetWidth - nekoW + w + 'px';
}
if (obj.direction === 'top') {
obj.style.top = 0 - h + 'px';
} else if (obj.direction === 'bottom') {
obj.style.top = document.body.offsetHeight - nekoH + h + 'px';
}
}
function rate(obj, a) {
// console.log(a);
obj.style.transform = ' rotate(' + a + ')'
}
function action(obj) {
var dir = obj.direction;
switch (dir) {
case 'left':
rate(obj, '90deg');
break;
case 'right':
rate(obj, '-90deg');
break;
case 'top':
rate(obj, '-180deg');
break;
default:
rate(obj, '-0');
break;
}
}
neko.onmousedown = function (e) {
var nekoL = e.clientX - neko.offsetLeft;
var nekoT = e.clientY - neko.offsetTop;
document.onmousemove = function (e) {
cuntW = 0;
cuntH = 0;
neko.direction = '';
neko.style.transition = '';
neko.style.left = (e.clientX - nekoL) + 'px';
neko.style.top = (e.clientY - nekoT) + 'px';
if (e.clientX - nekoL < 5) {
neko.direction = 'left';
}
if (e.clientY - nekoT < 5) {
neko.direction = 'top';
}
if (e.clientX - nekoL > document.body.offsetWidth - nekoW - 5) {
neko.direction = 'right';
}
if (e.clientY - nekoT > document.body.offsetHeight - nekoH - 5) {
neko.direction = 'bottom';
}
move(neko, 0, 0);
}
}
neko.onmouseover = function () {
move(this, 0, 0);
rate(this, 0)
}
neko.onmouseout = function () {
move(this, nekoW / 2, nekoH / 2);
action(this);
}
neko.onmouseup = function () {
document.onmousemove = null;
this.style.transition = '.5s';
move(this, nekoW / 2, nekoH / 2);
action(this);
}
window.onresize = function () {
var bodyH = document.body.offsetHeight;
var nekoT = neko.offsetTop;
var bodyW = document.body.offsetWidth;
var nekoL = neko.offsetLeft;
if (nekoT + nekoH > bodyH) {
neko.style.top = bodyH - nekoH + 'px';
cuntH++;
}
if (bodyH > nekoT && cuntH > 0) {
neko.style.top = bodyH - nekoH + 'px';
}
if (nekoL + nekoW > bodyW) {
neko.style.left = bodyW - nekoW + 'px';
cuntW++;
}
if (bodyW > nekoL && cuntW > 0) {
neko.style.left = bodyW - nekoW + 'px';
}
move(neko, nekoW / 2, nekoH / 2);
}
script>
body>
html>
最后祝大家节日快乐!