mobile

package
v0.0.0-...-bc17065 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GalaxyS5 = &Device{
		Metrics: &devtool.DeviceMetrics{
			Width:             360,
			Height:            640,
			DeviceScaleFactor: 3,
			Mobile:            true,
			ScreenOrientation: portrait,
		},
		UserAgent: "Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",
	}

	Pixel2 = &Device{
		Metrics: &devtool.DeviceMetrics{
			Width:             411,
			Height:            731,
			DeviceScaleFactor: 2.625,
			Mobile:            true,
			ScreenOrientation: portrait,
		},
		UserAgent: "Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",
	}

	Pixel2XL = &Device{
		Metrics: &devtool.DeviceMetrics{
			Width:             411,
			Height:            823,
			DeviceScaleFactor: 3.5,
			Mobile:            true,
			ScreenOrientation: portrait,
		},
		UserAgent: "Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",
	}

	IPad = &Device{
		Metrics: &devtool.DeviceMetrics{
			Width:             768,
			Height:            1024,
			DeviceScaleFactor: 2,
			Mobile:            true,
			ScreenOrientation: portrait,
		},
		UserAgent: ipadUA,
	}

	IPadMini = IPad

	IPadPro = &Device{
		Metrics: &devtool.DeviceMetrics{
			Width:             1024,
			Height:            1366,
			DeviceScaleFactor: 2,
			Mobile:            true,
			ScreenOrientation: portrait,
		},
		UserAgent: ipadUA,
	}

	IPhone6 = &Device{
		Metrics: &devtool.DeviceMetrics{
			Width:             375,
			Height:            667,
			DeviceScaleFactor: 2,
			Mobile:            true,
			ScreenOrientation: portrait,
		},
		UserAgent: iphoneUA,
	}
	IPhone7 = IPhone6
	IPhone8 = IPhone6

	IPhone6Plus = &Device{
		Metrics: &devtool.DeviceMetrics{
			Width:             414,
			Height:            736,
			DeviceScaleFactor: 3,
			Mobile:            true,
			ScreenOrientation: portrait,
		},
		UserAgent: iphoneUA,
	}
	IPhone7Plus = IPhone6Plus
	IPhone8Plus = IPhone6Plus

	IPhoneX = &Device{
		Metrics: &devtool.DeviceMetrics{
			Width:             375,
			Height:            812,
			DeviceScaleFactor: 3,
			Mobile:            true,
			ScreenOrientation: portrait,
		},
		UserAgent: iphoneUA,
	}
)

Predefined devices

Functions

This section is empty.

Types

type Device

type Device struct {
	Metrics   *devtool.DeviceMetrics
	UserAgent string
}

Device device description

func (Device) Rotated

func (d Device) Rotated() *Device

Rotated rotate copy of current device and return new device

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL