This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-04-28 09:51:09

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Share your raw HTML recipies [code] here

Here, you can post HTML snippets, and etc.

For me, it's

Code:

<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
body
{
background-color:#000000;
}
h1
{
color:white;
text-align:center;
}
p
{
font-family:"System";
font-size:10px;
}
</style>
<script type="text/javascript">
function displayDate()
{
document.getElementById("demo").innerHTML=Date();
}
</script>
<script type="text/javascript">
function displayVer()
{
document.getElementById("demo").innerHTML=("Hypertext DOS version 1.0 BETA made by Macrosoft HTML");
}
</script>
</head>
<body style="color: rgb(0, 0, 0); background-color: rgb(0, 0, 0);"
alink="#ee0000" link="#0000ee" vlink="#551a8b">
<style type="text/css">
body
{
background-color:#FF22FF;
}
h1
{
color:white;
text-align:center;
}
p
{
font-family:"System";
font-size:10px;
}
</style>
<p
style="font-family: Fixedsys; color: rgb(255, 255, 255); background-color: rgb(0, 0, 0);"
id="demo"><big>Welcome to Hypertext DOS. Your requests finished are
displayed here.</big></p>
<button type="button" onclick="displayVer()">About</button>
<button type="button" onclick="displayDate()">Date?</button>
</body>
</html>

---------------------
Hypertext DOS
It's DOS in a web-browser. Made in pure HTML Tryit Editor and a tiny bit of SeaMonkey Composer fiddling. Takes advantage of document editing with scripts, paragraphs, CSS fonts, and Javascript.

Post yours too!

Offline

 

#2 2011-04-28 10:52:13

thecrazyguy
Scratcher
Registered: 2010-07-22
Posts: 100+

Re: Share your raw HTML recipies [code] here

Ok, but it needs a little work.


I like pie.

Offline

 

#3 2011-04-28 11:04:27

blazerv82
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Share your raw HTML recipies [code] here

Very interesting. Trying out JS, or do you know some of it already?


Pretty Hate Machine, Broken, Closer To God, The Downward Spiral, Further Down The Spiral, The Perfect Drug, The Fragile, And All That Could Have Been, With Teeth, Year Zero, Y34RZ3R0R3M1X3D, Ghosts I-IV, The Slip, Pretty Hate Machine 2010

Offline

 

#4 2011-04-28 11:49:26

adriangl
Scratcher
Registered: 2007-07-02
Posts: 1000+

Re: Share your raw HTML recipies [code] here

To keep organized, you should always put your CSS in a different document and link it to this one. It really keeps everything clean  smile


Scratchin' since 2007

Offline

 

#5 2011-04-28 17:18:17

thecrazyguy
Scratcher
Registered: 2010-07-22
Posts: 100+

Re: Share your raw HTML recipies [code] here

Code:

<html>
<body>
<p>
Bump.
</p>
</body>
</html>

I like pie.

Offline

 

#6 2011-04-28 18:13:26

brettman98
Scratcher
Registered: 2010-10-17
Posts: 1000+

Re: Share your raw HTML recipies [code] here

Code:

<html>

<a href="http://scratch.mit.edu/users/brettman98">Check out this awesome stuff!</a>

<html>

http://i40.tinypic.com/n1wbr7.jpg

Offline

 

#7 2011-04-29 01:57:44

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: Share your raw HTML recipies [code] here

