Border_um_kreiss_mit_prozent.php


Quell Code


<style>
	.wrap.full output:before, .wrap:not(.full) output {
  position: absolute;
  width: 2.5em;
  height: 2.5em;
  opacity: 0;
  color: #fff;
  pointer-events: none;
  transition: opacity 0.5s ease-in-out;
}

* {
  margin: 0;
}

body {
  background: #3d3d4a;
}

.wrap {
  margin: 2em auto;
  width: 25em;
  font: 2vmin trebuchet ms, arial, sans-serif;
}
@media (max-width: 500px), (max-height: 500px) {
  .wrap {
    font-size: 10px;
  }
}
@media (min-width: 1600px), (min-height: 1600px) {
  .wrap {
    font-size: 32px;
  }
}
.wrap:not(.full) {
  position: relative;
}
.wrap:not(.full) output {
  top: 0;
  transform: translate(calc(var(--val)/100*22.5em));
}
.wrap.full {
  position: relative;
  height: 25em;
}
.wrap.full [type=range] {
  display: block;
  transform-origin: 100% 0;
  transform: rotate(-90deg) translatey(-100%);
}
.wrap.full output {
  width: 80%;
  height: 80%;
  border-radius: 50%;
  color: #7a7a7a;
  font-size: 4em;
  font-weight: 700;
}
.wrap.full output:before {
  right: 0;
  bottom: 0;
  transform: translatey(calc(var(--val)/-100*22.5em));
  line-height: 2.5em;
  text-align: center;
  font-size: 0.25em;
  font-weight: 200;
  counter-reset: val var(--val);
  content: counter(val) "%";
}

