index.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <!DOCTYPE html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  4. <title>where's the button</title>
  5. <script type="text/javascript" src="/js/jquery.min.js"></script>
  6. <link rel="stylesheet" href="/css/bootstrap.min.css">
  7. <script type="text/javascript" src="/js/bootstrap.min.js"></script>
  8. <link rel="stylesheet" href="/css/style.css">
  9. <link rel="preconnect" href="https://fonts.googleapis.com">
  10. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  11. <link href="https://fonts.googleapis.com/css2?family=Anonymous+Pro:ital,wght@0,400;0,700;1,400;1,700
  12. &family=Noto+Serif+SC:wght@300;400;500;600;700&display=swap" rel="stylesheet">
  13. <link rel="stylesheet" href="./style.css">
  14. <script src='three.min.js'></script>
  15. <script src='TweenMax.min.js'></script>
  16. <script src="./script.js"></script>
  17. <style>
  18. body {
  19. overflow-x: hidden;
  20. }
  21. .toggle {
  22. display: inline-block;
  23. }
  24. .toggle {
  25. box-shadow: inset 0 0 35px 5px rgba(0, 0, 0, 0.25), inset 0 2px 1px 1px rgba(255, 255, 255, 0.9), inset 0 -2px 1px 0 rgba(0, 0, 0, 0.25);
  26. border-radius: 8px;
  27. background: #ccd0d4;
  28. position: relative;
  29. height: 140px;
  30. width: 140px;
  31. scale: 0.5;
  32. margin: -30px;
  33. }
  34. .toggle:before {
  35. box-shadow: 0 0 17.5px 8.75px #fff;
  36. border-radius: 118.3px;
  37. background: #fff;
  38. position: absolute;
  39. margin-left: -50.4px;
  40. margin-top: -50.4px;
  41. opacity: 0.2;
  42. content: "";
  43. height: 100.8px;
  44. width: 100.8px;
  45. left: 50%;
  46. top: 50%;
  47. }
  48. .toggle .button {
  49. -webkit-filter: blur(1px);
  50. -moz-filter: blur(1px);
  51. filter: blur(1px);
  52. transition: all 300ms cubic-bezier(0.23, 1, 0.32, 1);
  53. box-shadow: 0 15px 25px -4px rgba(0, 0, 0, 0.5), inset 0 -3px 4px -1px rgba(0, 0, 0, 0.2), 0 -10px 15px -1px rgba(255, 255, 255, 0.6), inset 0 3px 4px -1px rgba(255, 255, 255, 0.2), inset 0 0 5px 1px rgba(255, 255, 255, 0.8), inset 0 20px 30px 0 rgba(255, 255, 255, 0.2);
  54. border-radius: 96.32px;
  55. position: absolute;
  56. background: #ccd0d4;
  57. margin-left: -48.16px;
  58. margin-top: -48.16px;
  59. display: block;
  60. height: 96.32px;
  61. width: 96.32px;
  62. left: 50%;
  63. top: 50%;
  64. }
  65. .toggle .label {
  66. transition: 100ms cubic-bezier(0.23, 1, 0.32, 1);
  67. text-shadow: 1px 1px 3px #ccd0d4, 0 0 0 rgba(0, 0, 0, 0.8), 1px 1px 4px #fff;
  68. line-height: 129px;
  69. text-align: center;
  70. position: absolute;
  71. font-family: "Lato", sans-serif;
  72. font-weight: 700;
  73. font-size: 42px;
  74. display: block;
  75. opacity: 0.9;
  76. height: 100%;
  77. width: 100%;
  78. color: rgba(0, 0, 0, 0.4);
  79. }
  80. .toggle input {
  81. opacity: 0;
  82. position: absolute;
  83. cursor: pointer;
  84. z-index: 1;
  85. height: 100%;
  86. width: 100%;
  87. left: 0;
  88. top: 0;
  89. }
  90. .toggle input:active~.button {
  91. box-shadow: 0 15px 25px -4px rgba(0, 0, 0, 0.4), inset 0 -8px 30px 1px rgba(255, 255, 255, 0.9), 0 -10px 15px -1px rgba(255, 255, 255, 0.6), inset 0 8px 25px 0 rgba(0, 0, 0, 0.4), inset 0 0 10px 1px rgba(255, 255, 255, 0.6);
  92. }
  93. .toggle input:active~.label {
  94. font-size: 40px;
  95. color: rgba(0, 0, 0, 0.45);
  96. }
  97. .toggle input:checked~.button {
  98. box-shadow: 0 15px 25px -4px rgba(0, 0, 0, 0.4), inset 0 -8px 25px -1px rgba(255, 255, 255, 0.9), 0 -10px 15px -1px rgba(255, 255, 255, 0.6), inset 0 8px 20px 0 rgba(0, 0, 0, 0.2), inset 0 0 5px 1px rgba(255, 255, 255, 0.6);
  99. }
  100. .toggle input:checked~.label {
  101. font-size: 40px;
  102. color: rgba(0, 0, 0, 0.4);
  103. }
  104. </style>
  105. </head>
  106. <body>
  107. <div class="container">
  108. <button>I'm a Button</button>
  109. </div>
  110. <div class="container">
  111. <div class="toggle">
  112. <input type="checkbox">
  113. <span class="button"></span>
  114. <span class="label">1</span>
  115. </div>
  116. <div class="toggle">
  117. <input type="checkbox" checked>
  118. <span class="button"></span>
  119. <span class="label">2</span>
  120. </div>
  121. <div class="toggle">
  122. <input type="checkbox">
  123. <span class="button"></span>
  124. <span class="label">yes</span>
  125. </div>
  126. <div class="toggle">
  127. <input type="checkbox" checked>
  128. <span class="button"></span>
  129. <span class="label">no</span>
  130. </div>
  131. </div>
  132. </body>