torsdag 23 september 2021 kl. 15:53:24 UTC+2 skrev Jonas Thörnvall:That work for javascript, but probably not for CSS?
One can't use javascript variables in CSS, but i read one can reach scale from javascript how would i do that?
<script>
function getResolution() {
dispWidth=screen.width;
dispHeight=screen.height;
}
getResolution();
resizedWidth=screenWidth/1920;
resizedHeight=screenHeight/1080;
</script>
<???style>
html {
transform: scale(resizedWidth,resizedHeight);
}Maybe i should just create strings dynamically and run?
</style>
One can't use javascript variables in CSS, but i read one can reach scale from javascript how would i do that?Maybe i should just create strings dynamically and run?
<script>
function getResolution() {
dispWidth=screen.width;
dispHeight=screen.height;
}
getResolution();
resizedWidth=screenWidth/1920;
resizedHeight=screenHeight/1080;
</script>
<???style>
html {
transform: scale(resizedWidth,resizedHeight);
}
</style>
torsdag 23 september 2021 kl. 16:00:35 UTC+2 skrev Jonas Thörnvall:<script>
torsdag 23 september 2021 kl. 15:53:24 UTC+2 skrev Jonas Thörnvall:
One can't use javascript variables in CSS, but i read one can reach scale from javascript how would i do that?
<script>
function getResolution() {
dispWidth=screen.width;
dispHeight=screen.height;
}
getResolution();
resizedWidth=screenWidth/1920;
resizedHeight=screenHeight/1080;
</script>
<???style>
html {
transform: scale(resizedWidth,resizedHeight);
That work for javascript, but probably not for CSS?}Maybe i should just create strings dynamically and run?
</style>
torsdag 23 september 2021 kl. 16:01:34 UTC+2 skrev Jonas Thörnvall:
torsdag 23 september 2021 kl. 16:00:35 UTC+2 skrev Jonas Thörnvall:
torsdag 23 september 2021 kl. 15:53:24 UTC+2 skrev Jonas Thörnvall:
One can't use javascript variables in CSS, but i read one can reach scale from javascript how would i do that?
<script>
function getResolution() {
dispWidth=screen.width;
dispHeight=screen.height;
}
getResolution();
resizedWidth=screenWidth/1920;
resizedHeight=screenHeight/1080;
</script>
<???style>
html {
transform: scale(resizedWidth,resizedHeight);
<script>That work for javascript, but probably not for CSS?}Maybe i should just create strings dynamically and run?
</style>
//function getResolution() {
// dispWidth=screen.width;
// dispHeight=screen.height;
// }
// getResolution();
// resizedWidth=dispWidth/1920;
// resizedHeight=dispHeight/1080;
var bodyStyles = document.body.style;
bodyStyles.setProperty('--scale', '0.5');
</script>
Is there a way to set scale of body like this?
torsdag 23 september 2021 kl. 16:37:22 UTC+2 skrev Jonas Thörnvall:Or something building on this?
torsdag 23 september 2021 kl. 16:01:34 UTC+2 skrev Jonas Thörnvall:
torsdag 23 september 2021 kl. 16:00:35 UTC+2 skrev Jonas Thörnvall:
torsdag 23 september 2021 kl. 15:53:24 UTC+2 skrev Jonas Thörnvall:
One can't use javascript variables in CSS, but i read one can reach scale from javascript how would i do that?
<script>
function getResolution() {
dispWidth=screen.width;
dispHeight=screen.height;
}
getResolution();
resizedWidth=screenWidth/1920;
resizedHeight=screenHeight/1080;
</script>
<???style>
html {
transform: scale(resizedWidth,resizedHeight);
<script>That work for javascript, but probably not for CSS?}Maybe i should just create strings dynamically and run?
</style>
//function getResolution() {
// dispWidth=screen.width;
// dispHeight=screen.height;
// }
// getResolution();
// resizedWidth=dispWidth/1920;
// resizedHeight=dispHeight/1080;
var bodyStyles = document.body.style;
bodyStyles.setProperty('--scale', '0.5');
</script>
Is there a way to set scale of body like this?Should not something like this work?
<style>
html {
background: white;
height: 100%;
width: 100%;
}
</style>
<script>
function getResolution() {
dispWidth=screen.width;
dispHeight=screen.height;
}
getResolution();
resizedWidth=300/1920;
resizedHeight=dispHeight/1080;
var htmlStyles = document.html.style; htmlStyles.setProperty('--scale',resizedWidth);
</script>
torsdag 23 september 2021 kl. 17:50:17 UTC+2 skrev Jonas Thörnvall:
torsdag 23 september 2021 kl. 16:37:22 UTC+2 skrev Jonas Thörnvall:Or something building on this?
torsdag 23 september 2021 kl. 16:01:34 UTC+2 skrev Jonas Thörnvall:Should not something like this work?
torsdag 23 september 2021 kl. 16:00:35 UTC+2 skrev Jonas Thörnvall:<script>
torsdag 23 september 2021 kl. 15:53:24 UTC+2 skrev Jonas Thörnvall: >>>>>> One can't use javascript variables in CSS, but i read one can reach scale from javascript how would i do that?That work for javascript, but probably not for CSS?
Maybe i should just create strings dynamically and run?
<script>
function getResolution() {
dispWidth=screen.width;
dispHeight=screen.height;
}
getResolution();
resizedWidth=screenWidth/1920;
resizedHeight=screenHeight/1080;
</script>
<???style>
html {
transform: scale(resizedWidth,resizedHeight);
}
</style>
//function getResolution() {
// dispWidth=screen.width;
// dispHeight=screen.height;
// }
// getResolution();
// resizedWidth=dispWidth/1920;
// resizedHeight=dispHeight/1080;
var bodyStyles = document.body.style;
bodyStyles.setProperty('--scale', '0.5');
</script>
Is there a way to set scale of body like this?
<style>
html {
background: white;
height: 100%;
width: 100%;
}
</style>
<script>
function getResolution() {
dispWidth=screen.width;
dispHeight=screen.height;
}
getResolution();
resizedWidth=300/1920;
resizedHeight=dispHeight/1080;
var htmlStyles = document.html.style;
htmlStyles.setProperty('--scale',resizedWidth);
</script>
<script>
var sheet = document.createElement('style')
sheet.innerHTML = "<style>html { background: white; height: "+resizedWidth+" width: "+resizedHeight+";}</style>";
document.body.appendChild(sheet);
</script>
Unfortunately it does not work?
On 23/09/2021 20:12, Jonas Thörnvall wrote:
torsdag 23 september 2021 kl. 17:50:17 UTC+2 skrev Jonas Thörnvall:
torsdag 23 september 2021 kl. 16:37:22 UTC+2 skrev Jonas Thörnvall:Or something building on this?
torsdag 23 september 2021 kl. 16:01:34 UTC+2 skrev Jonas Thörnvall: >>>> torsdag 23 september 2021 kl. 16:00:35 UTC+2 skrev Jonas Thörnvall: >>>>> torsdag 23 september 2021 kl. 15:53:24 UTC+2 skrev Jonas Thörnvall: >>>>>> One can't use javascript variables in CSS, but i read one can reach scale from javascript how would i do that?Should not something like this work?
<script>That work for javascript, but probably not for CSS?Maybe i should just create strings dynamically and run?
<script>
function getResolution() {
dispWidth=screen.width;
dispHeight=screen.height;
}
getResolution();
resizedWidth=screenWidth/1920;
resizedHeight=screenHeight/1080;
</script>
<???style>
html {
transform: scale(resizedWidth,resizedHeight);
}
</style>
//function getResolution() {
// dispWidth=screen.width;
// dispHeight=screen.height;
// }
// getResolution();
// resizedWidth=dispWidth/1920;
// resizedHeight=dispHeight/1080;
var bodyStyles = document.body.style;
bodyStyles.setProperty('--scale', '0.5');
</script>
Is there a way to set scale of body like this?
<style>
html {
background: white;
height: 100%;
width: 100%;
}
</style>
<script>
function getResolution() {
dispWidth=screen.width;
dispHeight=screen.height;
}
getResolution();
resizedWidth=300/1920;
resizedHeight=dispHeight/1080;
var htmlStyles = document.html.style;
htmlStyles.setProperty('--scale',resizedWidth);
</script>
<script>
var sheet = document.createElement('style')
sheet.innerHTML = "<style>html { background: white; height: "+resizedWidth+" width: "+resizedHeight+";}</style>";
document.body.appendChild(sheet);
</script>
Unfortunately it does not work?
Apologies for cutting and pasting but this is what I wrote to change
video aspect ratios from 16:19 to 4:3
Perhaps it helps?
<script>
var mux="";
var streamID=0;
var aspectRatio=1.77;
var pip=false;
var paused=false;
const video = document.getElementById("videoplayer");
const element = document.getElementById("videoframe");
// add fullscreen event listener to resize the video window back to what
it should be
// add event listenet to videoframe. element.addEventListener('fullscreenchange', (event) => {
// document.fullscreenElement will point to the element that
// is in fullscreen mode if there is one. If there isn't one,
// the value of the property is null.
if (!document.fullscreenElement)
{
video.style.height=508; // reset video height
video.style.top=42; // and top
video.style.left=(aspectRatio==1.77? 1:110); // and offset
}
});
function fullScreen()
{
var width;
var height;
var aspect;
var edge;
var top;
if (element.mozRequestFullScreen)
{
element.mozRequestFullScreen();
}
else if (element.webkitRequestFullScreen)
{
element.webkitRequestFullScreen();
}
width=window.screen.width;
height=window.screen.height;
aspect=width/height;
top=0;
// if aspect ratio is less than actual one, then we need to reduce the height, otherwise set it to full screen height
if (aspect < aspectRatio)
{
height=width/aspectRatio;
top=(window.screen.height-height)/2;
}
// now set the video element height...
video.style.height=height;
video.style.top=top;
//now center the picture...
edge=(width-height*aspectRatio)/2;
if (edge>0)
video.style.left=edge;
}
function changeAspectRatio()
{
aspectRatio=aspectRatio==1.77 ? 1.33:1.77; document.getElementById('aspect-ratio').innerHTML=(aspectRatio==1.77 ?"4:3":"16:9");
video.className=(aspectRatio==1.77 ? "tv":"tvold");
// sigh, we need to set offset too
video.style.left=(aspectRatio==1.77 ?1:110);
}
--
Religion is regarded by the common people as true, by the wise as
foolish, and by the rulers as useful.
(Seneca the Younger, 65 AD)
So i have the scales wanted for screen, in resizedWidth and resizedHeight but how do i set the "CSS html?" scale using javascript.
On 24/09/2021 14:58, Jonas Thörnvall wrote:
So i have the scales wanted for screen, in resizedWidth and resizedHeight but how do i set the "CSS html?" scale using javascript.I showed you in my example
you find the element in the dom and set its width and height
as in
const element = document.getElementById("videoframe"); element.style.width=newWidth;
element.style.height=newheight;
and so on.
That sets the elements size. If you want to e.g. scale a video to fit
it, you need the element to have the CSS attribute 'object-fill' set to fill
e.g.
CSS
.tv
{
position: absolute;
left:1px;
top: 42px;
height: 508;
aspect-ratio:1.77;
object-fit:fill;
}
Or you could probably do that with JavasScript as
element.style.object-fit="fill";
As usual with CSS, browsers and JavaShite™ no two browsers respond to mixtures of 'aspect-ratio', 'height' and 'width' the same way, so it's
wise to set them *all* up.
--By the way what the fuck have
Those who want slavery should have the grace to name it by its proper
name. They must face the full meaning of that which they are advocating
or condoning; the full, exact, specific meaning of collectivism, of its logical implications, of the principles upon which it is based, and of
the ultimate consequences to which these principles will lead. They must face it, then decide whether this is what they want or not.
Ayn Rand.
On 24/09/2021 14:58, Jonas Thörnvall wrote:
So i have the scales wanted for screen, in resizedWidth and resizedHeight but how do i set the "CSS html?" scale using javascript.I showed you in my example
you find the element in the dom and set its width and height
as in
const element = document.getElementById("videoframe"); element.style.width=newWidth;
element.style.height=newheight;
and so on.
That sets the elements size. If you want to e.g. scale a video to fit
it, you need the element to have the CSS attribute 'object-fill' set to fill
e.g.
CSS
.tv
{
position: absolute;
left:1px;
top: 42px;
height: 508;
aspect-ratio:1.77;
object-fit:fill;
}
Or you could probably do that with JavasScript as
element.style.object-fit="fill";
As usual with CSS, browsers and JavaShite™ no two browsers respond to mixtures of 'aspect-ratio', 'height' and 'width' the same way, so it's
wise to set them *all* up.
--
Those who want slavery should have the grace to name it by its proper
name. They must face the full meaning of that which they are advocating
or condoning; the full, exact, specific meaning of collectivism, of its logical implications, of the principles upon which it is based, and of
the ultimate consequences to which these principles will lead. They must face it, then decide whether this is what they want or not.
Ayn Rand.
By the way what the fuck have
const video = document.getElementById("videoplayer");
const element = document.getElementById("videoframe");
To do with it, you people just so convoluted in drivel to swallow any shit you learned.
fredag 24 september 2021 kl. 17:15:10 UTC+2 skrev The Natural Philosopher:
On 24/09/2021 14:58, Jonas Thörnvall wrote:
So i have the scales wanted for screen, in resizedWidth and resizedHeight but how do i set the "CSS html?" scale using javascript.I showed you in my example
you find the element in the dom and set its width and height
as in
const element = document.getElementById("videoframe");
element.style.width=newWidth;
element.style.height=newheight;
and so on.
That sets the elements size. If you want to e.g. scale a video to fit
it, you need the element to have the CSS attribute 'object-fill' set to fill >>
e.g.
CSS
.tv
{
position: absolute;
left:1px;
top: 42px;
height: 508;
aspect-ratio:1.77;
object-fit:fill;
}
Or you could probably do that with JavasScript as
element.style.object-fit="fill";
As usual with CSS, browsers and JavaShite™ no two browsers respond to
mixtures of 'aspect-ratio', 'height' and 'width' the same way, so it's
wise to set them *all* up.
--
Those who want slavery should have the grace to name it by its proper
name. They must face the full meaning of that which they are advocating
or condoning; the full, exact, specific meaning of collectivism, of its
logical implications, of the principles upon which it is based, and of
the ultimate consequences to which these principles will lead. They must
face it, then decide whether this is what they want or not.
Ayn Rand.
I don't know what is the element .tv you seem to refer to?
And there isn't exactly aspect ratios applied to displays/monitors, so why use it?
It is a simple matter of divide the source implementatio size to the correct scales of width and height to the display.well if all you want to do is fill the available space use
Make a simple example using javascript, so i can see your approach work.I did
Because i really can't see how your .tv differ from my Arnolds <styles> html{scale....} </styles> that really do work.
But just as your in no viable via javascript, at least i have not found any examples of it.
I just have a feeling that many of you make things more complex then they really are, Arnolds solution was great however it was not dynamical and maybe there is no dynamical solutions.
You see i understand "html" and "body" as known style elements but where did you get .tv from?
Is that part of CSS standard and defined as some sort of default object?
On 24/09/2021 19:38, Jonas Thörnvall wrote:Ok i tested now your idea, just do not work it will not change the content witin a div to the hight and width.
By the way what the fuck have
const video = document.getElementById("videoplayer");
const element = document.getElementById("videoframe");
To do with it, you people just so convoluted in drivel to swallow any shit you learned.No, they are references to bits of code that I didn't post up. I assumed
you would understand that.
In fact I assumed you understood basic CSS HTML and javascript.
It seems I was wrong, I apologise.,
--
How fortunate for governments that the people they administer don't think.
Adolf Hitler
lördag 25 september 2021 kl. 10:50:52 UTC+2 skrev The Natural Philosopher:Maybe just maybe i can make a innerHTML using a dynamic created string with the <style> html{transform: scale(x,y); }</style> and load it last in body.
On 24/09/2021 19:38, Jonas Thörnvall wrote:
By the way what the fuck have
const video = document.getElementById("videoplayer");
const element = document.getElementById("videoframe");
To do with it, you people just so convoluted in drivel to swallow any shit you learned.No, they are references to bits of code that I didn't post up. I assumed you would understand that.
In fact I assumed you understood basic CSS HTML and javascript.
It seems I was wrong, I apologise.,
--
How fortunate for governments that the people they administer don't think.
Adolf HitlerOk i tested now your idea, just do not work it will not change the content witin a div to the hight and width.
(between there is alot of divs canvas e t c witin the body)
So far the only thing that will scale it uniformly is.
html {
transform: scale(0.5,0.7);
}
So maybe one should have a script that invoke different CSS files deipendent on resolution.
It seem idiotic to me, but....
On 24/09/2021 19:38, Jonas Thörnvall wrote:This is how you solve things "clear, concise and compact" watch and learn ;) Convoluted shit gone.
By the way what the fuck have
const video = document.getElementById("videoplayer");
const element = document.getElementById("videoframe");
To do with it, you people just so convoluted in drivel to swallow any shit you learned.No, they are references to bits of code that I didn't post up. I assumed
you would understand that.
In fact I assumed you understood basic CSS HTML and javascript.
It seems I was wrong, I apologise.,
--
How fortunate for governments that the people they administer don't think.
Adolf Hitler
On 24/09/2021 19:38, Jonas Thörnvall wrote:What you posted is from "what i can get" just assign a value to a variable you call tv1, that will not change anything to the myTv element?
By the way what the fuck have
const video = document.getElementById("videoplayer");
const element = document.getElementById("videoframe");
To do with it, you people just so convoluted in drivel to swallow any shit you learned.No, they are references to bits of code that I didn't post up. I assumed
you would understand that.
In fact I assumed you understood basic CSS HTML and javascript.
It seems I was wrong, I apologise.,
--
How fortunate for governments that the people they administer don't think.
Adolf Hitler
lördag 25 september 2021 kl. 10:50:52 UTC+2 skrev The Natural Philosopher:Honestly i think i am border genius LoL
On 24/09/2021 19:38, Jonas Thörnvall wrote:
By the way what the fuck have
const video = document.getElementById("videoplayer");
const element = document.getElementById("videoframe");
To do with it, you people just so convoluted in drivel to swallow any shit you learned.No, they are references to bits of code that I didn't post up. I assumed you would understand that.
In fact I assumed you understood basic CSS HTML and javascript.
It seems I was wrong, I apologise.,
--
How fortunate for governments that the people they administer don't think.
Adolf HitlerThis is how you solve things "clear, concise and compact" watch and learn ;) Convoluted shit gone.
<script>
function getResolution() {
dispWidth=screen.width;
dispHeight=screen.height;
}
getResolution();
xScale=dispWidth/1920;
yScale=dispHeight/1080;
resString="<style>html {transform: scale("+xScale+","+yScale");}</style>"; document.getElementById("resolution").innerHTML=resString;
</script>
lördag 25 september 2021 kl. 10:50:52 UTC+2 skrev The Natural Philosopher:And it works ;)
On 24/09/2021 19:38, Jonas Thörnvall wrote:
By the way what the fuck have
const video = document.getElementById("videoplayer");
const element = document.getElementById("videoframe");
To do with it, you people just so convoluted in drivel to swallow any shit you learned.No, they are references to bits of code that I didn't post up. I assumed you would understand that.
In fact I assumed you understood basic CSS HTML and javascript.
It seems I was wrong, I apologise.,
--
How fortunate for governments that the people they administer don't think.
Adolf HitlerThis is how you solve things "clear, concise and compact" watch and learn ;) Convoluted shit gone.
<script>
function getResolution() {
dispWidth=screen.width;
dispHeight=screen.height;
}
getResolution();
xScale=dispWidth/1920;
yScale=dispHeight/1080;
resString="<style>html {transform: scale("+xScale+","+yScale");}</style>"; document.getElementById("resolution").innerHTML=resString;
</script>
lördag 25 september 2021 kl. 14:13:19 UTC+2 skrev Jonas Thörnvall:https://www.youtube.com/watch?v=1qNeGSJaQ9Q
lördag 25 september 2021 kl. 10:50:52 UTC+2 skrev The Natural Philosopher:
On 24/09/2021 19:38, Jonas Thörnvall wrote:
By the way what the fuck have
const video = document.getElementById("videoplayer");
const element = document.getElementById("videoframe");
To do with it, you people just so convoluted in drivel to swallow any shit you learned.No, they are references to bits of code that I didn't post up. I assumed you would understand that.
In fact I assumed you understood basic CSS HTML and javascript.
It seems I was wrong, I apologise.,
--
How fortunate for governments that the people they administer don't think.
And it works ;)Adolf HitlerThis is how you solve things "clear, concise and compact" watch and learn ;)
Convoluted shit gone.
<script>
function getResolution() {
dispWidth=screen.width;
dispHeight=screen.height;
}
getResolution();
xScale=dispWidth/1920;
yScale=dispHeight/1080;
resString="<style>html {transform: scale("+xScale+","+yScale");}</style>"; document.getElementById("resolution").innerHTML=resString;
</script>
lördag 25 september 2021 kl. 14:13:19 UTC+2 skrev Jonas Thörnvall:Thanks again Igor!, oh Arnold.
lördag 25 september 2021 kl. 10:50:52 UTC+2 skrev The Natural Philosopher:
On 24/09/2021 19:38, Jonas Thörnvall wrote:
By the way what the fuck have
const video = document.getElementById("videoplayer");
const element = document.getElementById("videoframe");
To do with it, you people just so convoluted in drivel to swallow any shit you learned.No, they are references to bits of code that I didn't post up. I assumed you would understand that.
In fact I assumed you understood basic CSS HTML and javascript.
It seems I was wrong, I apologise.,
--
How fortunate for governments that the people they administer don't think.
And it works ;)Adolf HitlerThis is how you solve things "clear, concise and compact" watch and learn ;)
Convoluted shit gone.
<script>
function getResolution() {
dispWidth=screen.width;
dispHeight=screen.height;
}
getResolution();
xScale=dispWidth/1920;
yScale=dispHeight/1080;
resString="<style>html {transform: scale("+xScale+","+yScale");}</style>"; document.getElementById("resolution").innerHTML=resString;
</script>
lördag 25 september 2021 kl. 15:39:31 UTC+2 skrev The Natural Philosopher:
On 25/09/2021 12:49, Jonas Thörnvall wrote:
var x = document.getElementsByTagName("HTML")[0];
So far the only thing that will scale it uniformly is.
html {
transform: scale(0.5,0.7);
}
So maybe one should have a script that invoke different CSS files deipendent on resolution.
It seem idiotic to me, but....
x.style.transform="scale(0.5,0.7)";
Yeah but it doesn't work....
So far the only thing that will scale it uniformly is.
html {
transform: scale(0.5,0.7);
}
So maybe one should have a script that invoke different CSS files deipendent on resolution.
It seem idiotic to me, but....
On 25/09/2021 12:49, Jonas Thörnvall wrote:
So far the only thing that will scale it uniformly is.
html {
transform: scale(0.5,0.7);
}
So maybe one should have a script that invoke different CSS files deipendent on resolution.
It seem idiotic to me, but....
var x = document.getElementsByTagName("HTML")[0];
x.style.transform="scale(0.5,0.7)";
--Yeah but it doesn't work....
“It is hard to imagine a more stupid decision or more dangerous way of making decisions than by putting those decisions in the hands of people
who pay no price for being wrong.”
Thomas Sowell
On 25/09/2021 14:46, Jonas Thörnvall wrote:
lördag 25 september 2021 kl. 15:39:31 UTC+2 skrev The Natural Philosopher:
On 25/09/2021 12:49, Jonas Thörnvall wrote:
var x = document.getElementsByTagName("HTML")[0];
So far the only thing that will scale it uniformly is.
html {
transform: scale(0.5,0.7);
}
So maybe one should have a script that invoke different CSS files deipendent on resolution.
It seem idiotic to me, but....
x.style.transform="scale(0.5,0.7)";
Yeah but it doesn't work....
It does, I tested it
<!DOCTYPE html>
<html>
<body>
<h3>A demonstration of how to access an HTML element</h3>
<p>Click the button to scale the document.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementsByTagName("BODY")[0];
x.style.transform = "scale(0.5,1.3)";
}
</script>
</body>
</html>
--Yeah i like it, better then mine i hope it works over all browsers.
There’s a mighty big difference between good, sound reasons and reasons that sound good.
Burton Hillis (William Vaughn, American columnist)
On 25/09/2021 14:46, Jonas Thörnvall wrote:
lördag 25 september 2021 kl. 15:39:31 UTC+2 skrev The Natural Philosopher:
On 25/09/2021 12:49, Jonas Thörnvall wrote:
var x = document.getElementsByTagName("HTML")[0];
So far the only thing that will scale it uniformly is.
html {
transform: scale(0.5,0.7);
}
So maybe one should have a script that invoke different CSS files deipendent on resolution.
It seem idiotic to me, but....
x.style.transform="scale(0.5,0.7)";
Yeah but it doesn't work....
It does, I tested it
<!DOCTYPE html>
<html>
<body>
<h3>A demonstration of how to access an HTML element</h3>
<p>Click the button to scale the document.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementsByTagName("BODY")[0];
x.style.transform = "scale(0.5,1.3)";
}
</script>
</body>
</html>
--
There’s a mighty big difference between good, sound reasons and reasons that sound good.
Burton Hillis (William Vaughn, American columnist)
lördag 25 september 2021 kl. 16:08:27 UTC+2 skrev The Natural Philosopher:
On 25/09/2021 14:46, Jonas Thörnvall wrote:
lördag 25 september 2021 kl. 15:39:31 UTC+2 skrev The Natural Philosopher:
On 25/09/2021 12:49, Jonas Thörnvall wrote:
var x = document.getElementsByTagName("HTML")[0];
So far the only thing that will scale it uniformly is.
html {
transform: scale(0.5,0.7);
}
So maybe one should have a script that invoke different CSS files deipendent on resolution.
It seem idiotic to me, but....
x.style.transform="scale(0.5,0.7)";
Yeah but it doesn't work....
It does, I tested it
<!DOCTYPE html>
<html>
<body>
<h3>A demonstration of how to access an HTML element</h3>
<p>Click the button to scale the document.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementsByTagName("BODY")[0];
x.style.transform = "scale(0.5,1.3)";
}
</script>
</body>
</html>
Now when the solution so neat i may actually add sliders to zoom in.--
There’s a mighty big difference between good, sound reasons and reasons that sound good.
Burton Hillis (William Vaughn, American columnist)Yeah i like it, better then mine i hope it works over all browsers.
<script>
function getResolution() {
dispWidth=screen.width;
dispHeight=screen.height;
}
getResolution();
var xScale=dispWidth/220;
var yScale=dispHeight/180;
var dispScale = document.getElementsByTagName("BODY")[0]; dispScale.style.transform = "scale("+xScale+","+yScale+")";
</script>
On 25/09/2021 14:46, Jonas Thörnvall wrote:
lördag 25 september 2021 kl. 15:39:31 UTC+2 skrev The Natural Philosopher:
On 25/09/2021 12:49, Jonas Thörnvall wrote:
var x = document.getElementsByTagName("HTML")[0];
So far the only thing that will scale it uniformly is.
html {
transform: scale(0.5,0.7);
}
So maybe one should have a script that invoke different CSS files deipendent on resolution.
It seem idiotic to me, but....
x.style.transform="scale(0.5,0.7)";
Yeah but it doesn't work....
It does, I tested it
<!DOCTYPE html>
<html>
<body>
<h3>A demonstration of how to access an HTML element</h3>
<p>Click the button to scale the document.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementsByTagName("BODY")[0];
x.style.transform = "scale(0.5,1.3)";
}
</script>
</body>
</html>
--This seem ok to me have to test on mobiles.
There’s a mighty big difference between good, sound reasons and reasons that sound good.
Burton Hillis (William Vaughn, American columnist)
On 25/09/2021 14:46, Jonas Thörnvall wrote:
lördag 25 september 2021 kl. 15:39:31 UTC+2 skrev The Natural Philosopher:
On 25/09/2021 12:49, Jonas Thörnvall wrote:
var x = document.getElementsByTagName("HTML")[0];
So far the only thing that will scale it uniformly is.
html {
transform: scale(0.5,0.7);
}
So maybe one should have a script that invoke different CSS files deipendent on resolution.
It seem idiotic to me, but....
x.style.transform="scale(0.5,0.7)";
Yeah but it doesn't work....
It does, I tested it
<!DOCTYPE html>
<html>
<body>
<h3>A demonstration of how to access an HTML element</h3>
<p>Click the button to scale the document.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementsByTagName("BODY")[0];
x.style.transform = "scale(0.5,1.3)";
}
</script>
</body>
</html>
--Just for fun i added sliders for scaling, but to be useful I should created another slider resolution for it "CSS" i used the midi i already had 0-127 so it isn't exactly finetuned zoomwise.
There’s a mighty big difference between good, sound reasons and reasons that sound good.
Burton Hillis (William Vaughn, American columnist)
lördag 25 september 2021 kl. 16:08:27 UTC+2 skrev The Natural Philosopher:
On 25/09/2021 14:46, Jonas Thörnvall wrote:
lördag 25 september 2021 kl. 15:39:31 UTC+2 skrev The Natural Philosopher:
On 25/09/2021 12:49, Jonas Thörnvall wrote:
var x = document.getElementsByTagName("HTML")[0];
So far the only thing that will scale it uniformly is.
html {
transform: scale(0.5,0.7);
}
So maybe one should have a script that invoke different CSS files deipendent on resolution.
It seem idiotic to me, but....
x.style.transform="scale(0.5,0.7)";
Yeah but it doesn't work....
It does, I tested it
<!DOCTYPE html>
<html>
<body>
<h3>A demonstration of how to access an HTML element</h3>
<p>Click the button to scale the document.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementsByTagName("BODY")[0];
x.style.transform = "scale(0.5,1.3)";
}
</script>
</body>
</html>
Well locked positonwise.--
There’s a mighty big difference between good, sound reasons and reasons that sound good.
Burton Hillis (William Vaughn, American columnist)Just for fun i added sliders for scaling, but to be useful I should created another slider resolution for it "CSS" i used the midi i already had 0-127 so it isn't exactly finetuned zoomwise.
But one wonder if one could keep them locked outside "the scaling document".
tisdag 28 september 2021 kl. 21:36:15 UTC+2 skrev Jonas Thörnvall:
lördag 25 september 2021 kl. 16:08:27 UTC+2 skrev The Natural Philosopher: >>> On 25/09/2021 14:46, Jonas Thörnvall wrote:Well locked positonwise.
Just for fun i added sliders for scaling, but to be useful I should created another slider resolution for it "CSS" i used the midi i already had 0-127 so it isn't exactly finetuned zoomwise.lördag 25 september 2021 kl. 15:39:31 UTC+2 skrev The Natural Philosopher:It does, I tested it
On 25/09/2021 12:49, Jonas Thörnvall wrote:
var x = document.getElementsByTagName("HTML")[0];
So far the only thing that will scale it uniformly is.
html {
transform: scale(0.5,0.7);
}
So maybe one should have a script that invoke different CSS files deipendent on resolution.
It seem idiotic to me, but....
x.style.transform="scale(0.5,0.7)";
Yeah but it doesn't work....
<!DOCTYPE html>
<html>
<body>
<h3>A demonstration of how to access an HTML element</h3>
<p>Click the button to scale the document.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementsByTagName("BODY")[0];
x.style.transform = "scale(0.5,1.3)";
}
</script>
</body>
</html>
--
There’s a mighty big difference between good, sound reasons and reasons >>> that sound good.
Burton Hillis (William Vaughn, American columnist)
But one wonder if one could keep them locked outside "the scaling document".
On 29/09/2021 10:24, Jonas Thörnvall wrote:
tisdag 28 september 2021 kl. 21:36:15 UTC+2 skrev Jonas Thörnvall:
lördag 25 september 2021 kl. 16:08:27 UTC+2 skrev The Natural Philosopher:Well locked positonwise.
On 25/09/2021 14:46, Jonas Thörnvall wrote:Just for fun i added sliders for scaling, but to be useful I should created another slider resolution for it "CSS" i used the midi i already had 0-127 so it isn't exactly finetuned zoomwise.
lördag 25 september 2021 kl. 15:39:31 UTC+2 skrev The Natural Philosopher:It does, I tested it
On 25/09/2021 12:49, Jonas Thörnvall wrote:
var x = document.getElementsByTagName("HTML")[0];
So far the only thing that will scale it uniformly is.
html {
transform: scale(0.5,0.7);
}
So maybe one should have a script that invoke different CSS files deipendent on resolution.
It seem idiotic to me, but....
x.style.transform="scale(0.5,0.7)";
Yeah but it doesn't work....
<!DOCTYPE html>
<html>
<body>
<h3>A demonstration of how to access an HTML element</h3>
<p>Click the button to scale the document.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementsByTagName("BODY")[0];
x.style.transform = "scale(0.5,1.3)";
}
</script>
</body>
</html>
--
There’s a mighty big difference between good, sound reasons and reasons
that sound good.
Burton Hillis (William Vaughn, American columnist)
But one wonder if one could keep them locked outside "the scaling document".
yes.
essentially you are scaling with the above code the HTML entity called 'BODY'
You could create a <div ID ="SCALEME"> inside that and scale that using
document.getElementById("SCALEME")
instead.
You need to read up on the DOM in Javascript. Eacg nested HTML object,
is a Document Object Module and can be selected by name, tagname, ID or class. If that selects more than one, you get an array that you can loop through.
Then everything inside the object is accessible by javascript.
--i see a problem with the div tag as is, if you have a very big document with iframes it can be hard to keep track of closures. So when you try frame the region it might not frame the region you want.
All political activity makes complete sense once the proposition that
all government is basically a self-legalising protection racket, is
fully understood.
onsdag 29 september 2021 kl. 12:52:30 UTC+2 skrev The Natural Philosopher:
On 29/09/2021 10:24, Jonas Thörnvall wrote:
tisdag 28 september 2021 kl. 21:36:15 UTC+2 skrev Jonas Thörnvall:
lördag 25 september 2021 kl. 16:08:27 UTC+2 skrev The Natural Philosopher:Well locked positonwise.
On 25/09/2021 14:46, Jonas Thörnvall wrote:Just for fun i added sliders for scaling, but to be useful I should created another slider resolution for it "CSS" i used the midi i already had 0-127 so it isn't exactly finetuned zoomwise.
lördag 25 september 2021 kl. 15:39:31 UTC+2 skrev The Natural Philosopher:It does, I tested it
On 25/09/2021 12:49, Jonas Thörnvall wrote:
var x = document.getElementsByTagName("HTML")[0];
So far the only thing that will scale it uniformly is.
html {
transform: scale(0.5,0.7);
}
So maybe one should have a script that invoke different CSS files deipendent on resolution.
It seem idiotic to me, but....
x.style.transform="scale(0.5,0.7)";
Yeah but it doesn't work....
<!DOCTYPE html>
<html>
<body>
<h3>A demonstration of how to access an HTML element</h3>
<p>Click the button to scale the document.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementsByTagName("BODY")[0];
x.style.transform = "scale(0.5,1.3)";
}
</script>
</body>
</html>
--
There’s a mighty big difference between good, sound reasons and reasons
that sound good.
Burton Hillis (William Vaughn, American columnist)
But one wonder if one could keep them locked outside "the scaling document".
yes.
essentially you are scaling with the above code the HTML entity called 'BODY'
You could create a <div ID ="SCALEME"> inside that and scale that using
document.getElementById("SCALEME")
instead.
You need to read up on the DOM in Javascript. Eacg nested HTML object,
is a Document Object Module and can be selected by name, tagname, ID or class. If that selects more than one, you get an array that you can loop through.
Then everything inside the object is accessible by javascript.
Added scaling by scroll, will make select buttons for X, Y,LOCKED--i see a problem with the div tag as is, if you have a very big document with iframes it can be hard to keep track of closures. So when you try frame the region it might not frame the region you want.
All political activity makes complete sense once the proposition that
all government is basically a self-legalising protection racket, is
fully understood.
That problem never occure with named closures of tags like </html>
And it is frustrating reading something like
</div>
</div>
</div>
As closure way below your actual <div id's>
What did that one close....
i see a problem with the div tag as is, if you have a very big document with iframes it can be hard to keep track of closures. So when you try frame the region it might not frame the region you want.
That problem never occure with named closures of tags like </html>
And it is frustrating reading something like
</div>
</div>
</div>
As closure way below your actual <div id's>
What did that one close....
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 251 |
Nodes: | 16 (2 / 14) |
Uptime: | 101:14:47 |
Calls: | 5,516 |
Calls today: | 4 |
Files: | 11,669 |
Messages: | 5,089,320 |