diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..7d512db --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,61 @@ +name: Pages + +on: + pull_request: + push: + branches: + - master + +permissions: + contents: read + +concurrency: + group: pages + cancel-in-progress: true + +jobs: + verify: + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v6 + + - name: Set up Node.js + uses: actions/setup-node@v6 + with: + node-version-file: .nvmrc + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test + + - name: Build site + run: npm run build + + - name: Upload Pages artifact + if: github.event_name == 'push' + uses: actions/upload-pages-artifact@v5 + with: + path: ./dist + + deploy: + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + needs: verify + runs-on: ubuntu-latest + + permissions: + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v5 diff --git a/.gitignore b/.gitignore index cfd9b9a..8751270 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,10 @@ *.swp node_modules +dist +coverage +playwright-report +test-results +TODO.md js/compiled.js css/_compiled_main.css css/merged.css diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 2d537c5..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "lib/google-closure-library"] - path = lib/google-closure-library - url = https://github.com/ciembor/google-closure-library diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..5bf4400 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +24.15.0 diff --git a/.project b/.project deleted file mode 100644 index 80af9b7..0000000 --- a/.project +++ /dev/null @@ -1,12 +0,0 @@ - - - 4bit - - - - - - - com.aptana.projects.webnature - - diff --git a/4bit-terminal-color-scheme-designer.webp b/4bit-terminal-color-scheme-designer.webp new file mode 100644 index 0000000..fc63bc0 Binary files /dev/null and b/4bit-terminal-color-scheme-designer.webp differ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f639757 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,237 @@ +# Changelog + +This changelog summarizes the full project history reconstructed from the repository commits since the project started on August 20, 2012. + +Early history is grouped by day to keep the file readable while still covering the full timeline. + +## 2026 + +### 2026-05-15 + +- Reorganized the xterm.js terminal preview modules around terminal-view naming to avoid confusion with the xterm export format. +- Split terminal preview command builders into a dedicated commands area. +- Added a live `usability` command that reports WCAG-based text contrast for the current terminal palette. +- Updated terminal help output with grouped tools and example commands, including colored command names and short descriptions. + +### 2026-05-14 + +- Migrated the terminal preview window to xterm.js while preserving the classic 4bit terminal proportions and font behavior. +- Added an interactive terminal preview prompt with commands for color matrix, `git diff`, `git status`, `ls`, `ls -al`, `clear`, and help output. +- Kept terminal preview content stable during slider changes by updating the theme without restoring the boot transcript. +- Fixed terminal view dimensions while the page and font are loading. + +### 2026-05-13 + +- Added export support for Windows Terminal, Termite, ConEmu, KiTTY, and macOS Terminal. +- Updated GNOME Terminal export support for the newer format without keeping the old fallback. +- Stabilized the ConEmu snapshot date used in generated output. + +### 2026-05-12 + +- Restyled About page feature cards to resemble terminal previews. + +### 2026-05-11 + +- Added a dedicated SEO-focused About page for 4bit with project history, supported terminal links, source references, and an explanation of the color-generation model. +- Reworked the page header navigation so the About page links back to the editor while the editor keeps the download workflow. +- Shared the page shell, header, footer, button, theme, asset, and store code between the editor and About page. +- Reorganized presentation code into `about-page`, `editor-page`, and `shared` areas to reduce coupling between page-specific UI and shared layout. +- Decoupled browser URL synchronization from Pinia by passing the scheme store into the infrastructure adapter. + +### 2026-05-10 + +- Added compact `s` query-string serialization for complete scheme settings while keeping backward compatibility with legacy shared URLs. +- Added mintty drag-and-drop URL payload support so generated palettes can be dropped into mintty from shared links. +- Updated social sharing and browser URL synchronization to use the compressed scheme settings and mintty drag payload. +- Extended unit and browser smoke coverage for compressed settings, legacy URL hydration, sharing URLs, and mintty drag serialization. + +### 2026-04-22 + +- Completed the Vue migration of the remaining UI pieces. +- Refactored `Advanced` controls to Vue components while keeping the legacy jQuery color wheel wrapped inside Vue. +- Ported newer legacy `master` changes into the Vue app, including exporter updates and newer defaults. +- Removed leftover legacy entrypoints and duplicated assets that were no longer used by the Vite app. +- Unified slider wrappers and added proper jQuery UI cleanup on unmount. +- Replaced runtime ` + + - - -
- -
- -
-

4bit Terminal Color Scheme Designer

-
-
-
-
- -
-
-
- Download Scheme -
-
- -
- -
-
-
-
-

Global Properties

-

Hue:

-
-

Saturation:

-
-
-
-

Lightness

-

Color:

-
-

Black:

-
-

White:

-
-
-
-

Advanced

