css+js模拟windows9x电脑桌面操作效果代码

代码语言:html

所属分类:其他

代码描述:css+js模拟windows9x电脑桌面操作效果代码,包括图标操作、开始菜单栏等。

代码标签: css js 模拟 windows 9x 桌面 操作

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

 
<meta charset="UTF-8">

 
 
 
<style>
html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background-color: #54A8A8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 12px;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

*, *::before, *::after {
  box-sizing: inherit;
}

svg {
  display: block;
}

.desktop {
  display: grid;
  user-select: none;
  position: relative;
  width: 100%;
  height: 100%;
}

.short-cuts {
  margin-bottom: 28px;
}

.short-cut {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 2px;
  width: 72px;
}
.short-cut .icon {
  margin-bottom: 6px;
}
.short-cut .text {
  text-align: center;
  color: #FFFFFF;
  border: 1px solid transparent;
}
.short-cut.selected .text {
  background-color: #0000A8;
  border: 1px dotted #FCFC00;
}

.window {
  position: absolute;
  border-top: 1px solid #DFDFDF;
  border-left: 1px solid #DFDFDF;
  border-bottom: 1px solid #000000;
  border-right: 1px solid #000000;
}
.window.minimized {
  display: none;
}
.window .restore-icon {
  display: none;
}
.window.maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: calc(100% - 28px) !important;
  border-top: 0;
  border-left: 0;
  border-bottom: 0;
  border-right: 0;
}
.window.maximized .frame {
  border-top: 0;
  border-left: 0;
  border-bottom: 0;
  border-right: 0;
  padding: 0;
}
.window.maximized .maximize-icon {
  display: none;
}
.window.maximized .restore-icon {
  display: block;
}
.window .frame {
  background: #BFBFBF;
  border-top: 1px solid #FFFFFF;
  border-left: 1px solid #FFFFFF;
  border-bottom: 1px solid #7F7F7F;
  border-right: 1px solid #7F7F7F;
  padding: 2px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.window .content-bevel {
  border-top: 1px solid #7F7F7F;
  border-left: 1px solid #7F7F7F;
  border-bottom: 1px solid #FFFFFF;
  border-right: 1px solid #FFFFFF;
  flex-grow: 1;
  height: calc(100% - 20px);
}
.window .content {
  border-top: 1px solid #000000;
  border-left: 1px solid #000000;
  border-bottom: 1px solid #DFDFDF;
  border-right: 1px solid #DFDFDF;
  background-color: #FFFFFF;
  height: 100%;
  padding: 0 8px;
  overflow: auto;
}
.window.active .title-bar {
  background-color: #0000A8;
}
.window.active .title-bar .title {
  color: #FFFFFF;
}
.window .grab {
  position: absolute;
}
.window .n-grab {
  top: -1px;
  left: 3px;
  right: 3px;
  height: 4px;
  cursor: ns-resize;
}
.window .ne-grab {
  top: -1px;
  right: -1px;
  width: 4px;
  height: 4px;
  cursor: nesw-resize;
}
.window .e-grab {
  top: 3px;
  right: -1px;
  bottom: 3px;
  width: 4px;
  cursor: ew-resize;
}
.window .se-grab {
  bottom: -1px;
  right: -1px;
  width: 4px;
  height: 4px;
  cursor: nwse-resize;
}
.window .s-grab {
  bottom: -1px;
  left: 3px;
  right: 3px;
  height: 4px;
  cursor: ns-resize;
}
.window .sw-grab {
  bottom: -1px;
  left: -1px;
  width: 4px;
  height: 4px;
  cursor: nesw-resize;
}
.window .w-grab {
  left: -1px;
  top: 3px;
  bottom: 3px;
  width: 4px;
  cursor: ew-resize;
}
.window .nw-grab {
  top: -1px;
  left: -1px;
  width: 4px;
  height: 4px;
  cursor: nwse-resize;
}

.title-bar {
  background-color: #7F7F7F;
  padding: 1px 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.title-bar .title {
  margin-left: 3px;
  flex-grow: 1;
  color: #BFBFBF;
  font-weight: bold;
}
.title-bar .button {
  padding: 0;
  background: #BFBFBF;
  border-top: 1px solid #FFFFFF;
  border-left: 1px solid #FFFFFF;
  border-bottom: 1px solid #000000;
  border-right: 1px solid #000000;
}
.title-bar .button .bevel {
  border-top: 1px solid #DFDFDF;
  border-left: 1px solid #DFDFDF;
  border-bottom: 1px solid #7F7F7F;
  border-right: 1px solid #7F7F7F;
}
.title-bar .button.close {
  margin-left: 2px;
}
.title-bar .button:active {
  border-top: 1px solid #000000;
  border-left: 1px solid #000000;
  border-bottom: 1px solid #FFFFFF;
  border-right: 1px solid #FFFFFF;
}
.title-bar .button:active svg {
  position: relative;
  top: 1px;
  left: 1px;
}
.title-bar .button:active .bevel {
  border-top: 1px solid #7F7F7F;
  border-left: 1px solid #7F7F7F;
  border-bottom: 1px solid #BFBFBF;
  border-right: 1px solid #BFBFBF;
}
.title-bar.animating {
  position: absolute;
  transition: all 200ms linear;
  background-color: #0000A8;
  z-index: 1000;
}
.title-bar.animating .title {
  color: #FFFFFF;
}
.title-bar.animating .button {
  display: none;
}

.task-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #C0C7C8;
  height: 28px;
  border-top: 1px solid #C0C7C8;
  z-index: 1000;
}
.task-bar > .bevel {
  border-top: 1px solid #FFFFFF;
  padding: 2px;
  display: flex;
}
.task-bar .start-button {
  border-top: 1px solid #FFFFFF;
  border-left: 1px solid #FFFFFF;
  border-bottom: 1px solid #000000;
  border-right: 1px solid #000000;
  background-color: #C0C7C8;
  display: flex;
  padding: 0;
  font-size: 11px;
}
.task-bar .start-button .bevel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #87888F;
  border-right: 1px solid #87888F;
  background-color: #C0C7C8;
  padding: 2px 3px 3px 3px;
}
.task-bar .start-button .icon {
  margin-right: 3px;
}
.task-bar .start-button.active {
  border-top: 1px solid #000000;
  border-left: 1px solid #000000;
  border-bottom: 1px solid #FFFFFF;
  border-right: 1px solid #FFFFFF;
}
.task-bar .start-button.active .bevel {
  border-top: 1px solid #87888F;
  border-left: 1px solid #87888F;
  padding: 2px 2px 2px 3px;
}
.task-bar .start-menu {
  position: absolute;
  bottom: 26px;
  left: 2px;
  background-color: #C0C7C8;
  display: flex;
  padding: 2px;
  border-top: 1px solid #C0C7C8;
  border-left: 1px solid #C0C7C8;
  border-bottom: 1px solid #000000;
  border-right: 1px solid #000000;
}
.task-bar .start-menu::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  pointer-events: none;
  border-top: 1px solid #FFFFFF;
  border-left: 1px solid #FFFFFF;
  border-bottom: 1px solid #87888F;
  border-right: 1px solid #87888F;
}
.task-bar .start-menu.hidden {
  display: none;
}
.task-bar .start-menu .side-logo {
  background-color: #87888F;
  width: 21px;
  min-height: 150px;
}
.task-bar .start-menu .side-logo .text {
  font-size: 20px;
  transform: rotate(-90deg) translate3d(-120px, -1px, 0);
}
.task-bar .start-menu .side-logo .windows {
  color: #C0C7C8;
  font-weight: 900;
}
.task-bar .start-menu .side-logo .version {
  color: #FFFFFF;
}
.task-bar .start-menu .menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.task-bar .start-menu .menu ul li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 6px;
}
.task-bar .start-menu .menu ul li .text {
  flex-grow: 1;
  min-width: 74px;
}
.task-bar .start-menu .menu ul li .icon {
  margin-right: 6px;
}
.task-bar .start-menu .menu ul li:hover {
  background-color: #0000A8;
  color: #FFFFFF;
}
.task-bar .start-menu .menu .underline {
  text-decoration: underline;
}
.task-bar .task-bar-items {
  margin-left: 1px;
  display: flex;
  justify-content: flex-start;
  flex-grow: 1;
}
.task-bar .task-bar-item {
  width: 157px;
  border-top: 1px solid #FFFFFF;
  border-left: 1px solid #FFFFFF;
  border-bottom: 1px solid #000000;
  border-right: 1px solid #000000;
  margin-left: 3px;
}
.task-bar .task-bar-item .bevel {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-bottom: 1px solid #87888F;
  border-right: 1px solid #87888F;
  background-color: #C0C7C8;
  padding-left: 3px;
}
.task-bar .task-bar-item .icon {
  margin-right: 4px;
}
.task-bar .task-bar-item.active {
  border-top: 1px solid #000000;
  border-left: 1px solid #000000;
  border-bottom: 1px solid #FFFFFF;
  border-right: 1px solid #FFFFFF;
}
.task-bar .task-bar-item.active .bevel {
  position: relative;
  border-top: 1px solid #87888F;
  border-left: 1px solid #87888F;
  border-bottom: 1px solid #C0C7C8;
  border-right: 1px solid #C0C7C8;
  background: url("data:image/svg+xml;utf8,
<svg xmlns='http://www.w3.org/2000/svg' width='2' height='2' fill='none'><path fill='%23fff' d='M0 0h2v2H0z'/><path fill='%23C0C7C8' d='M0 0h1v1H0zM1 1h1v1H1z'/></svg>");
  background-repeat: repeat;
}
.task-bar .task-bar-item.active .bevel:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  width: 100%;
  background-color: #FFFFFF;
}
.task-bar .notification-area {
  border-top: 1px solid #87888F;
  border-left: 1px solid #87888F;
  border-bottom: 1px solid #FFFFFF;
  border-right: 1px solid #FFFFFF;
  padding: 1px;
}
.task-bar .notification-area .clock {
  margin-right: 10px;
  min-width: 50px;
  text-align: right;
}

