跳转到内容

模板:示例模板A:修订间差异

来自osm&bio
Magezeya留言 | 贡献
无编辑摘要
Magezeya留言 | 贡献
无编辑摘要
 
(未显示同一用户的4个中间版本)
第6行: 第6行:
<div style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 30px; border-radius: 15px 15px 0 0; text-align: center; box-shadow: 0 5px 20px rgba(0,0,0,0.15);">
<div style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 30px; border-radius: 15px 15px 0 0; text-align: center; box-shadow: 0 5px 20px rgba(0,0,0,0.15);">
   <h1 style="margin: 0; font-size: 2.5em; text-shadow: 2px 2px 4px rgba(0,0,0,0.3);">示例模板A</h1>
   <h1 style="margin: 0; font-size: 2.5em; text-shadow: 2px 2px 4px rgba(0,0,0,0.3);">示例模板A</h1>
   <p style="font-size: 1.2em; opacity: 0.9;">探索 Wikitext、HTML、CSS 和解析器函数的无限可能</p>
   <p style="font-size: 1.2em; opacity: 0.9;">支持Wikitext、HTML、CSS</p>
   <div style="margin-top: 15px;">
   <div style="margin-top: 15px;">
     <span style="background: rgba(255,255,255,0.2); padding: 5px 15px; border-radius: 20px; margin: 0 5px;">{{CURRENTYEAR}}年{{CURRENTMONTH}}月{{CURRENTDAY}}日</span>
     <span style="background: rgba(255,255,255,0.2); padding: 5px 15px; border-radius: 20px; margin: 0 5px;">{{CURRENTYEAR}}年{{CURRENTMONTH}}月{{CURRENTDAY}}日</span>
第17行: 第17行:
<div style="display: flex; flex-wrap: wrap; margin: 0 -10px;">
<div style="display: flex; flex-wrap: wrap; margin: 0 -10px;">


   <!-- 左侧:Wikitext 展示 -->
   <!-- 左侧:Wikitext -->
   <div class="tech-section" style="flex: 1; min-width: 300px; padding: 20px; margin: 10px; background: #f8f9fa; border-radius: 10px; box-shadow: 0 3px 10px rgba(0,0,0,0.08);">
   <div class="tech-section" style="flex: 1; min-width: 300px; padding: 20px; margin: 10px; background: #f8f9fa; border-radius: 10px; box-shadow: 0 3px 10px rgba(0,0,0,0.08);">
     <h2 style="color: #28a745; border-bottom: 2px solid #28a745; padding-bottom: 10px;">Wikitext 技术展示</h2>
     <h2 style="color: #28a745; border-bottom: 2px solid #28a745; padding-bottom: 10px;">Wikitext </h2>
      
      
     <div style="background: white; padding: 15px; border-radius: 8px; margin: 15px 0;">
     <div style="background: white; padding: 15px; border-radius: 8px; margin: 15px 0;">
