Browse Source

update search page styles

main
ghost 1 year ago
parent
commit
39ddb966c1
  1. 123
      src/webui/search.php

123
src/webui/search.php

@ -143,12 +143,38 @@ $results = $query->offset($p * $config->webui->pagination->limit - $config->webu
top: 0; top: 0;
left: 0; left: 0;
right: 0; right: 0;
z-index: 2;
} }
main { main {
margin-top: 110px; margin-top: 80px;
margin-bottom: 76px; margin-bottom: 76px;
padding: 0 20px; padding: 0 32px;
}
main > div {
border-top: 1px #000 dashed;
font-size: 14px;
margin: 0 auto;
max-width: 620px;
padding: 8px 0;
position: relative;
}
main > div > img {
left: -24px;
position: absolute;
top: 18px;
}
main > div > div {
padding: 8px 0;
line-height: 16px;
}
main > div > div > a {
font-size: 12px;
} }
h1 { h1 {
@ -170,9 +196,8 @@ $results = $query->offset($p * $config->webui->pagination->limit - $config->webu
h2 { h2 {
display: block; display: block;
font-size: 16px; font-size: 15px;
font-weight: normal; font-weight: normal;
margin: 4px 0;
color: #fff; color: #fff;
} }
@ -238,33 +263,12 @@ $results = $query->offset($p * $config->webui->pagination->limit - $config->webu
a, a:visited, a:active { a, a:visited, a:active {
color: #9ba2ac; color: #9ba2ac;
font-size: 12px;
margin-top: 8px;
} }
a:hover { a:hover {
color: #54a3f7; color: #54a3f7;
} }
img.icon {
float: left;
border-radius: 50%;
margin-right: 8px;
}
img.image {
max-width: 100%;
border-radius: 3px;
}
div {
max-width: 640px;
margin: 0 auto;
padding: 16px 0;
border-top: 1px #000 dashed;
font-size: 14px
}
span { span {
display: block; display: block;
margin: 8px 0; margin: 8px 0;
@ -276,10 +280,6 @@ $results = $query->offset($p * $config->webui->pagination->limit - $config->webu
font-size: 11px; font-size: 11px;
} }
p > a, p > a:visited, p > a:active {
font-size: 11px;
}
.text-warning { .text-warning {
color: #db6161; color: #db6161;
} }
@ -297,8 +297,6 @@ $results = $query->offset($p * $config->webui->pagination->limit - $config->webu
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0"/> <path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0"/>
</svg> </svg>
</sub> </sub>
&nbsp;
<?php echo _('Search'); ?>
</button> </button>
</form> </form>
</header> </header>
@ -306,30 +304,23 @@ $results = $query->offset($p * $config->webui->pagination->limit - $config->webu
<?php if ($response) { ?> <?php if ($response) { ?>
<div><?php echo $response ?></div> <div><?php echo $response ?></div>
<?php } ?> <?php } ?>
<?php if ($results->getTotal()) { ?> <div><?php echo sprintf(_('Found: %s'), number_format($results->getTotal())) ?></div>
<?php foreach ($results as $result) { ?> <?php foreach ($results as $result) { ?>
<div> <div>
<?php if (!empty($result->url)) { ?>
<h2><?php echo $result->title ?></h2>
<?php } ?>
<?php if (!empty($result->description)) { ?>
<span><?php echo $result->description ?></span>
<?php } ?>
<?php if (!empty($result->keywords)) { ?>
<span><?php echo $result->keywords ?></span>
<?php } ?>
<a href="<?php echo $result->url ?>">
<?php <?php
$identicon = new \Jdenticon\Identicon();
$identicon->setValue( $hostname = parse_url(
parse_url(
$result->url, $result->url,
PHP_URL_HOST PHP_URL_HOST
)
); );
$identicon->setSize(16); $identicon = new \Jdenticon\Identicon();
$identicon->setValue(
$hostname
);
$identicon->setSize(14);
$identicon->setStyle( $identicon->setStyle(
[ [
@ -337,28 +328,38 @@ $results = $query->offset($p * $config->webui->pagination->limit - $config->webu
'padding' => 0 'padding' => 0
] ]
); );
$icon = $identicon->getImageDataUri('webp');
?> ?>
<img src="<?php echo $identicon->getImageDataUri('webp') ?>" alt="identicon" width="16" height="16" class="icon" /> <img src="<?php echo $icon ?>" title="<?php echo $hostname ?>" alt="identicon" />
<?php echo htmlentities(urldecode($result->url)) ?> <?php if (!empty($result->title)) { ?>
</a> <div>
<!-- @TODO <h2><?php echo $result->title ?></h2>
| </div>
<a href="<?php echo $config->webui->url->base; ?>/snap"> <?php } ?>
<?php echo _('cache'); ?> <?php if (!empty($result->description)) { ?>
</a> <div><?php echo $result->description ?></div>
--> <?php } ?>
<?php if (!empty($result->keywords)) { ?>
<div>
<?php echo $result->keywords ?>
</div>
<?php } ?>
<div>
<a href="<?php echo $result->url ?>"><?php echo htmlentities(urldecode($result->url)) ?></a>
<small>&bull;</small>
<a rel="nofollow" href="<?php echo $config->webui->url->base; ?>/explore.php?i=<?php echo $result->getId() ?>"><?php echo _('explore') ?></a>
</div>
</div> </div>
<?php } ?> <?php } ?>
<?php if ($p * $config->webui->pagination->limit <= $results->getTotal()) { ?> <?php if ($p * $config->webui->pagination->limit <= $results->getTotal()) { ?>
<div>
<div> <div>
<a href="<?php echo $config->webui->url->base; ?>/search.php?q=<?php echo urlencode(htmlentities($q)) ?>&p=<?php echo $p + 1 ?>"> <a href="<?php echo $config->webui->url->base; ?>/search.php?q=<?php echo urlencode(htmlentities($q)) ?>&p=<?php echo $p + 1 ?>">
<?php echo _('Next page') ?> <?php echo _('More') ?>
</a> </a>
</div> </div>
<?php } ?>
<?php } else { ?>
<div>
<?php echo _('Nothing found!') ?>
</div> </div>
<?php } ?> <?php } ?>
</main> </main>

Loading…
Cancel
Save