Przeglądaj źródła

[mod] web page modification

Dalf 11 lat temu
rodzic
commit
7915b5c5a0

+ 78
- 45
searx/static/css/style.css Wyświetl plik

@@ -2,8 +2,22 @@ html {
2 2
   font-family: sans-serif;
3 3
   font-size: 0.9em;
4 4
   -webkit-text-size-adjust: 100%;
5
-      -ms-text-size-adjust: 100%;
5
+  -ms-text-size-adjust: 100%;
6
+  -moz-text-size-adjust: 100%;
6 7
   color: #444444;
8
+  padding: 0;
9
+  margin: 0;
10
+}
11
+
12
+body, #container {
13
+  padding: 0;
14
+  margin: 0;
15
+}
16
+
17
+#container {
18
+    width: 100%;
19
+    position: absolute;
20
+    top: 0;
7 21
 }
8 22
 
9 23
 .row { max-width: 800px; margin: auto; text-align: justify; }
@@ -22,57 +36,49 @@ h1 { font-size: 5em; }
22 36
 div.title { background: url('/static/img/searx.png') no-repeat; width: 100%; background-position: center; }
23 37
 div.title h1 { visibility: hidden; }
24 38
 
25
-
26 39
 input[type="submit"] { border: 1px solid #666666; color: #444444;  padding: 4px; background-color: #FFFFFF; margin-left: 8px; }
27 40
 
28 41
 input[type="checkbox"] { visibility: hidden; }
29 42
 
30
-.checkbox_container { display: inline-block; position: relative; padding-left: 3px; margin: 0 10px; }
43
+#categories { margin: 0 10px; }
44
+
45
+.checkbox_container { display: inline-block; position: relative; margin: 0 3px; padding: 0px; }
46
+.checkbox_container input {
47
+    display: none;
48
+}
31 49
 .checkbox_container label {
32 50
     cursor: pointer;
51
+    padding: 4px 10px;
52
+    margin: 0;
53
+    display: block;
54
+    text-transform: capitalize;
55
+
56
+    -webkit-touch-callout: none;
57
+    -webkit-user-select: none;
58
+    -khtml-user-select: none;
59
+    -moz-user-select: none;
60
+    -ms-user-select: none;
61
+    user-select: none;
33 62
 }
34
-.checkbox_container label.cb {
35
-    position: absolute;
36
-    width: 16px;
37
-    height: 16px;
38
-    top: 2px;
39
-    left: 2px;
40
-    background: #eee;
41
-    border:1px solid #ddd;
42
-}
43
-.checkbox_container label.cb:after {
44
-    opacity: 0.2;
45
-    content: '';
46
-    position: absolute;
47
-    width: 8px;
48
-    height: 4px;
49
-    background: transparent;
50
-    top: 3px;
51
-    left: 3px;
52
-    border: 3px solid #333;
53
-    border-top: none;
54
-    border-right: none;
55
-
56
-    -webkit-transform: rotate(-45deg);
57
-    -moz-transform: rotate(-45deg);
58
-    -o-transform: rotate(-45deg);
59
-    -ms-transform: rotate(-45deg);
60
-    transform: rotate(-45deg);
63
+
64
+.checkbox_container input[type="checkbox"]:checked + label {
65
+    background: #b8c1d9;
61 66
 }
62
-.checkbox_container label.cb:hover:after {
63
-    opacity: 0.5;
67
+
68
+.search .checkbox_container label {
69
+    border-bottom: 4px solid #e8e7e6;
64 70
 }
65
-.checkbox_container input[type=checkbox]:checked + label.cb:after {
66
-    opacity: 1;
71
+
72
+.search .checkbox_container input[type="checkbox"]:checked + label { 
73
+    border-bottom: 4px solid #8098d9;
67 74
 }
68 75
 
69 76
 a { text-decoration: none; }
70 77
 
71
-
72 78
 .result { margin-bottom: 16px; clear: both; }
73 79
 .result_title { margin-bottom: 0; }
74
-.result p { margin-top: 0; padding-top: 0; font-size: 0.8em; max-width: 54em; }
75
-.result h3 { font-size: 0.9em;}
80
+.result p { margin-top: 0; padding-top: 0; font-size: 0.8em; max-width: 54em; word-wrap:break-word; }
81
+.result h3 { font-size: 0.9em; word-wrap:break-word; }
76 82
 .result { max-width: 70em; }
77 83
 
78 84
 .url { font-weight: bold; word-wrap:break-word; }
@@ -85,6 +91,8 @@ a { text-decoration: none; }
85 91
 
86 92
 .small p { margin: 2px 0; }
87 93
 
94
+.search { background: #e8e7e6; padding: 0; margin: 0 }
95
+
88 96
 .right { float: right; }
89 97
 
90 98
 .invisible { display: none; }
@@ -103,8 +111,7 @@ a { text-decoration: none; }
103 111
 td { padding: 0 4px; }
104 112
 tr:hover td { background: #DDDDDD; }
105 113
 
106
-
107
-#search_wrapper { position: relative; max-width: 600px; margin: 10px; }
114
+#search_wrapper { position: relative; max-width: 600px; padding: 10px; }
108 115
 .center #search_wrapper { margin-left: auto; margin-right: auto; }
109 116
 .q {
110 117
     background: none repeat scroll 0 0 #FFFFFF;
@@ -124,8 +131,8 @@ tr:hover td { background: #DDDDDD; }
124 131
 }
125 132
 #search_submit {
126 133
     position: absolute;
127
-    top: 5px;
128
-    right: 0px;
134
+    top: 15px;
135
+    right: 4px;
129 136
     padding: 0;
130 137
     border: 0;
131 138
     background: url('/static/img/search-icon.png') no-repeat;
@@ -135,14 +142,40 @@ tr:hover td { background: #DDDDDD; }
135 142
     height: 30px;
136 143
 }
137 144
 
138
-#results { margin-left: 10px; margin-top: 10px; }
145
+#results { margin-left: 10px; margin-top: 10px; margin-right: 10px; }
139 146
 
140 147
 #suggestions { max-width: 50em;}
141 148
 #suggestions form { display: inline; }
142 149
 #suggestions input { padding: 2px 6px; margin: 2px 4px;  font-size: 0.8em; display: inline-block; background: #E4E4E4; border-radius: 4px; border: 0; cursor: pointer; }
143 150
 
144
-@media screen and (max-width: 740px) {
145
-  .right { margin: 5px; } 
151
+#preferences { 
152
+    top: 10px;
153
+    padding: 0;
154
+    border: 0;
155
+    background: url('/static/img/preference-icon.png') no-repeat;
156
+    background-size: 28px 28px;
157
+    opacity: 0.8;
158
+    width: 28px;
159
+    height: 30px;
160
+    display: block;
161
+}
162
+
163
+#preferences * {
164
+    display: none;
165
+}
166
+
167
+#apis {
168
+    clear: both;
169
+}
170
+
171
+@media screen and (max-width: 680px) {
172
+  #search_wrapper { width: 90%; clear:both; }
173
+
174
+  .right { display: none; postion: fixed !important; top: 100px; right: 0px; }
175
+
176
+  #categories { font-size: 80% }
177
+  
178
+  #categories .checkbox_container { margin-top: 2px; margin: 0 2px; }
146 179
 
147
-  #search_wrapper { max-width: 90%; clear:both }
180
+  .result img { max-width: 90%; width: auto; height: auto }
148 181
 }

+ 3
- 1
searx/templates/categories.html Wyświetl plik

@@ -1,5 +1,7 @@
1
+<div id="categories">
1 2
 {% for category in categories %}
2 3
     <div class="checkbox_container">
3
-        <input type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} /><label for="checkbox_{{ category|replace(' ', '_') }}" class="cb"></label><label for="checkbox_{{ category|replace(' ', '_') }}">{{ category }}</label>
4
+        <input type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} /></label><label for="checkbox_{{ category|replace(' ', '_') }}">{{ category }}</label>
4 5
     </div>
5 6
 {% endfor %}
7
+</div>

+ 14
- 12
searx/templates/results.html Wyświetl plik

@@ -1,8 +1,8 @@
1 1
 {% extends "base.html" %}
2 2
 {% block title %}{{ q }} - {% endblock %}
3 3
 {% block content %}
4
-<div class="right"><a href="/preferences">preferences</a></div>
5
-<div class="small">
4
+<div class="right"><a href="/preferences" id="preferences"><span>preferences</span></a></div>
5
+<div class="small search">
6 6
     {% include 'search.html' %}
7 7
 </div>
8 8
 <div id="results">
@@ -19,19 +19,21 @@
19 19
             {% include 'result_templates/default.html' %}
20 20
         {% endif %}
21 21
     {% endfor %}
22
-    <form method="post" action="/">
22
+    <div id="apis">
23
+      <form method="post" action="/">
23 24
         <div class="left">
24
-            <input type="hidden" name="q" value="{{ q }}" />
25
-            <input type="hidden" name="format" value="csv" />
26
-            <input type="submit" value="download results in csv" />
25
+          <input type="hidden" name="q" value="{{ q }}" />
26
+          <input type="hidden" name="format" value="csv" />
27
+          <input type="submit" value="download results in csv" />
27 28
         </div>
28
-    </form>
29
-    <form method="post" action="/">
29
+      </form>
30
+      <form method="post" action="/">
30 31
         <div class="">
31
-            <input type="hidden" name="q" value="{{ q }}" />
32
-            <input type="hidden" name="format" value="json" />
33
-            <input type="submit" value="download results in json" />
32
+          <input type="hidden" name="q" value="{{ q }}" />
33
+          <input type="hidden" name="format" value="json" />
34
+          <input type="submit" value="download results in json" />
34 35
         </div>
35
-    </form>
36
+      </form>
37
+    </div>
36 38
 </div>
37 39
 {% endblock %}

+ 3
- 5
searx/templates/search.html Wyświetl plik

@@ -1,9 +1,7 @@
1 1
 <form method="post" action="/" id="search_form">
2
-<div id="search_wrapper">
2
+  <div id="search_wrapper">
3 3
     <input type="text" id="q" class="q" name="q" tabindex="1" autocomplete="off" {% if q %}value="{{ q }}"{% endif %}/>
4 4
     <input type="submit" value="" id="search_submit" />
5
-</div>
6
-    <div>
7
-    {% include 'categories.html' %}
8
-    </div>
5
+  </div>
6
+  {% include 'categories.html' %}
9 7
 </form>