📄 metasyntactic.html
字号:
<html>
<head>
<title>metasyntactic variable</title>
<script language="javascript">
/* This is the generative array script. It displays x amount of gifs to
fill the width of the screen, and most of the height. It then goes about
changing the image array and adding different gifs from the same object set
and playing the associated sound that goes along with it. After a set
amount of time (or user imput) the object set "bleeds" into a different set
which then progresses for a set amount of time. */
//Here is where we declare all of our varibles and arrays.
var basedir = "stuff/";
var imagedir = "gifs/";
var sounddir = "sound/";
var cellNum = null;
var wait = 10;
var imagesize = 16;
var firstobj = null;
var stuff = null;
var loadObject = null;
var morestuff = null;
objects = new Array("binary", "blocks", "dots", "letters", "motion");
binary = new Array("off", "on", "blank");
blocks = new Array("all", "botleft", "botright", "down-t", "horizontal", "left-t", "right-t", "topleft", "topright", "up-t", "vertical", "blank");
dots = new Array("blue", "green", "orange", "purple", "red", "yellow", "blank");
letters = new Array("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", "blank");
motion = new Array("down", "left", "right", "up", "blank");
working = new Array();
working = blocks;
var screenCols = 28;
var screenRows = 9;
// The procedular portion of the script.
// This waits for everything to load up before starting it all
function Start() {
loaded = 1;
keepGoing();
// for (b=0; b < voices; b++) {
// keepSoundGoing(b);
// }
}
// This is the function that will determine What the first set will be.
function first() {
firstobj = Math.round(Math.random() * objects.length);
if (firstobj > objects.length - 1) {
firstobj = 0
}
currentSet = objects[firstobj] + "/";
if (currentSet == null) {
currentSet = blocks;
}
working = eval(objects[firstobj]);
if (working == null) {
working = blocks;
}
}
// this figures out how many images there are on the page
function ImageCount(numOimages) {
cellNum = numOimages - 1;
}
// This is called to draw out the page.
function screenDraw() {
this.document.open();
this.document.writeln('<div align="center"><nobr>');
first();
for (x=0; x < screenRows; x++) {
for (y=0; y < screenCols; y++) {
newImage = Math.round(Math.random() * (working.length - 1));
document.writeln('<img src="' + basedir + currentSet + imagedir + working[newImage] + '" width="16" height="16" border="0">');
}
document.writeln('<br>');
}
document.writeln('</div></nobr>');
//soundDraw();
//userControls();
this.document.close();
ImageCount(document.images.length);
//EmbedCount(document.embeds.length);
}
// Now that we are done with all the conditionals, let's get to the fun part.
// This function is the meat of it. It randomly changes the image array
// and calls the other functions (sound) that are associated with it.
function imageMagic() {
changeCell = Math.round(Math.random() * cellNum);
newImage = Math.round(Math.random() * (working.length - 1));
if (working[newImage] == null) {
document.images[changeCell].src = basedir + "blank.gif";
} else {
document.images[changeCell].src = basedir + currentSet + imagedir + working[newImage] + ".gif";
// soundMagick(currentSet, working[newImage]);
}
}
// This is the function that draws out the user controls
function userControls() {
// for (uc=0; uc < objects.length; uc++) {
//document.write('<a href="javascript:void(0);" onMouseOver="setChange('' + objects[uc] + '')"> ' + objects[uc] + ' </a>');
//}
}
// This is the function that "bleeds" one array into the other. It takes the
// current array and the next array that was chosen and randomly ads and takes
// away array elements until the array only contains one set of objects.
function setChange(newSet) {
currentSet = newSet + '/';
working = eval(newSet);
}
// this function shuffles the array. I don't want things to always bleed,
// the same way.
// this function loops the image sections.
function keepGoing() {
for (z=0; z < screenRows; z++) {
imageMagic();
}
timeoutID=setTimeout("keepGoing()", 10);
}
</script>
</head>
<body bgcolor="#000000" text="#ffffff" link="#ffffff" alink="#ffffff" vlink="#ffffff"
onLoad="Start();">
<script>
screenDraw();
</script>
<p align="center"> <a href="javascript:void(0);"
onMouseOver="setChange('binary')"><img src="on.gif" border="0" width="16" height="16"></a>
<a href="javascript:void(0);" onMouseOver="setChange('blocks')"><img src="all.gif"
border="0" width="16" height="16"></a> <a href="javascript:void(0);"
onMouseOver="setChange('dots')"><img src="red.gif" border="0" width="16" height="16"></a>
<a href="javascript:void(0);" onMouseOver="setChange('letters')"><img src="a.gif"
border="0" width="16" height="16"></a> <a href="javascript:void(0);"
onMouseOver="setChange('motion')"><img src="right.gif" border="0" width="16" height="16"></a>
</p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -