go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/milo/frontend/ui/logo.go (about)

     1  // Copyright 2016 The LUCI Authors.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package ui
    16  
    17  // A collection of structs used for defining OS, platform, and device logos.
    18  // Each logo defined in this file should have a matching icon in the
    19  // application's static/logo/ folder.
    20  
    21  type LogoBase struct {
    22  	Img string `json:"img,omitempty"`
    23  	Alt string `json:"alt,omitempty"`
    24  }
    25  
    26  type Logo struct {
    27  	LogoBase
    28  	// Subtitle is text that goes under the logo.  This is most commonly used
    29  	// to specify the version of the OS or type of device.
    30  	Subtitle string `json:"subtitle,omitempty"`
    31  	// Count specifies how many of the OS or device there are.
    32  	Count int `json:"count,omitempty"`
    33  }
    34  
    35  // Define our known base logos
    36  var (
    37  	Windows = LogoBase{
    38  		Img: "windows.svg",
    39  		Alt: "Microsoft Windows",
    40  	}
    41  
    42  	OSX = LogoBase{
    43  		Img: "apple.svg",
    44  		Alt: "Apple OSX",
    45  	}
    46  
    47  	Ubuntu = LogoBase{
    48  		Img: "ubuntu.svg",
    49  		Alt: "Canonical Ubuntu",
    50  	}
    51  
    52  	// These are devices.
    53  	IOS = LogoBase{
    54  		Img: "ios_device.png",
    55  		Alt: "Apple iOS",
    56  	}
    57  
    58  	Android = LogoBase{
    59  		Img: "android_device.png",
    60  		Alt: "Google Android",
    61  	}
    62  
    63  	ChromeOS = LogoBase{
    64  		Img: "cros_device.png",
    65  		Alt: "Google ChromeOS",
    66  	}
    67  )