html水波纹样式,源码直接下载,代码有注释教程,小白可以看懂。

动画啥的都做好了,效果我觉得还不错

网上文章看到xbox 工程师使用隐写术,在界面的右下角放上了含有用户激活码的水波纹样式,一般人还真看不出来。

于是仿制了一个

先把莫尔兹转码部分放上来吧,莫尔兹转换部分是网上某位大佬写的,照抄。

完整代码下载在最后边

var utils = utils || {};

utils.isArray = function(value) {
return Object.prototype.toString.apply(value) === '[object Array]';
} utils.trim = function(value) {
return value.trim ? value.trim() : value.replace(/^\s+|\s+$|/g,'');
} // 解决IE不兼容console问题
var console = console || {};
console.log = console.log || function(){};
console.error = console.error || function(){}; // 使用字典存储摩斯码对照关系
function Dictionary() {
this.datasource = {};
this.rdatasource = {};
} Dictionary.prototype.add = function(keys, values) {
if(typeof keys === 'undefined' || typeof values === 'undefined') {
console.error('Illegal arguments');
return ;
}
if(utils.isArray(keys) && utils.isArray(values)) {
if(keys.length != values.length) {
console.error('keys length not equals values length');
return ;
}
for(var i = 0; i < keys.length; i++) {
this.datasource[keys[i]] = values[i];
}
return ;
}
this.datasource[keys] = values;
} Dictionary.prototype.reversal = function(){
var tempData = this.datasource;
for(var i in tempData) {
if(tempData.hasOwnProperty(i)) {
this.rdatasource[tempData[i]] = i;
}
}
} Dictionary.prototype.showAll = function(values) {
var count = 0;
console.log('-----------morse code mapping-----------');
for(var i in values) {
if(values.hasOwnProperty(i)) {
count++;
console.log(i + '\t > ' + values[i]);
}
}
console.log('total count: ' + count);
} // morse code library
var morse = (function(global){
var mcode = {},
r_special = /\<\w+\>/g,
r_find = /^\<(\w+)\>$/; // store datas mapping
mcode.mdatas = (function(){
var dictionaryDS = new Dictionary();
// initial mappping
dictionaryDS.add(
[
'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
'1','2','3','4','5','6','7','8','9','0',
'AA','AR','AS','BK','BT','CT','SK','SOS',
'.',':',',',';','?','=',"'",'/','!','-','_','"','(',')','$','&','@','+'
],
[
// letter
'.-','-...','-.-.','-..','.','..-.','--.','....','..','.---','-.-','.-..','--','-.','---','.--.','--.-','.-.','...','-','..-','...-','.--','-..-','-.--','--..',
// number
'.----','..---','...--','....-','.....','-....','--...','---..','----.','-----',
// special charactor
'.-.-','.-.-.','.-...','-...-.-','-...-','-.-.-','...-.-','...---...',
// punctuation
'.-.-.-','---...','--..--','-.-.-.','..--..','-...-','.----.','-..-.','-.-.--','-....-','..--.-','.-..-.','-.--.','-.--.-','...-..-','.-...','.--.-.','.-.-.'
]
);
return dictionaryDS;
}()); // error flag
mcode.error_flag = false; // 将字符串转换为摩斯码
mcode.parse = function(values) {
// console.log('input: ' + values);
this.error_flag = false; var _datasource = this.mdatas.datasource,
item = '',
a_special = [],
a_temp = [],
a_value = [],
count = 0,
result = '';
values = values.toUpperCase();
a_special = values.match(r_special);
a_temp = values.split(r_special); // 将用户输入的字符串转换成数组
for(var i=0; i<a_temp.length; i++) {
item = a_temp[i];
if(item !== '') {
// IE无法通过下标来索引字符串
if(!item[0]){
item = item.split('');
}
for(var j=0; j<item.length; j++) {
a_value[count++] = item[j];
}
} // 当前字符串为<AS>形式,提取AS字符
if(i !== a_temp.length - 1){
a_value[count++] = a_special[i].match(r_find)[1];
}
} // 将解析数组形式的用户输入值
for(var i=0; i<a_value.length; i++) {
item = a_value[i]; if(item === ' ') {
result += '/ ';
} else if(typeof _datasource[item] === 'undefined') {
this.error_flag = true;
// console.error('Invalid characters in input.')
result += '? ';
}else {
result += _datasource[item] + ' ';
}
}
return utils.trim(result);
} //将摩斯码转换成字符串
mcode.decode = function(values) {
// console.log('input: ' + values);
this.error_flag = false; this.mdatas.reversal();
var _rdatasource = this.mdatas.rdatasource,
a_input = values.split(' '),
result = '',
item = '',
c_result = ''; for(var i=0; i<a_input.length; i++) {
item = a_input[i];
if(item === '/') {
result += ' ';
}else {
c_result = _rdatasource[item];
if(typeof c_result === 'undefined') {
this.error_flag = true;
// console.error('Invalid characters in input.')
result += '?';
} else {
if(c_result.length > 1){
result += '<' + c_result + '>';
} else {
result += c_result;
}
}
}
}
return result;
} return mcode;
}(this));

百度云下载

链接:https://pan.baidu.com/s/1za3NLi8a7ebJuEExb10HdA
提取码:hsv5

