meta name =“ theme-color”的动画

问题描述

我想使用由a=[1,2,3] b=[1,3] new_a=list(el for el1 in zip(* [a]*len(b)) for el in el1) new_b=b*len(a) 中的几种颜色组成的动画,例如:#87CEFA,#1E90FF,#4169E1 ...

是否可以在Android上的Chrome中为>>> new_a [1,1,3,3] >>> new_b [1,3] 设置动画?

解决方法

最后,我找到了使用以下JavaScript代码解决此问题的方法。使用此代码,浏览器URL栏上的3种主题颜色会动态更改。

var themeColorTest = new function() {
  function e() {
    "#87CEFA" === $themeColor.content ? $themeColor.content = "#1E90FF" : "#1E90FF" === $themeColor.content ? $themeColor.content = "#4169E1" : $themeColor.content = "#87CEFA",setTimeout(e,500)
  }
  this.init = function() {
    $themeColor = document.querySelector("meta[name='theme-color']"),e()
  }
};
themeColorTest.init();
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <title>Animation of meta name theme-color</title>
  <meta name="theme-color" content="#87CEFA" />
</head>

<body>
  <p>More info on the <code>theme-color</code> meta tag is at this <a href="https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android?hl=en">Google Developers Blog Post</a>.</p>
</body>

</html>