Skip to content

Commit cc9eb50

Browse files
committed
Adding Web TTS support and installation and documentation
1 parent 07fc45f commit cc9eb50

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+35771
-1
lines changed

Nabaztag.WebTts.sln

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30011.22
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nabaztag.WebTts", "Nabaztag.WebTts\Nabaztag.WebTts.csproj", "{B292F603-DDC2-4144-BD9C-6FEED275E6BC}"
7+
EndProject
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nabaztag.Net", "Nabaztag.Net\Nabaztag.Net.csproj", "{D0BDDD0F-6CB6-4857-8BE5-288C3401A77E}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{B292F603-DDC2-4144-BD9C-6FEED275E6BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{B292F603-DDC2-4144-BD9C-6FEED275E6BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{B292F603-DDC2-4144-BD9C-6FEED275E6BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{B292F603-DDC2-4144-BD9C-6FEED275E6BC}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{D0BDDD0F-6CB6-4857-8BE5-288C3401A77E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{D0BDDD0F-6CB6-4857-8BE5-288C3401A77E}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{D0BDDD0F-6CB6-4857-8BE5-288C3401A77E}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{D0BDDD0F-6CB6-4857-8BE5-288C3401A77E}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {A1A4588C-4C3E-45E4-A3D6-F6C05971CAE5}
30+
EndGlobalSection
31+
EndGlobal
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System.Web;
2+
using System.Web.Optimization;
3+
4+
namespace Nabaztag.WebTts
5+
{
6+
public class BundleConfig
7+
{
8+
// For more information on bundling, visit https://go.microsoft.com/fwlink/?LinkId=301862
9+
public static void RegisterBundles(BundleCollection bundles)
10+
{
11+
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
12+
"~/Scripts/jquery-{version}.js"));
13+
14+
// Use the development version of Modernizr to develop with and learn from. Then, when you're
15+
// ready for production, use the build tool at https://modernizr.com to pick only the tests you need.
16+
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
17+
"~/Scripts/modernizr-*"));
18+
19+
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
20+
"~/Scripts/bootstrap.js"));
21+
22+
bundles.Add(new StyleBundle("~/Content/css").Include(
23+
"~/Content/bootstrap.css",
24+
"~/Content/site.css"));
25+
}
26+
}
27+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System.Web;
2+
using System.Web.Mvc;
3+
4+
namespace Nabaztag.WebTts
5+
{
6+
public class FilterConfig
7+
{
8+
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
9+
{
10+
filters.Add(new HandleErrorAttribute());
11+
}
12+
}
13+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Web;
5+
using System.Web.Mvc;
6+
using System.Web.Routing;
7+
8+
namespace Nabaztag.WebTts
9+
{
10+
public class RouteConfig
11+
{
12+
public static void RegisterRoutes(RouteCollection routes)
13+
{
14+
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
15+
16+
routes.MapRoute(
17+
name: "Default",
18+
url: "{controller}/{action}/{id}",
19+
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
20+
);
21+
}
22+
}
23+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Web.Http;
5+
6+
namespace Nabaztag.WebTts
7+
{
8+
public static class WebApiConfig
9+
{
10+
public static void Register(HttpConfiguration config)
11+
{
12+
// Web API configuration and services
13+
14+
// Web API routes
15+
config.MapHttpAttributeRoutes();
16+
17+
config.Routes.MapHttpRoute(
18+
name: "DefaultApi",
19+
routeTemplate: "api/{controller}/{id}",
20+
defaults: new { id = RouteParameter.Optional }
21+
);
22+
}
23+
}
24+
}

Nabaztag.WebTts/Content/Site.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
body {
2+
padding-top: 50px;
3+
padding-bottom: 20px;
4+
}
5+
6+
/* Set padding to keep content from hitting the edges */
7+
.body-content {
8+
padding-left: 15px;
9+
padding-right: 15px;
10+
}
11+
12+
/* Set width on the form input elements since they're 100% wide by default */
13+
input,
14+
select,
15+
textarea {
16+
max-width: 280px;
17+
}
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
// Button toggle by Aanjulena Sweet
2+
// https://codepen.io/aanjulena/pen/ZLZjzV
3+
4+
// Bootstrap colors.
5+
@primary: #007bff;
6+
@secondary: #6c757d;
7+
@success: #28a745;
8+
@info: #17a2b8;
9+
@warning: #ffc107;
10+
@danger: #dc3545;
11+
@light: #f8f9fa;
12+
@dark: #343a40;
13+
14+
@gray: #6b7381;
15+
@gray-light: lighten(@gray, 15%);
16+
@gray-lighter: lighten(@gray, 30%);;
17+
18+
// Button Colors
19+
@btn-default-color: @gray;
20+
@btn-default-bg: @gray-lighter;
21+
22+
// Toggle Sizes
23+
@toggle-default-size: 1.5rem;
24+
@toggle-default-label-width: 4rem;
25+
@toggle-default-font-size: .75rem;
26+
27+
// Mixin for Switch Colors
28+
// Variables: @color, @bg, @active-bg
29+
.toggle-color(@color: @btn-default-color; @bg: @btn-default-bg; @active-bg: @primary;) {
30+
color: @color;
31+
background: @bg;
32+
&:before,
33+
&:after {
34+
color: @color;
35+
}
36+
&.active {
37+
background-color: @active-bg;
38+
}
39+
}
40+
41+
// Mixin for Default Switch Styles
42+
// Variables: @size, @margin, @color, @bg, @active-bg, @font-size
43+
.toggle-mixin(@size: @toggle-default-size; @margin: @toggle-default-label-width; @font-size: @toggle-default-font-size;) {
44+
// color: @color;
45+
// background: @bg;
46+
margin: 0 @margin;
47+
padding: 0;
48+
position: relative;
49+
border: none;
50+
height: @size;
51+
width: @size * 2;
52+
border-radius: @size;
53+
54+
&:focus,
55+
&.focus {
56+
&,
57+
&.active {
58+
outline: none;
59+
}
60+
}
61+
62+
&:before,
63+
&:after {
64+
line-height: @size;
65+
width: @margin;
66+
text-align: center;
67+
font-weight: 600;
68+
// color: @color;
69+
font-size: @font-size;
70+
text-transform: uppercase;
71+
letter-spacing: 2px;
72+
position: absolute;
73+
bottom: 0;
74+
transition: opacity .25s;
75+
}
76+
&:before {
77+
content: 'Off';
78+
left: -@margin;
79+
}
80+
&:after {
81+
content: 'On';
82+
right: -@margin;
83+
opacity: .5;
84+
}
85+
86+
> .handle {
87+
position: absolute;
88+
top: (@size * .25) / 2;
89+
left: (@size * .25) / 2;
90+
width: @size * .75;
91+
height: @size * .75;
92+
border-radius: @size * .75;
93+
background: #fff;
94+
transition: left .25s;
95+
}
96+
&.active {
97+
transition: background-color .25s;
98+
> .handle {
99+
left: @size + ((@size * .25) / 2);
100+
transition: left .25s;
101+
}
102+
&:before {
103+
opacity: .5;
104+
}
105+
&:after {
106+
opacity: 1;
107+
}
108+
}
109+
110+
&.btn-sm {
111+
&:before,
112+
&:after {
113+
line-height: @size - 2px;
114+
color: #fff;
115+
letter-spacing: .75px;
116+
left: @size * .275;
117+
width: @size * 1.55;
118+
}
119+
&:before {
120+
text-align: right;
121+
}
122+
&:after {
123+
text-align: left;
124+
opacity: 0;
125+
}
126+
&.active {
127+
&:before {
128+
opacity: 0;
129+
}
130+
&:after {
131+
opacity: 1;
132+
}
133+
}
134+
}
135+
136+
&.btn-xs {
137+
&:before,
138+
&:after {
139+
display: none;
140+
}
141+
}
142+
}
143+
144+
145+
146+
// Apply Mixin to different sizes & colors
147+
.btn-toggle {
148+
149+
.toggle-mixin;
150+
.toggle-color;
151+
152+
&.btn-lg {
153+
.toggle-mixin(@size: 2.5rem; @font-size: 1rem; @margin: 5rem;);
154+
}
155+
156+
&.btn-sm {
157+
.toggle-mixin(@font-size: .55rem; @margin: .5rem;);
158+
}
159+
160+
&.btn-xs {
161+
.toggle-mixin(@size:1rem;@margin:0;)
162+
}
163+
164+
&.btn-secondary {
165+
.toggle-color(@active-bg:@secondary);
166+
}
167+
168+
&.btn-success {
169+
.toggle-color(@active-bg:@success);
170+
}
171+
172+
&.btn-info {
173+
.toggle-color(@active-bg:@info);
174+
}
175+
176+
&.btn-warning {
177+
.toggle-color(@active-bg:@warning);
178+
}
179+
180+
&.btn-danger {
181+
.toggle-color(@active-bg:@danger);
182+
}
183+
184+
&.btn-light {
185+
.toggle-color(@active-bg:@light);
186+
}
187+
188+
&.btn-dark {
189+
.toggle-color(@active-bg:@dark);
190+
}
191+
}
192+

0 commit comments

Comments
 (0)