html隐写术,使用摩尔兹电码/莫尔兹电码存储信息 水波纹样式 Morse code的更多相关文章

  1. 摩尔斯电码(Morse Code)Csharp实现

    摩尔斯电码,在早期的"生产斗争"生活中,扮演了很重要的角色,作为一种信息编码标准,摩尔斯电码拥有其他编码方案无法超越的长久生命.摩尔斯电码在海事通讯中被作为国际标准一直使用到199 ...

  2. Leetcode 804. Unique Morse Code Words 莫尔斯电码重复问题

    参考:https://blog.csdn.net/yuweiming70/article/details/79684433 题目描述: International Morse Code defines ...

  3. [Swift]LeetCode804. 唯一摩尔斯密码词 | Unique Morse Code Words

    International Morse Code defines a standard encoding where each letter is mapped to a series of dots ...

  4. Leetcode804.Unique Morse Code Words唯一摩尔斯密码词

    国际摩尔斯密码定义一种标准编码方式,将每个字母对应于一个由一系列点和短线组成的字符串, 比如: "a" 对应 ".-", "b" 对应 &q ...

  5. LeetCode 804. Unique Morse Code Words (唯一摩尔斯密码词)

    题目标签:String 题目给了我们 对应每一个 字母的 morse 密码,让我们从words 中 找出 有几个不同的 morse code 组合. 然后只要遍历 words,把每一个word 转换成 ...

  6. 牛客练习赛31 D 神器大师泰兹瑞与威穆 STL,模拟 A

    牛客练习赛31 D 神器大师泰兹瑞与威穆 https://ac.nowcoder.com/acm/contest/218/D 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 26214 ...

  7. 乔治·霍兹(George Hotz):特斯拉、谷歌最可怕的对手!

    17岁破解iPhone,21岁攻陷索尼PS3:现在,他是埃隆·马斯克最可怕的对手.   黑客往事   许多年后,当乔治·霍兹(George Hotz)回首往事,一定会把2007年作为自己传奇人生的起点 ...

  8. 算法习题---4-6莫尔斯电码(UVa508)

    一:题目 A-Z0-9分别对应一些莫尔斯电码字符串 A .- B -... C -.-. D -.. E . F ..-. G --. H .... I .. J .--- K -.- L .-.. ...

  9. [CTF]摩斯电码

    摩尔斯电码 -----------转载 https://morse.supfree.net/ 摩尔斯电码定义了包括:英文字母A-Z(无大小写区分)十进制数字0-9,以及"?"&qu ...

随机推荐

  1. Fire Balls 10——UI界面的制作

    版权申明: 本文原创首发于以下网站: 博客园『优梦创客』的空间:https://www.cnblogs.com/raymondking123 优梦创客的官方博客:https://91make.top ...

  2. this指哪儿

    this的指向问题 一.this初识 this是javascript中最复杂的机制之一.它尤为特殊,被自动定义在所有函数的作用域中.这篇文章将浅析this与函数的关系. 二.了解this 学习this ...

  3. 使用Quarkus在Openshift上构建微服务的快速指南

    在我的博客上,您有机会阅读了许多关于使用Spring Boot或Micronaut之类框架构建微服务的文章.这里将介绍另一个非常有趣的框架专门用于微服务体系结构,它越来越受到大家的关注– Quarku ...

  4. ASP.NET Core 2.2 : 二十二. 多样性的配置方式

    大多数应用都离不开配置,本章将介绍ASP.NET Core中常见的几种配置方式及系统内部实现的机制. 说到配置,第一印象可能就是“.config”类型的xml文件或者“.ini”类型的ini文件,在A ...

  5. 右键没有新建word选项

    两类解决办法 一. 1. 新建一个txt文本,并插入如下内容: Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\.doc] @=&quo ...

  6. 高性能最终一致性框架Ray之基本概念原理

    一.Actor介绍 Actor是一种并发模型,是共享内存并发模型的替代方案. 共享内存模型的缺点: 共享内存模型使用各种各样的锁来解决状态竞争问题,性能低下且让编码变得复杂和容易出错. 共享内存受限于 ...

  7. 初入计算机专业,学习c语言的第一周作业问答

    2019年9月17日下午3点30,我来到了1117教室准备上我进入大学的第一堂计算机专业课,并需要完成以下作业. 2.1 你对软件工程专业或者计算机科学与技术专业了解是怎样? 我所了解的计算机就是一台 ...

  8. [Leetcode] 第289题 生命游戏

    一.题目描述 根据百度百科,生命游戏,简称为生命,是英国数学家约翰·何顿·康威在1970年发明的细胞自动机. 给定一个包含 m × n 个格子的面板,每一个格子都可以看成是一个细胞.每个细胞具有一个初 ...

  9. mybatis中Insert后主键返回

    1.Mapper的写法,返回的这个int是受影响的行号 int insertNewUser(User newUser); 2.xml的写法 <!--返回主键 形式1 --> <ins ...

  10. 用 CocosCreator 快速开发推箱子游戏

    游戏总共分为4个功能模块: - 开始游戏(menuLayer) - 关卡选择(levelLayer) - 游戏(gameLayer) - 游戏结算(gameOverLayer) Creator内组件效 ...