js+svg实现数学比例切割圆形游戏代码

代码语言:html

所属分类:游戏

代码描述:js+svg实现数学比例切割圆形游戏代码,按照几分之几来切割圆形来通过下一题。

代码标签: js svg 数学 比例 切割 圆形 游戏 代码

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

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

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

  
  
<style>
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@500;650;800&display=swap");

:root {
  --paper: #f4f1ea;
  --surface: #fbf8f1;
  --ink: #24231f;
  --muted: #8b8478;
  --line: #d8d0c3;
  --slice: rgba(36, 35, 31, 0.13);
  --target-slice: rgba(36, 35, 31, 0.075);
  --shadow: rgba(46, 39, 30, 0.11);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
}

.game {
  position: relative;
  width: min(92vw, 430px);
  min-height: 660px;
  display: grid;
  grid-template-rows: auto auto auto 58px auto;
  justify-items: center;
  align-content: center;
  gap: 22px;
  padding: 42px 32px 34px;
  text-align: center;
  user-select: none;
}

.help {
  position: absolute;
  top: 28px;
  right: 28px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease;
}

.help:hover,
.help:focus-visible,
.help[aria-expanded="true"] {
  color: var(--ink);
  border-color: var(--ink);
  outline: none;
}

.tooltip {
  position: absolute;
  top: 70px;
  right: 28px;
  z-index: 20;
  width: min(280px, calc(100vw - 56px));
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 18px 44px var(--shadow);
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

.tooltip.open,
.help:hover + .tooltip,
.help:focus-visible + .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tooltip::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 14px;
  width: 10px;
  height: 10px;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  background: var(--surface);
  transform: rotate(45deg);
}

.tooltip strong {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 800;
}

.tooltip span {
  display: block;
  color: var(--muted);
  font-.........完整代码请登录后点击上方下载按钮下载查看

网友评论0