Browse Source

Support terminaux mobiles & ajout de personnalisation supplémentaire

master
Erase 3 years ago
parent
commit
da29d38efc
6 changed files with 109 additions and 36 deletions
  1. +27
    -2
      dist/config.json
  2. +1
    -1
      dist/css/style.css
  3. +1
    -1
      dist/js/script.js
  4. +27
    -2
      src/config.json
  5. +16
    -3
      src/css/style.css
  6. +37
    -27
      src/js/app.js

+ 27
- 2
dist/config.json View File

@ -1,5 +1,30 @@
{
"unsplashCollectionID": "1053828",
"unsplashCollectionID": 1053828,
"defaultWeatherLocation": "Paris",
"defaultSearchBaseURL": "https://encrypted.google.com/search?q="
"defaultSearchBaseURL": "https://encrypted.google.com/search?q=",
"commands" : [
{ "key": "s", "name": "Shaarlo", "url": "https://www.shaarlo.fr", "search": "/index.php?from=20130000&to=90130000&q=" },
{ "key": "b", "name": "Googl by Bronco", "url": "https://search.green-effect.fr", "search": "/?lang=fr&mod=web&q=" },
{ "key": "g", "name": "GitHub", "url": "https://github.com", "search": "/search?q=" },
{ "key": "m", "name": "Gmail", "url": "https://mail.google.com", "search": "/mail/u/0/#search/" },
{ "key": "t", "name": "Twitter", "url": "https://twitter.com", "search": "/search?q=" },
{ "key": "y", "name": "YouTube", "url": "https://www.youtube.com", "search": "/results?search_query=" }
],
"messages" : [
{
"min": 22, "max": 5, "texte": "Bonne nuit"
},
{
"min": 19, "max": 21, "texte": "Bonne soirée"
},
{
"min": 14, "max": 18, "texte": "Bon après-midi"
},
{
"min": 12, "max": 14, "texte": "Bon appétit"
},
{
"min": 6, "max": 11, "texte": "Bonjour"
}
]
}

+ 1
- 1
dist/css/style.css
File diff suppressed because it is too large
View File


+ 1
- 1
dist/js/script.js
File diff suppressed because it is too large
View File


+ 27
- 2
src/config.json View File

@ -1,5 +1,30 @@
{
"unsplashCollectionID": "1053828",
"unsplashCollectionID": 1053828,
"defaultWeatherLocation": "Paris",
"defaultSearchBaseURL": "https://encrypted.google.com/search?q="
"defaultSearchBaseURL": "https://encrypted.google.com/search?q=",
"commands" : [
{ "key": "s", "name": "Shaarlo", "url": "https://www.shaarlo.fr", "search": "/index.php?from=20130000&to=90130000&q=" },
{ "key": "b", "name": "Googl by Bronco", "url": "https://search.green-effect.fr", "search": "/?lang=fr&mod=web&q=" },
{ "key": "g", "name": "GitHub", "url": "https://github.com", "search": "/search?q=" },
{ "key": "m", "name": "Gmail", "url": "https://mail.google.com", "search": "/mail/u/0/#search/" },
{ "key": "t", "name": "Twitter", "url": "https://twitter.com", "search": "/search?q=" },
{ "key": "y", "name": "YouTube", "url": "https://www.youtube.com", "search": "/results?search_query=" }
],
"messages" : [
{
"min": 22, "max": 5, "texte": "Bonne nuit"
},
{
"min": 19, "max": 21, "texte": "Bonne soirée"
},
{
"min": 14, "max": 18, "texte": "Bon après-midi"
},
{
"min": 12, "max": 14, "texte": "Bon appétit"
},
{
"min": 6, "max": 11, "texte": "Bonjour"
}
]
}

+ 16
- 3
src/css/style.css View File

