feat: адаптация шаблонов для мобильных устройств

This commit is contained in:
Vlad 2025-04-20 01:26:01 +03:00
parent c2d60d946c
commit 1799493a4a
3 changed files with 227 additions and 120 deletions

View File

@ -11,104 +11,74 @@
title, but the fact that it has been damaged for sure. Our site helps people avoid buying a damaged vehicle
in the past.
</p>
<div class="wrapper">
<!--
-->
</div>
</div>
<br><br>
<table border="0" cellspacing="0" cellpadding="0" align="center" style="padding: 0px 0px 0px 0px">
<tr>
<td width="500px">
<table id="hor-minimalist-a" summary="Salvage cars;Database page 1">
<thead>
<tr>
<th scope="col">Make</th>
<th scope="col">Model</th>
<th scope="col">Year</th>
<th scope="col">
<center>VIN</center>
</th>
</tr>
</thead>
<tbody>
{% for it in pg%}
{% if it[0] <=25 %}
<tr>
<td>{{it[2]}}</td>
<td>{{it[3][0:14]}}</td>
<td>{{it[4]}}</td>
<td style="text-align:right;"><a href="/detail/{{it[1]}}.html"
title="vin check - {{it[1]}} ">{{it[1]}}<i
class="icon-search"></i></a></td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</td>
<td width="500px">
<table id="hor-minimalist-a" summary="Salvage cars;Database page 1">
<thead>
<tr>
<th scope="col">Make</th>
<th scope="col">Model</th>
<th scope="col">Year</th>
<th scope="col">
<center>VIN</center>
</th>
</tr>
</thead>
{% for it in pg%}
{% if it[0] >25 %}
<tr>
<td>{{it[2]}}</td>
<td>{{it[3][0:14]}}</td>
<td>{{it[4]}}</td>
<td style="text-align:right;"><a href="/detail/{{it[1]}}.html"
title="vin check - {{it[1]}} ">{{it[1]}}<i
class="icon-search"></i></a></td>
</tr>
{% endif %}
{% endfor %}
</table>
</td>
</table>
<div class="table-responsive">
<table id="hor-minimalist-a" summary="Salvage cars;Database page 1">
<thead>
<tr>
<th scope="col">Make</th>
<th scope="col">Model</th>
<th scope="col">Year</th>
<th scope="col">VIN</th>
</tr>
</thead>
<tbody>
{% for it in pg%}
<tr>
<td>{{it[2]}}</td>
<td>{{it[3][0:14]}}</td>
<td>{{it[4]}}</td>
<td><a href="/detail/{{it[1]}}.html" title="vin check - {{it[1]}}">{{it[1]}}<i class="icon-search"></i></a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<br><br>
<div class="row">
<div class="span4">&nbsp;</div>
<div class="span4 offset1">
{% if cur_page==1 %}
<button class="btn">1</button>
<a class="btn" href="/database/page2.html">2</a>
<a class="btn" href="/database/page3.html">3</a>
<a class="btn" href="/database/page2.html">Next</a>
<a class="btn" href="/database/page{{max_page}}.html">Last</a>
{% endif %}
{% if cur_page==max_page %}
<a class="btn" href="/database/page{{max_page-1}}.html">Prev</a>
<a class="btn" href="/database/page{{max_page-2}}.html">{{max_page-2}}</a>
<a class="btn" href="/database/page{{max_page-1}}.html">{{max_page-2}}</a>
<button class="btn">{{cur_page}}</button>
{% endif %}
{% if cur_page!=1 and cur_page!=max_page %}
<div class="pagination-container">
<div class="pagination">
{% if cur_page > 1 %}
<a class="btn" href="/database/page1.html">First</a>
<a class="btn" href="/database/page{{cur_page-1}}.html">Prev</a>
<button class="btn">{{cur_page}}</button>
{% endif %}
{% if cur_page > 3 %}
<span class="btn disabled">...</span>
{% endif %}
{% set start_page = cur_page - 2 %}
{% if start_page < 1 %}
{% set start_page = 1 %}
{% endif %}
{% set end_page = cur_page + 2 %}
{% if end_page > max_page %}
{% set end_page = max_page %}
{% endif %}
{% for page in range(start_page, end_page + 1) %}
{% if page == cur_page %}
<button class="btn active">{{page}}</button>
{% else %}
<a class="btn" href="/database/page{{page}}.html">{{page}}</a>
{% endif %}
{% endfor %}
{% if cur_page < max_page-2 %}
<span class="btn disabled">...</span>
{% endif %}
{% if cur_page < max_page %}
<a class="btn" href="/database/page{{cur_page+1}}.html">Next</a>
<a class="btn" href="/database/page{{max_page}}.html">Last</a>
{% endif %}
{% endif %}
</div>
</div>
</div><br>
</div>
<br>
<hr>
{% endblock %}

View File