- -
- -
- - - - -
-
-
- -
- - - - - -
-
-
- -
- - - - - -
-
-
-
-
- -
- - - -
- -
- - - - - - - - - - - - - - - - - - - - + + diff --git a/js/main.js b/js/main.js deleted file mode 100755 index 45f451d..0000000 --- a/js/main.js +++ /dev/null @@ -1,1096 +0,0 @@ -/** - * This is the main script of Terminal Color Scheme Designer - * author: Maciej Ciemborowicz - */ - -// social media /////////////////////////////////////////////////////////////////////////////////// - -(function() { - - // twitter button - !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs"); - -})(); - -// jquery ui vertial radio //////////////////////////////////////////////////////////////////////// - -(function( $ ){ - //plugin buttonset vertical - $.fn.buttonsetv = function() { - $(':radio, :checkbox', this).wrap('
'); - $(this).buttonset(); - $('label:first', this).removeClass('ui-corner-left').addClass('ui-corner-top'); - $('label:last', this).removeClass('ui-corner-right').addClass('ui-corner-bottom'); - mw = 0; // max witdh - $('label', this).each(function(index){ - w = $(this).width(); - if (w > mw) mw = w; - }) - $('label', this).each(function(index){ - $(this).width(mw); - }) - }; -})( jQuery ); - -// Backbone app /////////////////////////////////////////////////////////////////////////////////// - -_4bit = function() { - - goog.require('goog.color'); - - /** - * Creates HSL color objects - * - * @param {Number} h Hue between 0 and 360 - * @param {Number} s Saturation between 0 and 1 - * @param {Number} l Lightness between 0 and 1 - * - * @return {Object} HSL color - */ - function HSL(h, s, l) { - var color = [h, s, l]; - var dye = [0, 0, 0, 0]; // hsla tint - - getHue = function() { - return color[0]; - } - - getSaturation = function() { - return color[1]; - } - - getLightness = function() { - return color[2]; - } - - setHue = function(h) { - color[0] = h; - } - - setSaturation = function(s) { - color[1] = s; - } - - setLightness = function(l) { - color[2] = l; - } - - setDye = function(hsla) { - dye = hsla; - } - - setHsl = function(h, s, l) { - color = [h, s, l]; - } - - stringify = function() { - var blended = goog.color.hslArrayToRgb(color); - var blender = goog.color.hslToRgb(dye[0], dye[1], dye[2]); - var factor = dye[3]; - var rgb = goog.color.blend(blender, blended, factor); - return goog.color.rgbArrayToHex(rgb); - } - - toRgb = function() { - return goog.color.hslArrayToRgb(color); - } - - return { - getHue: getHue, - getSaturation: getSaturation, - getLightness: getLightness, - setHue: setHue, - setSaturation: setSaturation, - setLightness: setLightness, - setDye: setDye, - setHsl: setHsl, - toString: stringify, - toRgb: toRgb - } - } - - var COLOR_NAMES = [ - 'black', - 'bright_black', - 'red', - 'bright_red', - 'green', - 'bright_green', - 'yellow', - 'bright_yellow', - 'blue', - 'bright_blue', - 'magenta', - 'bright_magenta', - 'cyan', - 'bright_cyan', - 'white', - 'bright_white' - ] - - var Scheme = Backbone.Model.extend({ - - defaults: { - hue: 0, - saturation: 0.3, - normal_lightness: 0.6, - bright_lightness: 0.8, - black: [HSL(0, 0, 0), HSL(0, 0, 0.15)], - white: [HSL(0, 0, 0.85), HSL(0, 0, 1)], - background: HSL(0, 0, 0), - foreground: HSL(0, 0, 1) - }, - - initialize: function() { - var that = this - var degrees = [0, 60, 120, 180, 240, 300]; - var normal_array = _.map(degrees, function(degree) { - return HSL(that.get('hue') + degree, that.get('saturation'), that.get('normal_lightness')); - }); - var bright_array = _.map(degrees, function(degree) { - return HSL(that.get('hue') + degree, that.get('saturation'), that.get('bright_lightness')); - }); - - this.set({ - bright: bright_array, - normal: normal_array - }); - - this.set({ - colors: { - background: this.get('background'), - foreground: this.get('foreground'), - black: this.get('black')[0], - bright_black: this.get('black')[1], - red: this.get('normal')[0], - bright_red: this.get('bright')[0], - green: this.get('normal')[2], - bright_green: this.get('bright')[2], - yellow: this.get('normal')[1], - bright_yellow: this.get('bright')[1], - blue: this.get('normal')[4], - bright_blue: this.get('bright')[4], - magenta: this.get('normal')[5], - bright_magenta: this.get('bright')[5], - cyan: this.get('normal')[3], - bright_cyan: this.get('bright')[3], - white: this.get('white')[0], - bright_white: this.get('white')[1] - } - }); - }, - - setHue: function(hue) { - this.set('hue', this.get('hue') + hue) - _.each([this.get('bright'), this.get('normal')], function(colors) { - _.each(colors, function(color) { - color.setHue(hue + color.getHue()); - }); - }); - this.trigger('change'); - }, - - setSaturation: function(saturation) { - this.set('saturation', saturation) - _.each([this.get('bright'), this.get('normal')], function(colors) { - _.each(colors, function(color) { - color.setSaturation(saturation); - }); - }); - this.trigger('change'); - }, - - setLightness: function(type, lightness) { - - switch(type) { - case 'normal': - this.set('normal_lightness', lightness) - _.each(this.get('normal'), function(color) { - color.setLightness(lightness); - }); - break; - case 'bright': - this.set('bright_lightness', lightness) - _.each(this.get('bright'), function(color) { - color.setLightness(lightness); - }); - break; - default: - this.get('colors')[type].setLightness(lightness); - } - - this.trigger('change'); - }, - - dye: function(h, s, l, a, type) { - var colors = this.get('colors'); - var achromatic = [ - colors.black, - colors.bright_black, - colors.white, - colors.bright_white - ]; - var colors_array = []; - - if ('achromatic' === type) { - colors_array.push(achromatic); - } else if ('color' === type) { - colors_array.push(this.get('bright')); - colors_array.push(this.get('normal')); - } else { - colors_array.push(achromatic); - colors_array.push(this.get('bright')); - colors_array.push(this.get('normal')); - } - - this.set('dye', [h, s, l, a]); - - _.each(colors_array, function(colors) { - _.each(colors, function(color) { - color.setDye([h, s, l, a]); - }); - }); - - this.trigger('change'); - }, - - setBackground: function(h, s, l, option) { - var background = this.get('background'); - - if ('custom' === option) { - background.setHsl(h, s, l); - this.get('colors')['background'] = background; - } else { - this.get('colors')['background'] = this.get('colors')[option]; - } - - this.trigger('change'); - }, - - setForeground: function(h, s, l, option) { - var foreground = this.get('foreground'); - - if ('custom' === option) { - foreground.setHsl(h, s, l); - this.get('colors')['foreground'] = foreground; - } else { - this.get('colors')['foreground'] = this.get('colors')[option]; - } - - this.trigger('change'); - } - - }); - - var scheme = new Scheme(); - - var SchemeView = Backbone.View.extend({ - - el: $('#display'), - - model: scheme, - - initialize: function() { - _.bindAll(this, 'render'); - this.render(); - - $("#advanced").tabs(); - }, - - render: function() { - var string = ''; - var color_names = ['foreground', 'bright_foreground']; - var bg_names = ['background']; - var columns_th = [' ', ' ', '40m', '41m', '42m', '43m', '44m', '45m', '46m', '47m']; - var rows_th =['m','1m','30m','1;30m','31m','1;31m','32m','1;32m','33m','1;33m','34m','1;34m','35m','1;35m','36m','1;36m','37m','1;37m']; - var row_index = 0; - - string += '

Welcome to fish, the friendly interactive shell

'; - string += '

Type help for instructions on how to use fish

' - string += '

ciembor@browser ~> ./colors.sh

' - string += '
'; - - /* table with colors */ - string += ''; - - string += ''; - _.each(columns_th, function(th) { - string += ''; - }); - string += ''; - - _.each(COLOR_NAMES, function(name) { - if (0 !== name.indexOf('bright_')) { - bg_names.push(name); - } - color_names.push(name); - }); - - _.each(color_names, function(name) { - string += ''; - string += ''; - row_index += 1; - - _.each(bg_names, function(bg_name) { - string += ''; - }) - - string += ''; - }) - string += '
' + th + '
' + rows_th[row_index] + 'gYw
'; - - string += '
'; - string += '

ciembor@browser ~>

