├── .npmignore ├── README-content ├── pathfinder.gif ├── expand-strokes.gif ├── sketch-position.png ├── pixel-grid-illustrator.ai ├── header.txt └── clean-svg ├── html ├── index.html └── viewer │ ├── embed.html │ ├── images │ ├── check.svg │ ├── desktop-16.svg │ ├── android-16.svg │ ├── ios-16.svg │ └── context-fill.svg │ ├── js │ ├── icon-styles.js │ ├── icon-list.js │ └── app.js │ ├── css │ ├── input-radio.css │ ├── input-checkbox.css │ └── app.css │ └── index.html ├── .travis.yml ├── Gruntfile.js ├── .gitignore ├── package.json ├── README.md └── LICENSE /.npmignore: -------------------------------------------------------------------------------- 1 | Gruntfile.js -------------------------------------------------------------------------------- /README-content/pathfinder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FirefoxUX/icons/HEAD/README-content/pathfinder.gif -------------------------------------------------------------------------------- /README-content/expand-strokes.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FirefoxUX/icons/HEAD/README-content/expand-strokes.gif -------------------------------------------------------------------------------- /README-content/sketch-position.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FirefoxUX/icons/HEAD/README-content/sketch-position.png -------------------------------------------------------------------------------- /README-content/pixel-grid-illustrator.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FirefoxUX/icons/HEAD/README-content/pixel-grid-illustrator.ai -------------------------------------------------------------------------------- /html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Firefox SVG Viewer 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 7.7.0 4 | before_script: npm run build 5 | deploy: 6 | provider: pages 7 | skip_cleanup: true 8 | github_token: $GH_TOKEN 9 | local_dir: dist 10 | on: 11 | branch: master 12 | -------------------------------------------------------------------------------- /README-content/header.txt: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /README-content/clean-svg: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for svg in `ls **/*.svg` 4 | do 5 | 6 | # format the file with svgo 7 | svgo $svg --pretty --indent=2 8 | 9 | # append our Mozilla license to the beginning of the file 10 | cat /usr/local/bin/header.txt | cat - $svg > temp && mv temp $svg 11 | done -------------------------------------------------------------------------------- /html/viewer/embed.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Firefox SVG icons 5 | 6 | 7 | 8 |

Icons

9 | 10 | 11 |
Loading icons...
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /html/viewer/images/check.svg: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /html/viewer/images/desktop-16.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | grunt.initConfig({ 3 | svgmin: { 4 | options: { 5 | plugins: [ 6 | {removeViewBox: false}, 7 | {removeUselessStrokeAndFill: false}, 8 | {removeTitle: true} 9 | ] 10 | }, 11 | dist: { 12 | files: ["**/*.svg"] 13 | } 14 | } 15 | }); 16 | 17 | var packageJson = JSON.parse(grunt.file.read("package.json")); 18 | for (var packageName in packageJson.devDependencies) { 19 | if (packageName.indexOf("grunt-") !== -1) { 20 | grunt.loadNpmTasks(packageName); 21 | } 22 | } 23 | 24 | grunt.registerTask("default", ["svgmin"]); 25 | } 26 | -------------------------------------------------------------------------------- /html/viewer/js/icon-styles.js: -------------------------------------------------------------------------------- 1 | var FORMATS = { 2 | desktop: { 3 | export(svg) { 4 | let blob = new Blob([svg], { 5 | type: "image/svg+xml", 6 | }); 7 | return URL.createObjectURL(blob); 8 | } 9 | }, 10 | svg: { 11 | export(svg) { 12 | let blob = new Blob([svg], { 13 | type: "image/svg+xml", 14 | }); 15 | return URL.createObjectURL(blob); 16 | } 17 | }, 18 | ios: { 19 | export(svg) { 20 | let blob = new Blob([svg], { 21 | type: "image/svg+xml", 22 | }); 23 | return URL.createObjectURL(blob); 24 | } 25 | }, 26 | android: { 27 | export(svg) { 28 | let blob = new Blob([svg], { 29 | type: "image/svg+xml", 30 | }); 31 | return URL.createObjectURL(blob); 32 | } 33 | } 34 | }; -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .tmp 2 | .DS_Store 3 | .svgsus 4 | 5 | #### joe made this: https://goel.io/joe 6 | 7 | #####=== Node ===##### 8 | 9 | # Logs 10 | logs 11 | *.log 12 | 13 | # Runtime data 14 | pids 15 | *.pid 16 | *.seed 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | 24 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 25 | .grunt 26 | 27 | # node-waf configuration 28 | .lock-wscript 29 | 30 | # Compiled binary addons (http://nodejs.org/api/addons.html) 31 | build/Release 32 | dist 33 | 34 | # Dependency directory 35 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- 36 | node_modules 37 | 38 | # Debug log from npm 39 | npm-debug.log 40 | 41 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "icons", 3 | "description": "SVG files used in Firefox", 4 | "main": "", 5 | "version": "3.0.0", 6 | "scripts": { 7 | "test": "echo \"Tests? We don't need tests!\"", 8 | "build": "node build.js", 9 | "watch": "watch \"npm run build\" html", 10 | "serve": "serve dist", 11 | "dev": "npm run build && npm-run-all --parallel serve watch" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "https://github.com/FirefoxUX/icons" 16 | }, 17 | "author": "Mozilla", 18 | "license": "MPL-2.0", 19 | "bugs": { 20 | "url": "https://github.com/FirefoxUX/icons/issues" 21 | }, 22 | "files": [ 23 | "icons" 24 | ], 25 | "homepage": "https://github.com/FirefoxUX/icons", 26 | "devDependencies": { 27 | "npm-run-all": "4.1.5", 28 | "photon-icons": "5.4.0", 29 | "serve": "10.1.2", 30 | "shelljs": "0.8.3", 31 | "watch": "1.0.2" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /html/viewer/js/icon-list.js: -------------------------------------------------------------------------------- 1 | var IconList = { 2 | categories: null, 3 | 4 | getAllCategories: function() { 5 | if (!self.categories) { 6 | let category_index = {}; 7 | self.categories = []; 8 | 9 | for (let icon of data) { 10 | for (let category of icon.categories) { 11 | if (category_index[category] == undefined) { 12 | category_index[category] = self.categories.length; 13 | self.categories.push({name: category, items: []}) 14 | } 15 | let index = category_index[category]; 16 | self.categories[index].items.push(icon); 17 | } 18 | } 19 | } 20 | return self.categories; 21 | }, 22 | 23 | getDisplayURI: function(icon, platform, size) { 24 | const sizes = icon.source[platform]; 25 | if (!icon.source[platform]) { 26 | return undefined; 27 | } 28 | const selectedSize = size || Math.max(...Object.keys(sizes)); 29 | let pageUrl = location.href; 30 | pageUrl = pageUrl.substring(0, pageUrl.lastIndexOf("/")).replace("viewer", ""); 31 | return pageUrl + icon.source[platform][selectedSize]; 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /html/viewer/css/input-radio.css: -------------------------------------------------------------------------------- 1 | #icon-details [type="radio"]:not(:checked) + label, 2 | #icon-details [type="radio"]:checked + label { 3 | cursor: pointer; 4 | padding-left: 32px; 5 | position: relative; 6 | } 7 | 8 | #icon-details [type="radio"]:not(:checked), 9 | #icon-details [type="radio"]:checked { 10 | left: -9999px; 11 | position: absolute; 12 | } 13 | 14 | #icon-details [type="radio"]:not(:checked) + label::after, 15 | #icon-details [type="radio"]:checked + label::after { 16 | position: absolute; 17 | top: 5px; 18 | left: 5px; 19 | content: ''; 20 | width: 12px; 21 | height: 12px; 22 | border-radius: 100%; 23 | } 24 | 25 | #icon-details [type="radio"]:checked + label::after { 26 | background-color: var(--blue-50); 27 | } 28 | 29 | #icon-details [type="radio"]:not(:checked) + label::before, 30 | #icon-details [type="radio"]:checked + label::before { 31 | background: var(--white); 32 | border: 1px solid var(--grey-30); 33 | border-radius: 100%; 34 | content: ''; 35 | width: 20px; 36 | height: 20px; 37 | left: 0; 38 | position: absolute; 39 | top: 0; 40 | } 41 | 42 | #icon-details [type="radio"]:disabled + label{ 43 | opacity: 0.5; 44 | cursor: not-allowed; 45 | } -------------------------------------------------------------------------------- /html/viewer/css/input-checkbox.css: -------------------------------------------------------------------------------- 1 | #icon-details [type="checkbox"]:not(:checked) + label, 2 | #icon-details [type="checkbox"]:checked + label { 3 | cursor: pointer; 4 | padding-left: 32px; 5 | position: relative; 6 | } 7 | 8 | #icon-details [type="checkbox"]:not(:checked), 9 | #icon-details [type="checkbox"]:checked { 10 | left: -9999px; 11 | position: absolute; 12 | } 13 | 14 | #icon-details [type="checkbox"]:not(:checked) + label::after, 15 | #icon-details [type="checkbox"]:checked + label::after { 16 | content: ''; 17 | position: absolute; 18 | top: 0; 19 | padding: 3px; 20 | width: 16px; 21 | height: 16px; 22 | left: 0; 23 | } 24 | 25 | #icon-details [type="checkbox"]:checked + label::after { 26 | background: url("../images/check.svg") no-repeat center center; 27 | } 28 | 29 | #icon-details [type="checkbox"]:not(:checked) + label::before, 30 | #icon-details [type="checkbox"]:checked + label::before { 31 | background-color: var(--white); 32 | border: 1px solid var(--grey-30); 33 | border-radius: 3px; 34 | content: ''; 35 | height: 20px; 36 | left: 0; 37 | position: absolute; 38 | top: 0; 39 | width: 20px; 40 | } 41 | 42 | #icon-details [type="checkbox"]:disabled + label{ 43 | opacity: 0.5; 44 | cursor: not-allowed; 45 | } -------------------------------------------------------------------------------- /html/viewer/images/android-16.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /html/viewer/images/ios-16.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /html/viewer/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Photon Icons 5 | 6 | 7 | 8 | 9 | 10 |