@ -1,6 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="x-dns-prefetch-control" content="on">
<meta name="bothunter-verification" content="b6173305926f27509754d5b9e3a2deafd8ac1129">
@ -21,6 +23,156 @@
<link href="/static/plus.css" rel="stylesheet">
<link href="/static/plus2.css" rel="stylesheet">
<style type="text/css">
@media (max-width: 768px) {
.navbar-inner {
padding: 0 10px;
}
.search_box {
width: 100%;
max-width: 300px;
}
.container {
padding: 0 15px;
}
.hero-unit {
padding: 20px;
}
.hero-unit h1 {
font-size: 24px;
}
img {
max-width: 100%;
height: auto;
}
.search-container {
width: 100%;
padding: 0 15px;
}
.search-wrapper {
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
}
.search-wrapper input {
width: 100%;
max-width: 300px;
}
.search-wrapper button {
width: 100%;
max-width: 300px;
}
.vin-image {
max-width: 100%;
height: auto;
}
.navbar .nav > li > a {
padding: 10px 8px;
}
}
.search-title {
text-align: center;
width: 100%;
margin-bottom: 20px;
}
.search-title h2 {
display: inline-block;
margin: 0;
}
.table-responsive {
width: 100%;
margin-bottom: 20px;
}
#hor-minimalist-a {
width: 100%;
border-collapse: collapse;
}
#hor-minimalist-a th {
padding: 8px;
text-align: left;
background: #f5f5f5;
font-size: 14px;
}
#hor-minimalist-a td {
padding: 8px;
border-bottom: 1px solid #ddd;
font-size: 14px;
}
#hor-minimalist-a td a {
word-break: break-all;
}
@media (max-width: 768px) {
#hor-minimalist-a th,
#hor-minimalist-a td {
padding: 6px;
font-size: 12px;
}
#hor-minimalist-a td:nth-child(2) {
max-width: 200px;
word-break: break-word;
}
#hor-minimalist-a td:nth-child(4) {
max-width: 150px;
word-break: break-all;
}
}
.pagination-container {
display: flex;
justify-content: center;
margin: 20px 0;
}
.pagination {
display: flex;
flex-wrap: wrap;
gap: 5px;
justify-content: center;
}
.pagination .btn {
padding: 6px 12px;
margin: 0;
border: 1px solid #ddd;
background: #fff;
color: #333;
text-decoration: none;
border-radius: 3px;
}
.pagination .btn:hover {
background: #f5f5f5;
}
.pagination .btn.active {
background: #007bff;
color: #fff;
border-color: #007bff;
}
.pagination .btn.disabled {
color: #999;
cursor: not-allowed;
background: #f5f5f5;
}
@media (max-width: 768px) {
.pagination {
gap: 3px;
}
.pagination .btn {
padding: 4px 8px;
font-size: 12px;
}
}
</style>
@ -64,7 +216,6 @@
<li class="active"><a href="/">Home</a></li>
<li class="no2"><a href="/database/page1.html">Salvage vehicles</a></li>
<li class="no3"><a href="/decodevin.html">Decode VIN</a></li>
<li class="no4"><a href="https://www.salvagedb.com/#">Salvage catalog</a></li>
<li class="no6"><a href="mailto:info@salvagedb.com">Contact</a></li>
</ul>
</div>

View File

@ -11,49 +11,35 @@
title, but the fact that it has been damaged for sure. Our site helps people avoid buying a damaged vehicle
in the past.
</p>
<div class="wrapper">
<!--
-->
</div>
</div>
<br><br>
<div class="container-fluid">
<div class="row-fluid">
<center>
<form id="search_bar" action="/decode" method="post">
<div style="display: inline-block;">
<h2 id="find_your_car">ENTER <a href="https://en.wikipedia.org/wiki/Vehicle_Identification_Number"
target="_blank">VIN</a> YOU CAR</h2>
<input type="text" id="vininput" name="q" class="search_box ui-autocomplete-input" autocomplete="off"
value="" role="textbox" autofocus="" required="" validate="length_between,17,17">
<button class="g-recaptcha btn btn-primary" type="submit" data-sitekey="{{capcha_site}}" id="go_button" data-callback='onSubmit' data-action='submit' style="margin-bottom: 10px;">Check It</button>
<center>
<form id="search_bar" action="/decode" method="post">
<div class="search-container">
<div class="search-title">
<h2 id="find_your_car">ENTER <a href="https://en.wikipedia.org/wiki/Vehicle_Identification_Number" target="_blank">VIN</a> YOU CAR</h2>
</div>
</form>
<div class="search-wrapper">
<input type="text" id="vininput" name="q" class="search_box ui-autocomplete-input"
autocomplete="off" value="" role="textbox" autofocus required
validate="length_between,17,17">
<button class="g-recaptcha btn btn-primary" type="submit"
data-sitekey="{{capcha_site}}" id="go_button"
data-callback='onSubmit' data-action='submit'>Check It</button>
</div>
</div>
</form>
</center>
</div>
</div>
</div>
<h2 style="text-align: center;">Over {{ cnt }} salvage vehicles added.</h2>
<br>
<center>
</center>
<br>
<br><br>
<center>
<img src="static/vin-position1.gif">
<img src="static/vin-position1.gif" class="vin-image">
</center>
<br>
<script>