::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

::-webkit-scrollbar-thumb {
  border-top: 1px solid #C0C7C8;
  border-left: 1px solid #C0C7C8;
  border-right: 1px solid #000000;
  border-bottom: 1px solid #000000;
  box-shadow: inset -1px -1px 0 0 #87888F, inset 1px 1px 0 0 #FFFFFF;
  width: 16px;
  height: 16px;
  background-color: #C0C7C8;
  z-index: 1;
}

::-webkit-scrollbar-track {
  background: url("data:image/svg+xml;utf8,
<svg xmlns='http://www.w3.org/2000/svg' width='2' height='2' fill='none'><path fill='%23fff' d='M0 0h2v2H0z'/><path fill='%23C0C7C8' d='M0 0h1v1H0zM1 1h1v1H1z'/></svg>");
  background-repeat: repeat;
}

::-webkit-scrollbar-corner {
  background-color: #C0C7C8;
}

::-webkit-scrollbar-button {
  border-top: 1px solid #C0C7C8;
  border-left: 1px solid #C0C7C8;
  border-right: 1px solid #000000;
  border-bottom: 1px solid #000000;
  box-shadow: inset -1px -1px 0 0 #87888F, inset 1px 1px 0 0 #FFFFFF;
  display: block;
  width: 16px;
  height: 16px;
  background-color: #C0C7C8;
  background-repeat: no-repeat;
}
::-webkit-scrollbar-button:horizontal:decrement {
  background-image: url("data:image/svg+xml;utf8,
<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none'><path fill='%23000' d='M4 6v1h1v1h1v1h1v1h1V3H7v1H6v1H5v1H4Z'/></svg>");
}
::-webkit-scrollbar-button:horizontal:increment {
  background-image: url("data:image/svg+xml;utf8,
<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none'><path fill='%23000' d='M9 7V6H8V5H7V4H6V3H5v7h1V9h1V8h1V7h1Z'/></svg>");
}
::-webkit-scrollbar-button:vertical:decrement {
  background-image: url("data:image/svg+xml;utf8,
<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none'><path fill='%23000' d='M7 5H6v1H5v1H4v1H3v1h7V8H9V7H8V6H7V5Z'/></svg>");
}
::-webkit-scrollbar-button:vertical:increment {
  background-image: url("data:image/svg+xml;utf8,
<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none'><path fill='%23000' d='M6 9h1V8h1V7h1V6h1V5H3v1h1v1h1v1h1v1Z'.........完整代码请登录后点击上方下载按钮下载查看

网友评论0