Photon Icons

11 |
12 | 13 |
14 |
Desktop
15 |
Android
16 |
iOS
17 |
18 |
19 | 20 |
Loading icons...
21 |
22 |
23 |

Download

24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
Size
34 |
35 |
36 |
37 |
Icon Fill
38 |
39 | 40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | 55 |
56 |
57 | Site Feedback 58 |
59 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /html/viewer/images/context-fill.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Firefox SVG Assets [![Build Status](https://travis-ci.org/FirefoxUX/icons.svg?branch=master)](https://travis-ci.org/FirefoxUX/icons) 2 | If you'd like to contribute SVG assets to Firefox, this is meant to be a handy guide for making sure you SVGs are compressed and neatly formatted as possible :tada: 3 | 4 | ## Table of Contents 5 | 1. [Explanation of Pixel Grid](#explanation-of-pixel-grid) 6 | 2. [Tips for Illustrator SVGs](#tips-for-illustrator-svgs) 7 | 3. [Tips for Sketch](#tips-for-sketch) 8 | 4. [Contributing Other Design Workflows](#contributing-other-design-workflows) 9 | 5. [Bash Script for Cleaning SVGs](#bash-script-for-cleaning-svgs) 10 | 6. [Contributing Code](#contributing-code) 11 | 12 | 13 | 14 | 15 | ### Explanation of Pixel Grid 16 | Since so many of our SVGs appear so small, designing them on the pixel grid will help them not appear fuzzy when they’re sized down to 16x16 pixels. 17 | 18 | For Illustrator you’ll want the following settings: 19 | 20 | - **Document settings**: ```Units: pixels```, ```Advanced``` > check ```Align New Objects to Pixel Grid``` 21 | - **Transform Panel**: for existing artwork not on pixel grid, select and then within ```Transform``` > ```Advanced``` > check ```Align to Pixel Grid``` 22 | 23 | You can get a more detailed breakdown with images [here](http://medialoot.com/blog/3-valuable-pixel-perfect-illustrator-techniques/). 24 | 25 | You can download a sample Illustrator file [here](README-content/pixel-grid-illustrator.ai). 26 | 27 | 28 | 29 | ### Tips for Illustrator SVGs 30 | When you’re designing your icons in a graphics editor like Adobe Illustrator, there are a lot of things you can do that will bring down the size of the file and make your SVGs easier for the developers to work with. Here are some of them: 31 | 32 | - **Expand paths**: Instead of having multiple shapes overlapping each other, expand shapes using the pathfinder. 33 | ![Use pathfinder to expand shapes](README-content/pathfinder.gif) 34 | - Simplify paths (```Object``` > ```Path``` > ```Simplify```) 35 | - Expand objects so that stokes become objects. This has the added benefit of keeping the stroke size intact as the SVG is resized. 36 | ![Expand strokes to make them objects](README-content/expand-strokes.gif) 37 | 38 | #### Devtools-Specific Requests 39 | The devtools panel icons do a couple of things in a specific way; following these guidelines will help stick your patch: 40 | 41 | 1. **Inline fill colors.** Devtools panel icons all use ```fill=whitesmoke``` in the `````` tag. 42 | 2. **Inline opacities.** Devtools panel icons also inline opacities on their relevant path. 43 | 44 | ### Tips for Sketch 45 | Sketch vector work is a little different but the fundamentals (keeping your SVG small, expanding all paths) is the same. Here's what we've found helps to build clean icons: 46 | 47 | - **Build your icon at 16x16 with the Pixel Grid turned on.** You can turn the pixel grid on at ```View > Canvas > Show Pixels``` 48 | 49 | - **Make sure that all x/y coordinates are full pixels for lines/rectangles.** Sub-pixels = not on pixel grid. 50 | ![Position in the upper right hand corner of Sketch](README-content/sketch-position.png) 51 | 52 | - **Expand all your paths so strokes expand properly as SVG gets resized.** You can do this at ```Layer > Paths > Vectorize Stroke```. 53 | 54 | - **Align anything that isn't boxy to the pixel grid with item selected then ```Layer > Round to Nearest Pixel Edge```.** 55 | 56 | ### Contributing Other Design Workflows 57 | If you’re using a design tool that isn’t listed here and you’d like to add the instructions for how to expand paths, simplify paths, expand strokes, etc., please [open a PR]()! We’d super appreciate it + you’d be the best :100: 58 | 59 | 60 | 61 | 62 | 63 | ### Bash Script for Cleaning SVGs (Installation) 64 | The executable for cleaning svgs can be found [here](README-content/clean-svg). Its corresponding header can be found [here](README-content/header.txt). 65 | 66 | 1. Save both files. [```clean-svg``` executable](README-content/clean-svg) | [```header.txt```](README-content/header.txt) 67 | 2. ```npm install -g svgo``` (Installation instructions for Node can be found [here](https://nodejs.org/en/).) 68 | 3. Move both the executable and ```header.txt``` to ```usr/local/bin```. 69 | 4. Make the bash script executable with ```chmod 755 clean-svg```. 70 | 5. `cd icons` and then run `clean-svg` 71 | 72 | 73 | 74 | 75 | 76 | ### Contributing Code 77 | We have a bunch of things we'd like to include for version 1.0; feel free to take a look at [everything in milestone 1](https://github.com/nt1m/firefox-svg-icons/milestones/v1.0) and take a crack at any of them. 78 | 79 | 80 | -------------------------------------------------------------------------------- /html/viewer/js/app.js: -------------------------------------------------------------------------------- 1 | var IconViewer = { 2 | init: function() { 3 | document.querySelector('.filter .toggle').addEventListener('click', IconViewer.togglePlatform.bind(IconViewer)); 4 | this.platform = document.querySelector('.filter .toggle .checked').id.replace('toggle-', ''); 5 | 6 | this.iconListEl = document.querySelector("#icon-list"); 7 | this.searchEl = document.querySelector("#search-input"); 8 | if (this.searchEl) { 9 | this.searchEl.setAttribute("disabled", "disabled"); 10 | this.searchEl.addEventListener("input", this.filterIcons.bind(this)); 11 | if (location.hash) { 12 | this.searchEl.value = decodeURIComponent(location.hash.replace("#", "")); 13 | } 14 | } 15 | this.iconListEl.addEventListener("click", ({ target }) => { 16 | if (!target.classList.contains("icon-display")) { 17 | updateSidebar(); 18 | return; 19 | } 20 | updateSidebar(target); 21 | }); 22 | document.querySelector('#icon-details .close-button') 23 | .addEventListener('click', () => updateSidebar()); 24 | document.querySelector('#download a').addEventListener('click', e => { 25 | // If it's a deprecated icon, don't let people download it. 26 | if (document.getElementById('icon-details').dataset.deprecated == "true") { 27 | e.preventDefault(); 28 | return; 29 | } 30 | updateDownloadUrl(); 31 | ga('send', 'event', 'icons', 'click', e.target.dataset.path); 32 | }); 33 | this.previewEl = document.querySelector('#icon-details .preview'); 34 | 35 | document.querySelector('#icon-details .options').addEventListener('change', updatePreview); 36 | 37 | this.showAllIcons(); 38 | }, 39 | 40 | getSelected() { 41 | return document.querySelector(".icon-display.selected"); 42 | }, 43 | 44 | setSelected(element) { 45 | let icons = document.querySelectorAll(".icon-display"); 46 | icons.forEach(e => e.classList.toggle("selected", e === element)); 47 | }, 48 | 49 | displayCategory: function(category) { 50 | let categoryEl = createNode({ 51 | tagName: "div", 52 | attributes: { 53 | class: "category-display", 54 | "data-category": category.name 55 | }, 56 | parent: this.iconListEl 57 | }); 58 | for (let item of category.items) { 59 | this.displayIcon(item, categoryEl, category.name); 60 | } 61 | }, 62 | 63 | displayIcon: function(icon, container, category) { 64 | let iconContainer = createNode({ 65 | tagName: "div", 66 | attributes: { 67 | class: "icon-display", 68 | download: icon.name + '.svg', 69 | target: "_blank", 70 | "data-icon": icon.name.toLowerCase(), 71 | "data-category": category, 72 | "data-tags": (icon.tags || []).join(','), 73 | "data-path": icon.location, 74 | "data-filename": icon.name + '.svg', 75 | "data-deprecated": icon.tags.indexOf("deprecated") != -1 76 | }, 77 | parent: container 78 | }); 79 | 80 | iconContainer.source = icon.source; 81 | 82 | for (let platform in icon.source) { 83 | iconContainer.dataset[`uri_${platform}`] = IconList.getDisplayURI(icon, platform); 84 | } 85 | 86 | let image = createNode({ 87 | tagName: "img", 88 | attributes: { 89 | src: IconList.getDisplayURI(icon, this.platform) 90 | }, 91 | parent: iconContainer 92 | }); 93 | }, 94 | 95 | filterIcons: function() { 96 | let query = ""; 97 | if (this.searchEl) { 98 | query = this.searchEl.value.trim(); 99 | } 100 | let allIcons = [].slice.call(this.iconListEl.querySelectorAll(".icon-display")); 101 | location.hash = "#" + query; 102 | query = query.toLowerCase(); 103 | for (let icon of allIcons) { 104 | if (icon.dataset.icon.indexOf(query) > -1 || 105 | icon.dataset.category.indexOf(query) > -1 || 106 | icon.dataset.tags.indexOf(query) > -1 || 107 | query == "") { 108 | icon.classList.remove("hidden"); 109 | } else { 110 | icon.classList.add("hidden"); 111 | } 112 | } 113 | 114 | // Also specifically hide the ones that aren't on the specified platform.) 115 | nextIcon: for (let icon of allIcons) { 116 | if (!icon.classList.contains("hidden")) { 117 | let icon_uri = IconList.getDisplayURI(icon, this.platform); 118 | if (icon_uri) { 119 | icon.childNodes[0].src = icon_uri; 120 | } else { 121 | icon.classList.add("hidden"); 122 | } 123 | } 124 | } 125 | 126 | let categories = [].slice.call(this.iconListEl.querySelectorAll(".category-display")); 127 | for (let category of categories) { 128 | let numberOfHiddenItems = category.querySelectorAll(".hidden").length; 129 | if ((category.dataset.category.indexOf(query) > -1) || 130 | query == "") { 131 | category.classList.remove("hidden"); 132 | } else if (numberOfHiddenItems == category.childNodes.length) { 133 | category.classList.add("hidden"); 134 | } else { 135 | category.classList.remove("hidden"); 136 | } 137 | } 138 | }, 139 | 140 | showAllIcons: function() { 141 | let categories = IconList.getAllCategories(); 142 | for (let category of categories) { 143 | this.displayCategory(category); 144 | } 145 | document.getElementById("loading").remove(); 146 | this.iconListEl.removeAttribute("hidden"); 147 | if (this.searchEl) { 148 | this.searchEl.removeAttribute("disabled"); 149 | } 150 | this.filterIcons(); 151 | }, 152 | 153 | togglePlatform: function(e) { 154 | let target = e.originalTarget; 155 | while (!target.id) { 156 | target = target.parentNode; 157 | } 158 | let platforms = document.querySelectorAll(".filter .toggle div"); 159 | platforms.forEach(elem => elem.classList.toggle("checked", elem === target )); 160 | this.platform = target.id.replace('toggle-', ''); 161 | 162 | this.filterIcons(); 163 | } 164 | }; 165 | 166 | window.addEventListener("DOMContentLoaded", IconViewer.init.bind(IconViewer)); 167 | 168 | // Helpers 169 | function createNode(options) { 170 | let el = document.createElement(options.tagName || "div"); 171 | 172 | if (options.attributes) { 173 | for (let i in options.attributes) { 174 | el.setAttribute(i, options.attributes[i]); 175 | } 176 | } 177 | 178 | if (options.textContent) { 179 | el.textContent = options.textContent; 180 | } 181 | 182 | if (options.parent) { 183 | options.parent.appendChild(el); 184 | } 185 | 186 | return el; 187 | } 188 | 189 | function updateSidebar(icon) { 190 | let details = document.getElementById('icon-details'); 191 | details.classList.toggle('show', !!icon); 192 | 193 | IconViewer.setSelected(icon); 194 | 195 | if (!icon) { 196 | return; 197 | } 198 | 199 | ga('send', 'event', 'icons', 'preview', icon.dataset.path); 200 | 201 | let sizeSelector = document.getElementById("sizes"); 202 | let iconSizes = IconViewer.getSelected().source[IconViewer.platform]; 203 | 204 | sizeSelector.textContent = ""; 205 | for (let size in iconSizes) { 206 | let parent = createNode({ 207 | attributes: { class: "radio" }, 208 | parent: sizeSelector, 209 | }); 210 | createNode({ 211 | tagName: "input", 212 | attributes: { 213 | type: "radio", 214 | name: "size", 215 | value: size, 216 | id: "size-" + size, 217 | }, 218 | parent: parent, 219 | }); 220 | createNode({ 221 | tagName: "label", 222 | attributes: { 223 | for: "size-" + size, 224 | }, 225 | textContent: size, 226 | parent: parent, 227 | }); 228 | } 229 | 230 | let maxSize = Math.max(...Object.keys(iconSizes)); 231 | document.getElementById("size-" + maxSize).checked = true; 232 | 233 | details.querySelector('.name').textContent = icon.dataset.icon; 234 | details.dataset.deprecated = icon.dataset.deprecated; 235 | updatePreview(); 236 | } 237 | 238 | function updatePreview(e) { 239 | let selectedSize = document.querySelector("input[name='size']:checked").value; 240 | 241 | let icon_uri = IconList.getDisplayURI( 242 | IconViewer.getSelected(), 243 | IconViewer.platform, 244 | selectedSize, 245 | ); 246 | 247 | if (!icon_uri) { 248 | return; 249 | } 250 | fetch(icon_uri).then(response => { 251 | return response.text(); 252 | }).then(innerHTML => { 253 | let icon = document.querySelector('#icon-details .preview .icon'); 254 | icon.innerHTML = innerHTML; 255 | 256 | let fills = ['context-fill', 'light', 'dark']; 257 | let selectedFill = document.querySelector("input[name='fill']:checked"); 258 | if (fills.includes(selectedFill.id)) { 259 | for (let id of fills) { 260 | IconViewer.previewEl.classList.toggle(id, selectedFill.id === id); 261 | } 262 | } 263 | let elements = IconViewer.previewEl.querySelectorAll('[fill="context-fill"]'); 264 | if (elements.length == 0) { 265 | elements = IconViewer.previewEl.querySelectorAll('[fill="#0c0c0d" i]'); 266 | } 267 | elements.forEach(el => { 268 | el.setAttribute('fill', selectedFill.value); 269 | }); 270 | 271 | updateDownloadUrl(); 272 | }); 273 | } 274 | 275 | function updateDownloadUrl() { 276 | let selectedFormat = IconViewer.platform; 277 | let selectedIcon = IconViewer.getSelected(); 278 | 279 | let svg = document.querySelector("#icon-details .preview .icon").innerHTML; 280 | let url = FORMATS[selectedFormat].export(svg); 281 | let download = document.querySelector('#download a'); 282 | download.href = url; 283 | download.setAttribute('download', selectedIcon.dataset.filename); 284 | download.dataset.path = selectedIcon.dataset.path; 285 | } 286 | -------------------------------------------------------------------------------- /html/viewer/css/app.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --white-100: #ffffff; 3 | --blue-50: #0a84ff; 4 | --blue-60: #0060df; 5 | --grey-10: #f9f9fa; 6 | --grey-30: #d7d7db; 7 | --grey-50: #737373; 8 | --grey-70: #4a4a4f; 9 | --grey-90: #0c0c0d; 10 | --grey-90-a10: rgba(12, 12, 13, 0.1); 11 | --grey-90-a20: rgba(12, 12, 13, 0.2); 12 | --grey-90-a60: rgba(12, 12, 13, 0.6); 13 | --photon-timing-fuction: cubic-bezier(.07,.95,0,1); 14 | --sidebar-width: 320px; 15 | } 16 | 17 | * { 18 | box-sizing: border-box; 19 | } 20 | 21 | /** Global styles **/ 22 | 23 | body { 24 | font-family: -apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif; 25 | margin: 0; 26 | padding: 0; 27 | color: var(--grey-90); 28 | background-color: var(--grey-10); 29 | } 30 | 31 | .hidden { 32 | display: none !important; 33 | } 34 | 35 | #loading { 36 | text-align: center; 37 | font-size: 20px; 38 | margin-top: 30px; 39 | } 40 | 41 | #headline { 42 | margin: 0; 43 | padding: 20px; 44 | font-size: 36px; 45 | font-weight: 400; 46 | background-color: var(--white-100); 47 | } 48 | 49 | /** Filter **/ 50 | 51 | .filter { 52 | background-color: var(--white-100); 53 | border-bottom: 1px solid var(--grey-30); 54 | position: sticky; 55 | top: 0; 56 | z-index: 1; 57 | } 58 | 59 | /** Toggle **/ 60 | 61 | .filter .toggle { 62 | display: flex; 63 | flex-shrink: 0; 64 | } 65 | 66 | .filter .toggle div { 67 | border-bottom: 4px solid transparent; 68 | color: var(--grey-50); 69 | flex-grow: 1; 70 | font-size: 16px; 71 | padding: 16px 8px; 72 | text-align: center; 73 | } 74 | 75 | .filter .toggle div:hover, 76 | .filter .toggle div:active { 77 | background-color: var(--grey-90-a10); 78 | border-bottom: 4px solid var(--grey-30); 79 | } 80 | 81 | .filter .toggle div.checked { 82 | border-bottom: 4px solid var(--blue-50); 83 | color: var(--blue-50); 84 | } 85 | 86 | .toggle div span { 87 | background-color: var(--grey-90-a60); 88 | background-size: 16px; 89 | background-repeat: no-repeat; 90 | display: inline-block; 91 | height: 16px; 92 | margin-right: 8px; 93 | margin-top: 1px; 94 | vertical-align: top; 95 | width: 16px; 96 | } 97 | 98 | .filter .toggle div.checked span { 99 | background-color: var(--blue-50); 100 | } 101 | 102 | #toggle-desktop span { 103 | mask: url('../images/desktop-16.svg') no-repeat center; 104 | } 105 | 106 | #toggle-android span { 107 | mask: url('../images/android-16.svg') no-repeat center; 108 | } 109 | 110 | #toggle-ios span { 111 | mask: url('../images/ios-16.svg') no-repeat center; 112 | } 113 | 114 | @media screen and (min-width: 600px) { 115 | .filter { 116 | display: flex; 117 | } 118 | .filter .toggle span { 119 | flex-grow: 0; 120 | } 121 | 122 | .filter .toggle div { 123 | padding: 16px; 124 | } 125 | } 126 | 127 | #icon-list { 128 | margin: 20px; 129 | } 130 | 131 | /** icon details **/ 132 | 133 | #icon-details { 134 | display: flex; 135 | flex-direction: column; 136 | background-color: var(--white-100); 137 | height: 100vh; 138 | position: fixed; 139 | left: 100%; 140 | top: 0; 141 | transition: left .3s var(--photon-timing-fuction); 142 | width: var(--sidebar-width); 143 | border-left: solid 1px rgba(0, 0, 0, 0.1); 144 | box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.08); 145 | z-index: 2; 146 | overflow-y: auto; 147 | } 148 | 149 | #icon-details header { 150 | display: flex; 151 | justify-content: space-between; 152 | padding: 48px 48px 0 48px; 153 | } 154 | 155 | #icon-details main { 156 | flex-grow: 1; 157 | padding: 0 48px; 158 | } 159 | 160 | #icon-details footer { 161 | display: flex; 162 | justify-content: center; 163 | padding: 24px 48px; 164 | background-color: var(--grey-10); 165 | border-top: solid 1px rgba(0, 0, 0, 0.1); 166 | } 167 | 168 | #icon-details.show { 169 | left: calc(100% - var(--sidebar-width)); 170 | } 171 | 172 | #icon-details h1 { 173 | font-size: 24px; 174 | font-weight: 400; 175 | margin: 0 0 24px 0; 176 | } 177 | 178 | #icon-details .close-button { 179 | background-image: url('../../icons/desktop/stop-16.svg'); 180 | background-position: center; 181 | background-size: 16px 16px; 182 | background-repeat: no-repeat; 183 | transition: all 0.3s var(--photon-timing-fuction); 184 | width: 24px; 185 | height: 24px; 186 | cursor: pointer; 187 | background-color: var(--white-100); 188 | border-radius: 4px; 189 | } 190 | 191 | #icon-details .close-button:hover { 192 | background-color: var(--grey-30); 193 | } 194 | 195 | #icon-details .section { 196 | margin-bottom: 48px; 197 | } 198 | 199 | #icon-details .title { 200 | display: inline-block; 201 | font-weight: 500; 202 | } 203 | 204 | #icon-details .preview { 205 | margin-bottom: 48px; 206 | padding: 32px 16px 16px; 207 | text-align: center; 208 | fill: currentColor; 209 | border: solid 1px rgba(0, 0, 0, 0.1); 210 | box-shadow: 0 1px 4px rgba(9, 6, 12, 0.1); 211 | border-radius: 4px; 212 | } 213 | 214 | #icon-details .preview.light { 215 | color: rgba(249, 249, 250, .8); 216 | background-color: var(--grey-90); 217 | background-image: linear-gradient(45deg, var(--grey-70) 25%, transparent 25%, transparent 75%, var(--grey-70) 75%, var(--grey-70)), 218 | linear-gradient(45deg, var(--grey-70) 25%, transparent 25%, transparent 75%, var(--grey-70) 75%, var(--grey-70)); 219 | background-size: 10px 10px; 220 | background-position: 0 0, 5px 5px; 221 | } 222 | 223 | #icon-details .preview.dark { 224 | color: rgba(12, 12, 13, .8); 225 | background-color: var(--grey-10); 226 | background-image: linear-gradient(45deg, var(--grey-30) 25%, transparent 25%, transparent 75%, var(--grey-30) 75%, var(--grey-30)), 227 | linear-gradient(45deg, var(--grey-30) 25%, transparent 25%, transparent 75%, var(--grey-30) 75%, var(--grey-30)); 228 | background-size: 10px 10px; 229 | background-position: 0 0, 5px 5px; 230 | } 231 | #icon-details svg { 232 | width: 64px; 233 | height: 64px; 234 | } 235 | 236 | #icon-details[data-deprecated^="true"] svg { 237 | opacity: 0.5; 238 | } 239 | 240 | #icon-details .name { 241 | padding: 16px 0; 242 | text-align: center; 243 | text-transform: capitalize; 244 | } 245 | 246 | /** icon details checkbox **/ 247 | 248 | .checkbox, 249 | .radio { 250 | margin: 12px 0; 251 | } 252 | 253 | label span { 254 | display: inline-block; 255 | vertical-align: bottom; 256 | line-height: 1; 257 | } 258 | 259 | label code { 260 | display: inline-block; 261 | vertical-align: middle; 262 | padding: 4px 4px 2px; 263 | background-color: var(--grey-30); 264 | border-radius: 4px; 265 | } 266 | 267 | label small { 268 | vertical-align: bottom; 269 | font-size: 12px; 270 | line-height: 1.05; 271 | margin-left: 12px; 272 | font-weight: 400; 273 | text-transform: uppercase; 274 | } 275 | 276 | /** Footer Buttons **/ 277 | 278 | #download a { 279 | display: block; 280 | background-color: var(--blue-50); 281 | color: var(--white-100); 282 | -moz-osx-font-smoothing: grayscale; 283 | -webkit-font-smoothing: antialiased; 284 | padding: 12px 24px; 285 | text-decoration: none; 286 | border-radius: 4px; 287 | } 288 | 289 | #icon-details[data-deprecated^="true"] a { 290 | opacity: 0.5; 291 | cursor: not-allowed; 292 | } 293 | 294 | /** Embed version **/ 295 | 296 | .embed { 297 | color: var(--grey-50); 298 | } 299 | 300 | .embed #icon-list { 301 | margin: 0; 302 | } 303 | 304 | .embed h2 { 305 | font-size: 45px; 306 | font-style: italic; 307 | font-weight: 400; 308 | margin-top: 17px; 309 | padding-top: 34px; 310 | } 311 | 312 | /** Search input **/ 313 | 314 | #search-input { 315 | background-image: url(../../icons/desktop/search-16.svg); 316 | background-position: 20px center; 317 | background-repeat: no-repeat; 318 | border-width: 0 0 1px 0; 319 | border-style: solid; 320 | border-color: var(--grey-30); 321 | color: var(--grey-90); 322 | font-family: inherit; 323 | font-size: 16px; 324 | padding: 16px 24px 16px 48px; 325 | width: 100%; 326 | } 327 | 328 | #search-input[disabled] { 329 | background-color: var(--white-100); 330 | opacity: 0.5; 331 | } 332 | 333 | @media screen and (min-width: 600px) { 334 | #search-input { 335 | border: none; 336 | } 337 | } 338 | 339 | /** Category display **/ 340 | 341 | .category-display::before { 342 | content: attr(data-category); 343 | color: var(--grey-50); 344 | display: block; 345 | font-size: 13px; 346 | text-transform: capitalize; 347 | margin-bottom: 20px; 348 | } 349 | 350 | .category-display { 351 | border-bottom: 1px solid var(--grey-30); 352 | padding-bottom: 20px; 353 | margin-bottom: 40px; 354 | } 355 | 356 | /** Icon display **/ 357 | 358 | .icon-display { 359 | display: inline-block; 360 | padding: 16px 8px; 361 | text-align: center; 362 | width: 84px; 363 | margin: 4px; 364 | vertical-align: top; 365 | cursor: pointer; 366 | color: inherit; 367 | text-decoration: none; 368 | border-radius: 4px; 369 | background-color: var(--grey-10); 370 | transition: all .3s var(--photon-timing-fuction); 371 | } 372 | 373 | @media screen and (min-width: 768px) { 374 | .icon-display { 375 | width: 96px; 376 | } 377 | } 378 | 379 | .icon-display:hover, 380 | .icon-display.selected { 381 | background-color: var(--grey-30); 382 | } 383 | 384 | .icon-display > * { 385 | pointer-events: none; 386 | } 387 | 388 | .icon-display img { 389 | transition: filter 0.3s; 390 | width: 32px; 391 | height: 32px; 392 | margin-bottom: 8px; 393 | -webkit-user-select: none; 394 | -moz-user-select: none; 395 | user-select: none; 396 | } 397 | 398 | .icon-display::after { 399 | content: attr(data-icon); 400 | font-size: 10px; 401 | display: block; 402 | width: 100%; 403 | -moz-user-select: text; 404 | white-space: nowrap; 405 | overflow: hidden; 406 | text-overflow: ellipsis; 407 | text-transform: capitalize; 408 | } 409 | 410 | .icon-display[data-deprecated^="true"] { 411 | position: relative; 412 | cursor: not-allowed; 413 | opacity: 0.3; 414 | } 415 | 416 | .icon-display[data-deprecated^="true"]::before { 417 | content: "Outdated"; 418 | position: absolute; 419 | top: 2px; 420 | right: 2px; 421 | background-color: var(--grey-90); 422 | color: var(--white-100); 423 | opacity: 0; 424 | font-size: 12px; 425 | border-radius: 2px; 426 | padding: 1px 3px 0px; 427 | transition: opacity .3s var(--photon-timing-fuction); 428 | } 429 | 430 | .icon-display[data-deprecated^="true"]:hover, 431 | .icon-display[data-deprecated^="true"]:active { 432 | position: relative; 433 | transform: scale(1); 434 | box-shadow: none; 435 | } 436 | 437 | .icon-display[data-deprecated^="true"]:hover::before, 438 | .icon-display[data-deprecated^="true"]:active::before { 439 | opacity: 1; 440 | } 441 | 442 | .site-feedback a { 443 | color: var(--blue-50); 444 | padding: 20px; 445 | text-decoration: none; 446 | } 447 | 448 | .site-feedback a:hover, 449 | .site-feedback a:active { 450 | text-decoration: underline; 451 | } 452 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Mozilla Public License Version 2.0 2 | ================================== 3 | 4 | 1. Definitions 5 | -------------- 6 | 7 | 1.1. "Contributor" 8 | means each individual or legal entity that creates, contributes to 9 | the creation of, or owns Covered Software. 10 | 11 | 1.2. "Contributor Version" 12 | means the combination of the Contributions of others (if any) used 13 | by a Contributor and that particular Contributor's Contribution. 14 | 15 | 1.3. "Contribution" 16 | means Covered Software of a particular Contributor. 17 | 18 | 1.4. "Covered Software" 19 | means Source Code Form to which the initial Contributor has attached 20 | the notice in Exhibit A, the Executable Form of such Source Code 21 | Form, and Modifications of such Source Code Form, in each case 22 | including portions thereof. 23 | 24 | 1.5. "Incompatible With Secondary Licenses" 25 | means 26 | 27 | (a) that the initial Contributor has attached the notice described 28 | in Exhibit B to the Covered Software; or 29 | 30 | (b) that the Covered Software was made available under the terms of 31 | version 1.1 or earlier of the License, but not also under the 32 | terms of a Secondary License. 33 | 34 | 1.6. "Executable Form" 35 | means any form of the work other than Source Code Form. 36 | 37 | 1.7. "Larger Work" 38 | means a work that combines Covered Software with other material, in 39 | a separate file or files, that is not Covered Software. 40 | 41 | 1.8. "License" 42 | means this document. 43 | 44 | 1.9. "Licensable" 45 | means having the right to grant, to the maximum extent possible, 46 | whether at the time of the initial grant or subsequently, any and 47 | all of the rights conveyed by this License. 48 | 49 | 1.10. "Modifications" 50 | means any of the following: 51 | 52 | (a) any file in Source Code Form that results from an addition to, 53 | deletion from, or modification of the contents of Covered 54 | Software; or 55 | 56 | (b) any new file in Source Code Form that contains any Covered 57 | Software. 58 | 59 | 1.11. "Patent Claims" of a Contributor 60 | means any patent claim(s), including without limitation, method, 61 | process, and apparatus claims, in any patent Licensable by such 62 | Contributor that would be infringed, but for the grant of the 63 | License, by the making, using, selling, offering for sale, having 64 | made, import, or transfer of either its Contributions or its 65 | Contributor Version. 66 | 67 | 1.12. "Secondary License" 68 | means either the GNU General Public License, Version 2.0, the GNU 69 | Lesser General Public License, Version 2.1, the GNU Affero General 70 | Public License, Version 3.0, or any later versions of those 71 | licenses. 72 | 73 | 1.13. "Source Code Form" 74 | means the form of the work preferred for making modifications. 75 | 76 | 1.14. "You" (or "Your") 77 | means an individual or a legal entity exercising rights under this 78 | License. For legal entities, "You" includes any entity that 79 | controls, is controlled by, or is under common control with You. For 80 | purposes of this definition, "control" means (a) the power, direct 81 | or indirect, to cause the direction or management of such entity, 82 | whether by contract or otherwise, or (b) ownership of more than 83 | fifty percent (50%) of the outstanding shares or beneficial 84 | ownership of such entity. 85 | 86 | 2. License Grants and Conditions 87 | -------------------------------- 88 | 89 | 2.1. Grants 90 | 91 | Each Contributor hereby grants You a world-wide, royalty-free, 92 | non-exclusive license: 93 | 94 | (a) under intellectual property rights (other than patent or trademark) 95 | Licensable by such Contributor to use, reproduce, make available, 96 | modify, display, perform, distribute, and otherwise exploit its 97 | Contributions, either on an unmodified basis, with Modifications, or 98 | as part of a Larger Work; and 99 | 100 | (b) under Patent Claims of such Contributor to make, use, sell, offer 101 | for sale, have made, import, and otherwise transfer either its 102 | Contributions or its Contributor Version. 103 | 104 | 2.2. Effective Date 105 | 106 | The licenses granted in Section 2.1 with respect to any Contribution 107 | become effective for each Contribution on the date the Contributor first 108 | distributes such Contribution. 109 | 110 | 2.3. Limitations on Grant Scope 111 | 112 | The licenses granted in this Section 2 are the only rights granted under 113 | this License. No additional rights or licenses will be implied from the 114 | distribution or licensing of Covered Software under this License. 115 | Notwithstanding Section 2.1(b) above, no patent license is granted by a 116 | Contributor: 117 | 118 | (a) for any code that a Contributor has removed from Covered Software; 119 | or 120 | 121 | (b) for infringements caused by: (i) Your and any other third party's 122 | modifications of Covered Software, or (ii) the combination of its 123 | Contributions with other software (except as part of its Contributor 124 | Version); or 125 | 126 | (c) under Patent Claims infringed by Covered Software in the absence of 127 | its Contributions. 128 | 129 | This License does not grant any rights in the trademarks, service marks, 130 | or logos of any Contributor (except as may be necessary to comply with 131 | the notice requirements in Section 3.4). 132 | 133 | 2.4. Subsequent Licenses 134 | 135 | No Contributor makes additional grants as a result of Your choice to 136 | distribute the Covered Software under a subsequent version of this 137 | License (see Section 10.2) or under the terms of a Secondary License (if 138 | permitted under the terms of Section 3.3). 139 | 140 | 2.5. Representation 141 | 142 | Each Contributor represents that the Contributor believes its 143 | Contributions are its original creation(s) or it has sufficient rights 144 | to grant the rights to its Contributions conveyed by this License. 145 | 146 | 2.6. Fair Use 147 | 148 | This License is not intended to limit any rights You have under 149 | applicable copyright doctrines of fair use, fair dealing, or other 150 | equivalents. 151 | 152 | 2.7. Conditions 153 | 154 | Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted 155 | in Section 2.1. 156 | 157 | 3. Responsibilities 158 | ------------------- 159 | 160 | 3.1. Distribution of Source Form 161 | 162 | All distribution of Covered Software in Source Code Form, including any 163 | Modifications that You create or to which You contribute, must be under 164 | the terms of this License. You must inform recipients that the Source 165 | Code Form of the Covered Software is governed by the terms of this 166 | License, and how they can obtain a copy of this License. You may not 167 | attempt to alter or restrict the recipients' rights in the Source Code 168 | Form. 169 | 170 | 3.2. Distribution of Executable Form 171 | 172 | If You distribute Covered Software in Executable Form then: 173 | 174 | (a) such Covered Software must also be made available in Source Code 175 | Form, as described in Section 3.1, and You must inform recipients of 176 | the Executable Form how they can obtain a copy of such Source Code 177 | Form by reasonable means in a timely manner, at a charge no more 178 | than the cost of distribution to the recipient; and 179 | 180 | (b) You may distribute such Executable Form under the terms of this 181 | License, or sublicense it under different terms, provided that the 182 | license for the Executable Form does not attempt to limit or alter 183 | the recipients' rights in the Source Code Form under this License. 184 | 185 | 3.3. Distribution of a Larger Work 186 | 187 | You may create and distribute a Larger Work under terms of Your choice, 188 | provided that You also comply with the requirements of this License for 189 | the Covered Software. If the Larger Work is a combination of Covered 190 | Software with a work governed by one or more Secondary Licenses, and the 191 | Covered Software is not Incompatible With Secondary Licenses, this 192 | License permits You to additionally distribute such Covered Software 193 | under the terms of such Secondary License(s), so that the recipient of 194 | the Larger Work may, at their option, further distribute the Covered 195 | Software under the terms of either this License or such Secondary 196 | License(s). 197 | 198 | 3.4. Notices 199 | 200 | You may not remove or alter the substance of any license notices 201 | (including copyright notices, patent notices, disclaimers of warranty, 202 | or limitations of liability) contained within the Source Code Form of 203 | the Covered Software, except that You may alter any license notices to 204 | the extent required to remedy known factual inaccuracies. 205 | 206 | 3.5. Application of Additional Terms 207 | 208 | You may choose to offer, and to charge a fee for, warranty, support, 209 | indemnity or liability obligations to one or more recipients of Covered 210 | Software. However, You may do so only on Your own behalf, and not on 211 | behalf of any Contributor. You must make it absolutely clear that any 212 | such warranty, support, indemnity, or liability obligation is offered by 213 | You alone, and You hereby agree to indemnify every Contributor for any 214 | liability incurred by such Contributor as a result of warranty, support, 215 | indemnity or liability terms You offer. You may include additional 216 | disclaimers of warranty and limitations of liability specific to any 217 | jurisdiction. 218 | 219 | 4. Inability to Comply Due to Statute or Regulation 220 | --------------------------------------------------- 221 | 222 | If it is impossible for You to comply with any of the terms of this 223 | License with respect to some or all of the Covered Software due to 224 | statute, judicial order, or regulation then You must: (a) comply with 225 | the terms of this License to the maximum extent possible; and (b) 226 | describe the limitations and the code they affect. Such description must 227 | be placed in a text file included with all distributions of the Covered 228 | Software under this License. Except to the extent prohibited by statute 229 | or regulation, such description must be sufficiently detailed for a 230 | recipient of ordinary skill to be able to understand it. 231 | 232 | 5. Termination 233 | -------------- 234 | 235 | 5.1. The rights granted under this License will terminate automatically 236 | if You fail to comply with any of its terms. However, if You become 237 | compliant, then the rights granted under this License from a particular 238 | Contributor are reinstated (a) provisionally, unless and until such 239 | Contributor explicitly and finally terminates Your grants, and (b) on an 240 | ongoing basis, if such Contributor fails to notify You of the 241 | non-compliance by some reasonable means prior to 60 days after You have 242 | come back into compliance. Moreover, Your grants from a particular 243 | Contributor are reinstated on an ongoing basis if such Contributor 244 | notifies You of the non-compliance by some reasonable means, this is the 245 | first time You have received notice of non-compliance with this License 246 | from such Contributor, and You become compliant prior to 30 days after 247 | Your receipt of the notice. 248 | 249 | 5.2. If You initiate litigation against any entity by asserting a patent 250 | infringement claim (excluding declaratory judgment actions, 251 | counter-claims, and cross-claims) alleging that a Contributor Version 252 | directly or indirectly infringes any patent, then the rights granted to 253 | You by any and all Contributors for the Covered Software under Section 254 | 2.1 of this License shall terminate. 255 | 256 | 5.3. In the event of termination under Sections 5.1 or 5.2 above, all 257 | end user license agreements (excluding distributors and resellers) which 258 | have been validly granted by You or Your distributors under this License 259 | prior to termination shall survive termination. 260 | 261 | ************************************************************************ 262 | * * 263 | * 6. Disclaimer of Warranty * 264 | * ------------------------- * 265 | * * 266 | * Covered Software is provided under this License on an "as is" * 267 | * basis, without warranty of any kind, either expressed, implied, or * 268 | * statutory, including, without limitation, warranties that the * 269 | * Covered Software is free of defects, merchantable, fit for a * 270 | * particular purpose or non-infringing. The entire risk as to the * 271 | * quality and performance of the Covered Software is with You. * 272 | * Should any Covered Software prove defective in any respect, You * 273 | * (not any Contributor) assume the cost of any necessary servicing, * 274 | * repair, or correction. This disclaimer of warranty constitutes an * 275 | * essential part of this License. No use of any Covered Software is * 276 | * authorized under this License except under this disclaimer. * 277 | * * 278 | ************************************************************************ 279 | 280 | ************************************************************************ 281 | * * 282 | * 7. Limitation of Liability * 283 | * -------------------------- * 284 | * * 285 | * Under no circumstances and under no legal theory, whether tort * 286 | * (including negligence), contract, or otherwise, shall any * 287 | * Contributor, or anyone who distributes Covered Software as * 288 | * permitted above, be liable to You for any direct, indirect, * 289 | * special, incidental, or consequential damages of any character * 290 | * including, without limitation, damages for lost profits, loss of * 291 | * goodwill, work stoppage, computer failure or malfunction, or any * 292 | * and all other commercial damages or losses, even if such party * 293 | * shall have been informed of the possibility of such damages. This * 294 | * limitation of liability shall not apply to liability for death or * 295 | * personal injury resulting from such party's negligence to the * 296 | * extent applicable law prohibits such limitation. Some * 297 | * jurisdictions do not allow the exclusion or limitation of * 298 | * incidental or consequential damages, so this exclusion and * 299 | * limitation may not apply to You. * 300 | * * 301 | ************************************************************************ 302 | 303 | 8. Litigation 304 | ------------- 305 | 306 | Any litigation relating to this License may be brought only in the 307 | courts of a jurisdiction where the defendant maintains its principal 308 | place of business and such litigation shall be governed by laws of that 309 | jurisdiction, without reference to its conflict-of-law provisions. 310 | Nothing in this Section shall prevent a party's ability to bring 311 | cross-claims or counter-claims. 312 | 313 | 9. Miscellaneous 314 | ---------------- 315 | 316 | This License represents the complete agreement concerning the subject 317 | matter hereof. If any provision of this License is held to be 318 | unenforceable, such provision shall be reformed only to the extent 319 | necessary to make it enforceable. Any law or regulation which provides 320 | that the language of a contract shall be construed against the drafter 321 | shall not be used to construe this License against a Contributor. 322 | 323 | 10. Versions of the License 324 | --------------------------- 325 | 326 | 10.1. New Versions 327 | 328 | Mozilla Foundation is the license steward. Except as provided in Section 329 | 10.3, no one other than the license steward has the right to modify or 330 | publish new versions of this License. Each version will be given a 331 | distinguishing version number. 332 | 333 | 10.2. Effect of New Versions 334 | 335 | You may distribute the Covered Software under the terms of the version 336 | of the License under which You originally received the Covered Software, 337 | or under the terms of any subsequent version published by the license 338 | steward. 339 | 340 | 10.3. Modified Versions 341 | 342 | If you create software not governed by this License, and you want to 343 | create a new license for such software, you may create and use a 344 | modified version of this License if you rename the license and remove 345 | any references to the name of the license steward (except to note that 346 | such modified license differs from this License). 347 | 348 | 10.4. Distributing Source Code Form that is Incompatible With Secondary 349 | Licenses 350 | 351 | If You choose to distribute Source Code Form that is Incompatible With 352 | Secondary Licenses under the terms of this version of the License, the 353 | notice described in Exhibit B of this License must be attached. 354 | 355 | Exhibit A - Source Code Form License Notice 356 | ------------------------------------------- 357 | 358 | This Source Code Form is subject to the terms of the Mozilla Public 359 | License, v. 2.0. If a copy of the MPL was not distributed with this 360 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 361 | 362 | If it is not possible or desirable to put the notice in a particular 363 | file, then You may include the notice in a location (such as a LICENSE 364 | file in a relevant directory) where a recipient would be likely to look 365 | for such a notice. 366 | 367 | You may add additional accurate notices of copyright ownership. 368 | 369 | Exhibit B - "Incompatible With Secondary Licenses" Notice 370 | --------------------------------------------------------- 371 | 372 | This Source Code Form is "Incompatible With Secondary Licenses", as 373 | defined by the Mozilla Public License, v. 2.0. 374 | --------------------------------------------------------------------------------