Commit 6eeb3662 authored by Curtis Adam's avatar Curtis Adam

Landing-Page: Add a wordcloud icon to switch between wordcloud and pomodoro-timer

parent 8e268f7f
......@@ -533,6 +533,10 @@ $themes: (
$wozniak_rating_5_background_hover: map-get($map, "wozniak_rating_5_background_hover");
$wozniak_rating_5_text: map-get($map, "wozniak_rating_5_text");
$wozniak_rating_5_text_hover: map-get($map, "wozniak_rating_5_text_hover");
//landing page
$landing_page_wordcloud_button: map-get($map, "landing_page_wordcloud_button");
$landing_page_wordcloud_button_opacity: map-get($map, "landing_page_wordcloud_button_opacity");
$landing_page_label: map-get($map, "landing_page_label");
background-image: $background_image !important;
......@@ -3005,5 +3009,14 @@ $themes: (
background-color: $wozniak_rating_5_background_hover !important;
color: $wozniak_rating_5_text_hover !important;
}
.toggle-wordcloud i {
color: $landing_page_wordcloud_button !important;
opacity: $landing_page_wordcloud_button_opacity !important;
}
.toggle-wordcloud label, #pomodoroTimerNormalContainer label {
color: $landing_page_label !important;
}
}
}
......@@ -552,5 +552,9 @@
"wozniak_rating_5_background_hover": $button_background_hover,
"wozniak_rating_5_text": white,
"wozniak_rating_5_text_hover": $button_text_hover,
//landing page
"landing_page_wordcloud_button": white,
"landing_page_wordcloud_button_opacity": 1,
"landing_page_label": white
);
}
......@@ -554,6 +554,9 @@
"wozniak_rating_5_background_hover": $button_background_hover,
"wozniak_rating_5_text": white,
"wozniak_rating_5_text_hover": $button_text_hover,
//landing page
"landing_page_wordcloud_button": white,
"landing_page_wordcloud_button_opacity": 0.6,
"landing_page_label": white
);
}
......@@ -39,6 +39,14 @@
"guest": "Gast-Login",
"pro": "Pro-Login",
"backdoor": "Backdoor-Login"
},
"buttons": {
"wordcloud": "Karteien",
"pomodoro": "Pomodoro-Timer",
"tooltip": {
"wordcloud": "Wortwolke aktivieren / deaktivieren",
"pomodoro": "Pomodoro-Timer aktivieren (Vollansicht)"
}
}
},
"pomodoro": {
......
......@@ -4,8 +4,6 @@ import {Cardsets} from "./cardsets.js";
import {Route} from "./route.js";
import swal from "sweetalert2";
import {WordcloudCanvas} from "./wordcloudCanvas";
import {AdminSettings} from "./adminSettings";
let defaultSettings = {
goal: 2,
work: {
......@@ -840,14 +838,17 @@ export let PomodoroTimer = class PomodoroTimer {
*/
static pomoPosition () {
if (!PomodoroTimer.isClockInBigmode() && !Meteor.userId()) {
if (AdminSettings.findOne({name: "wordcloudPomodoroSettings"}).enabled || !cloudShown) {
if ((Session.get('wordcloudMode') || !cloudShown)) {
$('.pomodoroTimer').detach().appendTo('#pomodoroTimerWordcloudContainer');
$('#pomodoroTimerWordcloudContainer').css('display', 'block');
$('#wordcloud-container').css('display', 'none');
$('#pomodoroTimerNormalContainer').css('display', 'none');
} else {
$('.pomodoroTimer').detach().appendTo('#pomodoroTimerNormalContainer');
$('#pomodoroTimerNormalContainer').css('display', 'block');
$('.pomodoroTimer').detach().prependTo('#pomodoroTimerNormalContainer');
$('#pomodoroTimerWordcloudContainer').css('display', 'none');
$('#wordcloud-container').css('display', 'block');
$('.pomodoroClock').removeAttr("style");
}
} else {
$('#wordcloud-container').css('display', 'block');
......
......@@ -7,7 +7,6 @@ import {ReactiveVar} from 'meteor/reactive-var';
import {Meteor} from "meteor/meteor";
import {PomodoroTimer} from "./pomodoroTimer";
import {FilterNavigation} from "./filterNavigation";
import {AdminSettings} from "./adminSettings";
let clearCanvas;
let drawOutOfBound;
......@@ -69,7 +68,7 @@ export let WordcloudCanvas = class WordcloudCanvas {
backgroundColor: backgroundColor,
wait: wait
});
} else if ($(window).width() >= 768 && !AdminSettings.findOne({name: "wordcloudPomodoroSettings"}).enabled) {
} else if ($(window).width() >= 768 && !Session.get('wordcloudMode')) {
PomodoroTimer.setCloudShown(true);
this.setConfig();
let wordcloundContent = this.getContent();
......@@ -134,7 +133,7 @@ export let WordcloudCanvas = class WordcloudCanvas {
}
document.getElementById('wordcloud-canvas').width = newWidth;
let newHeight = $(window).height() - ($('#welcome').outerHeight(true) + $('#welcome-login').outerHeight(true));
if ($(window).width() >= 768 && !AdminSettings.findOne({name: "wordcloudPomodoroSettings"}).enabled) {
if ($(window).width() >= 768 && !Session.get('wordcloudMode')) {
document.getElementById('wordcloud-canvas').height = newHeight;
$('.pomodoroClock').css('height', 'unset');
} else {
......
......@@ -56,6 +56,10 @@ $padding_vertical_inventory: 5px;
$margin_top_inventory: 10px;
$padding_top_login: 10px;
$login_button_size: 60px;
$wordcloud_toggle_button_icon_size: 150px;
$wordcloud_toggle_button_bottom_margin: 45px;
$small_pomodoro_timer_bottom_margin: 70px;
$font_size_wordcloud_and_pomodoro_label: 16px;
//info page
$font_size_info_h1: 20px;
......
......@@ -70,8 +70,8 @@
width: 150px;
position: absolute;
bottom: 4rem;
left: 1rem;
left: 25px;
bottom: $small_pomodoro_timer_bottom_margin !important;
@media (max-width: 767px) {
height: 0;
width: 0;
......@@ -87,6 +87,12 @@
.pomodoroTimer {
margin: auto;
}
label {
font-size: $font_size_wordcloud_and_pomodoro_label !important;
position: relative;
margin: 0;
bottom: 25px;
}
}
//welcome page
......
......@@ -11,8 +11,19 @@
{{{getServerInventory}}}
</div>
<div id="pomodoroTimerNormalContainer">
<div id="pomodoroTimerNormalContainer" title="{{_ "landingPage.buttons.tooltip.pomodoro"}}">
{{> pomodoroTimer}}
<label>{{_ "landingPage.buttons.pomodoro"}}</label>
</div>
{{> welcomeWordcloudButton}}
</template>
<template name="welcomeWordcloudButton">
<div class="hidden-xs">
<div class="toggle-wordcloud" title="{{_ "landingPage.buttons.tooltip.wordcloud"}}">
<div class="flex-content"><i class="fa fa-cloud"></i></div>
<label>{{_ "landingPage.buttons.wordcloud"}}</label>
</div>
</div>
</template>
......@@ -32,10 +43,12 @@
<br>
{{#if isActiveRoute
'home'}}
<a href="about" class="visible-xs-inline-block btn btn-lg btn-raised btn-success show-more"><span class="flex-content">{{_
<a href="about" class="visible-xs-inline-block btn btn-lg btn-raised btn-success show-more"><span
class="flex-content">{{_
"intro.learnMoreMobile" lastAppTitle=(getLastAppTitle)}}</span></a>
<a href="demo" id="showDemo" class="hidden-xs btn btn-lg btn-raised btn-success show-more"><span class="flex-content">{{_
<a href="demo" id="showDemo" class="hidden-xs btn btn-lg btn-raised btn-success show-more"><span
class="flex-content">{{_
"intro.learnMore" lastAppTitle=(getLastAppTitle)}}</span></a>
{{/if}}
</div>
......
......@@ -12,12 +12,12 @@ import * as fakeInventory from '../../../public/fakeStatistics/inventory.json';
import {PomodoroTimer} from "../../api/pomodoroTimer";
import {CardVisuals} from "../../api/cardVisuals";
import {NavigatorCheck} from "../../api/navigatorCheck";
import {AdminSettings} from "../../api/adminSettings";
Meteor.subscribe("pomodoroLandingPage");
Meteor.subscribe("userData");
Meteor.subscribe("serverInventory");
function setActiveLanguage() {
let language = getUserLanguage();
TAPi18n.setLanguage(language);
......@@ -123,13 +123,13 @@ Template.welcome.helpers({
}
} else {
if (Meteor.settings.public.login.cas) {
loginButtons += '<button id="cas" class="btn btn-large btn-raised btn-block"><span class="flex-content"><i class="fa fa-graduation-cap"></i>' + TAPi18n.__("landingPage.login.cas") + '</span></button>';
loginButtons += '<button id="cas" class="btn btn-large btn-raised btn-block"><span class="flex-content"><i class="fa fa-graduation-cap"></i>&nbsp;' + TAPi18n.__("landingPage.login.cas") + '</span></button>';
}
if (Meteor.settings.public.login.guest) {
loginButtons += '<button id="guest" class="btn btn-large btn-raised btn-block" data-toggle="modal" data-target="#underDevelopmentModal"><span class="flex-content"><i class="fa fa-user"></i>' + TAPi18n.__("landingPage.login.guest") + '</span></button>';
loginButtons += '<button id="guest" class="btn btn-large btn-raised btn-block" data-toggle="modal" data-target="#underDevelopmentModal"><span class="flex-content"><i class="fa fa-user"></i>&nbsp;' + TAPi18n.__("landingPage.login.guest") + '</span></button>';
}
if (Meteor.settings.public.login.pro) {
loginButtons += '<button id="pro" class="btn btn-large btn-raised btn-block" data-toggle="modal" data-target="#underDevelopmentModal"><span class="flex-content"><i class="fa fa-credit-card"></i>' + TAPi18n.__("landingPage.login.pro") + '</span></button>';
loginButtons += '<button id="pro" class="btn btn-large btn-raised btn-block" data-toggle="modal" data-target="#underDevelopmentModal"><span class="flex-content"><i class="fa fa-credit-card"></i>&nbsp;' + TAPi18n.__("landingPage.login.pro") + '</span></button>';
}
}
// Backdoor for login in acceptance tests
......@@ -146,7 +146,7 @@ Template.welcome.helpers({
if (Meteor.settings.public.login.legacyMode.enabled) {
loginButtons += '<a id="BackdoorLogin" href=""><div class="' + getLoginClass() + '"></div></a>';
} else {
loginButtons += '<button id="BackdoorLogin" class="btn btn-large btn-raised btn-block"><span class="flex-content"><i class="fa fa-key"></i>' + TAPi18n.__("landingPage.login.backdoor") + '</span></button>';
loginButtons += '<button id="BackdoorLogin" class="btn btn-large btn-raised btn-block"><span class="flex-content"><i class="fa fa-key"></i>&nbsp;' + TAPi18n.__("landingPage.login.backdoor") + '</span></button>';
}
loginButtons += '<div class="btn-group backdoorLogin">';
if (Meteor.settings.public.login.legacyMode.enabled) {
......@@ -191,6 +191,7 @@ Template.welcome.onCreated(function () {
if (Route.isFirstTimeVisit()) {
Router.go('demo');
}
Session.set('wordcloudMode', AdminSettings.findOne({name: "wordcloudPomodoroSettings"}).enabled);
});
Template.welcome.onRendered(function () {
......@@ -207,6 +208,19 @@ Template.welcome.onRendered(function () {
});
});
/*
* ############################################################################
* welcomeWordcloudButton
* ############################################################################
*/
Template.welcomeWordcloudButton.events({
'click .toggle-wordcloud': function () {
Session.set('wordcloudMode', !Session.get('wordcloudMode'));
PomodoroTimer.showPomodoroNormal();
}
});
/*
* ############################################################################
* welcomeTitle
......
......@@ -189,3 +189,21 @@
.welcome-title-no-padding {
padding-bottom: 0 !important;
}
.toggle-wordcloud {
position: absolute;
text-align: center;
right: 25px;
bottom: $wordcloud_toggle_button_bottom_margin !important;
i {
font-size: $wordcloud_toggle_button_icon_size !important;
}
cursor: pointer;
text-decoration: none;
label {
font-size: $font_size_wordcloud_and_pomodoro_label !important;
position: relative;
margin: 0;
bottom: 15px;
}
}
\ No newline at end of file
......@@ -17,7 +17,7 @@
"cas": true,
"guest": true,
"pro": true,
"backdoor": true
"backdoor": false
},
"leitner": {
"dayIntervalHour": 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment