devtools less hacky

This commit is contained in:
olebeck 2022-09-19 17:10:17 +02:00
parent af0fb3d719
commit bd7fa4620e
2 changed files with 259 additions and 308 deletions

View File

@ -150,7 +150,6 @@ function getIcon(string $file)
return "/img/logo.png"; return "/img/logo.png";
} }
} }
?> ?>
<div class="devtoollist"> <div class="devtoollist">
@ -171,211 +170,171 @@ function getIcon(string $file)
echo "<h1>What are you looking for?</h1>"; echo "<h1>What are you looking for?</h1>";
} }
if($type == "") if($type == "") { ?>
{ <a href="?type=unity" class="devtool" id="unity">
echo'<div class="devtool" id="unity" onclick="open_url(\'?type=unity\')">
<a href="?type=unity" class="image">
<img src="/img/unity_icon.png" width="128" height="128" class="bubble"> <img src="/img/unity_icon.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
PSM Unity PSM Unity
</span> </span>
</a> </a>
</div>
<div class="devtool" id="psm" onclick="open_url(\'?type=psm\')"> <a href="?type=psm" class="devtool" id="psm">
<a href="?type=psm" class="image">
<img src="/img/psm_icon.png" width="128" height="128" class="bubble"> <img src="/img/psm_icon.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
PSM PSM
</span> </span>
</a> </a>
</div>
<div class="devtool" id="android" onclick="open_url(\'?type=psm-android\')"> <a href="?type=psm-android" class="devtool" id="android" >
<a href="?type=psm-android" class="image">
<img src="/img/androiddev.png" width="128" height="128" class="bubble"> <img src="/img/androiddev.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
PSM Android PSM Android
</span> </span>
</a> </a>
</div>
<div class="devtool" id="tools" onclick="open_url(\'?type=psm-tools\')"> <a href="?type=psm-tools" class="devtool" id="tools">
<a href="?type=psm-tools" class="image">
<img src="/img/tools.png" width="128" height="128" class="bubble"> <img src="/img/tools.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
Unofficial Tools Unofficial Tools
</span> </span>
</a> </a>
</div>'; <?php
} }
elseif($type == "psm") elseif($type == "psm")
{ {
echo'<div class="devtool" id="psmsdk" onclick="open_url(\'?type=psm-sdk\')"> ?>
<a href="?type=psm-sdk" class="image"> <a href="?type=psm-sdk" class="devtool" id="psmsdk">
<img src="/img/sdk.png" width="128" height="128" class="bubble"> <img src="/img/sdk.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
PSM SDK PSM SDK
</span> </span>
</a> </a>
</div>
<div class="devtool" id="psmruntime" onclick="open_url(\'?type=psm-runtime\')"> <a href="?type=psm-runtime" class="devtool" id="psmruntime">
<a href="?type=psm-runtime" class="image">
<img src="/img/psmruntime.png" width="128" height="128" class="bubble"> <img src="/img/psmruntime.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
PSM Runtime PSM Runtime
</span> </span>
</a> </a>
</div>
<div class="devtool" id="psmdev" onclick="open_url(\'?type=psm-dev\')"> <a href="?type=psm-dev" class="devtool" id="psmdev">
<a href="?type=psm-dev" class="image">
<img src="/img/psmdev.png" width="128" height="128" class="bubble"> <img src="/img/psmdev.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
Dev Assistant Dev Assistant
</span> </span>
</a> </a>
</div>
<div class="devtool" id="psdp" onclick="open_url(\'?type=psm-psdp\')"> <a href="?type=psm-psdp" class="devtool" id="psdp">
<a href="?type=psm-psdp" class="image">
<img src="/img/psdp.png" width="128" height="128" class="bubble"> <img src="/img/psdp.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
PSDP Packages PSDP Packages
</span> </span>
</a> </a>
</div>
<div class="devtool" id="docs" onclick="open_url(\'?type=psm-docs\')"> <a href="?type=psm-docs" class="devtool" id="docs">
<a href="?type=psm-docs" class="image">
<img src="/img/docs.png" width="128" height="128" class="bubble"> <img src="/img/docs.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
Documentation Documentation
</span> </span>
</a> </a>
</div>
<div class="devtool" id="sources" onclick="open_url(\'?type=psm-sources\')"> <a href="?type=psm-sources" class="devtool" id="sources">
<a href="?type=psm-sources" class="image">
<img src="/img/sources.png" width="128" height="128" class="bubble"> <img src="/img/sources.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
PSM Sources PSM Sources
</span> </span>
</a> </a>
</div>
<div class="devtool" id="keys" onclick="open_url(\'?type=psm-offical-keys\')"> <a href="?type=psm-offical-keys" class="devtool" id="keys">
<a href="?type=psm-offical-keys" class="image">
<img src="/img/psmda_keys.png" width="128" height="128" class="bubble"> <img src="/img/psmda_keys.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
Publisher Keys Publisher Keys
</span> </span>
</a> </a>
</div>
<a href="?type=psm-drivers" class="devtool" id="drivers">
<div class="devtool" id="drivers" onclick="open_url(\'?type=psm-drivers\')">
<a href="?type=psm-drivers" class="image">
<img src="/img/psm-drivers.png" width="128" height="128" class="bubble"> <img src="/img/psm-drivers.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
PSM Drivers PSM Drivers
</span> </span>
</a> </a>
</div> <?php
';
} }
elseif($type == "psm-sources") elseif($type == "psm-sources")
{ {
echo'<div class="devtool" id="monosrc" onclick="open_url(\'?type=psm-mono-src\')"> ?>
<a href="?type=psm-mono-src" class="image"> <a href="?type=psm-mono-src" class="devtool" id="monosrc">
<img src="/img/mono.png" width="128" height="128" class="bubble"> <img src="/img/mono.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
PSM Mono Src PSM Mono Src
</span> </span>
</a> </a>
</div>
<div class="devtool" id="gamessrc" onclick="open_url(\'?type=psm-games-src\')"> <a href="?type=psm-games-src" class="devtool" id="gamessrc">
<a href="?type=psm-games-src" class="image">
<img src="/img/games.png" width="128" height="128" class="bubble"> <img src="/img/games.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
PSM Games Src PSM Games Src
</span> </span>
</a> </a>
</div> <?php
';
} }
elseif($type == "unity") elseif($type == "unity")
{ {
echo'<div class="devtool" id="unityexport" onclick="open_url(\'?type=unity-support\')"> ?>
<a href="?type=unity-support" class="image"> <a href="?type=unity-support" class="devtool" id="unityexport">
<img src="/img/export.png" width="128" height="128" class="bubble"> <img src="/img/export.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
Unity Exports Unity Exports
</span> </span>
</a> </a>
</div>
<div class="devtool" id="unitydev" onclick="open_url(\'?type=unity-dev\')"> <a href="?type=unity-dev" class="devtool" id="unitydev">
<a href="?type=unity-dev" class="image">
<img src="/img/unitydev.png" width="128" height="128" class="bubble"> <img src="/img/unitydev.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
Dev Assistant Dev Assistant
</span> </span>
</a> </a>
</div>
<div class="devtool" id="unitydocs" onclick="open_url(\'?type=unity-docs\')"> <a href="?type=unity-docs" class="devtool" id="unitydocs">
<a href="?type=unity-docs" class="image">
<img src="/img/docs.png" width="128" height="128" class="bubble"> <img src="/img/docs.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
Documentation Documentation
</span> </span>
</a> </a>
</div>
<div class="devtool" id="unityassets" onclick="open_url(\'?type=unity-assets\')"> <a href="?type=unity-assets" class="devtool" id="unityassets">
<a href="?type=unity-assets" class="image">
<img src="/img/psm-drivers.png" width="128" height="128" class="bubble"> <img src="/img/psm-drivers.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
Assets Assets
</span> </span>
</a> </a>
</div>
<div class="devtool" id="unitytools" onclick="open_url(\'?type=unity-tools\')"> <a href="?type=unity-tools" class="devtool" id="unitytools">
<a href="?type=unity-tools" class="image">
<img src="/img/tools.png" width="128" height="128" class="bubble"> <img src="/img/tools.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
Tools for Unity Tools for Unity
</span> </span>
</a> </a>
</div>
<div class="devtool" id="unity-psdp" onclick="open_url(\'?type=unity-psdp\')"> <a href="?type=unity-psdp" class="devtool" id="unity-psdp">
<a href="?type=unity-psdp" class="image">
<img src="/img/psdp.png" width="128" height="128" class="bubble"> <img src="/img/psdp.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
PSDP Packages PSDP Packages
</span> </span>
</a> </a>
</div> <?php
';
} }
else else
{ {
$dirlist = glob($type.'/*'); $dirlist = glob($type.'/*');
foreach ($dirlist as &$path) { foreach ($dirlist as &$path) { ?>
echo '<div class="devtool" onclick="open_url(\''.$path.'\')"> <a href="'.$path.'" class="devtool" title="<?php echo basename($path) ?>">
<a href="'.$path.'" class="image" title="'.basename($path).'"> <img src="<?php echo getIcon($path) ?>" width="128" height="128" class="bubble">
<img src="'.getIcon($path).'" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
'.getName(pathinfo(basename($path), PATHINFO_FILENAME)).' <?php echo getName(pathinfo(basename($path), PATHINFO_FILENAME)) ?>
</span> </span>
</a> </a>
</div>'; <?php }
}
} }
?> ?>
</div> </div>

View File

@ -1,10 +1,6 @@
<?php include("common.php"); ?> <?php include("common.php"); ?>
<!DOCTYPE html>
<html> <?php
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<script src="common.js"></script>
<?php
$title = ""; $title = "";
$description = ""; $description = "";
$image = ""; $image = "";
@ -44,11 +40,6 @@
$title .= "PSM Reborn"; $title .= "PSM Reborn";
/*
* Write title
*/
echo("<title>".$title."</title>\n");
if(strpos($url, 'libary.php') !== false) if(strpos($url, 'libary.php') !== false)
{ {
if(isset($_GET["game"])) if(isset($_GET["game"]))
@ -93,15 +84,6 @@
$descsocial = str_replace('"', '', $descsocial); $descsocial = str_replace('"', '', $descsocial);
$descsocial = str_replace("'", "", $descsocial); $descsocial = str_replace("'", "", $descsocial);
/*
* Write metadata
*/
echo('<meta charset="utf-8">');
echo('<meta name="robots" content="all">');
echo('<meta name="viewport" content="width=1000; user-scalable=0;"/>');
echo('<meta name="Description" content="'.$descsocial.'"/>');
/* /*
* Default Image * Default Image
*/ */
@ -109,18 +91,28 @@
{ {
$image .= 'http://'.$_SERVER['HTTP_HOST'].'/img/logo.png'; $image .= 'http://'.$_SERVER['HTTP_HOST'].'/img/logo.png';
} }
/* ?>
* Social Media
*/
echo('<meta property="og:image" content="'.$image.'"/>'); <!DOCTYPE html>
echo('<meta property="og:title" content="'.$title.'"/>'); <html>
echo('<meta property="og:description" content="'.$descsocial.'"/>'); <head>
<link rel="stylesheet" type="text/css" href="style.css">
<script src="common.js"></script>
echo('<meta property="twitter:image" content="'.$image.'"/>'); <title><?php echo $title ?></title>
echo('<meta property="twitter:title" content="'.$title.'"/>');
echo('<meta property="twitter:description" content="'.$descsocial.'"/>'); <meta charset="utf-8">
?> <meta name="robots" content="all">
<meta name="viewport" content="width=1000; user-scalable=0;"/>
<meta name="Description" content="<?php echo $descsocial?>"/>
<meta property="og:image" content="<?php echo $image ?>"/>
<meta property="og:title" content="<?php echo $title ?>"/>
<meta property="og:description" content="<?php echo $descsocial ?>"/>
<meta property="twitter:image" content="<?php echo $image ?>"/>
<meta property="twitter:title" content="<?php echo $title ?>"/>
<meta property="twitter:description" content="<?php echo $descsocial ?>"/>
</head> </head>
<body> <body>
<div class="header"> <div class="header">