Html & CSS & Copilot AI

图片等

  大童  |   on Friday, March 15, 2024  |  1374   |  3 minutes

图片九宫格

HTML文字环绕图片布局HTML文字环绕图片布局HTML文字环绕图片布局HTML文字环绕图片布局HTML文字环绕图片布局HTML文字环绕图片布局HTML文字环绕图片布局HTML文字环绕图片布局HTML文字环绕图片布局HTML文字环绕图片布局HTML文字环绕图片布局HTML文字环绕图片布局HTML文字环绕图片布局HTML文字环绕图片布局HTML文字环绕图片布局 HTML文字环绕图片布局HTML文字环绕图片布局HTML文字环绕图片布局HTML文字环绕图片布局HTML文字环绕图

HTML文字环绕图片布局HTML文字环绕图片布局HTML文字


图像标题

HTML文字环绕图片布局HTML文字环绕图片布局HTML文字环绕图片布局

第二段HTML文字环绕图片布局第二段HTML文字环绕图片布局第二段HTML文字环绕图片布局第二段HTML文字环绕图片布局第二段HTML文字环绕图片布局第二段HTML文字环绕图片布局第二段HTML文字环绕图片布局第二段HTML文字环绕图片布局第二段HTML文字环绕图片布局第二段HTML文字环绕图片布局第二段HTML文字环绕图片布局第二段HTML文字环绕图片布局第二段HTML文字环绕图片布局

"We had agreed, my companion and I, that I should call for him at his house, after dinner, not later than eleven o’clock. This athletic young Frenchman belongs to a small set of Parisian sportsmen, who have taken up “ballooning” as a pastime. After having exhausted all the sensations that are to be found in ordinary sports, even those of “automobiling” at a breakneck speed, the members of the “Aéro Club” now seek in the air, where they indulge in all kinds of daring feats, the nerve-racking excitement that they have ceased to find on earth."


思维导图&泳道图

  • Root
    • Level 1
      • Level 2
      • Level 2
        • Level 3
        • Level 3
          • Level 4
            • Level 5
              • Level 6

@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request
Alice <-- Bob: Another authentication Response
@enduml

依据底色测试文字

Copilot自动生成

背景测试背景测试背景测背景测背景测背景测背景测背景测试试试试试试

背景测试背景测试背景测背景测背景测背景测背景测背景测试试试试试试

要实现自动判断背景颜色并相应改变文字颜色的功能,您可以使用JavaScript来检测背景颜色的亮度,并根据结果设置文字颜色。以下是一个HTML和JavaScript的示例代码:

<!DOCTYPE html>
<html>
<head>
<style>
  .auto-color {
    padding: 10px;
    margin: 10px 0;
    transition: background-color 0.5s, color 0.5s; /* 平滑过渡效果 */
  }
</style>
<script>
  function updateTextColor(element) {
    // 获取元素的背景颜色
    var bgColor = window.getComputedStyle(element, null).getPropertyValue('background-color');
    // 将RGB颜色值转换为亮度
    var brightness = getBrightness(bgColor);
    // 根据亮度决定文字颜色
    element.style.color = brightness < 128 ? 'white' : 'black';
  }

  function getBrightness(color) {
    var colorParts = color.match(/\d+/g); // 提取RGB值
    // 计算亮度
    return (parseInt(colorParts[0]) * 299 + parseInt(colorParts[1]) * 587 + parseInt(colorParts[2]) * 114) / 1000;
  }

  // 页面加载后,更新所有.auto-color类的文本颜色
  window.onload = function() {
    var elements = document.querySelectorAll('.auto-color');
    for (var i = 0; i < elements.length; i++) {
      updateTextColor(elements[i]);
    }
  };
</script>
</head>
<body>

<div class="auto-color" style="background-color: #f0f0f0;">
  <p>这是一个浅色背景。</p>
</div>

<div class="auto-color" style="background-color: #333333;">
  <p>这是一个深色背景。</p>
</div>

</body>
</html>

在这个示例中,.auto-color 类的元素在页面加载时会自动调用 updateTextColor 函数来设置合适的文字颜色。函数 getBrightness 用于计算背景颜色的亮度,如果亮度低于128(中等亮度),文字颜色将设置为白色,否则为黑色。您可以根据需要调整亮度阈值和颜色。🌈

shell脚本

copilot自动生成,提示语:

先用“grep -iR ‘- 历史’ *”查找内容,输出用awk解析文本,分隔符是:,取第一列,输出结果用xargs调用vi执行

grep -iR '\- 历史' * | awk -F':' '{print $1}' | xargs vi {}

自定义markdown渲染

自动给图片加水印