[type=range] {
  padding: 0;
  width: 25em;
  height: 2.5em;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
[type=range], [type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
}
[type=range]::-webkit-slider-runnable-track {
  border: none;
  width: 25em;
  height: 0.5em;
  border-radius: 0.25em;
  background: #343440;
}
[type=range]::-moz-range-track {
  border: none;
  width: 25em;
  height: 0.5em;
  border-radius: 0.25em;
  background: #343440;
}
[type=range]::-ms-track {
  border: none;
  width: 25em;
  height: 0.5em;
  border-radius: 0.25em;
  background: #343440;
}
[type=range]::-webkit-slider-thumb {
  margin-top: -1em;
  border: none;
  width: 2.5em;
  height: 2.5em;
  border-radius: 50%;
  transform: scale(0.7);
  background: #e6323e;
  filter: saturate(0.7);
  transition: transform 0.5s linear, filter 0.5s;
}
[type=range]::-moz-range-thumb {
  border: none;
  width: 2.5em;
  height: 2.5em;
  border-radius: 50%;
  transform: scale(0.7);
  background: #e6323e;
  filter: saturate(0.7);
  transition: transform 0.5s linear, filter 0.5s;
}
[type=range]::-ms-thumb {
  margin-top: 0;
  border: none;
  width: 2.5em;
  height: 2.5em;
  border-radius: 50%;
  transform: scale(0.7);
  background: #e6323e;
  filter: saturate(0.7);
  transition: transform 0.5s linear, filter 0.5s;
}
[type=range]::-ms-tooltip {
  display: none;
}
[type=range] + output {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(#3d3d4a 39%, transparent 39.5%), conic-gradient(#e64c65 calc(var(--val)*1%), #41a8ab 0%);
}
[type=range] + output:after {
  content: "%";
}
[type=range]:focus {
  outline: none;
}
[type=range]:focus::-webkit-slider-thumb {
  transform: none;
  filter: none;
}
[type=range]:focus::-moz-range-thumb {
  transform: none;
  filter: none;
}
[type=range]:focus::-ms-thumb {
  transform: none;
  filter: none;
}
.wrap:not(.full) [type=range]:focus + output, .wrap.full [type=range]:focus + output:before {
  opacity: 1;
}
</style>
<div class='wrap'>
	<input id='r' type='range'/>
</div>
<script>
	const _R = document.getElementById('r'),
_W = _R.parentNode,
_O = document.createElement('output');

let val = null,conic = false;

function update() {
  let newval = +_R.value;

  if (val !== newval) {
    _W.style.setProperty('--val', _O.value = val = newval);
    if (conic) _O.setAttribute('aria-label', `${val}%`);
  }
};

update();

_O.setAttribute('for', _R.id);
_W.appendChild(_O);

if (getComputedStyle(_O).backgroundImage !== 'none') {
  conic = true;
  _W.classList.add('full');
  _O.setAttribute('role', 'img');
  _O.setAttribute('aria-label', `${val}%`);
}

addEventListener('input', update, false);
addEventListener('change', update, false);
</script>
  1. <style>
  2. .wrap.full output:before, .wrap:not(.full) output {
  3. position: absolute;
  4. width: 2.5em;
  5. height: 2.5em;
  6. opacity: 0;
  7. color: #fff;
  8. pointer-events: none;
  9. transition: opacity 0.5s ease-in-out;
  10. }
  11. * {
  12. margin: 0;
  13. }
  14. body {
  15. background: #3d3d4a;
  16. }
  17. .wrap {
  18. margin: 2em auto;
  19. width: 25em;
  20. font: 2vmin trebuchet ms, arial, sans-serif;
  21. }
  22. @media (max-width: 500px), (max-height: 500px) {
  23. .wrap {
  24. font-size: 10px;
  25. }
  26. }
  27. @media (min-width: 1600px), (min-height: 1600px) {
  28. .wrap {
  29. font-size: 32px;
  30. }
  31. }
  32. .wrap:not(.full) {
  33. position: relative;
  34. }
  35. .wrap:not(.full) output {
  36. top: 0;
  37. transform: translate(calc(var(--val)/100*22.5em));
  38. }
  39. .wrap.full {
  40. position: relative;
  41. height: 25em;
  42. }
  43. .wrap.full [type=range] {
  44. display: block;
  45. transform-origin: 100% 0;
  46. transform: rotate(-90deg) translatey(-100%);
  47. }
  48. .wrap.full output {
  49. width: 80%;
  50. height: 80%;
  51. border-radius: 50%;
  52. color: #7a7a7a;
  53. font-size: 4em;
  54. font-weight: 700;
  55. }
  56. .wrap.full output:before {
  57. right: 0;
  58. bottom: 0;
  59. transform: translatey(calc(var(--val)/-100*22.5em));
  60. line-height: 2.5em;
  61. text-align: center;
  62. font-size: 0.25em;
  63. font-weight: 200;
  64. counter-reset: val var(--val);
  65. content: counter(val) "%";
  66. }
  67. [type=range] {
  68. padding: 0;
  69. width: 25em;
  70. height: 2.5em;
  71. background: transparent;
  72. font: inherit;
  73. cursor: pointer;
  74. }
  75. [type=range], [type=range]::-webkit-slider-thumb {
  76. -webkit-appearance: none;
  77. }
  78. [type=range]::-webkit-slider-runnable-track {
  79. border: none;
  80. width: 25em;
  81. height: 0.5em;
  82. border-radius: 0.25em;
  83. background: #343440;
  84. }
  85. [type=range]::-moz-range-track {
  86. border: none;
  87. width: 25em;
  88. height: 0.5em;
  89. border-radius: 0.25em;
  90. background: #343440;
  91. }
  92. [type=range]::-ms-track {
  93. border: none;
  94. width: 25em;
  95. height: 0.5em;
  96. border-radius: 0.25em;
  97. background: #343440;
  98. }
  99. [type=range]::-webkit-slider-thumb {
  100. margin-top: -1em;
  101. border: none;
  102. width: 2.5em;
  103. height: 2.5em;
  104. border-radius: 50%;
  105. transform: scale(0.7);
  106. background: #e6323e;
  107. filter: saturate(0.7);
  108. transition: transform 0.5s linear, filter 0.5s;
  109. }
  110. [type=range]::-moz-range-thumb {
  111. border: none;
  112. width: 2.5em;
  113. height: 2.5em;
  114. border-radius: 50%;
  115. transform: scale(0.7);
  116. background: #e6323e;
  117. filter: saturate(0.7);
  118. transition: transform 0.5s linear, filter 0.5s;
  119. }
  120. [type=range]::-ms-thumb {
  121. margin-top: 0;
  122. border: none;
  123. width: 2.5em;
  124. height: 2.5em;
  125. border-radius: 50%;
  126. transform: scale(0.7);
  127. background: #e6323e;
  128. filter: saturate(0.7);
  129. transition: transform 0.5s linear, filter 0.5s;
  130. }
  131. [type=range]::-ms-tooltip {
  132. display: none;
  133. }
  134. [type=range] + output {
  135. display: flex;
  136. align-items: center;
  137. justify-content: center;
  138. background: radial-gradient(#3d3d4a 39%, transparent 39.5%), conic-gradient(#e64c65 calc(var(--val)*1%), #41a8ab 0%);
  139. }
  140. [type=range] + output:after {
  141. content: "%";
  142. }
  143. [type=range]:focus {
  144. outline: none;
  145. }
  146. [type=range]:focus::-webkit-slider-thumb {
  147. transform: none;
  148. filter: none;
  149. }
  150. [type=range]:focus::-moz-range-thumb {
  151. transform: none;
  152. filter: none;
  153. }
  154. [type=range]:focus::-ms-thumb {
  155. transform: none;
  156. filter: none;
  157. }
  158. .wrap:not(.full) [type=range]:focus + output, .wrap.full [type=range]:focus + output:before {
  159. opacity: 1;
  160. }
  161. </style>
  162. <div class='wrap'>
  163. <input id='r' type='range'/>
  164. </div>
  165. <script>
  166. const _R = document.getElementById('r'),
  167. _W = _R.parentNode,
  168. _O = document.createElement('output');
  169. let val = null,conic = false;
  170. function update() {
  171. let newval = +_R.value;
  172. if (val !== newval) {
  173. _W.style.setProperty('--val', _O.value = val = newval);
  174. if (conic) _O.setAttribute('aria-label', `${val}%`);
  175. }
  176. };
  177. update();
  178. _O.setAttribute('for', _R.id);
  179. _W.appendChild(_O);
  180. if (getComputedStyle(_O).backgroundImage !== 'none') {
  181. conic = true;
  182. _W.classList.add('full');
  183. _O.setAttribute('role', 'img');
  184. _O.setAttribute('aria-label', `${val}%`);
  185. }
  186. addEventListener('input', update, false);
  187. addEventListener('change', update, false);
  188. </script>
<style>
	.wrap.full output:before, .wrap:not(.full) output {
  position: absolute;
  width: 2.5em;
  height: 2.5em;
  opacity: 0;
  color: #fff;
  pointer-events: none;
  transition: opacity 0.5s ease-in-out;
}

* {
  margin: 0;
}

body {
  background: #3d3d4a;
}

.wrap {
  margin: 2em auto;
  width: 25em;
  font: 2vmin trebuchet ms, arial, sans-serif;
}
@media (max-width: 500px), (max-height: 500px) {
  .wrap {
    font-size: 10px;
  }
}
@media (min-width: 1600px), (min-height: 1600px) {
  .wrap {
    font-size: 32px;
  }
}
.wrap:not(.full) {
  position: relative;
}
.wrap:not(.full) output {
  top: 0;
  transform: translate(calc(var(--val)/100*22.5em));
}
.wrap.full {
  position: relative;
  height: 25em;
}
.wrap.full [type=range] {
  display: block;
  transform-origin: 100% 0;
  transform: rotate(-90deg) translatey(-100%);
}
.wrap.full output {
  width: 80%;
  height: 80%;
  border-radius: 50%;
  color: #7a7a7a;
  font-size: 4em;
  font-weight: 700;
}
.wrap.full output:before {
  right: 0;
  bottom: 0;
  transform: translatey(calc(var(--val)/-100*22.5em));
  line-height: 2.5em;
  text-align: center;
  font-size: 0.25em;
  font-weight: 200;
  counter-reset: val var(--val);
  content: counter(val) "%";
}

[type=range] {
  padding: 0;
  width: 25em;
  height: 2.5em;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
[type=range], [type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
}
[type=range]::-webkit-slider-runnable-track {
  border: none;
  width: 25em;
  height: 0.5em;
  border-radius: 0.25em;
  background: #343440;
}
[type=range]::-moz-range-track {
  border: none;
  width: 25em;
  height: 0.5em;
  border-radius: 0.25em;
  background: #343440;
}
[type=range]::-ms-track {
  border: none;
  width: 25em;
  height: 0.5em;
  border-radius: 0.25em;
  background: #343440;
}
[type=range]::-webkit-slider-thumb {
  margin-top: -1em;
  border: none;
  width: 2.5em;
  height: 2.5em;
  border-radius: 50%;
  transform: scale(0.7);
  background: #e6323e;
  filter: saturate(0.7);
  transition: transform 0.5s linear, filter 0.5s;
}
[type=range]::-moz-range-thumb {
  border: none;
  width: 2.5em;
  height: 2.5em;
  border-radius: 50%;
  transform: scale(0.7);
  background: #e6323e;
  filter: saturate(0.7);
  transition: transform 0.5s linear, filter 0.5s;
}
[type=range]::-ms-thumb {
  margin-top: 0;
  border: none;
  width: 2.5em;
  height: 2.5em;
  border-radius: 50%;
  transform: scale(0.7);
  background: #e6323e;
  filter: saturate(0.7);
  transition: transform 0.5s linear, filter 0.5s;
}
[type=range]::-ms-tooltip {
  display: none;
}
[type=range] + output {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(#3d3d4a 39%, transparent 39.5%), conic-gradient(#e64c65 calc(var(--val)*1%), #41a8ab 0%);
}
[type=range] + output:after {
  content: "%";
}
[type=range]:focus {
  outline: none;
}
[type=range]:focus::-webkit-slider-thumb {
  transform: none;
  filter: none;
}
[type=range]:focus::-moz-range-thumb {
  transform: none;
  filter: none;
}
[type=range]:focus::-ms-thumb {
  transform: none;
  filter: none;
}
.wrap:not(.full) [type=range]:focus + output, .wrap.full [type=range]:focus + output:before {
  opacity: 1;
}
</style>
<div class='wrap'>
	<input id='r' type='range'/>
</div>
<script>
	const _R = document.getElementById('r'),
_W = _R.parentNode,
_O = document.createElement('output');

let val = null,conic = false;

function update() {
  let newval = +_R.value;

  if (val !== newval) {
    _W.style.setProperty('--val', _O.value = val = newval);
    if (conic) _O.setAttribute('aria-label', `${val}%`);
  }
};

update();

_O.setAttribute('for', _R.id);
_W.appendChild(_O);

if (getComputedStyle(_O).backgroundImage !== 'none') {
  conic = true;
  _W.classList.add('full');
  _O.setAttribute('role', 'img');
  _O.setAttribute('aria-label', `${val}%`);
}

addEventListener('input', update, false);
addEventListener('change', update, false);
</script>

Error: No site found with the domain 'test.basti1012.bplaced.net' (Learn more)
vConsole
18:59:46
Uncaught TypeError: Cannot read properties of null (reading 'style')
/my_codepen/index.php?name=Border_um_kreiss_mit_prozent.php&ordner=my_codepen:2751:53
18:59:47
500
18:59:46
WeChatLib: 0 (xxxx.xx.xx)
18:59:47
System: Unknown
18:59:47
Protocol: HTTPS
18:59:47
UA: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
18:59:47
navigationStart: 1743965985553
18:59:47
navigation: 3ms
18:59:47
dns: 123ms
18:59:47
tcp (ssl): 224ms (115ms)
18:59:47
request: 217ms
18:59:47
response: 55ms
18:59:47
domComplete (domLoaded): 1555ms (1440ms)
18:59:47
loadEvent: 13ms
18:59:47
total (DOM): 2138ms (2125ms)