第35行: 第35行:
       <p>[https://www.example.com 外部链接] → [https://www.example.com 外部链接]</p>
       <p>[https://www.example.com 外部链接] → [https://www.example.com 外部链接]</p>
       <p>[[Special:RecentChanges]] → [[Special:RecentChanges]]</p>
       <p>[[Special:RecentChanges]] → [[Special:RecentChanges]]</p>
    </div>
   
    <div style="background: white; padding: 15px; border-radius: 8px; margin: 15px 0;">
      <h3>列表与结构</h3>
      <div style="display: flex;">
        <div style="flex: 1;">
          <p>无序列表:</p>
          <ul>
            <li>第一项</li>
            <li>第二项</li>
            <li>第三项</li>
          </ul>
        </div>
        <div style="flex: 1;">
          <p>有序列表:</p>
          <ol>
            <li>第一项</li>
            <li>第二项</li>
            <li>第三项</li>
          </ol>
        </div>
      </div>
      <p>== 二级标题 ==</p>
      <p>=== 三级标题 ===</p>
     </div>
     </div>
   </div>
   </div>


   <!-- 中间:HTML/CSS 展示 -->
   <!-- 中间:HTML/CSS -->
   <div class="tech-section" style="flex: 1; min-width: 300px; padding: 20px; margin: 10px; background: #f8f9fa; border-radius: 10px; box-shadow: 0 3px 10px rgba(0,0,0,0.08);">
   <div class="tech-section" style="flex: 1; min-width: 300px; padding: 20px; margin: 10px; background: #f8f9fa; border-radius: 10px; box-shadow: 0 3px 10px rgba(0,0,0,0.08);">
     <h2 style="color: #dc3545; border-bottom: 2px solid #dc3545; padding-bottom: 10px;">HTML & CSS 技术展示</h2>
     <h2 style="color: #dc3545; border-bottom: 2px solid #dc3545; padding-bottom: 10px;">HTML & CSS</h2>
      
      
     <div style="background: white; padding: 15px; border-radius: 8px; margin: 15px 0;">
     <div style="background: white; padding: 15px; border-radius: 8px; margin: 15px 0;">
第70行: 第46行:
       <p style="font-family: 'Georgia', serif; font-size: 1.2em;">这是使用自定义字体的文本</p>
       <p style="font-family: 'Georgia', serif; font-size: 1.2em;">这是使用自定义字体的文本</p>
       <p style="text-shadow: 2px 2px 4px rgba(0,0,0,0.3); color: #6f42c1; font-weight: bold;">带有阴影的文本效果</p>
       <p style="text-shadow: 2px 2px 4px rgba(0,0,0,0.3); color: #6f42c1; font-weight: bold;">带有阴影的文本效果</p>
      <p style="background: linear-gradient(90deg, red, orange, yellow, green, blue, indigo, violet); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: bold; font-size: 1.5em;">彩虹渐变文字效果</p>
    </div>
   
    <div style="background: white; padding: 15px; border-radius: 8px; margin: 15px 0;">
      <h3>CSS动画与变换</h3>
      <div style="display: flex; justify-content: space-around; flex-wrap: wrap;">
        <div style="width: 100px; height: 100px; background: #007bff; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; margin: 10px; transition: all 0.3s;" onmouseover="this.style.transform='scale(1.2)'; this.style.background='#0056b3'" onmouseout="this.style.transform='scale(1)'; this.style.background='#007bff'">悬停效果</div>
       
        <div style="width: 100px; height: 100px; background: #6f42c1; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; margin: 10px; animation: pulse 2s infinite;">
          <style>
            @keyframes pulse {
              0% { transform: scale(1); }
              50% { transform: scale(1.1); }
              100% { transform: scale(1); }
            }
          </style>
          脉动动画
        </div>
      </div>
     </div>
     </div>
      
      
第97行: 第54行:
         <div style="flex: 1; min-width: 120px; background: #17a2b8; color: white; padding: 10px; margin: 5px; text-align: center;">Flex项 2</div>
         <div style="flex: 1; min-width: 120px; background: #17a2b8; color: white; padding: 10px; margin: 5px; text-align: center;">Flex项 2</div>
         <div style="flex: 1; min-width: 120px; background: #17a2b8; color: white; padding: 10px; margin: 5px; text-align: center;">Flex项 3</div>
         <div style="flex: 1; min-width: 120px; background: #17a2b8; color: white; padding: 10px; margin: 5px; text-align: center;">Flex项 3</div>
      </div>
    </div>
   
    <div style="background: white; padding: 15px; border-radius: 8px; margin: 15px 0;">
      <h3>高级表单元素</h3>
      <div style="background: #e9ecef; padding: 15px; border-radius: 8px;">
        <label for="demo-range">范围滑块:</label>
        <input type="range" id="demo-range" min="0" max="100" style="width: 100%;">
       
        <label for="demo-color" style="display: block; margin-top: 15px;">颜色选择器:</label>
        <input type="color" id="demo-color" value="#ff0000" style="width: 100%; height: 40px;">
       </div>
       </div>
     </div>
     </div>
第119行: 第65行:
       <h3>条件逻辑</h3>
       <h3>条件逻辑</h3>
       <p>参数1: <b>{{{1|未提供}}}</b></p>
       <p>参数1: <b>{{{1|未提供}}}</b></p>
      <p>参数2: <b>{{{2|未提供}}}</b></p>
        
        
       <div style="background: #f8f9fa; padding: 10px; border-radius: 5px; margin: 10px 0;">
       <div style="background: #f8f9fa; padding: 10px; border-radius: 5px; margin: 10px 0;">
第125行: 第70行:
         | ✅ <span style="color: #28a745;">已提供参数1: "{{{1}}}"</span>
         | ✅ <span style="color: #28a745;">已提供参数1: "{{{1}}}"</span>
         | ❌ <span style="color: #dc3545;">未提供参数1</span>
         | ❌ <span style="color: #dc3545;">未提供参数1</span>
        }}
      </div>
     
      <div style="background: #f8f9fa; padding: 10px; border-radius: 5px; margin: 10px 0;">
        {{#ifeq: {{{1|}}} | {{{2|}}}
        | ✅ <span style="color: #28a745;">参数1和参数2相同</span>
        | ❌ <span style="color: #dc3545;">参数1和参数2不同</span>
         }}
         }}
       </div>
       </div>