@ -12,7 +12,7 @@ body {
color: #111;
text-align: center;
background: #ffffff;
background-size: cover;
background-size: initial;
}
input,
@ -78,7 +78,7 @@ input:focus {
}
#wrapper {
position: fixed;
position: absolute;
top: 10%;
left: calc(50% - 200px);
margin-top: -50px;
@ -129,7 +129,7 @@ input:focus {
grid-template-columns: repeat(3, 1fr);
grid-gap: 10px;
max-width: 350px;
padding:25px;
padding:25px 0;
}
#addLinkForm{
@ -174,3 +174,16 @@ input:focus {
.alertify .ajs-footer{
display: none;
}
@media (max-width: 350px){
.grid{
grid-template-columns: repeat(2, 1fr);
padding: 0;
margin: 0 auto;
}
#wrapper {
left: 0;
width: auto;
}
}

+ 37
- 27
src/js/app.js View File

@ -1,3 +1,31 @@
var unsplashCollectionID = 1053828;
var defaultWeatherLocation = 'Limoges';
var defaultSearchBaseURL = 'https://encrypted.google.com/search?q=';
var commands = [
{ "key": "s", "name": "Shaarlo", "url": "https://www.shaarlo.fr", "search": "/index.php?from=20130000&to=90130000&q=" },
{ "key": "b", "name": "Googl by Bronco", "url": "https://search.green-effect.fr", "search": "/?lang=fr&mod=web&q=" },
{ "key": "g", "name": "GitHub", "url": "https://github.com", "search": "/search?q=" },
{ "key": "m", "name": "Gmail", "url": "https://mail.google.com", "search": "/mail/u/0/#search/" },
{ "key": "t", "name": "Twitter", "url": "https://twitter.com", "search": "/search?q=" },
{ "key": "y", "name": "YouTube", "url": "https://www.youtube.com", "search": "/results?search_query=" },
];
var messages = [
{
"min": 22, "max": 5, "texte": "Bonne nuit"
},
{
"min": 19, "max": 21, "texte": "Bonne soirée"
},
{
"min": 14, "max": 18, "texte": "Bon après-midi"
},
{
"min": 12, "max": 14, "texte": "Bon appétit"
},
{
"min": 6, "max": 11, "texte": "Bonjour"
},
];
function loadWeather(location, woeid) {
$.simpleWeather({
@ -20,22 +48,15 @@ function loadWeather(location, woeid) {
function timedQuotes() {
var day = new Date();
var hr = day.getHours();
var txt = "";
if (hr >= 22 && hr <= 5) {
return "Bonne nuit";
}
if (hr >= 19 && hr <= 21) {
return "Bonne soirée";
}
if (hr >= 14 && hr <= 18) {
return "Bon après-midi";
}
if (hr >= 12 && hr <= 14) {
return "Bon appétit";
}
if (hr >= 6 && hr <= 11) {
return "Bonjour";
}
$.each(messages, function(key, val){
if(hr >= val.min && hr <= val.max){
txt = val.texte;
}
});
return txt;
}
function loadRandomBackgroundImage() {
@ -134,10 +155,6 @@ function removeLink(key){
}
}
var unsplashCollectionID = 1053828;
var defaultWeatherLocation = 'Limoges';
var defaultSearchBaseURL = 'https://encrypted.google.com/search?q=';
$(function() {
$.getJSON( "config.json", function( data ) {
$.each( data, function( key, val ) {
@ -149,14 +166,7 @@ $(function() {
Clock.init();
Cmdr.init({
default: defaultSearchBaseURL,
commands: [
{ key: 's', name: 'Shaarlo', url: 'https://www.shaarlo.fr', search: '/index.php?from=20130000&to=90130000&q=' },
{ key: 'b', name: 'Googl by Bronco', url: 'https://search.green-effect.fr', search: '/?lang=fr&mod=web&q=' },
{ key: 'g', name: 'GitHub', url: 'https://github.com', search: '/search?q=' },
{ key: 'm', name: 'Gmail', url: 'https://mail.google.com', search: '/mail/u/0/#search/' },
{ key: 't', name: 'Twitter', url: 'https://twitter.com', search: '/search?q=' },
{ key: 'y', name: 'YouTube', url: 'https://www.youtube.com', search: '/results?search_query=' },
]
commands: commands
});
$('#quotes').text(timedQuotes());


Loading…
Cancel
Save