Ah heres mine for a 3d rotating square (u can manipulate it for whatever u want  wink 

Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <title>Untitled Document</title>
    <script language="JavaScript">
        var ctx;
        var FocalLength = 300;
        function init()
        {
            ctx = document.getElementById("canvas").getContext('2d');
            ctx.clearRect(0,0,800,600);
        }
        function dubplet(x,y)
        {
            
        }
        function triplet(x,y,z)
        {
            this.X = x;
            this.Y = y;
            this.Z = z;
            
        }
            var Rotation = new triplet(0,0,0);
        var Origin = new triplet(0,0,-30);
        
        function vertex(x,y,z)
        {
            this.x = x;
            this.y = y;
            this.z = z;
            this.rotate = function (){
                //Rotation On Y Axis
                sin = Math.sin(Rotation.Y);
                cos = Math.cos(Rotation.Y);
                Ax = this.x*cos + this.z*sin;
                Ay = this.y;
                Az = this.z*cos -this.x*sin;
                //Rotation On X Axis
                sin = Math.sin(Rotation.X);
                cos = Math.cos(Rotation.X);

                Bx = Ax;
                By = Ay*cos + Az*sin;
                Bz = Az*cos - Ay*sin;
                  
                // Rotation on Z axis
                sin = Math.sin(Rotation.Z);
                cos = Math.cos(Rotation.Z);
                Sx = Bx*cos + By*sin;
                Sy = By*cos -Bx*sin;
                Sz = Bz;
                
                var Rp = new triplet(Sx,Sy,Sz);
                return Rp;
            }
        }
        
        a = new vertex(50,50,0);
        b = new vertex(-50,50,0);
        d = new vertex(50,-50,0);
        c = new vertex(-50,-50,0);
    
        
        function Face(a,b,c,d)
        {
            this.A = a;
            this.B = b;
            this.C = c;
            this.D = d;
            
            this.Render= function()
                {
                
                    ctx.beginPath();    
                    var verts =  [];
                     verts[0]=  this.A.rotate();
                    verts[1] = this.B.rotate();
                    verts[2] = this.C.rotate();
                    verts[3] = this.D.rotate();
                    sfr = FocalLength / (FocalLength + verts[0].Z);
                    x= verts[0].X*sfr;
                    y= verts[0].Y*sfr;
                    ctx.moveTo(x+400,300-y);
                    
                    for (var i = 1; i <4; i++) 
                    {
                        sfr = FocalLength / (FocalLength + verts[i].Z);
                        x= verts[i].X*sfr;
                        y= verts[i].Y*sfr;
                        ctx.lineTo(x+400,300-y);
                    
                    
                    }
                    
                    ctx.closePath();
                    ctx.fill();
                }
            
        }
        
var NewFace =new Face(a,b,c,d);
function Cycle()
        {    ctx.clearRect(0,0,800,600);
            Rotation.X += 0.12;
            Rotation.Y += 0.12;
            Rotation.Z += 0.12;    
            NewFace.Render();
            
            setTimeout(Cycle,10);
        }
    </script>
    </head>
    <body onload="init();Cycle();">
        <canvas id = "canvas" height="600" width="800">
            Oink
        </canvas>
    </body>
</html>

http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#8 2011-04-29 02:25:10

urhungry
Scratcher
Registered: 2009-07-03
Posts: 1000+

Re: Share your raw HTML recipies [code] here

While I kind of know HTML, I haven't done anything in it, so I have nothing to post.

Offline

 

#9 2011-04-29 05:49:14

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Re: Share your raw HTML recipies [code] here

blazerv82 wrote:

Very interesting. Trying out JS, or do you know some of it already?

I learned it from W3schools and made it in Tryit Editor with a tiny bit of SeaMonkey editing.

I also did another one before this one, this time made with pure SeaMonkey Composer:

<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title>Dimensions</title>
</head>
<body>
<span style="font-family: Calibri;"></span>
<h1 style="font-family: Calibri;"><span
style="text-decoration: underline;"><span style="font-weight: bold;"><span
style="text-decoration: underline;"><span
style="text-decoration: underline;"><span style="font-weight: bold;">Dimensions</span></span></span></span></span></h1>
<span style="font-style: italic; font-family: Calibri;">Indroduction<br>
A dimension is one of the cooridnate values needed for the object to
specify a location in n-dimensional space. An object e.g. square needs
cooridnates to carry over to the n-dimensional space.<br>
<br>
</span><span style="font-family: Calibri;">1. The 1st and 0th
dimensional space</span><br style="font-family: Calibri;">
<span style="font-family: Calibri;">These dimensional spaces are rarely
known by kids. You probably all know about 2d and 3d, etc. but
1-dimensional spaces exist. A 1-dimensional space needs only 1
cooridnate value to specify a location of an object. That is, X
position. However if any cooridnate isn't known, it specifys a location
in 0-dimensional space.</span><br>
<span style="font-family: Calibri;">2. Oh, the 4th dimensional space
exists?</span><br style="font-family: Calibri;">
<span style="font-family: Calibri;">A 4-dimensional cube is a
tesseract. A tesseract, to explain needs sprites. So pretend we have
sprites...</span><br style="font-family: Calibri;">
<table
style="text-align: left; width: 160px; height: 88px; font-family: Calibri;"
border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="vertical-align: top;"><span style="font-weight: bold;">Name</span><br>
</td>
<td style="vertical-align: top;"><span style="font-weight: bold;">What
is
it</span><br>
</td>
</tr>
<tr>
<td style="vertical-align: top;">Cube1<br>
</td>
<td style="vertical-align: top;">Small cube<br>
</td>
</tr>
<tr>
<td style="vertical-align: top;">Cube2<br>
</td>
<td style="vertical-align: top;">Big cube<br>
</td>
</tr>
</tbody>
</table>
<span style="font-family: Calibri;">Now, Cube1 becomes the big cube, as
Cube2 becomes the small cube, when it is rotated in any-W rotation.</span><br
style="font-family: Calibri;">
<span style="font-family: Calibri;">To a 4d person, in the big cube,
any of the cubes as long as they are the big ones, is more closer in
the Upsilon direction to the 4d person than the small one.</span><br
style="font-family: Calibri;">
<br style="font-family: Calibri;">
<span style="font-family: Calibri;">3. What'd happen with a 4d kid
rotating in the Ana / Kata / Zant / Wint / other 4d directions feel
like for the 4d kid?</span><br style="font-family: Calibri;">
<span style="font-family: Calibri;">I think the kid's shape would
appear disorted. Like a baby being held by a mother, expect the baby is
the same size as the "mother". Then, the baby "infects" the mother and
becomes the "mother", and the proccess repeats for as long as the
rotation keeps going.</span><br style="font-family: Calibri;">
<br style="font-family: Calibri;">
<span style="font-family: Calibri;">4. More dimensional spaces.</span><br
style="font-family: Calibri;">
<span style="font-family: Calibri;">All I can say, a 5d cube is a
tesseract in a tesseract, corners connected like the tesseract case
with a cube-cube corners-connected. More direction rotations are made
for the new cubes.<br>
Here is a table on the hypercubes names in dimensions:<br>
</span>
<table
style="text-align: left; width: 109px; height: 136px; font-family: Calibri;"
border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="vertical-align: top; font-weight: bold;">#<br>
</td>
<td style="vertical-align: top; font-weight: bold;">Object<br>
</td>
</tr>
<tr>
<td style="vertical-align: top;">1<br>
</td>
<td style="vertical-align: top;">Line<br>
</td>
</tr>
<tr>
<td style="vertical-align: top;">2<br>
</td>
<td style="vertical-align: top;">Square<br>
</td>
</tr>
<tr>
<td style="vertical-align: top;">3<br>
</td>
<td style="vertical-align: top;">Cube<br>
</td>
</tr>
<tr>
<td style="vertical-align: top;">4<br>
</td>
<td style="vertical-align: top;">Tesseract<br>
</td>
</tr>
</tbody>
</table>
<span style="font-family: Calibri;"><br>
5. More!<br>
5.3. Email me about the image at 5.7<br>
Not implented yet<br>
5.7. Image of dimensions [with ALT text]<br>
<img style="width: 1197px; height: 495px;"
alt="0. &middot; 1. | 2. □ 3. Cube [no image] 4. Tesseract [no image] 2.5. ???? 11. Supergravity [no image]"
title="Image 1" src="file:///C:/Users/Parent/Pictures/Untitledxd.png"
align="right"><br>
5.7.1. All the different cooridnates<br>
----------------<br>
</span>
<div style="text-align: justify;">
<div style="text-align: left;"><span style="font-family: Calibri;">X Y
Z W V U T S R Q P and... O for the&nbsp; gravity!</span><br>
</div>
<span style="font-family: Calibri;"></span></div>
<span style="font-family: Calibri;"></span>
<br>
</body>
</html>

All the divs were rendered automatically for me via SeaMonkey. I don't know what the few spans are tho, SeaMonkey automatically did it for me... I did an alt for the picture incase it doesn't load on web-browsers.

Offline

 

Board footer