第140行: 第78行:
       <p>15 × 3 + 7 = <b>{{#expr: 15*3+7 }}</b></p>
       <p>15 × 3 + 7 = <b>{{#expr: 15*3+7 }}</b></p>
       <p>2<sup>10</sup> = <b>{{#expr: 2^10 }}</b></p>
       <p>2<sup>10</sup> = <b>{{#expr: 2^10 }}</b></p>
      <p>√49 = <b>{{#expr: sqrt(49) }}</b></p>
      <p>sin(π/2) = <b>{{#expr: sin(3.141592653589793/2) round 3 }}</b></p>
     </div>
     </div>
      
      
     <div style="background: white; padding: 15px; border-radius: 8px; margin: 15px 0;">
     <div style="background: white; padding: 15px; border-radius: 8px; margin: 15px 0;">
       <h3>字符串操作</h3>
       <h3>时间函数</h3>
       <p>当前时间: <b>{{#time: Y年m月d日 H:i:s }}</b></p>
       <p>当前时间: <b>{{#time: Y年m月d日 H:i:s }}</b></p>
      <p>字符串长度 "MediaWiki": <b>{{#len: MediaWiki}}</b></p>
      <p>字符串位置 "ia"在"MediaWiki"中: <b>{{#pos: MediaWiki|ia}}</b></p>
    </div>
   
    <div style="background: white; padding: 15px; border-radius: 8px; margin: 15px 0;">
      <h3>Switch语句</h3>
      <p>参数3: <b>{{{3|未提供}}}</b></p>
      <div style="background: #f8f9fa; padding: 10px; border-radius: 5px; margin: 10px 0;">
        {{#switch: {{{3|default}}}
        | red = <span style="color: white; background: #dc3545; padding: 5px 10px; border-radius: 5px;">红色主题</span>
        | blue = <span style="color: white; background: #007bff; padding: 5px 10px; border-radius: 5px;">蓝色主题</span>
        | green = <span style="color: white; background: #28a745; padding: 5px 10px; border-radius: 5px;">绿色主题</span>
        | #default = <span style="background: #6c757d; color: white; padding: 5px 10px; border-radius: 5px;">默认主题</span>
        }}
      </div>
     </div>
     </div>
   </div>
   </div>
</div>
</div>


<!-- 底部信息区 -->
<!-- 底部信息 -->
<div style="background: #343a40; color: white; padding: 20px; border-radius: 0 0 15px 15px; margin-top: 20px; text-align: center;">
<div style="margin-top: 20px; padding: 20px; background: #f8f9fa; border-radius: 0 0 15px 15px; text-align: center;">
  <h3>技术统计</h3>
  <p>本模板展示了MediaWiki平台的核心技术能力</p>
  <div style="display: flex; justify-content: space-around; flex-wrap: wrap;">
    <div style="margin: 10px;">
      <div style="font-size: 2em; font-weight: bold;">{{#len: {{FULLPAGENAME}}}}</div>
      <div>页面名称长度</div>
    </div>
    <div style="margin: 10px;">
      <div style="font-size: 2em; font-weight: bold;">{{#expr: ({{CURRENTHOUR}}*60 + {{CURRENTMINUTE}})/1}}</div>
      <div>今日已过分钟数</div>
    </div>
    <div style="margin: 10px;">
      <div style="font-size: 2em; font-weight: bold;">{{#time: z}}</div>
      <div>年内第几天</div>
    </div>
  </div>
 
  <div style="margin-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px;">
    <p>本模板展示了MediaWiki平台的核心技术能力,包括:</p>
    <div style="display: flex; justify-content: center; flex-wrap: wrap;">
      <span style="background: rgba(255,255,255,0.1); padding: 5px 15px; border-radius: 20px; margin: 5px;">Wikitext</span>
      <span style="background: rgba(255,255,255,0.1); padding: 5px 15px; border-radius: 20px; margin: 5px;">HTML5</span>
      <span style="background: rgba(255,255,255,0.1); padding: 5px 15px; border-radius: 20px; margin: 5px;">CSS3</span>
      <span style="background: rgba(255,255,255,0.1); padding: 5px 15px; border-radius: 20px; margin: 5px;">解析器函数</span>
      <span style="background: rgba(255,255,255,0.1); padding: 5px 15px; border-radius: 20px; margin: 5px;">响应式设计</span>
    </div>
  </div>
</div>
</div>


<!-- 响应式设计媒体查询 -->
<style>
@media (max-width: 768px) {
  .mw-tech-showcase {
    margin: 10px;
  }
  .tech-section {
    min-width: 100% !important;
  }
}
</style>
</div>
</div>
</includeonly>
</includeonly>


<noinclude>
<noinclude>
== 示例模板A ==
== 示例模板A - 技术展示 ==
这是一个展示MediaWiki所有核心技术的综合性演示模板。
这是一个展示MediaWiki核心技术的演示模板。


=== 使用方法 ===
=== 使用方法 ===
<pre>
<pre>
{{示例模板A}}
{{示例模板A}}
{{示例模板A|参数1|参数2|red}}
{{示例模板A|参数1}}
</pre>
</pre>


第223行: 第108行:
; 参数1
; 参数1
: 任意文本 - 用于演示条件判断和参数使用
: 任意文本 - 用于演示条件判断和参数使用
; 参数2
: 任意文本 - 用于演示比较和条件判断
; 参数3
: 可选值: red, blue, green - 用于演示switch函数和主题切换
=== 技术特性 ===
此模板展示了以下MediaWiki技术:
* Wikitext标记语言
* HTML5语义化标签
* CSS3样式和动画
* 解析器函数和逻辑操作
* 响应式网页设计
* 魔术字和变量使用


[[Category:演示模板]]
[[Category:演示模板]]
[[Category:技术模板]]
[[Category:多功能模板]]
</noinclude>
</noinclude>

2025年8月21日 (四) 13:57的最新版本


示例模板A - 技术展示

这是一个展示MediaWiki核心技术的演示模板。

使用方法

{{示例模板A}}
{{示例模板A|参数1}}

参数说明

参数1
任意文本 - 用于演示条件判断和参数使用