x32x01
أدارة أكتب كود
- بواسطة x32x01 ||
برمجة ساعة تبدو واقعية اكثر كجعل الساعة زجاجية + وضع ظلال من وراء الساعة من الجانب
HTML:
<div class="clook">
<div class="org"></div>
<div class="second"></div>
<span>1</span>
<span>2</span>
<span>3</span>
<span>4</span>
<span>5</span>
<span>6</span>
<span>7</span>
<span>8</span>
<span>9</span>
<span>10</span>
<span>11</span>
<span>12</span>
</div>
CSS:
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #aaaaaa;
}
.clook {
width: 300px;
height: 300px;
background-color: rgb(26, 25, 25);
border-radius: 50%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-ms-border-radius: 50%;
-o-border-radius: 50%;
position: relative;
border: 15px solid #333;
box-shadow: 0px 0px 29px #ffffffb5 inset, -2px 5px 7px black;
}
.org {
width: 15px;
height: 15px;
background-color: lightblue;
box-shadow: 0 0 7px #000 inset;
border-radius: 50%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-ms-border-radius: 50%;
-o-border-radius: 50%;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
z-index: 5;
}
.second {
width: 100%;
height: 100%;
animation: time 60s steps(60) infinite;
-webkit-animation: time 60s steps(60) infinite;
}
.second::after {
content: "";
width: 107px;
height: 3px;
background-color: red;
border-radius: 3px;
position: absolute;
left: 114px;
top: 134px;
z-index: 1;
transform-origin: 20% 50%;
transform: rotate(36deg);
-webkit-transform: rotate(36deg);
-moz-transform: rotate(36deg);
-ms-transform: rotate(36deg);
-o-transform: rotate(36deg);
}
.clook::after {
content: "";
width: 94px;
height: 4px;
background-color: skyblue;
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
-ms-border-radius: 3px;
-o-border-radius: 3px;
position: absolute;
left: 121px;
top: 133px;
z-index: 3;
transform-origin: 15% 50%;
transform: rotate(33deg);
-webkit-transform: rotate(33deg);
-moz-transform: rotate(33deg);
-ms-transform: rotate(33deg);
-o-transform: rotate(33deg);
animation: time 3600s steps(60) infinite;
-webkit-animation: time 3600s steps(60) infinite;
}
.clook::before {
content: "";
width: 80px;
height: 6px;
background-color: slateblue;
border-radius: 1px;
-webkit-border-radius: 1px;
-moz-border-radius: 1px;
-ms-border-radius: 1px;
-o-border-radius: 1px;
position: absolute;
left: 123px;
top: 133px;
z-index: 2;
transform-origin: 15% 50%;
transform: rotate(484deg);
-webkit-transform: rotate(484deg);
-moz-transform: rotate(484deg);
-ms-transform: rotate(484deg);
-o-transform: rotate(484deg);
animation: time 43200s steps(60) infinite;
-webkit-animation: time 43200s steps(60) infinite;
}
span {
font-size: 26px;
color: skyblue;
font-weight: 300;
position: absolute;
user-select: none;
}
span:nth-child(3) {
left: 71%;
top: 30px
}
span:nth-child(4) {
left: 84%;
top: 68px;
}
span:nth-child(5) {
left: 90%;
top: 46%;
}
span:nth-child(6) {
left: 84%;
top: 67%;
}
span:nth-child(7) {
left: 69%;
top: 81%;
}
span:nth-child(8) {
left: 128px;
top: 87%;
}
span:nth-child(9) {
left: 25%;
top: 81%;
}
span:nth-child(10) {
left: 11%;
top: 67%;
}
span:nth-child(11) {
left: 4%;
top: 46%;
}
span:nth-child(12) {
left: 10%;
top: 68px;
}
span:nth-child(13) {
left: 57px;
top: 30px
}
span:nth-child(14) {
left: 118px;
top: 9px;
}
@keyframes time {
to {
transform: rotate(360deg);
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
}
}