'; - - $(this.el).html(string); - } - - }); - - var SchemeCSSView = Backbone.View.extend({ - - model: scheme, - - initialize: function() { - _.bindAll(this, 'render'); - this.model.bind('change', _.bind(this.render, this)); - this.render(); - }, - - render: function() { - var that = this; - $('#display').css('color', that.model.get('colors')['foreground']); - $('#display').css('background-color', that.model.get('colors')['background']); - _.each(COLOR_NAMES, function(name) { - $('.' + name).css('color', that.model.get('colors')[name]); - $('.bg-' + name).css('background-color', that.model.get('colors')[name]); - }); - } - - }); - - var SchemeGuakeView = Backbone.View.extend({ - - model: scheme, - - initialize: function() { - _.bindAll(this, 'render'); - var that = this; - $('#guake-button').on('click', function(event) { - var blob = that.render(); - var blobURL = URL.createObjectURL(blob); - var link = $(event.target); - - link.attr('href', blobURL); - link.attr('download', 'set_colors.sh'); - }); - }, - - render: function() { - var that = this; - var palette = []; - var colors = that.model.get("colors"); - var blob = null; - var file = null; - - // Duplicate: #ab1224 -> #abab12122424, which is the expected format - function gnomeColor(color) { - return color.toString().replace(/#(.{2})(.{2})(.{2})/, '#$1$1$2$2$3$3'); - } - - _.each(COLOR_NAMES, function(name) { - palette.push( gnomeColor(colors[name]) ) - }); - - out = '#!/bin/bash \n\n'; - out += '# Save this script into set_colors.sh, make this file executable and run it: \n'; - out += '# \n'; - out += '# $ chmod +x set_colors.sh \n'; - out += '# $ ./set_colors.sh \n'; - out += '# \n'; - out += '# Alternatively copy lines below directly into your shell. \n\n'; - - out += "gconftool-2 -s -t string /apps/guake/style/background/color '" + gnomeColor(colors["background"]) + "'" +'\n'; - out += "gconftool-2 -s -t string /apps/guake/style/font/color '" + gnomeColor(colors["foreground"]) + "'" + '\n'; - out += "gconftool-2 -s -t string /apps/guake/style/font/palette '" + palette.join(":") + "'" + '\n'; - - return new Blob([out], { type: 'text/text' }); - } - - }); - - var SchemeGnomeTerminalView = Backbone.View.extend({ - - model: scheme, - - initialize: function() { - _.bindAll(this, 'render'); - var that = this; - $('#gnome-terminal-button').on('click', function(event) { - var blob = that.render(); - var blobURL = URL.createObjectURL(blob); - var link = $(event.target); - - link.attr('href', blobURL); - link.attr('download', 'set_colors.sh'); - }); - }, - - render: function() { - var that = this; - var palette = []; - var colors = that.model.get("colors"); - - // Duplicate: #ab1224 -> #abab12122424, which is the expected format - function gnomeColor(color) { - return color.toString().replace(/#(.{2})(.{2})(.{2})/, '#$1$1$2$2$3$3'); - } - - _.each(COLOR_NAMES, function(name) { - if (0 !== name.indexOf('bright_')) { - palette.push( gnomeColor(colors[name]) ); - } - }); - - _.each(COLOR_NAMES, function(name) { - if (0 === name.indexOf('bright_')) { - palette.push( gnomeColor(colors[name]) ); - } - }); - - out = '#!/bin/bash \n\n'; - out += '# Save this script into set_colors.sh, make this file executable and run it: \n'; - out += '# \n'; - out += '# $ chmod +x set_colors.sh \n'; - out += '# $ ./set_colors.sh \n'; - out += '# \n'; - out += '# Alternatively copy lines below directly into your shell. \n\n'; - - out += "gconftool-2 --set /apps/gnome-terminal/profiles/Default/use_theme_background --type bool false \n"; - out += "gconftool-2 --set /apps/gnome-terminal/profiles/Default/use_theme_colors --type bool false \n"; - out += "gconftool-2 -s -t string /apps/gnome-terminal/profiles/Default/background_color '" + gnomeColor(colors["background"]) + "'" +'\n'; - out += "gconftool-2 -s -t string /apps/gnome-terminal/profiles/Default/foreground_color '" + gnomeColor(colors["foreground"]) + "'" + '\n'; - out += "gconftool-2 -s -t string /apps/gnome-terminal/profiles/Default/palette '" + palette.join(":") + "'" + '\n'; - - return new Blob([out], { type: 'text/text' }); - } - - }); - - var SchemeKonsoleView = Backbone.View.extend({ - - model: scheme, - - initialize: function() { - _.bindAll(this, 'render'); - var that = this; - $('#konsole-button').on('click', function(event) { - var blob = that.render(); - var blobURL = URL.createObjectURL(blob); - var link = $(event.target); - - link.attr('href', blobURL); - link.attr('download', '4bit.colorscheme'); - }); - }, - - colorRgb: function(context, color) { - var rgbArray = context.model.get("colors")[color].toRgb(); - return rgbArray[0] + ',' + rgbArray[1] + ',' + rgbArray[2]; - }, - - render: function() { - var that = this; - var out = ''; - var counter = 0; - var tpf = "Transparency=false" + '\n' + '\n'; - var name = '4bit-' + that.model.get("colors")["foreground"] + "-on-" + that.model.get("colors")["background"]; - name = name.replace(/#/g,''); - - out += '# --- ~/.kde/share/apps/konsole/NAME.colorscheme -------------------------------\n'; - out += '# ------------------------------------------------------------------------------\n'; - out += '# --- generated with 4bit Terminal Color Scheme Designer -----------------------\n'; - out += '# ------------------------------------------------------------------------------\n'; - out += '# --- http://ciembor.github.io/4bit --------------------------------------------\n'; - out += '# ------------------------------------------------------------------------------\n\n'; - - out += '# --- special colors ---\n\n'; - out += '[Background]\n'; - out += 'Color=' + that.colorRgb(that, "background") + '\n'; - out += tpf; - out += '[BackgroundIntense]\n'; - out += 'color=' + that.colorRgb(that, "background") + '\n'; - out += tpf; - out += '[Foreground]\n'; - out += 'Color=' + that.colorRgb(that, "foreground") + '\n'; - out += tpf; - out += '[ForegroundIntense]\n'; - out += 'Color=' + that.colorRgb(that, "foreground") + '\n'; - out += 'Bold=true\n'; - out += tpf; - - out += '# --- standard colors ---\n\n'; - _.each(COLOR_NAMES, function(name) { - var number = counter / 2; - - if (0 === name.indexOf('bright_')) { - number += 7.5; - } - if (number > 7) { - colorsuffix = number % 8 + "Intense"; - } else { - colorsuffix = number % 8; - } - out += '[Color' + colorsuffix + ']\n'; - out += 'Color=' + that.colorRgb(that, name) + '\n'; - out += tpf; - counter++; - }); - - out += '# --- general options ---\n\n'; - out += '[General]\nDescription=' + name + '\nOpacity=1\n'; - - return new Blob([out], { type: 'text/text' }); - } - - }); - - var SchemeITerm2View = Backbone.View.extend({ - - model: scheme, - - initialize: function() { - _.bindAll(this, 'render'); - var that = this; - $('#iterm2-button').on('click', function(event) { - var blob = that.render(); - var blobURL = URL.createObjectURL(blob); - var link = $(event.target); - - link.attr('href', blobURL); - link.attr('download', '4bit.itermcolors'); - }); - }, - - colorRgb: function(context, color) { - var rgbArray = context.model.get("colors")[color].toRgb(); - return rgbArray[0] + ',' + rgbArray[1] + ',' + rgbArray[2]; - }, - - colorKeyDict: function(context, color, name) { - var rgbArray = context.model.get("colors")[color].toRgb(); - var out = ''; - out += ' '+name+' Color\n'; - out += ' \n'; - out += ' Blue Component\n'; - out += ' '+rgbArray[2]/255+'\n'; - out += ' Green Component\n'; - out += ' '+rgbArray[1]/255+'\n'; - out += ' Red Component\n'; - out += ' '+rgbArray[0]/255+'\n'; - out += ' \n'; - return out; - }, - - render: function() { - var that = this; - var out = ''; - var counter = 0; - var name = '4bit-' + that.model.get("colors")["foreground"] + "-on-" + that.model.get("colors")["background"]; - name = name.replace(/#/g,''); - - out += '\n'; - out += '\n'; - out += '\n\n\n'; - - out += '\n'; - out += '\n'; - - out += '\n'; - out += that.colorKeyDict(that, "background", "Background"); - out += that.colorKeyDict(that, "foreground", "Foreground"); - out += that.colorKeyDict(that, "foreground", "Cursor"); - out += that.colorKeyDict(that, "background", "Cursor Text"); - - out += '\n'; - - _.each(COLOR_NAMES, function(name) { - var number = counter / 2; - - if (0 === name.indexOf('bright_')) { - number += 7.5; - } - - out += ' \n'; - out += that.colorKeyDict(that, name, "Ansi "+number); - - counter += 1; - }); - - out += '\n'; - out += '\n'; - out += '\n'; - - return new Blob([out], { type: 'text/text' }); - } - - }); - - var SchemeXresourcesView = Backbone.View.extend({ - - model: scheme, - - initialize: function() { - _.bindAll(this, 'render'); - var that = this; - $('#xresources-button').on('click', function(event) { - var blob = that.render(); - var blobURL = URL.createObjectURL(blob); - var link = $(event.target); - - link.attr('href', blobURL); - link.attr('download', '.Xresources'); - }); - }, - - render: function() { - var that = this; - var xresources = ''; - var counter = 0; - - xresources += '! --- ~/.Xresources ------------------------------------------------------------\n'; - xresources += '! ------------------------------------------------------------------------------\n'; - xresources += '! --- generated with 4bit Terminal Color Scheme Designer -----------------------\n'; - xresources += '! ------------------------------------------------------------------------------\n'; - xresources += '! --- http://ciembor.github.io/4bit --------------------------------------------\n'; - xresources += '! ------------------------------------------------------------------------------\n\n'; - - xresources += '! --- special colors ---\n\n'; - xresources += '*background: ' + that.model.get('colors')['background'] + '\n'; - xresources += '*foreground: ' + that.model.get('colors')['foreground'] + '\n\n'; - - xresources += '! --- standard colors ---\n\n'; - _.each(COLOR_NAMES, function(name) { - var number = counter / 2; - - if (0 === name.indexOf('bright_')) { - number += 7.5; - } - - xresources += '! ' + name + '\n'; - xresources += '*color' + number + ': ' + that.model.get('colors')[name] + '\n\n'; - counter += 1; - }); - - xresources += '\n! ------------------------------------------------------------------------------\n'; - xresources += '! --- end of terminal colors section -------------------------------------------\n'; - xresources += '! ------------------------------------------------------------------------------\n\n'; - - return new Blob([xresources], { type: 'text/text' }); - } - - }); - - var SchemeXfceTerminalView = Backbone.View.extend({ - - model: scheme, - - initialize: function() { - _.bindAll(this, 'render'); - var that = this; - $('#xfce-terminal-button').on('click', function(event) { - var blob = that.render(); - var blobURL = URL.createObjectURL(blob); - var link = $(event.target); - - link.attr('href', blobURL); - link.attr('download', 'terminalrc'); - }); - }, - - render: function() { - var that = this; - var terminalrc = '[Configuration]\n'; - var counter = 1; - - // special colors - terminalrc += 'ColorBackground=' + that.model.get('colors')['background'] + '\n'; - terminalrc += 'ColorForeground=' + that.model.get('colors')['foreground'] + '\n'; - terminalrc += 'ColorCursor=' + that.model.get('colors')['foreground'] + '\n'; - - // standard colors - _.each(COLOR_NAMES, function(name) { - var number = counter / 2 + 0.5; - - if (0 === name.indexOf('bright_')) { - number += 7.5; - } - - terminalrc += 'ColorPalette' + number + '=' + that.model.get('colors')[name] + '\n'; - counter += 1; - }); - - return new Blob([terminalrc], { type: 'text/text' }); - } - - }); - - var SchemeMinttyView = Backbone.View.extend({ - - model: scheme, - - initialize: function() { - _.bindAll(this, 'render'); - var that = this; - $('#mintty-button').on('click', function(event) { - var blob = that.render(); - var blobURL = URL.createObjectURL(blob); - var link = $(event.target); - - link.attr('href', blobURL); - link.attr('download', '4bit-mintty-color-scheme'); - }); - }, - - colorRgb: function(context, color) { - var rgbArray = context.model.get("colors")[color].toRgb(); - return rgbArray[0] + ',' + rgbArray[1] + ',' + rgbArray[2]; - }, - - render: function() { - function MinttyName(name) { - if (0 === name.indexOf('bright_')) { - name = name.substring('bright_'.length); - return 'Bold' + name.charAt(0).toUpperCase() + name.slice(1); - } else { - return name.charAt(0).toUpperCase() + name.slice(1); - } - } - - var that = this; - var out = ''; - - out += 'BackgroundColour=' + that.colorRgb(that, "background") + '\n'; - out += 'ForegroundColour=' + that.colorRgb(that, "foreground") + '\n'; - out += 'CursorColour=' + that.colorRgb(that, "foreground") + '\n'; - - _.each(COLOR_NAMES, function(name) { - out += MinttyName(name) + '=' + that.colorRgb(that, name) + '\n'; - }); - - return new Blob([out], { type: 'text/text' }); - } - - }); - - var SchemePuttyView = Backbone.View.extend({ - - model: scheme, - - initialize: function() { - _.bindAll(this, 'render'); - var that = this; - $('#putty-button').on('click', function(event) { - var blob = that.render(); - var blobURL = URL.createObjectURL(blob); - var link = $(event.target); - - link.attr('href', blobURL); - link.attr('download', '4bit-putty-color-scheme.reg'); - }); - }, - - colorRgb: function(context, color) { - var rgbArray = context.model.get("colors")[color].toRgb(); - return rgbArray[0] + ',' + rgbArray[1] + ',' + rgbArray[2]; - }, - - render: function() { - var that = this; - var out = ''; - var counter = 6; - out += 'Windows Registry Editor Version 5.00 \n\n'; - out += '[HKEY_CURRENT_USER\\Software\\SimonTatham\\PuTTY\\Sessions\\Default%20Settings]\n'; - - out += '"Colour0"="' + that.colorRgb(that, "foreground") + '"\n'; - out += '"Colour1"="' + that.colorRgb(that, "foreground") + '"\n'; - out += '"Colour2"="' + that.colorRgb(that, "background") + '"\n'; - out += '"Colour3"="' + that.colorRgb(that, "background") + '"\n'; - out += '"Colour4"="' + that.colorRgb(that, "background") + '"\n'; - out += '"Colour5"="' + that.colorRgb(that, "foreground") + '"\n'; - - _.each(COLOR_NAMES, function(name) { - out += '"Colour' + counter + '"="' + that.colorRgb(that, name) + '"\n'; - counter += 1; - }); - - return new Blob([out], { type: 'text/text' }); - } - - }); - - var SchemeTerminatorView = Backbone.View.extend({ - - model: scheme, - - initialize: function() { - _.bindAll(this, 'render'); - var that = this; - $('#terminator-button').on('click', function(event) { - var blob = that.render(); - var blobURL = URL.createObjectURL(blob); - var link = $(event.target); - - link.attr('href', blobURL); - link.attr('download', 'config'); - }); - }, - - render: function() { - var that = this; - var out = ''; - var palette_normal = []; - var palette_bright = []; - var colors = that.model.get('colors'); - var name = '4bit-' + (new Date()).getTime(); - - _.each(COLOR_NAMES, function(name) { - if (0 === name.indexOf('bright_')) { - palette_bright.push(colors[name]); - palette_normal.push(colors[name.substr('bright_'.length)]); - } - }); - - var palette = palette_normal.concat(palette_bright); - - out += '# Color scheme configuration for Terminator terminal emulator (http://gnometerminator.blogspot.com/p/introduction.html and https://launchpad.net/terminator)\n'; - out += '# \n'; - out += '# Copy the following lines within the [profiles] section of terminator configuration file at ~/.config/terminator/config\n\n'; - - out += '[[' + name + ']]\n'; - out += ' use_theme_colors = False\n'; - out += ' background_color = "' + colors['background'] + '"\n'; - out += ' foreground_color = "' + colors['foreground'] + '"\n'; - out += ' palette = "' + palette.join(':') + '"' + '\n'; - - return new Blob([out], { type: 'text/text' }); - } - }); - - var ControlsView = Backbone.View.extend({ - - el: $('#controls'), - - model: scheme, - - initialize: function() { - _.bindAll(this, 'render'); - - var that = this; - - $("#hue-slider").slider({ - value: that.model.get('hue') + 30, - min: 0, - max: 60, - step: 1, - slide: function( event, ui ) { - that.model.setHue((ui.value - 30) - that.model.get('hue')); - } - }); - - $("#saturation-slider").slider({ - value: that.model.get('saturation') * 256, - min: 0, - max: 256, - step: 1, - slide: function( event, ui ) { - that.model.setSaturation(ui.value / 256); - } - }); - - $("#lightness-slider").slider({ - range: true, - values: [that.model.get('normal_lightness') * 256, that.model.get('bright_lightness') * 256], - min: 0, - max: 256, - step: 1, - slide: function( event, ui ) { - that.model.setLightness('normal', ui.values[0] / 256); - that.model.setLightness('bright', ui.values[1] / 256); - } - }); - - $("#black-slider").slider({ - range: true, - values: [ - that.model.get('colors').black.getLightness() * 256, - that.model.get('colors').bright_black.getLightness() * 256 - ], - min: 0, - max: 128, - step: 1, - slide: function( event, ui ) { - that.model.setLightness('black', ui.values[0] / 256); - that.model.setLightness('bright_black', ui.values[1] / 256); - } - }); - - $("#white-slider").slider({ - range: true, - values: [ - that.model.get('colors').white.getLightness() * 256, - that.model.get('colors').bright_white.getLightness() * 256 - ], - min: 128, - max: 256, - step: 1, - slide: function( event, ui ) { - that.model.setLightness('white', ui.values[0] / 256); - that.model.setLightness('bright_white', ui.values[1] / 256); - } - }); - - $('#dye-colorpicker').colorPicker({ - format: 'hsla', - size: 90, - colorChange: function(e, ui) { - var pattern, _ref, h, s, l, a; - var type = $('input[name=dye]:checked').val() - pattern = /^hsla\((\d+),\s+(\d+(?:.\d+)?)%,\s+(\d+(?:.\d+)?)%,\s+(\d+(?:.\d+)?)\)$/; - _ref = pattern.exec(ui.color), h = _ref[1], s = _ref[2] / 100, l = _ref[3] / 100, a = _ref[4]; - - switch(type) { - case 'none': - that.model.dye(0, 0, 0, 0, 'all'); - break; - case 'color': - that.model.dye(0, 0, 0, 0, 'achromatic'); - that.model.dye(h, s, l, a, 'color'); - break; - case 'achromatic': - that.model.dye(0, 0, 0, 0, 'color'); - that.model.dye(h, s, l, a, 'achromatic'); - break; - case 'all': - that.model.dye(h, s, l, a, 'all'); - break; - } - } - }); - - $('#dye-colorpicker').colorPicker('setColor', 210, 50, 50, 0.2); - - $("input[name=dye]").change(function() { - $('#dye-colorpicker').change(); - }); - - $('#background-colorpicker').colorPicker({ - format: 'hsl', - size: 90, - colorChange: function(e, ui) { - var pattern, _ref, h, s, l; - var option = $('input[name=background]:checked').val() - pattern = /^hsl\((\d+),\s+(\d+(?:.\d+)?)%,\s+(\d+(?:.\d+)?)%\)$/; - _ref = pattern.exec(ui.color), h = _ref[1], s = _ref[2] / 100, l = _ref[3] / 100; - that.model.setBackground(h, s, l, option); - } - }); - - $('#background-colorpicker').colorPicker('setColor', 210, 50, 10); - - $("input[name=background]").change(function() { - $('#background-colorpicker').change(); - }); - - $('#background .alpha .ui-draggable').removeClass('ui-draggable handle'); - - $('#foreground-colorpicker').colorPicker({ - format: 'hsl', - size: 90, - colorChange: function(e, ui) { - var pattern, _ref, h, s, l; - var option = $('input[name=foreground]:checked').val() - pattern = /^hsl\((\d+),\s+(\d+(?:.\d+)?)%,\s+(\d+(?:.\d+)?)%\)$/; - _ref = pattern.exec(ui.color), h = _ref[1], s = _ref[2] / 100, l = _ref[3] / 100; - that.model.setForeground(h, s, l, option); - } - }); - - $('#foreground-colorpicker').colorPicker('setColor', 210, 50, 90); - - $("input[name=foreground]").change(function() { - $('#foreground-colorpicker').change(); - }); - - $('#foreground .alpha .ui-draggable').removeClass('ui-draggable handle'); - - $(".radio-group").buttonsetv(); - - } - - }); - - var schemeView = new SchemeView(); - var schemeCSSView = new SchemeCSSView(); - var schemeXresourcesView = new SchemeXresourcesView(); - var schemeKonsoleView = new SchemeKonsoleView(); - var schemeMinttyView = new SchemeMinttyView(); - var schemeITerm2View = new SchemeITerm2View(); - var schemeGuakeView = new SchemeGuakeView(); - var schemeGnomeTerminalView = new SchemeGnomeTerminalView(); - var schemeXfceTerminalView = new SchemeXfceTerminalView(); - var schemePuttyView = new SchemePuttyView(); - var schemeTerminatorView = new SchemeTerminatorView(); - var controlsView = new ControlsView(); - - // basic layout behaviour ///////////////////////////// - - $('footer p').hover( - function() { - $(this).find('a').addClass('blue'); - schemeCSSView.render(); - }, - function() { - $(this).find('a').removeClass('blue'); - $(this).find('a').removeAttr("style"); - } - ); - - $(window).bind('load', function() { - $('#display').css('visibility', 'visible'); - $('#controls').css('visibility', 'visible'); - $('#skews').fadeIn(700); - $('#app').animate({opacity: 1}, 700); - $('#get-scheme-button').click(function(button) { - $('#dialog-modal').dialog({ - height: 90 + 50 * $('.get-scheme-link').length, - width: 450, - modal: true, - draggable: false, - resizable: false, - open: function( event, ui ) { - $('.ui-dialog').css('display', 'flex'); - } - }); - }); - }); - -} diff --git a/less/main.less b/less/main.less deleted file mode 100644 index 9d9c8cc..0000000 --- a/less/main.less +++ /dev/null @@ -1,534 +0,0 @@ -/* http://meyerweb.com/eric/tools/css/reset/ - v2.0 | 20110126 - License: none (public domain) -*/ - -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -b, u, i, center, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, embed, -figure, figcaption, footer, header, hgroup, -menu, nav, output, ruby, section, summary, -time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; -} -/* HTML5 display-role reset for older browsers */ -article, aside, details, figcaption, figure, -footer, header, hgroup, menu, nav, section { - display: block; -} -body { - line-height: 1; -} -ol, ul { - list-style: none; -} -blockquote, q { - quotes: none; -} -blockquote:before, blockquote:after, -q:before, q:after { - content: ''; - content: none; -} -table { - border-collapse: collapse; - border-spacing: 0; -} - -a { - color: #000; - text-decoration: none; -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// - -@font-face { - font-family: 'Rationale'; - src: url('../fonts/rationale/rationale-webfont.eot'); - src: url('../fonts/rationale/rationale-webfont.eot?#iefix') format('embedded-opentype'), - url('../fonts/rationale/rationale-webfont.woff') format('woff'), - url('../fonts/rationale/rationale-webfont.ttf') format('truetype'), - url('../fonts/rationale/rationale-webfont.svg#webfontregular') format('svg'); - font-weight: normal; - font-style: normal; -} - -@font-face { - font-family: 'Inconsolata'; - src: url('../fonts/inconsolata/ttf-inconsolata-webfont.eot'); - src: url('../fonts/inconsolata/ttf-inconsolata-webfont.eot?#iefix') format('embedded-opentype'), - url('../fonts/inconsolata/ttf-inconsolata-webfont.woff') format('woff'), - url('../fonts/inconsolata/ttf-inconsolata-webfont.ttf') format('truetype'), - url('../fonts/inconsolata/ttf-inconsolata-webfont.svg#webfontregular') format('svg'); - font-weight: normal; - font-style: normal; -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// - -@app_width: 1190px; -@app_height: 555px; -@header_height: 60px; -@footer_height: 40px; - -html, body { - height: 100%; - width: 100%; -} - -body { - background-color: #eee; - font-family: 'Rationale', sans-serif; - h1 { - color: #777; - font-size: 48px; - display: inline-block; - margin: 18px 0 0 20px; - a { - color: #777; - } - } - header { - position: relative; - min-width: @app_width; - height: @header_height; - overflow: visible; - } - footer { - // display: none; - min-width: @app_width; - height: @footer_height; - overflow: visible; - font-size: 20px; - width: 100%; - p { - display: inline-block; - } - .left { - float: left; - margin-left: 20px; - padding-bottom: 20px; - img { - width: 20px; - height: 20px; - margin: 0 0 -2px 0; - } - } - .right { - float: right; - margin-right: 20px; - padding-bottom: 20px; - } - .left, .right { - opacity: 0.5; - } - .left:hover, .right:hover { - opacity: 1; - } - } -} - -.wrapper { - min-height: @header_height + @app_height + @footer_height; - height: 100%; - margin: 0 auto (-@footer_height - 1px); /* the bottom margin is the negative value of the footer's height */ -} - -.distance { - min-height: ((@app_height) / 2) - @header_height -10px; - margin-bottom: -(((@app_height) / 2) + @header_height) + 10px; - width: 1px; - height: 50%; - margin-top: 0; - float: left; -} - -.vertical-center { - width: @app_width; - height: @app_height; - z-index: 1; - position: relative; - margin: 0 auto; - clear: left; -} - -.push { - height: @footer_height; -} - -.twitter-follow-button { - display: inline-block; - margin-bottom: -3px; - width: 60px; -} - -.twitter-follow-button, .twitter-share-button { - font-size: 0; -} - -#skews { - display: none; - position: absolute; - top: 23px; - right: 23px; - height: 34px; -} - -.skew { - vertical-align: top; - display: block; - height: 34px; - -webkit-transform: skew(-30deg); - -moz-transform: skewX(-30deg); - -o-transform: skew(-30deg); - transform: skew(-30deg); - border-radius: 6px; - margin-right: 4px; - margin-top: 0; -} - -.skew > * { - -webkit-transform: skew(30deg); - -moz-transform: skewX(30deg); - -o-transform: skew(30deg); - transform: skew(30deg); -} - -#social-media { - border: 1px solid #AAA; - background-color: #C9C9C9; - position: relative; - padding: 7px 15px 0 15px; - width: 74px; - height: 26px; - display: inline-block; - white-space: nowrap; - .buttons { - display: inline-block; - } - .inner { - position: absolute; - display: block; - width: 74px; - height: 20px; - } -} - -#get-scheme-button { - width: 163px; - border: 1px solid #ccc; - - span { - white-space: nowrap; - font-size: 20px; - display: inline-block; - -webkit-transform: skew(30deg); - -moz-transform: skewX(30deg); - -o-transform: skew(30deg); - transform: skew(30deg); - padding: 7px 20px 0 15px; - } - - &:hover, &:active { - border: 1px solid #bbb; - } -} - -#get-scheme-button, .get-scheme-link { - display: inline-block; - color: inherit; - background: rgb(254,254,254); /* Old browsers */ - background: -moz-linear-gradient(top, rgba(254,254,254,1) 0%, rgba(223,223,223,1) 100%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(254,254,254,1)), color-stop(100%,rgba(223,223,223,1))); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, rgba(254,254,254,1) 0%,rgba(223,223,223,1) 100%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, rgba(254,254,254,1) 0%,rgba(223,223,223,1) 100%); /* Opera 11.10+ */ - background: -ms-linear-gradient(top, rgba(254,254,254,1) 0%,rgba(223,223,223,1) 100%); /* IE10+ */ - background: linear-gradient(to bottom, rgba(254,254,254,1) 0%,rgba(223,223,223,1) 100%); /* W3C */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fefefe', endColorstr='#dfdfdf',GradientType=0 ); /* IE6-9 */ - - &:hover { - background: rgb(247,247,247); /* Old browsers */ - background: -moz-linear-gradient(top, rgba(247,247,247,1) 0%, rgba(224,224,224,1) 76%, rgba(218,218,218,1) 88%, rgba(209,209,209,1) 100%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(247,247,247,1)), color-stop(76%,rgba(224,224,224,1)), color-stop(88%,rgba(218,218,218,1)), color-stop(100%,rgba(209,209,209,1))); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, rgba(247,247,247,1) 0%,rgba(224,224,224,1) 76%,rgba(218,218,218,1) 88%,rgba(209,209,209,1) 100%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, rgba(247,247,247,1) 0%,rgba(224,224,224,1) 76%,rgba(218,218,218,1) 88%,rgba(209,209,209,1) 100%); /* Opera 11.10+ */ - background: -ms-linear-gradient(top, rgba(247,247,247,1) 0%,rgba(224,224,224,1) 76%,rgba(218,218,218,1) 88%,rgba(209,209,209,1) 100%); /* IE10+ */ - background: linear-gradient(to bottom, rgba(247,247,247,1) 0%,rgba(224,224,224,1) 76%,rgba(218,218,218,1) 88%,rgba(209,209,209,1) 100%); /* W3C */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f7f7f7', endColorstr='#d1d1d1',GradientType=0 ); /* IE6-9 */ - } - &:active { - background: rgb(225,225,225); /* Old browsers */ - background: -moz-linear-gradient(top, rgba(225,225,225,1) 0%, rgba(225,225,225,1) 7%, rgba(232,232,232,1) 16%, rgba(238,238,238,1) 31%, rgba(218,218,218,1) 95%, rgba(217,217,217,1) 96%, rgba(187,187,187,1) 98%, rgba(187,187,187,1) 100%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(225,225,225,1)), color-stop(7%,rgba(225,225,225,1)), color-stop(16%,rgba(232,232,232,1)), color-stop(31%,rgba(238,238,238,1)), color-stop(95%,rgba(218,218,218,1)), color-stop(96%,rgba(217,217,217,1)), color-stop(98%,rgba(187,187,187,1)), color-stop(100%,rgba(187,187,187,1))); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, rgba(225,225,225,1) 0%,rgba(225,225,225,1) 7%,rgba(232,232,232,1) 16%,rgba(238,238,238,1) 31%,rgba(218,218,218,1) 95%,rgba(217,217,217,1) 96%,rgba(187,187,187,1) 98%,rgba(187,187,187,1) 100%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, rgba(225,225,225,1) 0%,rgba(225,225,225,1) 7%,rgba(232,232,232,1) 16%,rgba(238,238,238,1) 31%,rgba(218,218,218,1) 95%,rgba(217,217,217,1) 96%,rgba(187,187,187,1) 98%,rgba(187,187,187,1) 100%); /* Opera 11.10+ */ - background: -ms-linear-gradient(top, rgba(225,225,225,1) 0%,rgba(225,225,225,1) 7%,rgba(232,232,232,1) 16%,rgba(238,238,238,1) 31%,rgba(218,218,218,1) 95%,rgba(217,217,217,1) 96%,rgba(187,187,187,1) 98%,rgba(187,187,187,1) 100%); /* IE10+ */ - background: linear-gradient(to bottom, rgba(225,225,225,1) 0%,rgba(225,225,225,1) 7%,rgba(232,232,232,1) 16%,rgba(238,238,238,1) 31%,rgba(218,218,218,1) 95%,rgba(217,217,217,1) 96%,rgba(187,187,187,1) 98%,rgba(187,187,187,1) 100%); /* W3C */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e1e1e1', endColorstr='#bbbbbb',GradientType=0 ); /* IE6-9 */ - } -} - -.get-scheme-link { - padding: 5px 10px; - float: right; - border: 1px solid #bbb; - border-radius: 6px; - &:hover, &:active { - border: 1px solid #aaa; - } -} - -#dialog-modal { - display: none; -} - -#app { - opacity: 0; - white-space: nowrap; -} - -#controls { - vertical-align: top; - visibility: hidden; - display: inline-block; - margin-left: 16px; - width: 300px; - - h2 { - font-size: 26px; - margin: 20px 0 5px 0; - } - - h3 { - font-size: 18px; - margin: 10px 0 5px 0; - } - -} - -#advanced { - font-size: 18px; - font-family: 'Rationale', sans-serif; - border: none; - background: none; - - h2 { - margin-bottom: 10px; - } - - a { - color: #000 !important; - font-weight: normal; - padding: 2px 16px 3px 16px; - } - - &>.ui-tabs-nav>.ui-state-active { - background: #C9C9C9 !important; - } - - &>.ui-tabs-panel.ui-widget-content { - background: #C9C9C9 !important; - } - - &>.ui-tabs-nav { - padding: 0 !important; - border: none; - background: #eee; - border-radius: 0; - } - - &>.ui-tabs-panel { - padding: 18px 18px 16px 17px; - min-height: 0 !important; - border: 1px solid #999; - -moz-border-radius-top-right: 6px; - -webkit-border-top-right-radius: 6px; - -khtml-border-top-right-radius: 6px; - border-top-right-radius: 6px; - } - - .radio-group { - vertical-align: top; - display: inline-block; - margin: 0; - } - - .colorpicker { - display: inline-block; - } -} - -#controls>.ui-tabs { - padding: 0 !important; -} - -#display { - visibility: hidden; - display: inline-block; - font-family: Inconsolata; - font-size: 20px; - margin: 26px 0 0 20px; - width: auto; - height: auto; - padding: 1px 2px 1px 2px; - -moz-box-shadow: 0 0 10px #666; - -webkit-box-shadow: 0 0 10px #666; - box-shadow: 0 0 10px #666; - - table { - border-collapse: separate; - border-spacing: 0.5em 0; - margin-right: 0.5em; - } - - td { - margin-left: 1em; - padding: 0 1em 0 1em; - } - - .row-th { - text-align: right; - } -} - -.bold { - font-weight: bold; // opera sux -} - -.ui-slider { - font-size: 12px; -} - -.ui-slider-handle { - outline: 0 !important; - cursor: pointer !important; -} - -.colorInput { - display: none; -} - -.colorpicker { - height: 90px; -} - -#foreground, #background { - .alpha { - opacity: 0.3; - } -} - -.radio-group { - margin: -1px 0 0 15px !important; - - input { - display: none; - } - - br { - display: none; - } - - label { - display: block; - height: 18px; - width: 115px; - margin: -2px 0 0 0; - padding: 0; - border: 1px solid #999 !important; - .ui-button-text { - font-family: Arial, Verdana, sans-serif; - margin: 1px 0 0 0; - padding: 0; - font-size: 12px; - color: #000; - font-weight: normal; - padding: 0 !important; - } - } -} - -#dye-radio label { - height: 23px !important; - margin-bottom: -1px; - .ui-button-text { - margin: 3px 0 0 0; - } -} - -.ui-dialog { - font-family: 'Rationale', sans-serif; - background: #c9c9c9 !important; - display: flex; - flex-direction: column; - max-height: 90vh; - - &>.ui-widget-header { - padding-left: 15px; - font-size: 26px; - font-weight: normal; - color: #000; - background: #eee !important; - } - - &>.ui-widget-content { - overflow: scroll; - background: #c9c9c9 !important; - height: auto !important; - padding: 1em 0.8em 0.8em 0.8em; - } - - .ui-icon-closethick { - background: url("../images/cross.png") 3px 3px no-repeat !important; - } - - .ui-state-hover > .ui-icon-closethick { - background: url("../images/cross_active.png") 3px 3px no-repeat !important; - } - - ul { - background-color: #eee; - border-radius: 6px; - - li { - padding: 10px 0 10px 0; - - p { - font-size: 22px; - position: relative; - line-height: 30px; - padding: 0 10px 0 10px; - a { - line-height: 1em; - font-size: 18px; - } - } - } - - li:nth-child(even) { - background-color: #ddd; - } - - li:last-child { - border-bottom-left-radius: 6px; - border-bottom-right-radius: 6px; - } - } - -} - -.ui-widget-overlay { - background: #000; -} diff --git a/lib/google-closure-library b/lib/google-closure-library deleted file mode 160000 index 9b8921b..0000000 --- a/lib/google-closure-library +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9b8921b13f2228dd1c9a59b8bda2fe17302c041d diff --git a/lib/js/backbone-min.js b/lib/js/backbone-min.js deleted file mode 100755 index c1c0d4f..0000000 --- a/lib/js/backbone-min.js +++ /dev/null @@ -1,38 +0,0 @@ -// Backbone.js 0.9.2 - -// (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc. -// Backbone may be freely distributed under the MIT license. -// For all details and documentation: -// http://backbonejs.org -(function(){var l=this,y=l.Backbone,z=Array.prototype.slice,A=Array.prototype.splice,g;g="undefined"!==typeof exports?exports:l.Backbone={};g.VERSION="0.9.2";var f=l._;!f&&"undefined"!==typeof require&&(f=require("underscore"));var i=l.jQuery||l.Zepto||l.ender;g.setDomLibrary=function(a){i=a};g.noConflict=function(){l.Backbone=y;return this};g.emulateHTTP=!1;g.emulateJSON=!1;var p=/\s+/,k=g.Events={on:function(a,b,c){var d,e,f,g,j;if(!b)return this;a=a.split(p);for(d=this._callbacks||(this._callbacks= -{});e=a.shift();)f=(j=d[e])?j.tail:{},f.next=g={},f.context=c,f.callback=b,d[e]={tail:g,next:j?j.next:f};return this},off:function(a,b,c){var d,e,h,g,j,q;if(e=this._callbacks){if(!a&&!b&&!c)return delete this._callbacks,this;for(a=a?a.split(p):f.keys(e);d=a.shift();)if(h=e[d],delete e[d],h&&(b||c))for(g=h.tail;(h=h.next)!==g;)if(j=h.callback,q=h.context,b&&j!==b||c&&q!==c)this.on(d,j,q);return this}},trigger:function(a){var b,c,d,e,f,g;if(!(d=this._callbacks))return this;f=d.all;a=a.split(p);for(g= -z.call(arguments,1);b=a.shift();){if(c=d[b])for(e=c.tail;(c=c.next)!==e;)c.callback.apply(c.context||this,g);if(c=f){e=c.tail;for(b=[b].concat(g);(c=c.next)!==e;)c.callback.apply(c.context||this,b)}}return this}};k.bind=k.on;k.unbind=k.off;var o=g.Model=function(a,b){var c;a||(a={});b&&b.parse&&(a=this.parse(a));if(c=n(this,"defaults"))a=f.extend({},c,a);b&&b.collection&&(this.collection=b.collection);this.attributes={};this._escapedAttributes={};this.cid=f.uniqueId("c");this.changed={};this._silent= -{};this._pending={};this.set(a,{silent:!0});this.changed={};this._silent={};this._pending={};this._previousAttributes=f.clone(this.attributes);this.initialize.apply(this,arguments)};f.extend(o.prototype,k,{changed:null,_silent:null,_pending:null,idAttribute:"id",initialize:function(){},toJSON:function(){return f.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;b=this.get(a);return this._escapedAttributes[a]=f.escape(null== -b?"":""+b)},has:function(a){return null!=this.get(a)},set:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c||(c={});if(!d)return this;d instanceof o&&(d=d.attributes);if(c.unset)for(e in d)d[e]=void 0;if(!this._validate(d,c))return!1;this.idAttribute in d&&(this.id=d[this.idAttribute]);var b=c.changes={},h=this.attributes,g=this._escapedAttributes,j=this._previousAttributes||{};for(e in d){a=d[e];if(!f.isEqual(h[e],a)||c.unset&&f.has(h,e))delete g[e],(c.silent?this._silent: -b)[e]=!0;c.unset?delete h[e]:h[e]=a;!f.isEqual(j[e],a)||f.has(h,e)!=f.has(j,e)?(this.changed[e]=a,c.silent||(this._pending[e]=!0)):(delete this.changed[e],delete this._pending[e])}c.silent||this.change(c);return this},unset:function(a,b){(b||(b={})).unset=!0;return this.set(a,null,b)},clear:function(a){(a||(a={})).unset=!0;return this.set(f.clone(this.attributes),a)},fetch:function(a){var a=a?f.clone(a):{},b=this,c=a.success;a.success=function(d,e,f){if(!b.set(b.parse(d,f),a))return!1;c&&c(b,d)}; -a.error=g.wrapError(a.error,b,a);return(this.sync||g.sync).call(this,"read",this,a)},save:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c=c?f.clone(c):{};if(c.wait){if(!this._validate(d,c))return!1;e=f.clone(this.attributes)}a=f.extend({},c,{silent:!0});if(d&&!this.set(d,c.wait?a:c))return!1;var h=this,i=c.success;c.success=function(a,b,e){b=h.parse(a,e);if(c.wait){delete c.wait;b=f.extend(d||{},b)}if(!h.set(b,c))return false;i?i(h,a):h.trigger("sync",h,a,c)};c.error=g.wrapError(c.error, -h,c);b=this.isNew()?"create":"update";b=(this.sync||g.sync).call(this,b,this,c);c.wait&&this.set(e,a);return b},destroy:function(a){var a=a?f.clone(a):{},b=this,c=a.success,d=function(){b.trigger("destroy",b,b.collection,a)};if(this.isNew())return d(),!1;a.success=function(e){a.wait&&d();c?c(b,e):b.trigger("sync",b,e,a)};a.error=g.wrapError(a.error,b,a);var e=(this.sync||g.sync).call(this,"delete",this,a);a.wait||d();return e},url:function(){var a=n(this,"urlRoot")||n(this.collection,"url")||t(); -return this.isNew()?a:a+("/"==a.charAt(a.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(a){return a},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},change:function(a){a||(a={});var b=this._changing;this._changing=!0;for(var c in this._silent)this._pending[c]=!0;var d=f.extend({},a.changes,this._silent);this._silent={};for(c in d)this.trigger("change:"+c,this,this.get(c),a);if(b)return this;for(;!f.isEmpty(this._pending);){this._pending= -{};this.trigger("change",this,a);for(c in this.changed)!this._pending[c]&&!this._silent[c]&&delete this.changed[c];this._previousAttributes=f.clone(this.attributes)}this._changing=!1;return this},hasChanged:function(a){return!arguments.length?!f.isEmpty(this.changed):f.has(this.changed,a)},changedAttributes:function(a){if(!a)return this.hasChanged()?f.clone(this.changed):!1;var b,c=!1,d=this._previousAttributes,e;for(e in a)if(!f.isEqual(d[e],b=a[e]))(c||(c={}))[e]=b;return c},previous:function(a){return!arguments.length|| -!this._previousAttributes?null:this._previousAttributes[a]},previousAttributes:function(){return f.clone(this._previousAttributes)},isValid:function(){return!this.validate(this.attributes)},_validate:function(a,b){if(b.silent||!this.validate)return!0;var a=f.extend({},this.attributes,a),c=this.validate(a,b);if(!c)return!0;b&&b.error?b.error(this,c,b):this.trigger("error",this,c,b);return!1}});var r=g.Collection=function(a,b){b||(b={});b.model&&(this.model=b.model);b.comparator&&(this.comparator=b.comparator); -this._reset();this.initialize.apply(this,arguments);a&&this.reset(a,{silent:!0,parse:b.parse})};f.extend(r.prototype,k,{model:o,initialize:function(){},toJSON:function(a){return this.map(function(b){return b.toJSON(a)})},add:function(a,b){var c,d,e,g,i,j={},k={},l=[];b||(b={});a=f.isArray(a)?a.slice():[a];c=0;for(d=a.length;c=b))this.iframe=i('