Реализована адаптивность
This commit is contained in:
parent
fe243d94d3
commit
df18d0b469
16
index.html
16
index.html
|
@ -7,7 +7,7 @@
|
|||
<link rel="icon" href="src/img/favicon.ico">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<body id="main">
|
||||
<header id="header" class="default">
|
||||
<div class="logo-img">
|
||||
<a href="index.html"><img class="header-img" src="src/img/dhaverd2.png"></a>
|
||||
|
@ -15,20 +15,20 @@
|
|||
</header>
|
||||
<main>
|
||||
<section class="side-bar">
|
||||
<p class="mainp"><a href="index.html">Главная</a></p>
|
||||
<p class="gitea"><a href="http:\\176.114.129.4:3000">Gitea</a></p>
|
||||
<p class="servers"><a href="servers.html">Сервера</a></p>
|
||||
<p class="mychat"><a href="mychat.html">MyChat</a></p>
|
||||
<p class="workout-area"><a href="workout.html">Программа тренировок</a></p>
|
||||
<p class="mainp"><a class="side-href" href="index.html">Главная</a></p>
|
||||
<p class="gitea"><a class="side-href" href="http:\\176.114.129.4:3000">Gitea</a></p>
|
||||
<p class="servers"><a class="side-href" href="servers.html">Сервера</a></p>
|
||||
<p class="mychat"><a class="side-href" href="mychat.html">MyChat</a></p>
|
||||
<p class="workout-area"><a class="side-href" href="workout.html">Программа тренировок</a></p>
|
||||
</section>
|
||||
<section class="main-content" id="main-content">
|
||||
<h1 class="page-title">Приветствую!</h1>
|
||||
<p>Данный сайт разработан для личного использования. Здесь можно найти репозиторий Git. Также тут можно найти мои сервера Minecraft, Project Zomboid и иногда других игр. Еще у нас есть свой мессенджер MyChat</p>
|
||||
<p class="content-text">Данный сайт разработан для личного использования. Здесь можно найти репозиторий Git. Также тут можно найти мои сервера Minecraft, Project Zomboid и иногда других игр. Еще у нас есть свой мессенджер MyChat</p>
|
||||
</section>
|
||||
</main>
|
||||
<footer>
|
||||
<section>
|
||||
<p>® Dhaverd 2022</p>
|
||||
<p id="footer">® Dhaverd 2022</p>
|
||||
</section>
|
||||
</footer>
|
||||
</body>
|
||||
|
|
30
mychat.html
30
mychat.html
|
@ -7,7 +7,7 @@
|
|||
<link rel="icon" href="src/img/favicon.ico">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<body id="main">
|
||||
<header id="header" class="default">
|
||||
<div>
|
||||
<a href="index.html"><img class="header-img" src="src/img/dhaverd2.png"></a>
|
||||
|
@ -15,28 +15,28 @@
|
|||
</header>
|
||||
<main>
|
||||
<section class="side-bar">
|
||||
<p class="mainp"><a href="index.html">Главная</a></p>
|
||||
<p class="gitea"><a href="http:\\176.114.129.4:3000">Gitea</a></p>
|
||||
<p class="servers"><a href="servers.html">Сервера</a></p>
|
||||
<p class="mychat"><a href="mychat.html">MyChat</a></p>
|
||||
<p class="workout-area"><a href="workout.html">Программа тренировок</a></p>
|
||||
<p class="mainp"><a class="side-href" href="index.html">Главная</a></p>
|
||||
<p class="gitea"><a class="side-href" href="http:\\176.114.129.4:3000">Gitea</a></p>
|
||||
<p class="servers"><a class="side-href" href="servers.html">Сервера</a></p>
|
||||
<p class="mychat"><a class="side-href" href="mychat.html">MyChat</a></p>
|
||||
<p class="workout-area"><a class="side-href" href="workout.html">Программа тренировок</a></p>
|
||||
</section>
|
||||
<section class="main-content" id="main-content">
|
||||
<h1 class="page-title">MyChat</h1>
|
||||
<p>Скачать MyChat Client можно здесь: <a class="text-link" target="_blank" href="https://nsoft-s.com/downloadmychat.html">ТыК</a></p>
|
||||
<p>Также можно открыть Web-версию: <a class="text-link" target="_blank" href="http://176.114.129.4:800/chat">ТыК</a> </p>
|
||||
<p>Для подключения потребуется ввести следующие данные:</p>
|
||||
<p class="mychat-cred">- IP: 176.114.129.4</p>
|
||||
<p class="mychat-cred">- Port: 2004</p>
|
||||
<p class="mychat-cred">- WEB порт: 800</p>
|
||||
<p class="mychat-cred">- Пароль сервера: 2ZJcs</p>
|
||||
<p class="content-text">Скачать MyChat Client можно здесь: <a class="text-link" target="_blank" href="https://nsoft-s.com/downloadmychat.html">ТыК</a></p>
|
||||
<p class="content-text">Также можно открыть Web-версию: <a class="text-link" target="_blank" href="http://176.114.129.4:800/chat">ТыК</a> </p>
|
||||
<p class="content-text">Для подключения потребуется ввести следующие данные:</p>
|
||||
<p class="content-text mychat-cred">- IP: 176.114.129.4</p>
|
||||
<p class="content-text mychat-cred">- Port: 2004</p>
|
||||
<p class="content-text mychat-cred">- WEB порт: 800</p>
|
||||
<p class="content-text mychat-cred">- Пароль сервера: 2ZJcs</p>
|
||||
</section>
|
||||
</main>
|
||||
<footer>
|
||||
<section>
|
||||
<p>® Dhaverd 2022</p>
|
||||
<p id="footer">® Dhaverd 2022</p>
|
||||
</section>
|
||||
</footer>
|
||||
</body>
|
||||
<script src="src/scripts/index.js"></script>
|
||||
<script src="src/scripts/mychat.js"></script>
|
||||
</html>
|
21
servers.html
21
servers.html
|
@ -7,7 +7,7 @@
|
|||
<link rel="icon" href="src/img/favicon.ico">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<body id="main">
|
||||
<header id="header" class="default">
|
||||
<div>
|
||||
<a href="index.html"><img class="header-img" src="src/img/dhaverd2.png"></a>
|
||||
|
@ -15,23 +15,22 @@
|
|||
</header>
|
||||
<main id="#main">
|
||||
<section class="side-bar">
|
||||
<p class="mainp"><a href="index.html">Главная</a></p>
|
||||
<p class="gitea"><a href="http:\\176.114.129.4:3000">Gitea</a></p>
|
||||
<p class="servers"><a href="servers.html">Сервера</a></p>
|
||||
<p class="mychat"><a href="mychat.html">MyChat</a></p>
|
||||
<p class="workout-area"><a href="workout.html">Программа тренировок</a></p>
|
||||
<p class="mainp"><a class="side-href" href="index.html">Главная</a></p>
|
||||
<p class="gitea"><a class="side-href" href="http:\\176.114.129.4:3000">Gitea</a></p>
|
||||
<p class="servers"><a class="side-href" href="servers.html">Сервера</a></p>
|
||||
<p class="mychat"><a class="side-href" href="mychat.html">MyChat</a></p>
|
||||
<p class="workout-area"><a class="side-href" href="workout.html">Программа тренировок</a></p>
|
||||
</section>
|
||||
<section class="main-content" id="main-content">
|
||||
<h1 class="page-title">У нас имеются следующие сервера:</h1>
|
||||
<br>
|
||||
<h2>Minecraft 1.16.1 Vanilla</h2>
|
||||
<h2 class="server-name">Minecraft 1.16.1 Vanilla</h2>
|
||||
<h3 class="server-ips">IP: 176.114.129.4:25565</h3>
|
||||
<section class="image-content">
|
||||
<img class="minecraft-vanilla" src="src/img/minecraft_vanilla.jpg">
|
||||
</section>
|
||||
<br>
|
||||
<br>
|
||||
<h2>Project Zomboid</h2>
|
||||
<h2 class="server-name">Project Zomboid</h2>
|
||||
<h3 class="server-ips">IP: 176.114.129.4:16261</h3>
|
||||
<section class="image-content">
|
||||
<img class="zomboid" src="src/img/zomboid.jpg">
|
||||
|
@ -40,9 +39,9 @@
|
|||
</main>
|
||||
<footer>
|
||||
<section>
|
||||
<p>® Dhaverd 2022</p>
|
||||
<p id="footer">® Dhaverd 2022</p>
|
||||
</section>
|
||||
</footer>
|
||||
</body>
|
||||
<script src="src/scripts/index.js"></script>
|
||||
<script src="src/scripts/servers.js"></script>
|
||||
</html>
|
|
@ -1,14 +1,90 @@
|
|||
$(document).ready(function() {
|
||||
resetContentSize()
|
||||
resetContentSize();
|
||||
fixMobile();
|
||||
window.addEventListener('resize', fixMobile);
|
||||
window.onresize = fixMobile;
|
||||
});
|
||||
|
||||
function resetContentSize() {
|
||||
console.log("Fixing main-content height:");
|
||||
let mainContent = document.getElementById('main-content');
|
||||
mainContent.setAttribute('style', 'height: auto');
|
||||
mainContent = document.getElementById('main-content');
|
||||
var offsetHeight = Number(mainContent.offsetHeight);
|
||||
console.log("\tHeight was: " + offsetHeight);
|
||||
var newHeight = offsetHeight + 30;
|
||||
console.log("\tSetting css: " + 'height:'+newHeight+'px');
|
||||
mainContent.setAttribute('style', 'height:'+newHeight+'px');
|
||||
console.log("\tHeight become: " + mainContent.offsetHeight);
|
||||
return;
|
||||
}
|
||||
|
||||
function resetHeader() {
|
||||
var header = document.getElementById('header');
|
||||
header.setAttribute('style', 'height: auto');
|
||||
header = document.getElementById('header');
|
||||
var hh = Number(header.offsetHeight);
|
||||
hh = hh + 10;
|
||||
header.setAttribute('style', 'height:'+hh+'px');
|
||||
}
|
||||
|
||||
function isMobile() {
|
||||
let check = false;
|
||||
(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);
|
||||
return check;
|
||||
}
|
||||
|
||||
function fixMobile() {
|
||||
resetContentSize();
|
||||
resetHeader();
|
||||
var ismobile = isMobileByScreenSize();
|
||||
console.log("Is mobile: " + ismobile);
|
||||
if (ismobile) {
|
||||
resizeElementsDown();
|
||||
} else {
|
||||
resizeElementsUp();
|
||||
}
|
||||
resetContentSize();
|
||||
}
|
||||
|
||||
function resizeElementsDown() {
|
||||
var pageTitle = document.getElementsByClassName('page-title');
|
||||
pageTitle[0].setAttribute('style', 'font-size:16px');
|
||||
var refs = document.getElementsByClassName('side-href');
|
||||
for (let i = 0; i < refs.length; i++) {
|
||||
refs[i].setAttribute('style', 'font-size:16px');
|
||||
}
|
||||
var mainCont = document.getElementById('main');
|
||||
mainCont.setAttribute('style', 'padding-left: 0px; padding-right: 0px;');
|
||||
var contentText = document.getElementsByClassName('content-text');
|
||||
for (let i = 0; i < contentText.length; i++) {
|
||||
contentText[i].setAttribute('style', 'font-size:14px');
|
||||
}
|
||||
var footer = document.getElementById('footer');
|
||||
footer.setAttribute('style', 'font-size:14px');
|
||||
}
|
||||
|
||||
function resizeElementsUp() {
|
||||
var pageTitle = document.getElementsByClassName('page-title');
|
||||
pageTitle[0].setAttribute('style', 'font-size:25px');
|
||||
var refs = document.getElementsByClassName('side-href');
|
||||
for (let i = 0; i < refs.length; i++) {
|
||||
refs[i].setAttribute('style', 'font-size:20px');
|
||||
}
|
||||
var mainCont = document.getElementById('main');
|
||||
mainCont.setAttribute('style', 'padding-left: 100px; padding-right: 100px;');
|
||||
var contentText = document.getElementsByClassName('content-text');
|
||||
for (let i = 0; i < contentText.length; i++) {
|
||||
contentText[i].setAttribute('style', 'font-size:20px');
|
||||
}
|
||||
var footer = document.getElementById('footer');
|
||||
footer.setAttribute('style', 'font-size:18px');
|
||||
}
|
||||
|
||||
function isMobileByScreenSize() {
|
||||
var width = window.innerWidth;
|
||||
var height = window.innerHeight;
|
||||
console.log('Height = ' + height);
|
||||
console.log('Width = ' + width);
|
||||
return (width - height) < 150;
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
$(document).ready(function() {
|
||||
resetContentSize();
|
||||
fixMobile();
|
||||
window.addEventListener('resize', fixMobile);
|
||||
window.onresize = fixMobile;
|
||||
});
|
||||
|
||||
function resetContentSize() {
|
||||
console.log("Fixing main-content height:");
|
||||
let mainContent = document.getElementById('main-content');
|
||||
mainContent.setAttribute('style', 'height: auto');
|
||||
mainContent = document.getElementById('main-content');
|
||||
var offsetHeight = Number(mainContent.offsetHeight);
|
||||
console.log("\tHeight was: " + offsetHeight);
|
||||
var newHeight = offsetHeight + 30;
|
||||
console.log("\tSetting css: " + 'height:'+newHeight+'px');
|
||||
mainContent.setAttribute('style', 'height:'+newHeight+'px');
|
||||
console.log("\tHeight become: " + mainContent.offsetHeight);
|
||||
return;
|
||||
}
|
||||
|
||||
function resetHeader() {
|
||||
var header = document.getElementById('header');
|
||||
header.setAttribute('style', 'height: auto');
|
||||
header = document.getElementById('header');
|
||||
var hh = Number(header.offsetHeight);
|
||||
hh = hh + 10;
|
||||
header.setAttribute('style', 'height:'+hh+'px');
|
||||
}
|
||||
|
||||
function isMobile() {
|
||||
let check = false;
|
||||
(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);
|
||||
return check;
|
||||
}
|
||||
|
||||
function fixMobile() {
|
||||
resetContentSize();
|
||||
resetHeader();
|
||||
var ismobile = isMobileByScreenSize();
|
||||
console.log("Is mobile: " + ismobile);
|
||||
if (ismobile) {
|
||||
resizeElementsDown();
|
||||
} else {
|
||||
resizeElementsUp();
|
||||
}
|
||||
resetContentSize();
|
||||
}
|
||||
|
||||
function resizeElementsDown() {
|
||||
var pageTitle = document.getElementsByClassName('page-title');
|
||||
pageTitle[0].setAttribute('style', 'font-size:16px');
|
||||
var refs = document.getElementsByClassName('side-href');
|
||||
for (let i = 0; i < refs.length; i++) {
|
||||
refs[i].setAttribute('style', 'font-size:16px');
|
||||
}
|
||||
var mainCont = document.getElementById('main');
|
||||
mainCont.setAttribute('style', 'padding-left: 0px; padding-right: 0px;');
|
||||
var contentText = document.getElementsByClassName('content-text');
|
||||
for (let i = 0; i < contentText.length; i++) {
|
||||
contentText[i].setAttribute('style', 'font-size:14px');
|
||||
}
|
||||
var footer = document.getElementById('footer');
|
||||
footer.setAttribute('style', 'font-size:14px');
|
||||
var textLinks = document.getElementsByClassName('text-link');
|
||||
for (let i = 0; i < textLinks.length; i++) {
|
||||
textLinks[i].setAttribute('style', 'font-size:14px');
|
||||
}
|
||||
}
|
||||
|
||||
function resizeElementsUp() {
|
||||
var pageTitle = document.getElementsByClassName('page-title');
|
||||
pageTitle[0].setAttribute('style', 'font-size:25px');
|
||||
var refs = document.getElementsByClassName('side-href');
|
||||
for (let i = 0; i < refs.length; i++) {
|
||||
refs[i].setAttribute('style', 'font-size:20px');
|
||||
}
|
||||
var mainCont = document.getElementById('main');
|
||||
mainCont.setAttribute('style', 'padding-left: 100px; padding-right: 100px;');
|
||||
var contentText = document.getElementsByClassName('content-text');
|
||||
for (let i = 0; i < contentText.length; i++) {
|
||||
contentText[i].setAttribute('style', 'font-size:20px');
|
||||
}
|
||||
var footer = document.getElementById('footer');
|
||||
footer.setAttribute('style', 'font-size:18px');
|
||||
var textLinks = document.getElementsByClassName('text-link');
|
||||
for (let i = 0; i < textLinks.length; i++) {
|
||||
textLinks[i].setAttribute('style', 'font-size:20px');
|
||||
}
|
||||
}
|
||||
|
||||
function isMobileByScreenSize() {
|
||||
var width = window.innerWidth;
|
||||
var height = window.innerHeight;
|
||||
console.log('Height = ' + height);
|
||||
console.log('Width = ' + width);
|
||||
return (width - height) < 150;
|
||||
}
|
|
@ -0,0 +1,106 @@
|
|||
$(document).ready(function() {
|
||||
resetContentSize();
|
||||
fixMobile();
|
||||
window.addEventListener('resize', fixMobile);
|
||||
window.onresize = fixMobile;
|
||||
});
|
||||
|
||||
function resetContentSize() {
|
||||
console.log("Fixing main-content height:");
|
||||
let mainContent = document.getElementById('main-content');
|
||||
mainContent.setAttribute('style', 'height: auto');
|
||||
mainContent = document.getElementById('main-content');
|
||||
var offsetHeight = Number(mainContent.offsetHeight);
|
||||
console.log("\tHeight was: " + offsetHeight);
|
||||
var newHeight = offsetHeight + 30;
|
||||
console.log("\tSetting css: " + 'height:'+newHeight+'px');
|
||||
mainContent.setAttribute('style', 'height:'+newHeight+'px');
|
||||
console.log("\tHeight become: " + mainContent.offsetHeight);
|
||||
return;
|
||||
}
|
||||
|
||||
function resetHeader() {
|
||||
var header = document.getElementById('header');
|
||||
header.setAttribute('style', 'height: auto');
|
||||
header = document.getElementById('header');
|
||||
var hh = Number(header.offsetHeight);
|
||||
hh = hh + 10;
|
||||
header.setAttribute('style', 'height:'+hh+'px');
|
||||
}
|
||||
|
||||
function isMobile() {
|
||||
let check = false;
|
||||
(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);
|
||||
return check;
|
||||
}
|
||||
|
||||
function fixMobile() {
|
||||
resetContentSize();
|
||||
resetHeader();
|
||||
var ismobile = isMobileByScreenSize();
|
||||
console.log("Is mobile: " + ismobile);
|
||||
if (ismobile) {
|
||||
resizeElementsDown();
|
||||
} else {
|
||||
resizeElementsUp();
|
||||
}
|
||||
resetContentSize();
|
||||
}
|
||||
|
||||
function resizeElementsDown() {
|
||||
var pageTitle = document.getElementsByClassName('page-title');
|
||||
pageTitle[0].setAttribute('style', 'font-size:16px');
|
||||
var refs = document.getElementsByClassName('side-href');
|
||||
for (let i = 0; i < refs.length; i++) {
|
||||
refs[i].setAttribute('style', 'font-size:16px');
|
||||
}
|
||||
var mainCont = document.getElementById('main');
|
||||
mainCont.setAttribute('style', 'padding-left: 0px; padding-right: 0px;');
|
||||
var contentText = document.getElementsByClassName('content-text');
|
||||
for (let i = 0; i < contentText.length; i++) {
|
||||
contentText[i].setAttribute('style', 'font-size:14px');
|
||||
}
|
||||
var footer = document.getElementById('footer');
|
||||
footer.setAttribute('style', 'font-size:14px');
|
||||
var serverNames = document.getElementsByClassName('server-name');
|
||||
for (let i = 0; i < serverNames.length; i++) {
|
||||
serverNames[i].setAttribute('style', 'font-size:16px');
|
||||
}
|
||||
var serverIps = document.getElementsByClassName('server-ips');
|
||||
for (let i = 0; i < serverIps.length; i++) {
|
||||
serverIps[i].setAttribute('style', 'font-size:14px');
|
||||
}
|
||||
}
|
||||
|
||||
function resizeElementsUp() {
|
||||
var pageTitle = document.getElementsByClassName('page-title');
|
||||
pageTitle[0].setAttribute('style', 'font-size:25px');
|
||||
var refs = document.getElementsByClassName('side-href');
|
||||
for (let i = 0; i < refs.length; i++) {
|
||||
refs[i].setAttribute('style', 'font-size:20px');
|
||||
}
|
||||
var mainCont = document.getElementById('main');
|
||||
mainCont.setAttribute('style', 'padding-left: 100px; padding-right: 100px;');
|
||||
var contentText = document.getElementsByClassName('content-text');
|
||||
for (let i = 0; i < contentText.length; i++) {
|
||||
contentText[i].setAttribute('style', 'font-size:20px');
|
||||
}
|
||||
var footer = document.getElementById('footer');
|
||||
footer.setAttribute('style', 'font-size:18px');
|
||||
var serverNames = document.getElementsByClassName('server-name');
|
||||
for (let i = 0; i < serverNames.length; i++) {
|
||||
serverNames[i].setAttribute('style', 'font-size:20px');
|
||||
}
|
||||
var serverIps = document.getElementsByClassName('server-ips');
|
||||
for (let i = 0; i < serverIps.length; i++) {
|
||||
serverIps[i].setAttribute('style', 'font-size:16px');
|
||||
}
|
||||
}
|
||||
|
||||
function isMobileByScreenSize() {
|
||||
var width = window.innerWidth;
|
||||
var height = window.innerHeight;
|
||||
console.log('Height = ' + height);
|
||||
console.log('Width = ' + width);
|
||||
return (width - height) < 150;
|
||||
}
|
|
@ -0,0 +1,134 @@
|
|||
$(document).ready(function() {
|
||||
resetContentSize();
|
||||
fixMobile();
|
||||
window.addEventListener('resize', fixMobile);
|
||||
window.onresize = fixMobile;
|
||||
});
|
||||
|
||||
function resetContentSize() {
|
||||
console.log("Fixing main-content height:");
|
||||
let mainContent = document.getElementById('main-content');
|
||||
mainContent.setAttribute('style', 'height: auto');
|
||||
mainContent = document.getElementById('main-content');
|
||||
var offsetHeight = Number(mainContent.offsetHeight);
|
||||
console.log("\tHeight was: " + offsetHeight);
|
||||
var newHeight = offsetHeight + 30;
|
||||
console.log("\tSetting css: " + 'height:'+newHeight+'px');
|
||||
mainContent.setAttribute('style', 'height:'+newHeight+'px');
|
||||
console.log("\tHeight become: " + mainContent.offsetHeight);
|
||||
return;
|
||||
}
|
||||
|
||||
function resetHeader() {
|
||||
var header = document.getElementById('header');
|
||||
header.setAttribute('style', 'height: auto');
|
||||
header = document.getElementById('header');
|
||||
var hh = Number(header.offsetHeight);
|
||||
hh = hh + 10;
|
||||
header.setAttribute('style', 'height:'+hh+'px');
|
||||
}
|
||||
|
||||
function isMobile() {
|
||||
let check = false;
|
||||
(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);
|
||||
return check;
|
||||
}
|
||||
|
||||
function fixMobile() {
|
||||
resetContentSize();
|
||||
resetHeader();
|
||||
var ismobile = isMobileByScreenSize();
|
||||
console.log("Is mobile: " + ismobile);
|
||||
if (ismobile) {
|
||||
resizeElementsDown();
|
||||
} else {
|
||||
resizeElementsUp();
|
||||
}
|
||||
resetContentSize();
|
||||
}
|
||||
|
||||
function resizeElementsDown() {
|
||||
var pageTitle = document.getElementsByClassName('page-title');
|
||||
pageTitle[0].setAttribute('style', 'font-size:16px');
|
||||
var refs = document.getElementsByClassName('side-href');
|
||||
for (let i = 0; i < refs.length; i++) {
|
||||
refs[i].setAttribute('style', 'font-size:16px');
|
||||
}
|
||||
var mainCont = document.getElementById('main');
|
||||
mainCont.setAttribute('style', 'padding-left: 0px; padding-right: 0px;');
|
||||
var contentText = document.getElementsByClassName('content-text');
|
||||
for (let i = 0; i < contentText.length; i++) {
|
||||
contentText[i].setAttribute('style', 'font-size:14px');
|
||||
}
|
||||
var footer = document.getElementById('footer');
|
||||
footer.setAttribute('style', 'font-size:14px');
|
||||
var tableHeads = document.getElementsByClassName('table-head');
|
||||
for (let i = 0; i < tableHeads.length; i++) {
|
||||
tableHeads[i].setAttribute('style', 'font-size:14px');
|
||||
}
|
||||
var exerciseHead = document.getElementById('exercise-head');
|
||||
exerciseHead.setAttribute('style', 'font-size:14px');
|
||||
var muscleGroupHead = document.getElementById('muscle-group-head');
|
||||
muscleGroupHead.setAttribute('style', 'font-size:14px');
|
||||
var countHead = document.getElementById('count-head');
|
||||
countHead.setAttribute('style', 'font-size:14px');
|
||||
var exercises = document.getElementsByClassName('exercise');
|
||||
for (let i = 0; i < exercises.length; i++) {
|
||||
exercises[i].setAttribute('style', 'font-size:12px');
|
||||
}
|
||||
var muscleGroups = document.getElementsByClassName('muscle-group');
|
||||
for (let i = 0; i < muscleGroups.length; i++) {
|
||||
muscleGroups[i].setAttribute('style', 'font-size:12px');
|
||||
}
|
||||
var count = document.getElementsByClassName('count');
|
||||
for (let i = 0; i < count.length; i++) {
|
||||
count[i].setAttribute('style', 'font-size:12px');
|
||||
}
|
||||
}
|
||||
|
||||
function resizeElementsUp() {
|
||||
var pageTitle = document.getElementsByClassName('page-title');
|
||||
pageTitle[0].setAttribute('style', 'font-size:25px');
|
||||
var refs = document.getElementsByClassName('side-href');
|
||||
for (let i = 0; i < refs.length; i++) {
|
||||
refs[i].setAttribute('style', 'font-size:20px');
|
||||
}
|
||||
var mainCont = document.getElementById('main');
|
||||
mainCont.setAttribute('style', 'padding-left: 100px; padding-right: 100px;');
|
||||
var contentText = document.getElementsByClassName('content-text');
|
||||
for (let i = 0; i < contentText.length; i++) {
|
||||
contentText[i].setAttribute('style', 'font-size:20px');
|
||||
}
|
||||
var footer = document.getElementById('footer');
|
||||
footer.setAttribute('style', 'font-size:18px');
|
||||
var tableHeads = document.getElementsByClassName('table-head');
|
||||
for (let i = 0; i < tableHeads.length; i++) {
|
||||
tableHeads[i].setAttribute('style', 'font-size:16px');
|
||||
}
|
||||
var exerciseHead = document.getElementById('exercise-head');
|
||||
exerciseHead.setAttribute('style', 'font-size:16px');
|
||||
var muscleGroupHead = document.getElementById('muscle-group-head');
|
||||
muscleGroupHead.setAttribute('style', 'font-size:16px');
|
||||
var countHead = document.getElementById('count-head');
|
||||
countHead.setAttribute('style', 'font-size:16px');
|
||||
var exercises = document.getElementsByClassName('exercise');
|
||||
for (let i = 0; i < exercises.length; i++) {
|
||||
exercises[i].setAttribute('style', 'font-size:14px');
|
||||
}
|
||||
var muscleGroups = document.getElementsByClassName('muscle-group');
|
||||
for (let i = 0; i < muscleGroups.length; i++) {
|
||||
muscleGroups[i].setAttribute('style', 'font-size:14px');
|
||||
}
|
||||
var count = document.getElementsByClassName('count');
|
||||
for (let i = 0; i < count.length; i++) {
|
||||
count[i].setAttribute('style', 'font-size:14px');
|
||||
}
|
||||
}
|
||||
|
||||
function isMobileByScreenSize() {
|
||||
var width = window.innerWidth;
|
||||
var height = window.innerHeight;
|
||||
console.log('Height = ' + height);
|
||||
console.log('Width = ' + width);
|
||||
return (width - height) < 150;
|
||||
}
|
|
@ -128,7 +128,6 @@ a {
|
|||
font-style: normal;
|
||||
color: #E0E0E0;
|
||||
font-family: Arial;
|
||||
font-size: 20px;
|
||||
text-decoration: none;
|
||||
transition: 0.2s linear;
|
||||
}
|
||||
|
|
24
workout.html
24
workout.html
|
@ -7,7 +7,7 @@
|
|||
<link rel="icon" href="src/img/favicon.ico">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<body id="main">
|
||||
<header id="header" class="default">
|
||||
<div>
|
||||
<a href="index.html"><img class="header-img" src="src/img/dhaverd2.png"></a>
|
||||
|
@ -15,11 +15,11 @@
|
|||
</header>
|
||||
<main>
|
||||
<section class="side-bar">
|
||||
<p class="mainp"><a href="index.html">Главная</a></p>
|
||||
<p class="gitea"><a href="http:\\176.114.129.4:3000">Gitea</a></p>
|
||||
<p class="servers"><a href="servers.html">Сервера</a></p>
|
||||
<p class="mychat"><a href="mychat.html">MyChat</a></p>
|
||||
<p class="workout-area"><a href="workout.html">Программа тренировок</a></p>
|
||||
<p class="mainp"><a class="side-href" href="index.html">Главная</a></p>
|
||||
<p class="gitea"><a class="side-href" href="http:\\176.114.129.4:3000">Gitea</a></p>
|
||||
<p class="servers"><a class="side-href" href="servers.html">Сервера</a></p>
|
||||
<p class="mychat"><a class="side-href" href="mychat.html">MyChat</a></p>
|
||||
<p class="workout-area"><a class="side-href" href="workout.html">Программа тренировок</a></p>
|
||||
</section>
|
||||
<section class="main-content" id="main-content">
|
||||
<h1 class="page-title">Программа тренировок</h1>
|
||||
|
@ -28,9 +28,9 @@
|
|||
<td class="table-head" colspan="3"><b>Вторник: Грудь. Бицепсы. Пресс.</b></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td class="exercise-head"><strong>Упражнение</strong></td>
|
||||
<td class="muscle-group-head"><strong>Группа мышц</strong></td>
|
||||
<td class="count-head"><strong>Время/подходы</strong></td>
|
||||
<td class="exercise-head" id="exercise-head"><strong>Упражнение</strong></td>
|
||||
<td class="muscle-group-head" id="muscle-group-head"><strong>Группа мышц</strong></td>
|
||||
<td class="count-head" id="count-head"><strong>Время/подходы</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="exercise">Разминка</td>
|
||||
|
@ -73,7 +73,7 @@
|
|||
<td class="count">3x10</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="table-head" colspan="3"><b>Четвер: Плечи. Трицепсы.</b></td>
|
||||
<td class="table-head" colspan="3"><b>Четверг: Плечи. Трицепсы.</b></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td class="exercise">Разминка</td>
|
||||
|
@ -158,9 +158,9 @@
|
|||
</main>
|
||||
<footer>
|
||||
<section>
|
||||
<p>® Dhaverd 2022</p>
|
||||
<p id="footer">® Dhaverd 2022</p>
|
||||
</section>
|
||||
</footer>
|
||||
</body>
|
||||
<script src="src/scripts/index.js"></script>
|
||||
<script src="src/scripts/workout.js"></script>
|
||||
</html>
|
Loading…
Reference in New Issue