微件:CodeLoadingUI:修订间差异

来自SOKA CAFE
第1行: 第1行:
  <title>CodeLoadingUI</title>
<!-- CSS 样式 -->
  <description>Displays a full-screen digital code loading animation with customizable code.</description>
<style>
  <parameters>
   /* 全屏覆盖层 */
    <parameter name="code" required="true">The code to display in the loading animation.</parameter>
  #loadingOverlay {
    <parameter name="speed" default="1">Animation speed (1 = normal, 2 = fast, 0.5 = slow).</parameter>
    position: fixed;
    <parameter name="color" default="#00ff00">Color of the code text (hex or CSS color).</parameter>
    top: 0;
    <parameter name="background" default="#000000">Background color of the loading screen (hex or CSS color).</parameter>
    left: 0;
   </parameters>
    width: 100%;
  <content>
    height: 100%;
    <![CDATA[
    background: #000;
    <style>
    display: flex;
      /* Full-screen styling */
    justify-content: center;
      .code-loading-ui {
    align-items: center;
        position: fixed;
    flex-direction: column;
        top: 0;
    z-index: 1000;
        left: 0;
    color: #fff;
        width: 100%;
    font-family: monospace;
        height: 100%;
  }
        background-color: {{{background}}};
 
        color: {{{color}}};
  /* 加载动画 */
        font-family: monospace;
  .loader {
        font-size: 24px;
    border: 5px solid #f3f3f3;
        display: flex;
    border-top: 5px solid #3498db;
        align-items: center;
    border-radius: 50%;
        justify-content: center;
    width: 50px;
        overflow: hidden;
    height: 50px;
        z-index: 9999;
    animation: spin 1s linear infinite;
      }
  }
      .code-loading-ui .code {
 
        white-space: pre;
  @keyframes spin {
        animation: code-loading calc(1s / {{{speed}}}) infinite;
    0% { transform: rotate(0deg); }
      }
    100% { transform: rotate(360deg); }
      @keyframes code-loading {
  }
        0% { opacity: 0.5; }
 
        50% { opacity: 1; }
  /* 进度条 */
        100% { opacity: 0.5; }
  #progressBar {
      }
    width: 200px;
    </style>
    height: 10px;
    <div class="code-loading-ui">
    background: #444;
      <div class="code">{{{code}}}</div>
    margin-top: 20px;
    </div>
    border-radius: 5px;
     ]]>
    overflow: hidden;
   </content>
  }
 
  #progressBar div {
    height: 100%;
    width: 0;
    background: #3498db;
    transition: width 0.5s ease;
  }
 
  /* 模拟代码样式 */
  #codeDisplay {
    margin-top: 20px;
    background: #222;
    padding: 10px;
    border-radius: 5px;
    width: 80%;
    max-width: 600px;
    overflow: auto;
    white-space: pre-wrap;
  }
</style>
<!-- JavaScript 逻辑 -->
<script>
  // 模拟加载进度
  var progress = 0;
  var progressBar = document.getElementById('progressBar').querySelector('div');
  var interval = setInterval(function () {
    progress += 10;
    progressBar.style.width = progress + '%';
    if (progress >= 100) {
      clearInterval(interval);
      document.getElementById('loadingOverlay').style.display = 'none'; // 隐藏加载界面
     }
   }, 300);
</script>

2025年3月2日 (日) 09:17的版本

<style>

 /* 全屏覆盖层 */
 #loadingOverlay {
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background: #000;
   display: flex;
   justify-content: center;
   align-items: center;
   flex-direction: column;
   z-index: 1000;
   color: #fff;
   font-family: monospace;
 }
 /* 加载动画 */
 .loader {
   border: 5px solid #f3f3f3;
   border-top: 5px solid #3498db;
   border-radius: 50%;
   width: 50px;
   height: 50px;
   animation: spin 1s linear infinite;
 }
 @keyframes spin {
   0% { transform: rotate(0deg); }
   100% { transform: rotate(360deg); }
 }
 /* 进度条 */
 #progressBar {
   width: 200px;
   height: 10px;
   background: #444;
   margin-top: 20px;
   border-radius: 5px;
   overflow: hidden;
 }
 #progressBar div {
   height: 100%;
   width: 0;
   background: #3498db;
   transition: width 0.5s ease;
 }
 /* 模拟代码样式 */
 #codeDisplay {
   margin-top: 20px;
   background: #222;
   padding: 10px;
   border-radius: 5px;
   width: 80%;
   max-width: 600px;
   overflow: auto;
   white-space: pre-wrap;
 }

</style> <script>

 // 模拟加载进度
 var progress = 0;
 var progressBar = document.getElementById('progressBar').querySelector('div');
 var interval = setInterval(function () {
   progress += 10;
   progressBar.style.width = progress + '%';
   if (progress >= 100) {
     clearInterval(interval);
     document.getElementById('loadingOverlay').style.display = 'none'; // 隐藏加载界面
   }
 }, 300);

</script>